diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5fc30c5ef49..7b5e4cd3f2e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -114,6 +114,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/cached-install + with: + node-version: 18.x - name: Build fabric.js uses: ./.github/actions/build-fabric-cached # Playwright suggests against caching the browser install @@ -127,7 +129,7 @@ jobs: with: name: e2e-report path: ./e2e/test-report/ - - name: Upload test coverage + - name: Upload Test Coverage uses: actions/upload-artifact@v3 with: name: coverage-e2e diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a0f335a89..d7e72514f4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] +- ci(e2e): support relative imports [#9108](https://github.com/fabricjs/fabric.js/pull/9108) - chore(TS): complete type check [#9119](https://github.com/fabricjs/fabric.js/pull/9119) - chore(TS): Add type-checking to files excluded with ts-nocheck [#9097](https://github.com/fabricjs/fabric.js/pull/9097) - chore(TS): Add type-checking to files excluded with ts-nocheck ( Parser mostly ) [#9085](https://github.com/fabricjs/fabric.js/pull/9085) diff --git a/e2e/.babelrc.js b/e2e/.babelrc.js new file mode 100644 index 00000000000..bb200e8a255 --- /dev/null +++ b/e2e/.babelrc.js @@ -0,0 +1,49 @@ +// https://github.com/viruscamp/babel-plugin-transform-imports#using-a-function-as-the-transformer + +const path = require('path'); +const testsDir = path.resolve('./e2e/tests'); +const testsBuiltDir = path.resolve('./e2e/dist'); + +function resolve(file) { + const found = ['', '.ts', '/index.ts'] + .map((resolution) => `${file}${resolution}`) + .find((file) => { + try { + return require.resolve(file); + } catch (error) { + return false; + } + }); + if (!found) { + console.error(`Failed to resolve ${file}`); + process.exit(1); + } + return require.resolve(found).replace(/\.ts$/, '.js'); +} + +module.exports = { + extends: '../.babelrcAlt', + plugins: [ + [ + 'transform-imports', + { + '\\..*': { + skipDefaultConversion: true, + transform: function (importName, matches, filename) { + const file = resolve( + path.resolve(path.dirname(filename), `${matches[0]}`) + ); + return `/${path + .relative( + process.cwd(), + file.startsWith(testsDir) + ? path.resolve(testsBuiltDir, path.relative(testsDir, file)) + : file + ) + .replaceAll('\\', '/')}`; + }, + }, + }, + ], + ], +}; diff --git a/e2e/imports.ts b/e2e/imports.ts index 2b63b3b68f3..5b2daeaf05f 100644 --- a/e2e/imports.ts +++ b/e2e/imports.ts @@ -1,12 +1,12 @@ import { readJSONSync } from 'fs-extra'; /** - * The import map used by `./utils/setupApp` to inject into the page - * so test scripts can use modules (relative imports don't seem to work out of the box) + * The import map used by `./utils/setupApp` to inject into the page so test scripts can use modules. + * + * Relative imports are supported thanks to babel, see `./.babelrc.js`. * * **IMPORTANT**: be sure to update the paths field in `./tsconfig.json` to reflect imports correctly */ export default { fabric: readJSONSync('./package.json').module.slice(1), - test: '/e2e/dist/test.js', }; diff --git a/e2e/setup/setupApp.ts b/e2e/setup/setupApp.ts index f29e2827210..e3fbd035c78 100644 --- a/e2e/setup/setupApp.ts +++ b/e2e/setup/setupApp.ts @@ -61,7 +61,7 @@ test.beforeEach(async ({ page }, { file }) => { await page.addScriptTag({ type: 'module', content: `${readFileSync( - path.relative(process.cwd(), pathToApp) + path.relative(process.cwd(), pathToBuiltApp) ).toString()} window.dispatchEvent(new CustomEvent('fabric:setup')); `, diff --git a/e2e/tests/template/index.ts b/e2e/tests/template/index.ts index b18c9b6c197..fd7845d7c08 100644 --- a/e2e/tests/template/index.ts +++ b/e2e/tests/template/index.ts @@ -1,10 +1,10 @@ /** * Runs in the **BROWSER** - * Use absolute imports defined in 'e2e/imports.ts' + * Imports are defined in 'e2e/imports.ts' */ import * as fabric from 'fabric'; -import { beforeAll } from 'test'; +import { beforeAll } from '../test'; beforeAll((canvas) => { const textbox = new fabric.Textbox('fabric.js test', { diff --git a/e2e/tests/test.ts b/e2e/tests/test.ts index a7dcf66c4a4..25e4317b280 100644 --- a/e2e/tests/test.ts +++ b/e2e/tests/test.ts @@ -8,6 +8,8 @@ import { Canvas } from 'fabric'; const canvasMap = (window.canvasMap = new Map()); const objectMap = (window.objectMap = new Map()); +type AsyncReturnValue = T | Promise; + const setupTasks: Promise[] = []; const teardownTasks: Awaited[] = []; @@ -26,14 +28,16 @@ export function before( /** * @returns a map of objects for playwright to access during tests */ - cb: Awaited<(canvas: Canvas) => Record>, - options? + cb: (canvas: HTMLCanvasElement) => AsyncReturnValue<{ + canvas: Canvas; + objects?: Record; + }> ) { const task = Promise.resolve().then(async () => { const el = document.querySelector(selector); - const canvas = new Canvas(el, options); + const { canvas, objects = {} } = await cb(el); canvasMap.set(el, canvas); - Object.entries((await cb(canvas)) || {}).forEach(([key, value]) => { + Object.entries(objects).forEach(([key, value]) => { if (objectMap.has(key)) { throw new Error( `Object identifiers must be unique: ${key} is already defined` @@ -52,13 +56,20 @@ export function before( * @param options canvas options */ export function beforeAll( - cb: Awaited<(canvas: Canvas) => Record>, + cb: (canvas: Canvas) => AsyncReturnValue>, options? ) { - before('#canvas', cb, options); + before('#canvas', async (el) => { + const canvas = new Canvas(el, options); + const objects = await cb(canvas); + return { canvas, objects }; + }); } -export function after(selector: string, cb: Awaited<(canvas: Canvas) => void>) { +export function after( + selector: string, + cb: (canvas: Canvas) => AsyncReturnValue +) { teardownTasks.push(() => { const el = document.querySelector(selector); const canvas = canvasMap.get(el); @@ -66,6 +77,6 @@ export function after(selector: string, cb: Awaited<(canvas: Canvas) => void>) { }); } -export function afterAll(cb: Awaited<(canvas: Canvas) => void>) { +export function afterAll(cb: (canvas: Canvas) => AsyncReturnValue) { after('#canvas', cb); } diff --git a/e2e/tests/text/text-editing/index.ts b/e2e/tests/text/text-editing/index.ts index a6b6bb7713c..12f87f49b0a 100644 --- a/e2e/tests/text/text-editing/index.ts +++ b/e2e/tests/text/text-editing/index.ts @@ -1,10 +1,5 @@ -/** - * Runs in the **BROWSER** - * Use absolute imports defined in 'e2e/imports.ts' - */ - import { Textbox } from 'fabric'; -import { beforeAll } from 'test'; +import { beforeAll } from '../../test'; beforeAll((canvas) => { const textbox = new Textbox('initial text', { width: 200, left: 50 }); diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index b13f6dcd859..b6b7be8d00e 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -10,6 +10,6 @@ * A reflection of the configured imports used by test scripts * **IMPORTANT**: be sure to keep this updated to reflect `./imports.ts` correctly */ - "paths": { "fabric": ["../dist"], "test": ["./tests/test.ts"] } + "paths": { "fabric": ["../dist"] } } } diff --git a/package-lock.json b/package-lock.json index eecd28ec02f..3fd18519fad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "auto-changelog": "^2.3.0", "axios": "^0.27.2", "babel-plugin-import-json-value": "^0.1.2", + "babel-plugin-transform-imports": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git", "busboy": "^1.6.0", "chalk": "^2.4.1", "commander": "^9.1.0", @@ -3999,6 +4000,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/babel-plugin-transform-imports": { + "version": "1.7.0", + "resolved": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git#e105857c5bbf5c1ecd0ea3ec5fe3f068ddd4739b", + "dev": true, + "license": "ISC", + "dependencies": { + "babel-types": "^6.6.0", + "is-valid-path": "^0.1.1", + "lodash.camelcase": "^4.3.0", + "lodash.findkey": "^4.6.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.upperfirst": "^4.3.1" + } + }, "node_modules/babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -4038,6 +4054,43 @@ "@babel/core": "^7.0.0" } }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "dev": true, + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "node_modules/babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "node_modules/babel-types/node_modules/to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/backbone": { "version": "1.4.1", "dev": true, @@ -4672,6 +4725,14 @@ "dev": true, "license": "MIT" }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, "node_modules/core-js-compat": { "version": "3.31.1", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.31.1.tgz", @@ -6923,6 +6984,39 @@ "node": ">=8" } }, + "node_modules/is-invalid-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-invalid-path/-/is-invalid-path-0.1.0.tgz", + "integrity": "sha512-aZMG0T3F34mTg4eTdszcGXx54oiZ4NtHSft3hWNJMGJXUUqdIj3cOZuHcU0nCWWcY3jd7yRe/3AEm3vSNTpBGQ==", + "dev": true, + "dependencies": { + "is-glob": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-invalid-path/node_modules/is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-invalid-path/node_modules/is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==", + "dev": true, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-number": { "version": "7.0.0", "dev": true, @@ -6979,6 +7073,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-valid-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-valid-path/-/is-valid-path-0.1.1.tgz", + "integrity": "sha512-+kwPrVDu9Ms03L90Qaml+79+6DZHqHyRoANI6IsZJ/g8frhnfchDOBCa0RbQ6/kdHt5CS5OeIEyrYznNuVN+8A==", + "dev": true, + "dependencies": { + "is-invalid-path": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-windows": { "version": "1.0.2", "dev": true, @@ -9116,6 +9222,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, "node_modules/lodash.castarray": { "version": "4.4.0", "dev": true, @@ -9137,6 +9249,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.findkey": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.findkey/-/lodash.findkey-4.6.0.tgz", + "integrity": "sha512-Y+f2R8KsUDJVqdfeai01P5A1IQeMWsMG1p0rghzdhIl7TIap47Y2Z5UJK8x4pstixNL56KVHFRE1IW9jvRwy4g==", + "dev": true + }, "node_modules/lodash.flatten": { "version": "3.0.2", "dev": true, @@ -9161,16 +9279,34 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "dev": true, "license": "MIT" }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "dev": true + }, "node_modules/lodash.uniqby": { "version": "4.7.0", "dev": true, "license": "MIT" }, + "node_modules/lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", + "dev": true + }, "node_modules/log-symbols": { "version": "4.1.0", "dev": true, @@ -14905,6 +15041,20 @@ "@babel/helper-define-polyfill-provider": "^0.4.1" } }, + "babel-plugin-transform-imports": { + "version": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git#e105857c5bbf5c1ecd0ea3ec5fe3f068ddd4739b", + "dev": true, + "from": "babel-plugin-transform-imports@git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git", + "requires": { + "babel-types": "^6.6.0", + "is-valid-path": "^0.1.1", + "lodash.camelcase": "^4.3.0", + "lodash.findkey": "^4.6.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.upperfirst": "^4.3.1" + } + }, "babel-preset-current-node-syntax": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", @@ -14935,6 +15085,44 @@ "babel-preset-current-node-syntax": "^1.0.0" } }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + }, + "dependencies": { + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", + "dev": true + } + } + }, "backbone": { "version": "1.4.1", "dev": true, @@ -15341,6 +15529,12 @@ "version": "1.0.6", "dev": true }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true + }, "core-js-compat": { "version": "3.31.1", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.31.1.tgz", @@ -16814,6 +17008,32 @@ "version": "1.0.0", "dev": true }, + "is-invalid-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-invalid-path/-/is-invalid-path-0.1.0.tgz", + "integrity": "sha512-aZMG0T3F34mTg4eTdszcGXx54oiZ4NtHSft3hWNJMGJXUUqdIj3cOZuHcU0nCWWcY3jd7yRe/3AEm3vSNTpBGQ==", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha512-7Q+VbVafe6x2T+Tu6NcOf6sRklazEPmBoB3IWk3WdGZM2iGUwU/Oe3Wtq5lSEkDTTlpp8yx+5t4pzO/i9Ty1ww==", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + } + } + }, "is-number": { "version": "7.0.0", "dev": true @@ -16845,6 +17065,15 @@ "version": "0.1.0", "dev": true }, + "is-valid-path": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-valid-path/-/is-valid-path-0.1.1.tgz", + "integrity": "sha512-+kwPrVDu9Ms03L90Qaml+79+6DZHqHyRoANI6IsZJ/g8frhnfchDOBCa0RbQ6/kdHt5CS5OeIEyrYznNuVN+8A==", + "dev": true, + "requires": { + "is-invalid-path": "^0.1.0" + } + }, "is-windows": { "version": "1.0.2", "dev": true @@ -18403,6 +18632,12 @@ "version": "4.2.0", "dev": true }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true + }, "lodash.castarray": { "version": "4.4.0", "dev": true @@ -18421,6 +18656,12 @@ "version": "4.6.0", "dev": true }, + "lodash.findkey": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.findkey/-/lodash.findkey-4.6.0.tgz", + "integrity": "sha512-Y+f2R8KsUDJVqdfeai01P5A1IQeMWsMG1p0rghzdhIl7TIap47Y2Z5UJK8x4pstixNL56KVHFRE1IW9jvRwy4g==", + "dev": true + }, "lodash.flatten": { "version": "3.0.2", "dev": true, @@ -18441,14 +18682,32 @@ "version": "3.0.4", "dev": true }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true + }, "lodash.merge": { "version": "4.6.2", "dev": true }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "dev": true + }, "lodash.uniqby": { "version": "4.7.0", "dev": true }, + "lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", + "dev": true + }, "log-symbols": { "version": "4.1.0", "dev": true, diff --git a/package.json b/package.json index 3d5d5f5eab0..156e998ff01 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,7 @@ "auto-changelog": "^2.3.0", "axios": "^0.27.2", "babel-plugin-import-json-value": "^0.1.2", + "babel-plugin-transform-imports": "git+https://git@github.com/ShaMan123/babel-plugin-transform-imports.git", "busboy": "^1.6.0", "chalk": "^2.4.1", "commander": "^9.1.0", diff --git a/playwright.config.ts b/playwright.config.ts index 739ff668d91..c6f5f187590 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -37,7 +37,7 @@ const config: PlaywrightTestConfig = { reporter: [ ['list'], ['html', { outputFolder: './e2e/test-report', open: 'on-failure' }], - ['json', './e2e/test-results/test-results.json'], + ['json', { outputFile: './e2e/test-results/test-results.json' }], ], outputDir: './e2e/test-results', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ diff --git a/playwright.setup.ts b/playwright.setup.ts index 5d95a65e9f3..25c01b6b44c 100644 --- a/playwright.setup.ts +++ b/playwright.setup.ts @@ -5,7 +5,7 @@ export default (config: PlaywrightTestConfig) => { const watch = process.argv.includes('--ui'); return new Promise((resolve) => { const p = spawn( - `babel --no-babelrc e2e/tests --extensions '.ts' --ignore '**/*.spec.ts' --out-dir e2e/dist --config-file ./.babelrcAlt ${ + `babel --no-babelrc e2e/tests --extensions '.ts' --ignore '**/*.spec.ts' --out-dir e2e/dist --config-file ./e2e/.babelrc.js ${ watch ? '-w' : '' }`, { shell: true, detached: false }