Skip to content

Commit cadff26

Browse files
committed
move repo to esm
1 parent 81f59f9 commit cadff26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+410
-408
lines changed

local/browser-testing/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@~local/browser-testing",
33
"private": true,
4+
"type": "module",
45
"version": "0.0.0",
56
"main": "./dist/index.js",
67
"types": "./dist/index.d.ts",

local/browser-testing/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"outDir": "./dist/",
55
"baseUrl": "./src/",
6+
"module": "ESNext",
67
"typeRoots": []
78
}
89
}

local/config/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"name": "@~local/config",
3+
"type": "module",
34
"private": true,
45
"exports": {
56
"./resolve": "./src/resolve.json",
67
"./playwright": "./src/playwright.js",
78
"./playwright.coverage": "./src/playwright.coverage.js",
89
"./jest": "./src/jest.js",
9-
"./jest-babel": "./src/jest.babel.js",
10+
"./jest-babel": "./src/jest.babel.cjs",
1011
"./full-coverage": "./src/full-coverage.js",
11-
"./vitest": "./src/vitest.mjs",
12-
"./vitest.new-jsdom.env": "./src/vitest.new-jsdom.env.mjs"
12+
"./vitest": "./src/vitest.js",
13+
"./vitest.new-jsdom.env": "./src/vitest.new-jsdom.env.js"
1314
},
1415
"version": "0.0.0"
1516
}

local/config/src/full-coverage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
tmpCoverageDirectory: './.coverage/.nycFull',
33
coverageDirectory: './.coverage/full',
44
};

local/config/src/jest.babel.js renamed to local/config/src/jest.babel.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ module.exports = {
99
},
1010
],
1111
],
12+
plugins: ['@babel/plugin-syntax-import-attributes'],
1213
};

local/config/src/jest.fileMock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = {};
1+
export default {};

local/config/src/jest.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
const path = require('path');
2-
const resolve = require('./resolve');
1+
import path from 'node:path';
2+
import { fileURLToPath } from 'node:url';
3+
import resolve from './resolve.json' with { type: 'json' };
34

45
// For a detailed explanation regarding each configuration property, visit:
56
// https://jestjs.io/docs/en/configuration.html
67

8+
const dirname = path.dirname(fileURLToPath(import.meta.url));
79
const assetFilesModuleNameMapper = {
810
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
9-
path.resolve(__dirname, 'jest.fileMock.js'),
10-
'.*\\.(css|less|scss|sass)$': path.resolve(__dirname, 'jest.fileMock.js'),
11+
path.resolve(dirname, 'jest.fileMock.js'),
12+
'.*\\.(css|less|scss|sass)$': path.resolve(dirname, 'jest.fileMock.js'),
1113
};
1214
const coveragePathIgnorePatterns = [
1315
'/node_modules/',
1416
'<rootDir>/([^/]*)\\.config\\.(js|mjs|cjs|ts)',
1517
];
1618

1719
/** @type {import('jest').Config} */
18-
module.exports = {
20+
export default {
1921
coverageDirectory: './.coverage/unit',
2022
projects: [
2123
{
@@ -30,7 +32,7 @@ module.exports = {
3032
...resolve.paths.jest.moduleNameMapper,
3133
},
3234
testPathIgnorePatterns: ['/node_modules/'],
33-
setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.node.js')],
35+
setupFilesAfterEnv: [path.resolve(dirname, './jest.setup.node.js')],
3436
coveragePathIgnorePatterns,
3537
},
3638
{
@@ -45,7 +47,7 @@ module.exports = {
4547
...resolve.paths.jest.moduleNameMapper,
4648
},
4749
testPathIgnorePatterns: ['/node_modules/'],
48-
setupFilesAfterEnv: [path.resolve(__dirname, './jest.setup.jsdom.js')],
50+
setupFilesAfterEnv: [path.resolve(dirname, './jest.setup.jsdom.js')],
4951
coveragePathIgnorePatterns,
5052
},
5153
],

local/config/src/jest.setup.jsdom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { mockAnimationApi, mockComputedStyles } from './mocks';
1+
import { mockAnimationApi, mockComputedStyles } from './mocks.js';
22

33
mockAnimationApi();
44
mockComputedStyles();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
tmpCoverageDirectory: './.coverage/.nycPlaywright',
33
coverageDirectory: './.coverage/e2e',
44
};

local/config/src/playwright.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { devices } = require('@playwright/test');
1+
import { devices } from '@playwright/test';
22

3-
module.exports = {
3+
export default {
44
testMatch: /.*\/test\/playwright\/.*\.test\.[jt]sx?/,
55
timeout: 10 * 60 * 1500,
66
navigationTimeout: 1000,
@@ -10,6 +10,15 @@ module.exports = {
1010
fullyParallel: true,
1111
reporter: 'list',
1212
outputDir: '.playwright',
13+
build: {
14+
// external: [
15+
// 'local/playwright-tooling/**/*',
16+
// 'local/config/**/*',
17+
// 'local/rollup/**/*',
18+
// 'local/esbuild/**/*',
19+
// 'scrollSnap/**/*',
20+
// ],
21+
},
1322
projects: [
1423
{
1524
name: 'Chromium',

0 commit comments

Comments
 (0)