From 8e31a4f3b9383eadb9ea41b28c894b13b4c062cb Mon Sep 17 00:00:00 2001 From: Seungwoo Hong Date: Sun, 2 Jul 2023 02:29:41 +0900 Subject: [PATCH 1/7] remove: promise-polyfill --- package-lock.json | 24 ------------------------ package.json | 2 -- rollup.config.js | 6 +++--- src/ngl.ts | 5 ----- 4 files changed, 3 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40dd6ef9..8b939be1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "MIT", "dependencies": { "chroma-js": "^1.3.7", - "promise-polyfill": "^8.0.0", "signals": "^1.0.0", "sprintf-js": "^1.1.2", "three": "^0.118.0" @@ -26,7 +25,6 @@ "@types/jest": "^27.5.1", "@types/node": "^10.17.9", "@types/offscreencanvas": "^2019.6.4", - "@types/promise-polyfill": "^6.0.0", "@types/signals": "1.0.1", "@types/sprintf-js": "^1.1.2", "@yushijinhun/three-minifier-rollup": "^0.3.1", @@ -2685,12 +2683,6 @@ "integrity": "sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw==", "dev": true }, - "node_modules/@types/promise-polyfill": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@types/promise-polyfill/-/promise-polyfill-6.0.4.tgz", - "integrity": "sha512-GSCjjH6mDS8jgpT22rEOkZVqZcYj7i9AHJu4ntpvoohEpa0mLAKP/Kz3POMKqABaFsS4TyNHOeoyWpzycddcoQ==", - "dev": true - }, "node_modules/@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -8599,11 +8591,6 @@ "node": ">=0.4.0" } }, - "node_modules/promise-polyfill": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.3.tgz", - "integrity": "sha512-Og0+jCRQetV84U8wVjMNccfGCnMQ9mGs9Hv78QFe+pSDD3gWTpz0y+1QCuxy5d/vBFuZ3iwP2eycAkvqIMPmWg==" - }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -12370,12 +12357,6 @@ "integrity": "sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw==", "dev": true }, - "@types/promise-polyfill": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@types/promise-polyfill/-/promise-polyfill-6.0.4.tgz", - "integrity": "sha512-GSCjjH6mDS8jgpT22rEOkZVqZcYj7i9AHJu4ntpvoohEpa0mLAKP/Kz3POMKqABaFsS4TyNHOeoyWpzycddcoQ==", - "dev": true - }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", @@ -16897,11 +16878,6 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "promise-polyfill": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.3.tgz", - "integrity": "sha512-Og0+jCRQetV84U8wVjMNccfGCnMQ9mGs9Hv78QFe+pSDD3gWTpz0y+1QCuxy5d/vBFuZ3iwP2eycAkvqIMPmWg==" - }, "prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", diff --git a/package.json b/package.json index 82242252..19e947e7 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,6 @@ "@types/jest": "^27.5.1", "@types/node": "^10.17.9", "@types/offscreencanvas": "^2019.6.4", - "@types/promise-polyfill": "^6.0.0", "@types/signals": "1.0.1", "@types/sprintf-js": "^1.1.2", "@yushijinhun/three-minifier-rollup": "^0.3.1", @@ -87,7 +86,6 @@ }, "dependencies": { "chroma-js": "^1.3.7", - "promise-polyfill": "^8.0.0", "signals": "^1.0.0", "sprintf-js": "^1.1.2", "three": "^0.118.0" diff --git a/rollup.config.js b/rollup.config.js index 99711ae5..d031b4d2 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -13,11 +13,12 @@ var pkg = require('./package.json') // When building UMD or ES6 module, mark dependencies as external export const moduleExternals = Object.keys(pkg.dependencies) export const moduleGlobals = {three: 'three'} -export const umdGlobals = {'promise-polyfill': '_Promise', +export const umdGlobals = { 'chroma-js': 'chroma', 'signals': 'signalsWrapper', 'sprintf-js': 'sprintfJs', - three: 'three'} + three: 'three' +} function glsl () { return { @@ -70,7 +71,6 @@ export const plugins = [ glsl(), text(), json(), - buble() ] const moduleConfig = { diff --git a/src/ngl.ts b/src/ngl.ts index cdeb9911..eef64c59 100644 --- a/src/ngl.ts +++ b/src/ngl.ts @@ -5,7 +5,6 @@ */ import './polyfills' -import _Promise from 'promise-polyfill' /** * The NGL module. These members are available in the `NGL` namespace when using the {@link https://github.com/umdjs/umd|UMD} build in the `ngl.js` file. @@ -218,10 +217,6 @@ export { StructureComponentDefaultParameters } from './component/structure-compo import Version from './version' -if (!(window as any).Promise) { - (window as any).Promise = _Promise -} - export { Version, StaticDatasource, From 189ac879fd9b8755ee7c9ba84053932202b5f674 Mon Sep 17 00:00:00 2001 From: Seungwoo Hong Date: Sun, 2 Jul 2023 02:31:57 +0900 Subject: [PATCH 2/7] remove: buble compiler --- package-lock.json | 300 ---------------------------------------------- package.json | 1 - rollup.config.js | 1 - src/polyfills.js | 2 + 4 files changed, 2 insertions(+), 302 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b939be1..061ebca6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ }, "devDependencies": { "@babel/preset-env": "^7.17.10", - "@rollup/plugin-buble": "^0.21.3", "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.1.1", @@ -2399,23 +2398,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@rollup/plugin-buble": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-0.21.3.tgz", - "integrity": "sha512-Iv8cCuFPnMdqV4pcyU+OrfjOfagPArRQ1PyQjx5KgHk3dARedI+8PNTLSMpJts0lQJr8yF2pAU4GxpxCBJ9HYw==", - "dev": true, - "dependencies": { - "@rollup/pluginutils": "^3.0.8", - "@types/buble": "^0.19.2", - "buble": "^0.20.0" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0" - } - }, "node_modules/@rollup/plugin-commonjs": { "version": "17.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz", @@ -2584,15 +2566,6 @@ "@babel/types": "^7.3.0" } }, - "node_modules/@types/buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", - "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", - "dev": true, - "dependencies": { - "magic-string": "^0.25.0" - } - }, "node_modules/@types/chroma-js": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-1.4.3.tgz", @@ -2801,15 +2774,6 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -3312,141 +3276,6 @@ "node-int64": "^0.4.0" } }, - "node_modules/buble": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", - "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", - "dev": true, - "dependencies": { - "acorn": "^6.4.1", - "acorn-dynamic-import": "^4.0.0", - "acorn-jsx": "^5.2.0", - "chalk": "^2.4.2", - "magic-string": "^0.25.7", - "minimist": "^1.2.5", - "regexpu-core": "4.5.4" - }, - "bin": { - "buble": "bin/buble" - } - }, - "node_modules/buble/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/buble/node_modules/acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0" - } - }, - "node_modules/buble/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/buble/node_modules/regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "node_modules/buble/node_modules/regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/buble/node_modules/unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/buble/node_modules/unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -12109,17 +11938,6 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "@rollup/plugin-buble": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-0.21.3.tgz", - "integrity": "sha512-Iv8cCuFPnMdqV4pcyU+OrfjOfagPArRQ1PyQjx5KgHk3dARedI+8PNTLSMpJts0lQJr8yF2pAU4GxpxCBJ9HYw==", - "dev": true, - "requires": { - "@rollup/pluginutils": "^3.0.8", - "@types/buble": "^0.19.2", - "buble": "^0.20.0" - } - }, "@rollup/plugin-commonjs": { "version": "17.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz", @@ -12258,15 +12076,6 @@ "@babel/types": "^7.3.0" } }, - "@types/buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", - "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", - "dev": true, - "requires": { - "magic-string": "^0.25.0" - } - }, "@types/chroma-js": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-1.4.3.tgz", @@ -12462,13 +12271,6 @@ } } }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -12860,108 +12662,6 @@ "node-int64": "^0.4.0" } }, - "buble": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", - "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", - "dev": true, - "requires": { - "acorn": "^6.4.1", - "acorn-dynamic-import": "^4.0.0", - "acorn-jsx": "^5.2.0", - "chalk": "^2.4.2", - "magic-string": "^0.25.7", - "minimist": "^1.2.5", - "regexpu-core": "4.5.4" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - }, - "acorn-dynamic-import": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", - "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", - "dev": true, - "requires": {} - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", - "dev": true, - "requires": { - "regenerate": "^1.4.0" - } - }, - "regexpu-core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", - "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", - "dev": true, - "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.0.2", - "regjsgen": "^0.5.0", - "regjsparser": "^0.6.0", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.1.0" - } - }, - "regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - } - }, - "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", - "dev": true - } - } - }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", diff --git a/package.json b/package.json index 19e947e7..10c1f00f 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ ], "devDependencies": { "@babel/preset-env": "^7.17.10", - "@rollup/plugin-buble": "^0.21.3", "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.1.1", diff --git a/rollup.config.js b/rollup.config.js index d031b4d2..7cd20c51 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,7 +2,6 @@ import json from '@rollup/plugin-json' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import typescript from '@rollup/plugin-typescript' -import buble from '@rollup/plugin-buble' import internal from 'rollup-plugin-internal' // import terser from 'rollup-plugin-terser' diff --git a/src/polyfills.js b/src/polyfills.js index e58c810b..a37338db 100644 --- a/src/polyfills.js +++ b/src/polyfills.js @@ -1,3 +1,5 @@ +// TODO remove..? + /** * @file shims * @private From b4acf5d333794506c8b758ada3e08c260cc26118 Mon Sep 17 00:00:00 2001 From: Seungwoo Hong Date: Sun, 2 Jul 2023 13:18:32 +0900 Subject: [PATCH 3/7] remove: polyfills.js --- src/ngl.ts | 2 - src/polyfills.js | 494 ----------------------------------------------- 2 files changed, 496 deletions(-) delete mode 100644 src/polyfills.js diff --git a/src/ngl.ts b/src/ngl.ts index eef64c59..bf6f6fb3 100644 --- a/src/ngl.ts +++ b/src/ngl.ts @@ -4,8 +4,6 @@ * @author Alexander Rose */ -import './polyfills' - /** * The NGL module. These members are available in the `NGL` namespace when using the {@link https://github.com/umdjs/umd|UMD} build in the `ngl.js` file. * @module NGL diff --git a/src/polyfills.js b/src/polyfills.js deleted file mode 100644 index a37338db..00000000 --- a/src/polyfills.js +++ /dev/null @@ -1,494 +0,0 @@ -// TODO remove..? - -/** - * @file shims - * @private - * @author Alexander Rose - */ - -/// /////////// -// Polyfills - -if (typeof window !== 'undefined') { - (function () { - 'use strict' - // Console-polyfill. MIT license. - // https://github.com/paulmillr/console-polyfill - // Make it safe to do console.log() always. - - window.console = window.console || {} - var con = window.console - var prop, method - var empty = {} - var dummy = function () {} - var properties = 'memory'.split(',') - var methods = ( - 'assert,clear,count,debug,dir,dirxml,error,exception,group,' + - 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + - 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn' - ).split(',') - - while ((prop = properties.pop())) if (!con[prop]) con[prop] = empty - while ((method = methods.pop())) if (!con[method]) con[method] = dummy - })() -} - -if (typeof window !== 'undefined' && typeof window.HTMLCanvasElement !== 'undefined' && !window.HTMLCanvasElement.prototype.toBlob) { - // http://code.google.com/p/chromium/issues/detail?id=67587#57 - Object.defineProperty(window.HTMLCanvasElement.prototype, 'toBlob', { - - value: function (callback, type, quality) { - var bin = window.atob(this.toDataURL(type, quality).split(',')[ 1 ]) - var len = bin.length - var len32 = len >> 2 - var a8 = new Uint8Array(len) - var a32 = new Uint32Array(a8.buffer, 0, len32) - - for (var i = 0, j = 0; i < len32; i++) { - a32[i] = ( - bin.charCodeAt(j++) | - bin.charCodeAt(j++) << 8 | - bin.charCodeAt(j++) << 16 | - bin.charCodeAt(j++) << 24 - ) - } - - var tailLength = len & 3 - - while (tailLength--) { - a8[ j ] = bin.charCodeAt(j++) - } - - callback(new window.Blob([ a8 ], { 'type': type || 'image/png' })) - } - - }) -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt -Math.cbrt = Math.cbrt || function (x) { - var y = Math.pow(Math.abs(x), 1 / 3) - return x < 0 ? -y : y -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign -if (!Math.sign) { - Math.sign = function (x) { - // If x is NaN, the result is NaN. - // If x is -0, the result is -0. - // If x is +0, the result is +0. - // If x is negative and not -0, the result is -1. - // If x is positive and not +0, the result is +1. - x = +x // convert to a number - if (x === 0 || isNaN(x)) { - return Number(x) - } - return x > 0 ? 1 : -1 - } -} - -if (!Number.isInteger) { - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger - Number.isInteger = function isInteger (nVal) { - return typeof nVal === 'number' && isFinite(nVal) && nVal > -9007199254740992 && nVal < 9007199254740992 && Math.floor(nVal) === nVal - } -} - -if (!Number.isNaN) { - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN - Number.isNaN = function isNaN (value) { - return value !== value // eslint-disable-line no-self-compare - } -} - -if (!Object.assign) { - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - Object.defineProperty(Object, 'assign', { - - enumerable: false, - configurable: true, - writable: true, - - value: function (target/*, firstSource */) { - 'use strict' - if (target === undefined || target === null) { throw new TypeError('Cannot convert first argument to object') } - - var to = Object(target) - - var hasPendingException = false - var pendingException - - for (var i = 1; i < arguments.length; i++) { - var nextSource = arguments[i] - if (nextSource === undefined || nextSource === null) { continue } - - var keysArray = Object.keys(Object(nextSource)) - for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { - var nextKey = keysArray[nextIndex] - try { - var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey) - if (desc !== undefined && desc.enumerable) { to[nextKey] = nextSource[nextKey] } - } catch (e) { - if (!hasPendingException) { - hasPendingException = true - pendingException = e - } - } - } - - if (hasPendingException) { throw pendingException } - } - - return to - } - - }) -} - -if (!String.prototype.startsWith) { - /*! https://mths.be/startswith v0.2.0 by @mathias */ - - (function () { - 'use strict' // needed to support `apply`/`call` with `undefined`/`null` - var defineProperty = (function () { - // IE 8 only supports `Object.defineProperty` on DOM elements - var result - try { - var object = {} - var $defineProperty = Object.defineProperty - result = $defineProperty(object, object, object) && $defineProperty - } catch (error) {} // eslint-disable-line no-empty - return result - }()) - var toString = {}.toString - var startsWith = function (search) { - if (this === null) { - throw TypeError() - } - var string = String(this) - if (search && toString.call(search) === '[object RegExp]') { - throw TypeError() - } - var stringLength = string.length - var searchString = String(search) - var searchLength = searchString.length - var position = arguments.length > 1 ? arguments[1] : undefined - // `ToInteger` - var pos = position ? Number(position) : 0 - if (Number.isNaN(pos)) { - pos = 0 - } - var start = Math.min(Math.max(pos, 0), stringLength) - // Avoid the `indexOf` call if no match is possible - if (searchLength + start > stringLength) { - return false - } - var index = -1 - while (++index < searchLength) { - if (string.charCodeAt(start + index) !== searchString.charCodeAt(index)) { - return false - } - } - return true - } - if (defineProperty) { - defineProperty(String.prototype, 'startsWith', { - 'value': startsWith, - 'configurable': true, - 'writable': true - }) - } else { - // eslint-disable-next-line no-extend-native - String.prototype.startsWith = startsWith - } - }()) -} - -if (!String.prototype.endsWith) { - // eslint-disable-next-line no-extend-native - String.prototype.endsWith = function (searchString, position) { - var subjectString = this.toString() - if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { - position = subjectString.length - } - position -= searchString.length - var lastIndex = subjectString.indexOf(searchString, position) - return lastIndex !== -1 && lastIndex === position - } -} - -if (!String.prototype.repeat) { - // eslint-disable-next-line no-extend-native - String.prototype.repeat = function (count) { - 'use strict' - if (this === null) { - throw new TypeError('can\'t convert ' + this + ' to object') - } - var str = '' + this - count = +count - if (Number.isNaN(count)) { - count = 0 - } - if (count < 0) { - throw new RangeError('repeat count must be non-negative') - } - if (count === Infinity) { - throw new RangeError('repeat count must be less than infinity') - } - count = Math.floor(count) - if (str.length === 0 || count === 0) { - return '' - } - // Ensuring count is a 31-bit integer allows us to heavily optimize the - // main part. But anyway, most current (August 2014) browsers can't handle - // strings 1 << 28 chars or longer, so: - if (str.length * count >= 1 << 28) { - throw new RangeError('repeat count must not overflow maximum string size') - } - var rpt = '' - for (;;) { - if ((count & 1) === 1) { - rpt += str - } - count >>>= 1 - if (count === 0) { - break - } - str += str - } - // Could we try: - // return Array(count + 1).join(this); - return rpt - } -} - -if (!String.prototype.includes) { - // eslint-disable-next-line no-extend-native - String.prototype.includes = function (search, start) { - 'use strict' - if (typeof start !== 'number') { - start = 0 - } - - if (start + search.length > this.length) { - return false - } else { - return this.indexOf(search, start) !== -1 - } - } -} - -if (!Array.prototype.includes) { - // eslint-disable-next-line no-extend-native - Array.prototype.includes = function (searchElement /*, fromIndex */) { - 'use strict' - if (this == null) { - throw new TypeError('Array.prototype.includes called on null or undefined') - } - - var O = Object(this) - var len = parseInt(O.length, 10) || 0 - if (len === 0) { - return false - } - var n = parseInt(arguments[1], 10) || 0 - var k - if (n >= 0) { - k = n - } else { - k = len + n - if (k < 0) { k = 0 } - } - var currentElement - while (k < len) { - currentElement = O[k] - if (searchElement === currentElement || - (Number.isNaN(searchElement) && Number.isNaN(currentElement)) - ) { - return true - } - k++ - } - return false - } -} - -// Production steps of ECMA-262, Edition 6, 22.1.2.1 -// Reference: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from -if (!Array.from) { - Array.from = (function () { - var toStr = Object.prototype.toString - var isCallable = function (fn) { - return typeof fn === 'function' || toStr.call(fn) === '[object Function]' - } - var toInteger = function (value) { - var number = Number(value) - if (isNaN(number)) { return 0 } - if (number === 0 || !isFinite(number)) { return number } - return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)) - } - var maxSafeInteger = Math.pow(2, 53) - 1 - var toLength = function (value) { - var len = toInteger(value) - return Math.min(Math.max(len, 0), maxSafeInteger) - } - - // The length property of the from method is 1. - return function from (arrayLike/*, mapFn, thisArg */) { - // 1. Let C be the this value. - var C = this - - // 2. Let items be ToObject(arrayLike). - var items = Object(arrayLike) - - // 3. ReturnIfAbrupt(items). - if (arrayLike == null) { - throw new TypeError('Array.from requires an array-like object - not null or undefined') - } - - // 4. If mapfn is undefined, then let mapping be false. - var mapFn = arguments.length > 1 ? arguments[1] : void undefined - var T - if (typeof mapFn !== 'undefined') { - // 5. else - // 5. a If IsCallable(mapfn) is false, throw a TypeError exception. - if (!isCallable(mapFn)) { - throw new TypeError('Array.from: when provided, the second argument must be a function') - } - - // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined. - if (arguments.length > 2) { - T = arguments[2] - } - } - - // 10. Let lenValue be Get(items, "length"). - // 11. Let len be ToLength(lenValue). - var len = toLength(items.length) - - // 13. If IsConstructor(C) is true, then - // 13. a. Let A be the result of calling the [[Construct]] internal method of C with an argument list containing the single item len. - // 14. a. Else, Let A be ArrayCreate(len). - var A = isCallable(C) ? Object(new C(len)) : new Array(len) - - // 16. Let k be 0. - var k = 0 - // 17. Repeat, while k < len… (also steps a - h) - var kValue - while (k < len) { - kValue = items[k] - if (mapFn) { - A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k) - } else { - A[k] = kValue - } - k += 1 - } - // 18. Let putStatus be Put(A, "length", len, true). - A.length = len - // 20. Return A. - return A - } - }()) -} - -if (typeof window !== 'undefined') { - (function () { - // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating - - // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel - - // MIT license - - var lastTime = 0 - var vendors = [ 'ms', 'moz', 'webkit', 'o' ] - - for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = ( - window[ vendors[ x ] + 'RequestAnimationFrame' ] - ) - - window.cancelAnimationFrame = ( - window[ vendors[ x ] + 'CancelAnimationFrame' ] || - window[ vendors[ x ] + 'CancelRequestAnimationFrame' ] - ) - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function (callback/*, element */) { - var currTime = new Date().getTime() - var timeToCall = Math.max(0, 16 - (currTime - lastTime)) - - var id = window.setTimeout(function () { - var time = currTime + timeToCall - callback(time) - }, timeToCall) - - lastTime = currTime + timeToCall - - return id - } - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function (id) { - clearTimeout(id) - } - } - }()) -} - -if (Function.prototype.name === undefined && Object.defineProperty !== undefined) { - // Missing in IE9-11. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name - - // eslint-disable-next-line no-extend-native - Object.defineProperty(Function.prototype, 'name', { - - get: function () { - return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[ 1 ] - } - - }) -} - -if (typeof window !== 'undefined') { - if (window.performance === undefined) { - /* global self */ - self.performance = {} - } - - if (window.performance.now === undefined) { - (function () { - var start = Date.now() - - window.performance.now = function () { - return Date.now() - start - } - })() - } -} - -if (Object.defineProperty !== undefined) { - // Missing in IE < 13 - // MIT license - // Copyright (c) 2016 Financial Times - // https://github.com/Financial-Times/polyfill-service - if (Number.MAX_SAFE_INTEGER === undefined) { - Object.defineProperty(Number, 'MAX_SAFE_INTEGER', { - enumerable: false, - configurable: false, - writable: false, - value: Math.pow(2, 53) - 1 - }) - } - if (Number.MIN_SAFE_INTEGER === undefined) { - Object.defineProperty(Number, 'MIN_SAFE_INTEGER', { - enumerable: false, - configurable: false, - writable: false, - value: -(Math.pow(2, 53) - 1) - }) - } -} From c69ff0bcd2e098a8d495381136633a60dd70e420 Mon Sep 17 00:00:00 2001 From: Seungwoo Hong Date: Sun, 2 Jul 2023 13:35:50 +0900 Subject: [PATCH 4/7] lint: . --- rollup.config.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 7cd20c51..6c0fc428 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,16 +2,16 @@ import json from '@rollup/plugin-json' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import typescript from '@rollup/plugin-typescript' + import internal from 'rollup-plugin-internal' -// import terser from 'rollup-plugin-terser' var path = require('path') var pkg = require('./package.json') // When building UMD or ES6 module, mark dependencies as external export const moduleExternals = Object.keys(pkg.dependencies) -export const moduleGlobals = {three: 'three'} +export const moduleGlobals = { three: 'three' } export const umdGlobals = { 'chroma-js': 'chroma', 'signals': 'signalsWrapper', @@ -42,7 +42,7 @@ function glsl () { .replace(/ {2,}/g, ' ') .replace(/ *\n */g, '\n') ) - var register = "ShaderRegistry.add('" + key + "', " + shader + ');' + var register = 'ShaderRegistry.add(\'' + key + '\', ' + shader + ');' code = registryImport + register return { code: code, map: { mappings: '' } } } @@ -61,10 +61,10 @@ function text () { } export const plugins = [ - typescript({sourceMap: true, inlineSources: true}), + typescript({ sourceMap: true, inlineSources: true }), resolve({ jsnext: true, - main: true + main: true, }), commonjs(), glsl(), From 8beed070057bb81b8712cf2711ffd450dc02dc6b Mon Sep 17 00:00:00 2001 From: Seungwoo Hong Date: Sun, 2 Jul 2023 13:54:25 +0900 Subject: [PATCH 5/7] remove: unused plugin --- package.json | 1 - rollup.config.js | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/package.json b/package.json index 10c1f00f..ddb245f3 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "jest": "^28.1.0", "jest-environment-jsdom": "^28.1.0", "rollup": "^2.38.5", - "rollup-plugin-internal": "^1.0.4", "rollup-plugin-terser": "^7.0.2", "standard": "^11.0.1", "ts-jest": "^28.0.2", diff --git a/rollup.config.js b/rollup.config.js index 6c0fc428..20367e6e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,9 +3,6 @@ import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import typescript from '@rollup/plugin-typescript' -import internal from 'rollup-plugin-internal' - - var path = require('path') var pkg = require('./package.json') @@ -97,7 +94,7 @@ const moduleConfig = { // this version has three.js and everything else built in const bundleConfig = { input: 'src/ngl.ts', - plugins: [...plugins, internal(['three'])], + plugins: [...plugins], output: { file: 'build/js/ngl.dev.js', format: 'umd', From bf695390959107052fd990970aa31565ed283f5e Mon Sep 17 00:00:00 2001 From: Seungwoo Hong Date: Sun, 2 Jul 2023 13:55:36 +0900 Subject: [PATCH 6/7] chore: update plugin-terser --- package-lock.json | 311 ++++++++++++------------------------------ package.json | 2 +- rollup.config.dist.js | 2 +- 3 files changed, 92 insertions(+), 223 deletions(-) diff --git a/package-lock.json b/package-lock.json index 061ebca6..a80010ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.1.1", + "@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-typescript": "^8.1.1", "@types/chroma-js": "^1.3.5", "@types/jest": "^27.5.1", @@ -31,8 +32,6 @@ "jest": "^28.1.0", "jest-environment-jsdom": "^28.1.0", "rollup": "^2.38.5", - "rollup-plugin-internal": "^1.0.4", - "rollup-plugin-terser": "^7.0.2", "standard": "^11.0.1", "ts-jest": "^28.0.2", "tslib": "^2.3.1", @@ -2359,28 +2358,10 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, - "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.4.tgz", + "integrity": "sha512-KE/SxsDqNs3rrWwFHcRh15ZLVFrI0YoZtgAdIyIq9k5hUNmiWRXXThPomIxHuL20sLdgzbDFyvkUMna14bvtrw==", + "dev": true }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.13", @@ -2451,6 +2432,37 @@ "rollup": "^1.20.0||^2.0.0" } }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", + "integrity": "sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==", + "dev": true, + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.x || ^3.x" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser/node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/@rollup/plugin-typescript": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.2.tgz", @@ -2732,9 +2744,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", + "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -8851,78 +8863,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-internal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-internal/-/rollup-plugin-internal-1.0.4.tgz", - "integrity": "sha512-abFOORRqps1dICHgLqasbVG+Kt45BDifUj5XuLSGQm/UBnrLuj9ctKxw8388B4YS9Gk6pv3YRjNIsJ/SJKBE9w==", - "dev": true, - "dependencies": { - "safe-resolve": "^1.0.0", - "tslib": "^1.10.0" - }, - "engines": { - "node": ">=8" - }, - "peerDependencies": { - "rollup": ">=0.45.2" - } - }, - "node_modules/rollup-plugin-internal/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0" - } - }, - "node_modules/rollup-plugin-terser/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/rollup-plugin-terser/node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/rollup-plugin-terser/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -8976,12 +8916,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/safe-resolve": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-resolve/-/safe-resolve-1.0.0.tgz", - "integrity": "sha1-/jT40p16O+z9JJ0KqKeZtcPPZVk=", - "dev": true - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -9009,15 +8943,6 @@ "semver": "bin/semver.js" } }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -9102,6 +9027,12 @@ "node": ">=4" } }, + "node_modules/smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -9441,13 +9372,13 @@ } }, "node_modules/terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.2.tgz", + "integrity": "sha512-Ah19JS86ypbJzTzvUCX7KOsEIhDaRONungA4aYBjEP3JZRf4ocuDzTg4QWZnPn9DEMiMYGJPiSOy7aykoCc70w==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -11900,27 +11831,10 @@ "dev": true }, "@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", - "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - } - } + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.4.tgz", + "integrity": "sha512-KE/SxsDqNs3rrWwFHcRh15ZLVFrI0YoZtgAdIyIq9k5hUNmiWRXXThPomIxHuL20sLdgzbDFyvkUMna14bvtrw==", + "dev": true }, "@jridgewell/sourcemap-codec": { "version": "1.4.13", @@ -11976,6 +11890,28 @@ "resolve": "^1.19.0" } }, + "@rollup/plugin-terser": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", + "integrity": "sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==", + "dev": true, + "requires": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "dependencies": { + "serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + } + } + }, "@rollup/plugin-typescript": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.2.tgz", @@ -12242,9 +12178,9 @@ "dev": true }, "acorn": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", + "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", "dev": true }, "acorn-globals": { @@ -16912,64 +16848,6 @@ "fsevents": "~2.3.2" } }, - "rollup-plugin-internal": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/rollup-plugin-internal/-/rollup-plugin-internal-1.0.4.tgz", - "integrity": "sha512-abFOORRqps1dICHgLqasbVG+Kt45BDifUj5XuLSGQm/UBnrLuj9ctKxw8388B4YS9Gk6pv3YRjNIsJ/SJKBE9w==", - "dev": true, - "requires": { - "safe-resolve": "^1.0.0", - "tslib": "^1.10.0" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, - "rollup-plugin-terser": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", - "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "jest-worker": "^26.2.1", - "serialize-javascript": "^4.0.0", - "terser": "^5.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -17006,12 +16884,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safe-resolve": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-resolve/-/safe-resolve-1.0.0.tgz", - "integrity": "sha1-/jT40p16O+z9JJ0KqKeZtcPPZVk=", - "dev": true - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -17033,15 +16905,6 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -17111,6 +16974,12 @@ "is-fullwidth-code-point": "^2.0.0" } }, + "smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -17384,13 +17253,13 @@ } }, "terser": { - "version": "5.15.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", - "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.18.2.tgz", + "integrity": "sha512-Ah19JS86ypbJzTzvUCX7KOsEIhDaRONungA4aYBjEP3JZRf4ocuDzTg4QWZnPn9DEMiMYGJPiSOy7aykoCc70w==", "dev": true, "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, diff --git a/package.json b/package.json index ddb245f3..7a4aa2ab 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.1.1", + "@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-typescript": "^8.1.1", "@types/chroma-js": "^1.3.5", "@types/jest": "^27.5.1", @@ -75,7 +76,6 @@ "jest": "^28.1.0", "jest-environment-jsdom": "^28.1.0", "rollup": "^2.38.5", - "rollup-plugin-terser": "^7.0.2", "standard": "^11.0.1", "ts-jest": "^28.0.2", "tslib": "^2.3.1", diff --git a/rollup.config.dist.js b/rollup.config.dist.js index 18e09b30..e578ea55 100644 --- a/rollup.config.dist.js +++ b/rollup.config.dist.js @@ -1,4 +1,4 @@ -import { terser } from 'rollup-plugin-terser' +import terser from '@rollup/plugin-terser'; import { plugins, moduleGlobals, umdGlobals, moduleExternals } from './rollup.config.js' import { threeMinifier } from "@yushijinhun/three-minifier-rollup"; From 798353a846c88a8b10060a39b0c1eb7dc9719dd3 Mon Sep 17 00:00:00 2001 From: HHongSeongwoo Date: Tue, 10 Oct 2023 12:30:31 +0900 Subject: [PATCH 7/7] lint: . --- rollup.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 20367e6e..cbfd56db 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -8,7 +8,7 @@ var pkg = require('./package.json') // When building UMD or ES6 module, mark dependencies as external export const moduleExternals = Object.keys(pkg.dependencies) -export const moduleGlobals = { three: 'three' } +export const moduleGlobals = {three: 'three'} export const umdGlobals = { 'chroma-js': 'chroma', 'signals': 'signalsWrapper', @@ -39,7 +39,7 @@ function glsl () { .replace(/ {2,}/g, ' ') .replace(/ *\n */g, '\n') ) - var register = 'ShaderRegistry.add(\'' + key + '\', ' + shader + ');' + var register = "ShaderRegistry.add('" + key + "', " + shader + ');' code = registryImport + register return { code: code, map: { mappings: '' } } } @@ -58,7 +58,7 @@ function text () { } export const plugins = [ - typescript({ sourceMap: true, inlineSources: true }), + typescript({sourceMap: true, inlineSources: true}), resolve({ jsnext: true, main: true,