diff --git a/.changeset/yellow-shrimps-arrive.md b/.changeset/yellow-shrimps-arrive.md new file mode 100644 index 000000000..1f3bac5cf --- /dev/null +++ b/.changeset/yellow-shrimps-arrive.md @@ -0,0 +1,6 @@ +--- +'@codeshift/cli': minor +'@hypermod/cli': minor +--- + +CLI packages now support hypermod packages using ESM syntax diff --git a/community/@atlaskit__avatar/package.json b/community/@atlaskit__avatar/package.json index f91e7b22a..9c1528c6a 100644 --- a/community/@atlaskit__avatar/package.json +++ b/community/@atlaskit__avatar/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__avatar" diff --git a/community/@atlaskit__breadcrumbs/package.json b/community/@atlaskit__breadcrumbs/package.json index 11b6b2acf..e489bc3ba 100644 --- a/community/@atlaskit__breadcrumbs/package.json +++ b/community/@atlaskit__breadcrumbs/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__breadcrumbs" diff --git a/community/@atlaskit__button/package.json b/community/@atlaskit__button/package.json index cbb0cd724..8bfdb3503 100644 --- a/community/@atlaskit__button/package.json +++ b/community/@atlaskit__button/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__button" diff --git a/community/@atlaskit__calendar/package.json b/community/@atlaskit__calendar/package.json index 0756533d2..6eccf7225 100644 --- a/community/@atlaskit__calendar/package.json +++ b/community/@atlaskit__calendar/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__calendar" diff --git a/community/@atlaskit__checkbox/package.json b/community/@atlaskit__checkbox/package.json index 561008dda..5ef6da606 100644 --- a/community/@atlaskit__checkbox/package.json +++ b/community/@atlaskit__checkbox/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__checkbox" diff --git a/community/@atlaskit__icon/package.json b/community/@atlaskit__icon/package.json index 5de5f1c18..03306f191 100644 --- a/community/@atlaskit__icon/package.json +++ b/community/@atlaskit__icon/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__icon" diff --git a/community/@atlaskit__menu/package.json b/community/@atlaskit__menu/package.json index 2020cb5a2..7fb5167b7 100644 --- a/community/@atlaskit__menu/package.json +++ b/community/@atlaskit__menu/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__menu" diff --git a/community/@atlaskit__popper/package.json b/community/@atlaskit__popper/package.json index b39911d66..b048bae81 100644 --- a/community/@atlaskit__popper/package.json +++ b/community/@atlaskit__popper/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__popper" diff --git a/community/@atlaskit__popup/package.json b/community/@atlaskit__popup/package.json index ec5fd1cf4..8c333c671 100644 --- a/community/@atlaskit__popup/package.json +++ b/community/@atlaskit__popup/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__popup" diff --git a/community/@atlaskit__progress-indicator/package.json b/community/@atlaskit__progress-indicator/package.json index 9e7e7fdd9..bc6dd4a41 100644 --- a/community/@atlaskit__progress-indicator/package.json +++ b/community/@atlaskit__progress-indicator/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__progress-indicator" diff --git a/community/@atlaskit__range/package.json b/community/@atlaskit__range/package.json index 8a20a522c..54c18412c 100644 --- a/community/@atlaskit__range/package.json +++ b/community/@atlaskit__range/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__range" diff --git a/community/@atlaskit__section-message/package.json b/community/@atlaskit__section-message/package.json index c31e9ee22..6bcbaf904 100644 --- a/community/@atlaskit__section-message/package.json +++ b/community/@atlaskit__section-message/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__section-message" diff --git a/community/@atlaskit__side-navigation/package.json b/community/@atlaskit__side-navigation/package.json index fd4a3d493..ca0255056 100644 --- a/community/@atlaskit__side-navigation/package.json +++ b/community/@atlaskit__side-navigation/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__side-navigation" diff --git a/community/@atlaskit__spinner/package.json b/community/@atlaskit__spinner/package.json index bfdb7acc2..796266de5 100644 --- a/community/@atlaskit__spinner/package.json +++ b/community/@atlaskit__spinner/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__spinner" diff --git a/community/@atlaskit__tag/package.json b/community/@atlaskit__tag/package.json index a4b7d452e..41784e1c4 100644 --- a/community/@atlaskit__tag/package.json +++ b/community/@atlaskit__tag/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__tag" diff --git a/community/@atlaskit__textarea/package.json b/community/@atlaskit__textarea/package.json index 9cfd984ac..c8c1714ee 100644 --- a/community/@atlaskit__textarea/package.json +++ b/community/@atlaskit__textarea/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__textarea" diff --git a/community/@atlaskit__textfield/package.json b/community/@atlaskit__textfield/package.json index 8bc09b79f..94c6283ba 100644 --- a/community/@atlaskit__textfield/package.json +++ b/community/@atlaskit__textfield/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__textfield" diff --git a/community/@atlaskit__toggle/package.json b/community/@atlaskit__toggle/package.json index 9ede9c192..05e4cec60 100644 --- a/community/@atlaskit__toggle/package.json +++ b/community/@atlaskit__toggle/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__toggle" diff --git a/community/@emotion__monorepo/package.json b/community/@emotion__monorepo/package.json index f4b482311..cb34ece52 100644 --- a/community/@emotion__monorepo/package.json +++ b/community/@emotion__monorepo/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@emotion__monorepo" diff --git a/community/hypermod/package.json b/community/hypermod/package.json index 8ed857d92..8d825aa70 100644 --- a/community/hypermod/package.json +++ b/community/hypermod/package.json @@ -21,7 +21,7 @@ "jest": "^29.0.0", "parcel": "^2.8.3", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/hypermod" diff --git a/community/javascript/package.json b/community/javascript/package.json index 2f2bed59f..ba14e5964 100644 --- a/community/javascript/package.json +++ b/community/javascript/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/javascript" diff --git a/community/memoize-one/package.json b/community/memoize-one/package.json index 69baf9542..5eb48acf4 100644 --- a/community/memoize-one/package.json +++ b/community/memoize-one/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/memoize-one" diff --git a/community/react/package.json b/community/react/package.json index 24b4ac24f..923814a46 100644 --- a/community/react/package.json +++ b/community/react/package.json @@ -20,7 +20,7 @@ "@types/node": "^16.11.0", "jest": "^29.0.0", "prettier": "^2.0.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", "typescript": "^5.2.2" }, "repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/react" diff --git a/jest.config.js b/jest.config.js index 239ff437c..92fd8ac0f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,9 +1,20 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { transform: { - '^.+\\.ts$': [ + '\\.[jt]sx?$': [ 'ts-jest', { - tsconfig: 'tsconfig.json', + diagnostics: { ignoreCodes: [1343] }, + astTransformers: { + before: [ + { + path: 'node_modules/ts-jest-mock-import-meta', // or, alternatively, 'ts-jest-mock-import-meta' directly, without node_modules. + options: { + metaObjectReplacement: { url: 'https://www.url.com' }, + }, + }, + ], + }, }, ], }, @@ -15,6 +26,7 @@ module.exports = { 'jest-watch-typeahead/testname', ], moduleNameMapper: { + '(.+)\\.js$': '$1', '@hypermod/(.*)$': '/packages/$1/src', '@codeshift/(.*)$': '/packages/$1/src', }, diff --git a/package.json b/package.json index 8f2e12aea..c54fe1fc3 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,8 @@ "rimraf": "^2.6.3", "semver": "^7.3.5", "tar": "^6.1.0", - "ts-jest": "^29.0.0", + "ts-jest": "^29.2.5", + "ts-jest-mock-import-meta": "^1.2.0", "ts-loader": "^6.2.1", "ts-node": "^10.9.1", "tslib": "^2.2.0", diff --git a/packages/cli-alias/bin/codeshift-cli.js b/packages/cli-alias/bin/codeshift-cli.js index af523d395..9ff5293bd 100755 --- a/packages/cli-alias/bin/codeshift-cli.js +++ b/packages/cli-alias/bin/codeshift-cli.js @@ -1,4 +1,2 @@ #!/usr/bin/env node -const path = require('path'); - -require(path.join('..', 'dist', 'index.js')); +export * from '../dist/index.js'; diff --git a/packages/cli-alias/package.json b/packages/cli-alias/package.json index 004afdba8..44f61e351 100644 --- a/packages/cli-alias/package.json +++ b/packages/cli-alias/package.json @@ -1,6 +1,7 @@ { "name": "@codeshift/cli", "version": "0.22.0", + "type": "module", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/cli/bin/hypermod-cli.js b/packages/cli/bin/hypermod-cli.js index af523d395..9ff5293bd 100755 --- a/packages/cli/bin/hypermod-cli.js +++ b/packages/cli/bin/hypermod-cli.js @@ -1,4 +1,2 @@ #!/usr/bin/env node -const path = require('path'); - -require(path.join('..', 'dist', 'index.js')); +export * from '../dist/index.js'; diff --git a/packages/cli/package.json b/packages/cli/package.json index 1dbd9be98..40e44a45e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,7 @@ { "name": "@hypermod/cli", "version": "0.22.0", + "type": "module", "source": "src/index.ts", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 869a3ad87..ed1c513b0 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -3,14 +3,18 @@ import { readFileSync } from 'fs'; import chalk from 'chalk'; import { Command, Option, CommanderError } from 'commander'; -import main from './main'; -import list from './list'; -import init from './init'; -import validate from './validate'; -import { InvalidUserInputError, InvalidConfigError } from './errors'; +import main from './main.js'; +import list from './list.js'; +import init from './init.js'; +import validate from './validate.js'; +import { InvalidUserInputError, InvalidConfigError } from './errors.js'; const packageJson = readFileSync( - path.join(__dirname, '..', 'package.json'), + path.join( + path.dirname(new URL(import.meta.url).pathname), + '..', + 'package.json', + ), 'utf-8', ); diff --git a/packages/cli/src/list.ts b/packages/cli/src/list.ts index 2b677dd8c..aab66bafa 100644 --- a/packages/cli/src/list.ts +++ b/packages/cli/src/list.ts @@ -1,8 +1,8 @@ import chalk from 'chalk'; import { PluginManager } from 'live-plugin-manager'; -import { fetchPackages } from './utils/fetch-package'; -import { getHypermodPackageName } from './utils/package-names'; +import { fetchPackages } from './utils/fetch-package.js'; +import { getHypermodPackageName } from './utils/package-names.js'; export default async function list(packages: string[]) { const packageManager = new PluginManager(); diff --git a/packages/cli/src/main.ts b/packages/cli/src/main.ts index 1f7efc04d..a263d1796 100644 --- a/packages/cli/src/main.ts +++ b/packages/cli/src/main.ts @@ -10,11 +10,14 @@ import { installPackage } from '@antfu/install-pkg'; import * as core from '@hypermod/core'; import { fetchConfigAtPath } from '@hypermod/fetcher'; -import { InvalidUserInputError } from './errors'; -import { fetchPackages } from './utils/fetch-package'; -import { mergeConfigs } from './utils/merge-configs'; -import { fetchConfigsForWorkspaces, getPackageJson } from './utils/file-system'; -import { getConfigPrompt, getMultiConfigPrompt } from './prompt'; +import { InvalidUserInputError } from './errors.js'; +import { fetchPackages } from './utils/fetch-package.js'; +import { mergeConfigs } from './utils/merge-configs.js'; +import { + fetchConfigsForWorkspaces, + getPackageJson, +} from './utils/file-system.js'; +import { getConfigPrompt, getMultiConfigPrompt } from './prompt.js'; const ExperimentalModuleLoader = () => { const getInfo = (packageName: string) => { @@ -34,6 +37,7 @@ const ExperimentalModuleLoader = () => { }; const install = async (packageName: string) => { + const __dirname = path.dirname(new URL(import.meta.url).pathname); await installPackage(packageName, { cwd: __dirname, packageManager: 'npm', @@ -76,7 +80,11 @@ export default async function main( } const pluginManagerConfig: Partial = { - pluginsPath: path.join(__dirname, '..', 'node_modules'), + pluginsPath: path.join( + path.dirname(new URL(import.meta.url).pathname), + '..', + 'node_modules', + ), }; // If a registry is provided in the CLI flags, use it for the pluginManagers configuration. @@ -156,21 +164,33 @@ export default async function main( */ const configFilePath = await findUp([ 'hypermod.config.js', + 'hypermod.config.cjs', + 'hypermod.config.mjs', 'hypermod.config.ts', 'hypermod.config.tsx', 'src/hypermod.config.js', + 'src/hypermod.config.cjs', + 'src/hypermod.config.mjs', 'src/hypermod.config.ts', 'src/hypermod.config.tsx', 'codemods/hypermod.config.js', + 'codemods/hypermod.config.cjs', + 'codemods/hypermod.config.mjs', 'codemods/hypermod.config.ts', 'codemods/hypermod.config.tsx', 'codeshift.config.js', + 'codeshift.config.cjs', + 'codeshift.config.mjs', 'codeshift.config.ts', 'codeshift.config.tsx', 'src/codeshift.config.js', + 'src/codeshift.config.cjs', + 'src/codeshift.config.mjs', 'src/codeshift.config.ts', 'src/codeshift.config.tsx', 'codemods/codeshift.config.js', + 'codemods/codeshift.config.cjs', + 'codemods/codeshift.config.mjs', 'codemods/codeshift.config.ts', 'codemods/codeshift.config.tsx', ]); diff --git a/packages/cli/src/utils/fetch-package.ts b/packages/cli/src/utils/fetch-package.ts index 83ffd2ef4..abbd426f5 100644 --- a/packages/cli/src/utils/fetch-package.ts +++ b/packages/cli/src/utils/fetch-package.ts @@ -9,7 +9,7 @@ import { } from '@hypermod/fetcher'; import { isValidConfig } from '@hypermod/validator'; -import { getHypermodPackageName } from './package-names'; +import { getHypermodPackageName } from './package-names.js'; export async function fetchPackages( packageName: string, diff --git a/packages/fetcher/src/index.spec.ts b/packages/fetcher/src/index.spec.ts index 9fd72464b..eaaf38e8f 100644 --- a/packages/fetcher/src/index.spec.ts +++ b/packages/fetcher/src/index.spec.ts @@ -19,7 +19,7 @@ describe('fetcher', () => { let mockMatchedPaths: string[] = []; beforeEach(() => { - mockMatchedPaths = [path.join(mockBasePath, 'hypermod.config.js')]; + mockMatchedPaths = [path.join(mockBasePath, 'hypermod.config.ts')]; (globby as unknown as jest.Mock).mockImplementation(() => Promise.resolve(mockMatchedPaths), @@ -34,10 +34,10 @@ describe('fetcher', () => { describe('fetchConfig', () => { it('fetches config with default export', async () => { - const mockFilePath = `${__dirname}/path/to/hypermod.config.js`; + const mockFilePath = `${__dirname}/path/to/hypermod.config.ts`; jest.mock( - `${__dirname}/path/to/hypermod.config.js`, + `${__dirname}/path/to/hypermod.config.ts`, () => ({ __esModule: true, default: mockConfig }), { virtual: true }, ); @@ -50,7 +50,7 @@ describe('fetcher', () => { it('fetches config with named export', async () => { jest.mock( - path.join(mockBasePath, 'hypermod.config.js'), + path.join(mockBasePath, 'hypermod.config.ts'), () => mockConfig, { virtual: true, @@ -61,7 +61,7 @@ describe('fetcher', () => { expect(configMeta!.config).toEqual(mockConfig); expect(configMeta!.filePath).toEqual( - path.join(mockBasePath, 'hypermod.config.js'), + path.join(mockBasePath, 'hypermod.config.ts'), ); }); @@ -102,7 +102,7 @@ describe('fetcher', () => { describe('fetchPackage', () => { it('correctly fetches package and returns a config', async () => { - const mockFilePath = 'path/to/config.hypermod.js'; + const mockFilePath = 'path/to/config.hypermod.ts'; const mockPackageManager = { install: jest.fn(), getInfo: jest.fn().mockReturnValue({ location: mockFilePath }), @@ -155,7 +155,7 @@ describe('fetcher', () => { expect(configMeta!.config).toEqual(mockConfig); expect(configMeta!.filePath).toEqual( - mockBasePath + '/hypermod.config.js', + mockBasePath + '/hypermod.config.ts', ); }); diff --git a/scripts/sync.ts b/scripts/sync.ts index c333e7250..4a84480b7 100644 --- a/scripts/sync.ts +++ b/scripts/sync.ts @@ -21,9 +21,9 @@ async function main() { const directories = communityCodemods.filter(dir => junk.not(dir)); for (const dir of directories) { - const { config } = await fetchConfig(path.join(COMMUNITY_PATH, dir)); + const configMeta = await fetchConfig(path.join(COMMUNITY_PATH, dir)); - if (!config) { + if (!configMeta?.config) { throw new Error(`Unable to locate config for path: ${dir}`); } @@ -31,7 +31,9 @@ async function main() { const rawPkgName = dir.replace('__', '/'); data.push({ pkgName, - targets: rawPkgName + (config.targets ? `, ${config.targets}` : ''), + targets: + rawPkgName + + (configMeta.config.targets ? `, ${configMeta.config.targets}` : ''), }); } diff --git a/tsconfig.json b/tsconfig.json index f31e7316d..8d593c628 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,9 @@ "compilerOptions": { "strict": true, "skipLibCheck": true, - "moduleResolution": "node", "target": "es6", - "module": "CommonJS", + "module": "nodenext", + "moduleResolution": "nodenext", "resolveJsonModule": true, "esModuleInterop": true, "lib": [ diff --git a/yarn.lock b/yarn.lock index a9af191b0..bde1586c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3140,6 +3140,11 @@ astral-regex@^2.0.0: resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +async@^3.2.3: + version "3.2.6" + resolved "https://packages.atlassian.com/api/npm/npm-remote/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" + integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" @@ -3331,6 +3336,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://packages.atlassian.com/api/npm/npm-remote/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^2.3.1: version "2.3.2" resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz" @@ -3371,9 +3383,9 @@ browserslist@^4.22.2, browserslist@^4.6.6: node-releases "^2.0.14" update-browserslist-db "^1.0.13" -bs-logger@0.x: +bs-logger@^0.2.6: version "0.2.6" - resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" + resolved "https://packages.atlassian.com/api/npm/npm-remote/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== dependencies: fast-json-stable-stringify "2.x" @@ -3478,7 +3490,7 @@ chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3742,7 +3754,7 @@ cross-spawn@^5.1.0: cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" + resolved "https://packages.atlassian.com/api/npm/npm-remote/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: path-key "^3.1.0" @@ -4010,6 +4022,13 @@ duplexer3@^0.1.4: resolved "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.5.tgz" integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== +ejs@^3.1.10: + version "3.1.10" + resolved "https://packages.atlassian.com/api/npm/npm-remote/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" + integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== + dependencies: + jake "^10.8.5" + electron-to-chromium@^1.4.601: version "1.4.614" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz" @@ -4445,6 +4464,13 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" +filelist@^1.0.4: + version "1.0.4" + resolved "https://packages.atlassian.com/api/npm/npm-remote/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" + integrity sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q== + dependencies: + minimatch "^5.0.1" + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz" @@ -5349,6 +5375,16 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jake@^10.8.5: + version "10.9.2" + resolved "https://packages.atlassian.com/api/npm/npm-remote/jake/-/jake-10.9.2.tgz#6ae487e6a69afec3a5e167628996b59f35ae2b7f" + integrity sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA== + dependencies: + async "^3.2.3" + chalk "^4.0.2" + filelist "^1.0.4" + minimatch "^3.1.2" + jest-changed-files@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz" @@ -6131,9 +6167,9 @@ lodash.debounce@^4.0.8: resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.memoize@4.x: +lodash.memoize@^4.1.2: version "4.1.2" - resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" + resolved "https://packages.atlassian.com/api/npm/npm-remote/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== lodash.merge@^4.6.2: @@ -6218,9 +6254,9 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@1.x, make-error@^1.1.1: +make-error@^1.1.1, make-error@^1.3.6: version "1.3.6" - resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" + resolved "https://packages.atlassian.com/api/npm/npm-remote/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== makeerror@1.0.12: @@ -6346,13 +6382,20 @@ min-indent@^1.0.0: resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://packages.atlassian.com/api/npm/npm-remote/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + minimist-options@^4.0.2: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" @@ -7367,6 +7410,11 @@ semver@^7.2.1, semver@^7.3.5, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3, semve dependencies: lru-cache "^6.0.0" +semver@^7.6.3: + version "7.6.3" + resolved "https://packages.atlassian.com/api/npm/npm-remote/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" @@ -7933,19 +7981,25 @@ trim-newlines@^3.0.0: resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== -ts-jest@^29.0.0: - version "29.1.1" - resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz" - integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== +ts-jest-mock-import-meta@^1.2.0: + version "1.2.0" + resolved "https://packages.atlassian.com/api/npm/npm-remote/ts-jest-mock-import-meta/-/ts-jest-mock-import-meta-1.2.0.tgz#6fb12a1fa47f70f9335a288e888cbacf592c4dc1" + integrity sha512-r2+TH6d8LHBXqLTXjJh1KfTZoMvGV0hdn9gwickNVcwS2Co2/mewGjj0XDVEPLg5MVfZVHUFQ9O09anURA3KCw== + +ts-jest@^29.2.5: + version "29.2.5" + resolved "https://packages.atlassian.com/api/npm/npm-remote/ts-jest/-/ts-jest-29.2.5.tgz#591a3c108e1f5ebd013d3152142cb5472b399d63" + integrity sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA== dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" + bs-logger "^0.2.6" + ejs "^3.1.10" + fast-json-stable-stringify "^2.1.0" jest-util "^29.0.0" json5 "^2.2.3" - lodash.memoize "4.x" - make-error "1.x" - semver "^7.5.3" - yargs-parser "^21.0.1" + lodash.memoize "^4.1.2" + make-error "^1.3.6" + semver "^7.6.3" + yargs-parser "^21.1.1" ts-loader@^6.2.1: version "6.2.2" @@ -8389,7 +8443,7 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^21.0.1, yargs-parser@^21.1.1: +yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==