Create CookieMonsterDev

This commit is contained in:
Daniël van Noord
2021-05-02 09:55:00 +02:00
parent 32b7bfc2c9
commit 21b8a169ef
8 changed files with 40 additions and 8 deletions

View File

@@ -12,12 +12,21 @@ jobs:
run: npx eslint src
- name: Run Mocha tests
run: npx mocha
- name: Check if CookieMonster.js is built correctly
- name: Check if CookieMonsterDev.js is built correctly
run: |
npx webpack -o ./tmp --env production
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
echo '### SUCCESS: CookieMonsterDev is correctly built! ###'
else
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
exit 1
fi
- name: Check if CookieMonster.js is built correctly
if: github.ref == 'refs/heads/master'
run: |
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 dist/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is correctly built! ###'
else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to copy CookieMonsterDev.js into CookieMonster.js before merging to master! ###'
exit 1
fi

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dist/CookieMonsterDev.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
/**
* jscolor - JavaScript Color Picker
*
* @link http://jscolor.com
* @license For open source use: GPLv3
* For commercial use: JSColor Commercial License
* @author Jan Odvarko - East Desire
*
* See usage examples at http://jscolor.com/examples/
*/

1
dist/CookieMonsterDev.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -12,11 +12,10 @@
],
"scripts": {
"eslint-src": "eslint src test",
"build": "run-s eslint-src pack-prod remove-comment test",
"build": "run-s eslint-src pack-prod test",
"build-test": "run-s pack-dev",
"pack-prod": "webpack --env production",
"pack-dev": "webpack",
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js",
"test": "mocha"
},
"repository": {

View File

@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');
module.exports = function (env) {
return {
@@ -21,8 +22,15 @@ module.exports = function (env) {
],
},
output: {
filename: 'CookieMonster.js',
filename: 'CookieMonsterDev.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: 'CookieMonsterDev.js.map',
publicPath: 'https://cookiemonsterteam.github.io/CookieMonster/dist/',
fileContext: 'public',
}),
],
};
};