From 2452508ea95205f6bc49ef5373a442b38eca48ec Mon Sep 17 00:00:00 2001 From: Nicholas Sherlock Date: Mon, 10 May 2021 12:42:22 +1200 Subject: [PATCH] Use end-to-end map file generation --- Makefile | 9 ++-- package-lock.json | 97 +++++++++++++++++++++++++++++++++++++++++ package.json | 1 + resources/js/.gitignore | 1 + 4 files changed, 104 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3b152c4..4a51ad3 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,12 @@ resources/css/chickenpaint.css : resources/css/chickenpaint.scss resources/fonts node_modules/.bin/sass $< > $@ node_modules/.bin/postcss --replace $@ -resources/js/chickenpaint.min.js : resources/js/chickenpaint.js - cd resources/js && ../../node_modules/.bin/uglifyjs --compress --mangle --source-map "filename='chickenpaint.min.js.map',url='chickenpaint.min.js.map',root='./'" --output chickenpaint.min.js -- chickenpaint.js +resources/js/chickenpaint.min.js resources/js/chickenpaint.min.js.map : resources/js/chickenpaint.js + cd resources/js && ../../node_modules/.bin/uglifyjs --compress --mangle \ + --source-map "content='chickenpaint.js.map',filename='chickenpaint.min.js.map',url='chickenpaint.min.js.map',root='./'" --output chickenpaint.min.js -- chickenpaint.js resources/js/chickenpaint.js : js/engine/* js/gui/* js/util/* js/ChickenPaint.js js/engine/CPBlend.js lib/* - node_modules/.bin/browserify --standalone ChickenPaint --outfile $@ -d -e js/ChickenPaint.js -t babelify + node_modules/.bin/browserify --standalone ChickenPaint --debug --entry js/ChickenPaint.js --transform babelify | node_modules/.bin/exorcist $@.map > $@ resources/fonts/ChickenPaint-Symbols.scss : resources/fonts/chickenpaint-symbols-source/* node_modules/.bin/icomoon-build -p "resources/fonts/chickenpaint-symbols-source/ChickenPaint Symbols.json" --scss resources/fonts/ChickenPaint-Symbols.scss --fonts resources/fonts @@ -61,7 +62,7 @@ js/engine/CPBlend.js : codegenerator/BlendGenerator.js node codegenerator/BlendGenerator.js > js/engine/CPBlend.js clean : - rm -f resources/css/chickenpaint.css resources/js/chickenpaint.js resources/js/chickenpaint.min.js resources/js/chickenpaint.min.js.map + rm -f resources/css/chickenpaint.css resources/js/chickenpaint{.js,.js.map} resources/js/chickenpaint.min{.js,.js.map} rm -f test/blending_bench/blending_test.js test/blending_bench/blending.js test/integration_test/integration.js js/engine/CPBlend.js rm -f resources/fonts/ChickenPaint-Symbols.{scss,ttf,woff,eot} rm -f chickenpaint.zip diff --git a/package-lock.json b/package-lock.json index 36ae569..1a76e09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "babelify": "^10.0.0", "browserify": "^17.0.0", "canvas": "^2.7.0", + "exorcist": "^2.0.0", "icomoon-build": "^0.2.8", "mocha": "^8.4.0", "multipipe": "^2.0.3", @@ -3618,6 +3619,42 @@ "node": ">=4" } }, + "node_modules/exorcist": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/exorcist/-/exorcist-2.0.0.tgz", + "integrity": "sha512-+c63SvhBq/HjmbV9cu9vkDkjXFiuI4lpqOZU5Y3t5GSV2l4TQCqVli9c7nIASHxkUL4THaOZDUcb6XNBI/eYjw==", + "dev": true, + "dependencies": { + "is-stream": "^2.0.0", + "minimist": "^1.2.5", + "mkdirp": "^1.0.4", + "mold-source-map": "^0.4.0" + }, + "bin": { + "exorcist": "bin/exorcist.js" + } + }, + "node_modules/exorcist/node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/exorcist/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -5932,6 +5969,22 @@ "node": ">= 0.8.0" } }, + "node_modules/mold-source-map": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mold-source-map/-/mold-source-map-0.4.0.tgz", + "integrity": "sha1-z2fgsxxHq5uttcnCVlGGISe7gxc=", + "dev": true, + "dependencies": { + "convert-source-map": "^1.1.0", + "through": "~2.2.7" + } + }, + "node_modules/mold-source-map/node_modules/through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -12329,6 +12382,32 @@ "strip-eof": "^1.0.0" } }, + "exorcist": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/exorcist/-/exorcist-2.0.0.tgz", + "integrity": "sha512-+c63SvhBq/HjmbV9cu9vkDkjXFiuI4lpqOZU5Y3t5GSV2l4TQCqVli9c7nIASHxkUL4THaOZDUcb6XNBI/eYjw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "minimist": "^1.2.5", + "mkdirp": "^1.0.4", + "mold-source-map": "^0.4.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -14136,6 +14215,24 @@ "xtend": "^4.0.0" } }, + "mold-source-map": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mold-source-map/-/mold-source-map-0.4.0.tgz", + "integrity": "sha1-z2fgsxxHq5uttcnCVlGGISe7gxc=", + "dev": true, + "requires": { + "convert-source-map": "^1.1.0", + "through": "~2.2.7" + }, + "dependencies": { + "through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + } + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index 6a2661f..cbceca2 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "babelify": "^10.0.0", "browserify": "^17.0.0", "canvas": "^2.7.0", + "exorcist": "^2.0.0", "icomoon-build": "^0.2.8", "mocha": "^8.4.0", "multipipe": "^2.0.3", diff --git a/resources/js/.gitignore b/resources/js/.gitignore index b4ec70a..cff1212 100644 --- a/resources/js/.gitignore +++ b/resources/js/.gitignore @@ -1,3 +1,4 @@ /chickenpaint.js +/chickenpaint.js.map /chickenpaint.min.js /chickenpaint.min.js.map