From c9123d3635ab27d10993705fe38b298177a75c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 19 Nov 2021 00:39:52 +0100 Subject: [PATCH 1/4] Only bundle the release build, and don't import `src` in tests --- .eslintrc.cjs | 6 ++---- Makefile | 21 ++++++++++--------- babel.config.js | 4 ++++ .../test/integration/parser-override.js | 1 + .../babel-parser/test/unit/tokenizer/types.js | 11 ++++++++-- .../babel-parser/test/unit/util/identifier.js | 14 ++++++++----- .../babel-parser/test/unit/util/location.js | 9 ++++++-- .../test/util.test.js | 10 +++++++-- .../test/util.test.js | 10 +++++++-- .../test/util.test.js | 10 +++++++-- .../test/normalize-options.spec.js | 12 +++++++++-- .../test/normalize-options.spec.js | 12 +++++++++-- 12 files changed, 87 insertions(+), 33 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1ada9b291ecc..e2d424025744 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -67,10 +67,8 @@ module.exports = { "jest/no-standalone-expect": "off", "jest/no-test-callback": "off", "jest/valid-describe": "off", - "import/extensions": [ - "error", - { json: "always", js: "always", cjs: "always", mjs: "always" }, - ], + "import/extensions": ["error", "always"], + "no-restricted-imports": ["error", { patterns: ["**/src/**"] }], }, }, { diff --git a/Makefile b/Makefile index 341cd136a90f..d17500b8631a 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ NODE := $(YARN) node .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap -build: build-bundle +build: build-no-bundle ifneq ("$(BABEL_COVERAGE)", "true") $(MAKE) build-standalone endif @@ -28,8 +28,15 @@ build-bundle: clean clean-lib $(MAKE) build-flow-typings $(MAKE) build-dist -build-bundle-ci: bootstrap-only - $(MAKE) build-bundle +build-no-bundle-ci: bootstrap-only + $(YARN) gulp build-dev + $(MAKE) build-flow-typings + $(MAKE) build-dist + +build-no-bundle: clean clean-lib + BABEL_ENV=development $(YARN) gulp build-dev + $(MAKE) build-flow-typings + $(MAKE) build-dist generate-tsconfig: $(NODE) scripts/generators/tsconfig.js @@ -46,7 +53,7 @@ build-typescript-legacy-typings: build-standalone: build-babel-standalone -build-standalone-ci: build-bundle-ci +build-standalone-ci: build-no-bundle-ci $(MAKE) build-standalone build-babel-standalone: @@ -61,12 +68,6 @@ build-plugin-transform-runtime-dist: cd packages/babel-plugin-transform-runtime; \ $(NODE) scripts/build-dist.js -build-no-bundle: clean clean-lib - BABEL_ENV=development $(YARN) gulp build-dev - # Ensure that build artifacts for types are created during local - # development too. - $(MAKE) build-flow-typings - watch: build-no-bundle BABEL_ENV=development $(YARN) gulp watch diff --git a/babel.config.js b/babel.config.js index 5ea6cfb229e9..60fa06968635 100644 --- a/babel.config.js +++ b/babel.config.js @@ -215,6 +215,10 @@ module.exports = function (api) { assumptions: sourceAssumptions, plugins: [transformNamedBabelTypesImportToDestructuring], }, + { + test: sources.map(source => normalize(source.replace("/src", "/test"))), + plugins: ["@babel/plugin-proposal-dynamic-import"], + }, { test: unambiguousSources.map(normalize), sourceType: "unambiguous", diff --git a/eslint/babel-eslint-tests/test/integration/parser-override.js b/eslint/babel-eslint-tests/test/integration/parser-override.js index 1091c40671a1..5c5632485b1c 100644 --- a/eslint/babel-eslint-tests/test/integration/parser-override.js +++ b/eslint/babel-eslint-tests/test/integration/parser-override.js @@ -34,6 +34,7 @@ describe("parserOverride", () => { const babel7node12 = parseInt(process.versions.node) < 12 ? it.skip : it; babel7node12("works when parsing in a worker", async () => { const require = createRequire(import.meta.url); + // eslint-disable-next-line import/extensions const babelESLintWorker = require("@babel/eslint-parser/experimental-worker"); const { ast } = babelESLintWorker.parseForESLint(`27`, { diff --git a/packages/babel-parser/test/unit/tokenizer/types.js b/packages/babel-parser/test/unit/tokenizer/types.js index f242441bd588..0785c3055e16 100644 --- a/packages/babel-parser/test/unit/tokenizer/types.js +++ b/packages/babel-parser/test/unit/tokenizer/types.js @@ -1,6 +1,13 @@ -import { tt, tokenOperatorPrecedence } from "../../../src/tokenizer/types.js"; +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("token types", () => { + let tt, tokenOperatorPrecedence; + beforeAll(async () => { + ({ tt, tokenOperatorPrecedence } = await import( + "../../../lib/tokenizer/types.js" + )); + }); -describe("token types", () => { it("should check if the binOp for relational === in", () => { expect(tokenOperatorPrecedence(tt.relational)).toEqual( tokenOperatorPrecedence(tt._in), diff --git a/packages/babel-parser/test/unit/util/identifier.js b/packages/babel-parser/test/unit/util/identifier.js index c6c25ec942da..7ac5639eeb83 100644 --- a/packages/babel-parser/test/unit/util/identifier.js +++ b/packages/babel-parser/test/unit/util/identifier.js @@ -1,9 +1,13 @@ -import { - isKeyword, - keywordRelationalOperator, -} from "../../../src/util/identifier.js"; +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("identifier", () => { + let isKeyword, keywordRelationalOperator; + beforeAll(async () => { + ({ isKeyword, keywordRelationalOperator } = await import( + "../../../lib/util/identifier.js" + )); + }); -describe("identifier", () => { describe("isKeyword", () => { it("break is a keyword", () => { expect(isKeyword("break")).toBe(true); diff --git a/packages/babel-parser/test/unit/util/location.js b/packages/babel-parser/test/unit/util/location.js index 9c8fb79b37a4..7439ebfeb383 100644 --- a/packages/babel-parser/test/unit/util/location.js +++ b/packages/babel-parser/test/unit/util/location.js @@ -1,6 +1,11 @@ -import { getLineInfo } from "../../../src/util/location.js"; +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("getLineInfo", () => { + let getLineInfo; + beforeAll(async () => { + ({ getLineInfo } = await import("../../../lib/util/location.js")); + }); -describe("getLineInfo", () => { const input = "a\nb\nc\nd\ne\nf\ng\nh\ni"; it("reports correct position", () => { diff --git a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js index f6e9282e42fa..23a34a258639 100644 --- a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js +++ b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js @@ -1,5 +1,4 @@ import { parseSync, traverse } from "@babel/core"; -import { shouldTransform } from "../src/util.ts"; function getPath(input, parserOpts = {}) { let targetPath; @@ -19,7 +18,14 @@ function getPath(input, parserOpts = {}) { return targetPath; } -describe("shouldTransform", () => { +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("shouldTransform", () => { + let shouldTransform; + beforeAll(async () => { + ({ shouldTransform } = await import("../lib/util.js")); + }); + const positiveCases = [ "(function a([a]) {})", "({ b: function a([a]) {} })", diff --git a/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js b/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js index 89bc17afb5d7..9147705cced4 100644 --- a/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js +++ b/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js @@ -1,5 +1,4 @@ import { parseSync, traverse } from "@babel/core"; -import { shouldTransform } from "../src/util.ts"; function getPath(input, parserOpts = {}) { let targetPath; @@ -20,7 +19,14 @@ function getPath(input, parserOpts = {}) { return targetPath; } -describe("shouldTransform", () => { +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("shouldTransform", () => { + let shouldTransform; + beforeAll(async () => { + ({ shouldTransform } = await import("../lib/util.js")); + }); + const positiveCases = [ "fn?.(...[], 0)", "fn?.(...[], ...[])", diff --git a/packages/babel-plugin-proposal-optional-chaining/test/util.test.js b/packages/babel-plugin-proposal-optional-chaining/test/util.test.js index d2b8a3d83331..afbd65c9ff19 100644 --- a/packages/babel-plugin-proposal-optional-chaining/test/util.test.js +++ b/packages/babel-plugin-proposal-optional-chaining/test/util.test.js @@ -1,4 +1,3 @@ -import { willPathCastToBoolean } from "../src/util.js"; import { parseSync, traverse } from "@babel/core"; function getPath(input, parserOpts) { @@ -13,7 +12,14 @@ function getPath(input, parserOpts) { return targetPath; } -describe("willPathCastToBoolean", () => { +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("willPathCastToBoolean", () => { + let willPathCastToBoolean; + beforeAll(async () => { + ({ willPathCastToBoolean } = await import("../lib/util.js")); + }); + const positiveCases = [ "if(a?.b) {}", "while(a?.b) {}", diff --git a/packages/babel-preset-react/test/normalize-options.spec.js b/packages/babel-preset-react/test/normalize-options.spec.js index b3e1b8dee390..87dafebc3180 100644 --- a/packages/babel-preset-react/test/normalize-options.spec.js +++ b/packages/babel-preset-react/test/normalize-options.spec.js @@ -1,5 +1,13 @@ -import normalizeOptions from "../src/normalize-options.js"; -describe("normalize options", () => { +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("normalize options", () => { + let normalizeOptions; + beforeAll(async () => { + ({ default: normalizeOptions } = await import( + "../lib/normalize-options.js" + )); + }); + (process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => { it("should throw on unknown options", () => { expect(() => normalizeOptions({ throwIfNamespaces: true })).toThrowError( diff --git a/packages/babel-preset-typescript/test/normalize-options.spec.js b/packages/babel-preset-typescript/test/normalize-options.spec.js index 710c9dc797c6..bae4bd54c1fa 100644 --- a/packages/babel-preset-typescript/test/normalize-options.spec.js +++ b/packages/babel-preset-typescript/test/normalize-options.spec.js @@ -1,5 +1,13 @@ -import normalizeOptions from "../src/normalize-options.js"; -describe("normalize options", () => { +const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; + +describeSkipPublish("normalize options", () => { + let normalizeOptions; + beforeAll(async () => { + ({ default: normalizeOptions } = await import( + "../lib/normalize-options.js" + )); + }); + (process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => { it("should throw on unknown options", () => { expect(() => normalizeOptions({ allowNamespace: true })).toThrowError( From 63f5f79948533f379f7d63ad3d63f5d931d1c395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 24 Nov 2021 12:18:05 +0100 Subject: [PATCH 2/4] Use file extension to signal skipping --- jest.config.js | 4 ++++ .../tokenizer/{types.js => types.skip-bundled.js} | 11 ++--------- .../{identifier.js => identifier.skip-bundled.js} | 14 +++++--------- .../util/{location.js => location.skip-bundled.js} | 9 ++------- .../test/{util.test.js => util.skip-bundled.js} | 10 ++-------- .../test/{util.test.js => util.skip-bundled.js} | 10 ++-------- .../test/{util.test.js => util.skip-bundled.js} | 10 ++-------- ...s.spec.js => normalize-options.skip-bundled.js} | 11 ++--------- ...s.spec.js => normalize-options.skip-bundled.js} | 11 ++--------- 9 files changed, 23 insertions(+), 67 deletions(-) rename packages/babel-parser/test/unit/tokenizer/{types.js => types.skip-bundled.js} (65%) rename packages/babel-parser/test/unit/util/{identifier.js => identifier.skip-bundled.js} (78%) rename packages/babel-parser/test/unit/util/{location.js => location.skip-bundled.js} (77%) rename packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/{util.test.js => util.skip-bundled.js} (84%) rename packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/{util.test.js => util.skip-bundled.js} (92%) rename packages/babel-plugin-proposal-optional-chaining/test/{util.test.js => util.skip-bundled.js} (89%) rename packages/babel-preset-react/test/{normalize-options.spec.js => normalize-options.skip-bundled.js} (94%) rename packages/babel-preset-typescript/test/{normalize-options.spec.js => normalize-options.skip-bundled.js} (91%) diff --git a/jest.config.js b/jest.config.js index 276e156144d9..b60fa636a815 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,5 @@ const supportsESM = parseInt(process.versions.node) >= 12; +const isPublishBundle = process.env.IS_PUBLISH; module.exports = { collectCoverageFrom: [ @@ -23,6 +24,9 @@ module.exports = { "/build/", "/.history/", // local directory for VSCode Extension - https://marketplace.visualstudio.com/items?itemName=xyz.local-history "_browser\\.js", + // Some tests require internal files of bundled packages, which are not available + // in production builds. They are marked using the .skip-bundled.js extension. + ...(isPublishBundle ? ["\\.skip-bundled\\.js$"] : []), ], testEnvironment: "node", setupFilesAfterEnv: ["/test/testSetupFile.js"], diff --git a/packages/babel-parser/test/unit/tokenizer/types.js b/packages/babel-parser/test/unit/tokenizer/types.skip-bundled.js similarity index 65% rename from packages/babel-parser/test/unit/tokenizer/types.js rename to packages/babel-parser/test/unit/tokenizer/types.skip-bundled.js index 0785c3055e16..0cbcaa8d6fd6 100644 --- a/packages/babel-parser/test/unit/tokenizer/types.js +++ b/packages/babel-parser/test/unit/tokenizer/types.skip-bundled.js @@ -1,13 +1,6 @@ -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("token types", () => { - let tt, tokenOperatorPrecedence; - beforeAll(async () => { - ({ tt, tokenOperatorPrecedence } = await import( - "../../../lib/tokenizer/types.js" - )); - }); +import { tt, tokenOperatorPrecedence } from "../../../lib/tokenizer/types.js"; +describe("token types", () => { it("should check if the binOp for relational === in", () => { expect(tokenOperatorPrecedence(tt.relational)).toEqual( tokenOperatorPrecedence(tt._in), diff --git a/packages/babel-parser/test/unit/util/identifier.js b/packages/babel-parser/test/unit/util/identifier.skip-bundled.js similarity index 78% rename from packages/babel-parser/test/unit/util/identifier.js rename to packages/babel-parser/test/unit/util/identifier.skip-bundled.js index 7ac5639eeb83..6a9b3f7b20fb 100644 --- a/packages/babel-parser/test/unit/util/identifier.js +++ b/packages/babel-parser/test/unit/util/identifier.skip-bundled.js @@ -1,13 +1,9 @@ -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("identifier", () => { - let isKeyword, keywordRelationalOperator; - beforeAll(async () => { - ({ isKeyword, keywordRelationalOperator } = await import( - "../../../lib/util/identifier.js" - )); - }); +import { + isKeyword, + keywordRelationalOperator, +} from "../../../lib/util/identifier.js"; +describe("identifier", () => { describe("isKeyword", () => { it("break is a keyword", () => { expect(isKeyword("break")).toBe(true); diff --git a/packages/babel-parser/test/unit/util/location.js b/packages/babel-parser/test/unit/util/location.skip-bundled.js similarity index 77% rename from packages/babel-parser/test/unit/util/location.js rename to packages/babel-parser/test/unit/util/location.skip-bundled.js index 7439ebfeb383..463463c88921 100644 --- a/packages/babel-parser/test/unit/util/location.js +++ b/packages/babel-parser/test/unit/util/location.skip-bundled.js @@ -1,11 +1,6 @@ -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("getLineInfo", () => { - let getLineInfo; - beforeAll(async () => { - ({ getLineInfo } = await import("../../../lib/util/location.js")); - }); +import { getLineInfo } from "../../../lib/util/location.js"; +describe("getLineInfo", () => { const input = "a\nb\nc\nd\ne\nf\ng\nh\ni"; it("reports correct position", () => { diff --git a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js similarity index 84% rename from packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js rename to packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js index 23a34a258639..c2478caba4bf 100644 --- a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.test.js +++ b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js @@ -1,4 +1,5 @@ import { parseSync, traverse } from "@babel/core"; +import { shouldTransform } from "../lib/util.ts"; function getPath(input, parserOpts = {}) { let targetPath; @@ -18,14 +19,7 @@ function getPath(input, parserOpts = {}) { return targetPath; } -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("shouldTransform", () => { - let shouldTransform; - beforeAll(async () => { - ({ shouldTransform } = await import("../lib/util.js")); - }); - +describe("shouldTransform", () => { const positiveCases = [ "(function a([a]) {})", "({ b: function a([a]) {} })", diff --git a/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js b/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js similarity index 92% rename from packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js rename to packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js index 9147705cced4..2703696945bd 100644 --- a/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.test.js +++ b/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js @@ -1,4 +1,5 @@ import { parseSync, traverse } from "@babel/core"; +import { shouldTransform } from "../lib/util.ts"; function getPath(input, parserOpts = {}) { let targetPath; @@ -19,14 +20,7 @@ function getPath(input, parserOpts = {}) { return targetPath; } -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("shouldTransform", () => { - let shouldTransform; - beforeAll(async () => { - ({ shouldTransform } = await import("../lib/util.js")); - }); - +describe("shouldTransform", () => { const positiveCases = [ "fn?.(...[], 0)", "fn?.(...[], ...[])", diff --git a/packages/babel-plugin-proposal-optional-chaining/test/util.test.js b/packages/babel-plugin-proposal-optional-chaining/test/util.skip-bundled.js similarity index 89% rename from packages/babel-plugin-proposal-optional-chaining/test/util.test.js rename to packages/babel-plugin-proposal-optional-chaining/test/util.skip-bundled.js index afbd65c9ff19..ee3289dcc530 100644 --- a/packages/babel-plugin-proposal-optional-chaining/test/util.test.js +++ b/packages/babel-plugin-proposal-optional-chaining/test/util.skip-bundled.js @@ -1,3 +1,4 @@ +import { willPathCastToBoolean } from "../lib/util.js"; import { parseSync, traverse } from "@babel/core"; function getPath(input, parserOpts) { @@ -12,14 +13,7 @@ function getPath(input, parserOpts) { return targetPath; } -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("willPathCastToBoolean", () => { - let willPathCastToBoolean; - beforeAll(async () => { - ({ willPathCastToBoolean } = await import("../lib/util.js")); - }); - +describe("willPathCastToBoolean", () => { const positiveCases = [ "if(a?.b) {}", "while(a?.b) {}", diff --git a/packages/babel-preset-react/test/normalize-options.spec.js b/packages/babel-preset-react/test/normalize-options.skip-bundled.js similarity index 94% rename from packages/babel-preset-react/test/normalize-options.spec.js rename to packages/babel-preset-react/test/normalize-options.skip-bundled.js index 87dafebc3180..5932ed4b6d73 100644 --- a/packages/babel-preset-react/test/normalize-options.spec.js +++ b/packages/babel-preset-react/test/normalize-options.skip-bundled.js @@ -1,13 +1,6 @@ -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("normalize options", () => { - let normalizeOptions; - beforeAll(async () => { - ({ default: normalizeOptions } = await import( - "../lib/normalize-options.js" - )); - }); +import normalizeOptions from "../lib/normalize-options.js"; +describe("normalize options", () => { (process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => { it("should throw on unknown options", () => { expect(() => normalizeOptions({ throwIfNamespaces: true })).toThrowError( diff --git a/packages/babel-preset-typescript/test/normalize-options.spec.js b/packages/babel-preset-typescript/test/normalize-options.skip-bundled.js similarity index 91% rename from packages/babel-preset-typescript/test/normalize-options.spec.js rename to packages/babel-preset-typescript/test/normalize-options.skip-bundled.js index bae4bd54c1fa..205409af007e 100644 --- a/packages/babel-preset-typescript/test/normalize-options.spec.js +++ b/packages/babel-preset-typescript/test/normalize-options.skip-bundled.js @@ -1,13 +1,6 @@ -const describeSkipPublish = process.env.IS_PUBLISH ? describe.skip : describe; - -describeSkipPublish("normalize options", () => { - let normalizeOptions; - beforeAll(async () => { - ({ default: normalizeOptions } = await import( - "../lib/normalize-options.js" - )); - }); +import normalizeOptions from "../lib/normalize-options.js"; +describe("normalize options", () => { (process.env.BABEL_8_BREAKING ? describe : describe.skip)("Babel 8", () => { it("should throw on unknown options", () => { expect(() => normalizeOptions({ allowNamespace: true })).toThrowError( From 1f37a0bcce7771052fa3e0c193dde7d4f00ac566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 24 Nov 2021 12:21:20 +0100 Subject: [PATCH 3/4] Remove unnecessary config change --- babel.config.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/babel.config.js b/babel.config.js index 60fa06968635..5ea6cfb229e9 100644 --- a/babel.config.js +++ b/babel.config.js @@ -215,10 +215,6 @@ module.exports = function (api) { assumptions: sourceAssumptions, plugins: [transformNamedBabelTypesImportToDestructuring], }, - { - test: sources.map(source => normalize(source.replace("/src", "/test"))), - plugins: ["@babel/plugin-proposal-dynamic-import"], - }, { test: unambiguousSources.map(normalize), sourceType: "unambiguous", From f82974d99b556d807df3456295942edd13db8560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 24 Nov 2021 14:01:56 +0100 Subject: [PATCH 4/4] Fix imports --- .../test/util.skip-bundled.js | 2 +- .../test/util.skip-bundled.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js index c2478caba4bf..ed7576030378 100644 --- a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js +++ b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/test/util.skip-bundled.js @@ -1,5 +1,5 @@ import { parseSync, traverse } from "@babel/core"; -import { shouldTransform } from "../lib/util.ts"; +import { shouldTransform } from "../lib/util.js"; function getPath(input, parserOpts = {}) { let targetPath; diff --git a/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js b/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js index 2703696945bd..e475940c0b31 100644 --- a/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js +++ b/packages/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining/test/util.skip-bundled.js @@ -1,5 +1,5 @@ import { parseSync, traverse } from "@babel/core"; -import { shouldTransform } from "../lib/util.ts"; +import { shouldTransform } from "../lib/util.js"; function getPath(input, parserOpts = {}) { let targetPath;