From b54dcc4f9dc41742980c904b04c870408dd1d7c1 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 6 Jan 2021 15:18:54 -0500 Subject: [PATCH 1/5] test non-gl2d/3d bundles to avoid function constructors --- .circleci/config.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b34366a43ca..dbc7e4b812d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: at: ~/ - run: name: Build dist/ - command: npm run build + command: npm run build && npm run no-new-func - store_artifacts: path: dist destination: dist diff --git a/package.json b/package.json index 115f851437c..2bf587a4a3e 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "watch": "node tasks/watch.js", "lint": "eslint --version && eslint .", "lint-fix": "eslint . --fix || true", + "no-new-func": "eslint --no-ignore --no-eslintrc --rule '{no-new-func: error}' dist/plotly-finance.js dist/plotly-basic.js dist/plotly-cartesian.js dist/plotly-geo.js dist/plotly-mapbox.js", "docker": "node tasks/docker.js", "pretest": "node tasks/pretest.js", "test-jasmine": "karma start test/jasmine/karma.conf.js", From 4c7ad71f1fc04c643639434774c424ebe3b8c811 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 6 Jan 2021 21:29:53 -0500 Subject: [PATCH 2/5] put partial bundle tests in a separate run block --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dbc7e4b812d..5ab7d2afc52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -145,7 +145,7 @@ jobs: at: ~/ - run: name: Build dist/ - command: npm run build && npm run no-new-func + command: npm run build - store_artifacts: path: dist destination: dist @@ -166,6 +166,9 @@ jobs: echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json + - run: + name: Test bundles + command: npm run no-new-func workflows: version: 2 From c611031939f10c64d1afdf2dc9bc0f0207989361 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 6 Jan 2021 22:09:24 -0500 Subject: [PATCH 3/5] change to exclude pattern - use debug mode --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2bf587a4a3e..81b863e74ab 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "watch": "node tasks/watch.js", "lint": "eslint --version && eslint .", "lint-fix": "eslint . --fix || true", - "no-new-func": "eslint --no-ignore --no-eslintrc --rule '{no-new-func: error}' dist/plotly-finance.js dist/plotly-basic.js dist/plotly-cartesian.js dist/plotly-geo.js dist/plotly-mapbox.js", + "no-new-func": "eslint --debug --no-ignore --no-eslintrc --rule '{no-new-func: error}' $(ls dist/plotly*.js | grep -v plotly-locale* | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.min.js)", "docker": "node tasks/docker.js", "pretest": "node tasks/pretest.js", "test-jasmine": "karma start test/jasmine/karma.conf.js", From 4c8b959c1c7976144436d0b5d8538bc6ac66ec12 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 7 Jan 2021 09:07:09 -0500 Subject: [PATCH 4/5] find and scan all js files in dist & subfolders --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81b863e74ab..65ea8a18ebf 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "watch": "node tasks/watch.js", "lint": "eslint --version && eslint .", "lint-fix": "eslint . --fix || true", - "no-new-func": "eslint --debug --no-ignore --no-eslintrc --rule '{no-new-func: error}' $(ls dist/plotly*.js | grep -v plotly-locale* | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.min.js)", + "no-new-func": "eslint --no-ignore --no-eslintrc --rule '{no-new-func: error}' $(find dist -type f -iname '*.js' | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.min.js)", "docker": "node tasks/docker.js", "pretest": "node tasks/pretest.js", "test-jasmine": "karma start test/jasmine/karma.conf.js", From 32490349a505a4f6788c875b6c9ddbb12aaad4fe Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 7 Jan 2021 09:28:38 -0500 Subject: [PATCH 5/5] exclude MathJax.js --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65ea8a18ebf..234829e8402 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "watch": "node tasks/watch.js", "lint": "eslint --version && eslint .", "lint-fix": "eslint . --fix || true", - "no-new-func": "eslint --no-ignore --no-eslintrc --rule '{no-new-func: error}' $(find dist -type f -iname '*.js' | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.min.js)", + "no-new-func": "eslint --no-ignore --no-eslintrc --rule '{no-new-func: error}' $(find dist -type f -iname '*.js' | grep -v plotly-gl* | grep -v plotly-with-meta.* | grep -v plotly.js | grep -v plotly.min.js | grep -v MathJax.js)", "docker": "node tasks/docker.js", "pretest": "node tasks/pretest.js", "test-jasmine": "karma start test/jasmine/karma.conf.js",