Skip to content

Commit e69f221

Browse files
author
Daniel Del Core
committed
Revert "initial esm cli migration"
This reverts commit fa45fcb.
1 parent 6e1d67b commit e69f221

File tree

36 files changed

+117
-85
lines changed

36 files changed

+117
-85
lines changed

.changeset/brown-camels-think.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@codeshift/cli': patch
3+
'@hypermod/cli': patch
4+
---
5+
6+
Reverts ESM support.

community/@atlaskit__avatar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__avatar"

community/@atlaskit__breadcrumbs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__breadcrumbs"

community/@atlaskit__button/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__button"

community/@atlaskit__calendar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__calendar"

community/@atlaskit__checkbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__checkbox"

community/@atlaskit__icon/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__icon"

community/@atlaskit__menu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__menu"

community/@atlaskit__popper/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__popper"

community/@atlaskit__popup/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__popup"

community/@atlaskit__progress-indicator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__progress-indicator"

community/@atlaskit__range/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__range"

community/@atlaskit__section-message/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__section-message"

community/@atlaskit__side-navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__side-navigation"

community/@atlaskit__spinner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__spinner"

community/@atlaskit__tag/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__tag"

community/@atlaskit__textarea/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__textarea"

community/@atlaskit__textfield/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__textfield"

community/@atlaskit__toggle/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@atlaskit__toggle"

community/@emotion__monorepo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/@emotion__monorepo"

community/hypermod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"jest": "^29.0.0",
2222
"parcel": "^2.8.3",
2323
"prettier": "^2.0.0",
24-
"ts-jest": "^29.0.0",
24+
"ts-jest": "^29.2.5",
2525
"typescript": "^5.2.2"
2626
},
2727
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/hypermod"

community/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/javascript"

community/memoize-one/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/memoize-one"

community/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "^16.11.0",
2121
"jest": "^29.0.0",
2222
"prettier": "^2.0.0",
23-
"ts-jest": "^29.0.0",
23+
"ts-jest": "^29.2.5",
2424
"typescript": "^5.2.2"
2525
},
2626
"repository": "https://github.com/hypermod-io/hypermod-community/tree/main/community/react"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"rimraf": "^2.6.3",
6969
"semver": "^7.3.5",
7070
"tar": "^6.1.0",
71-
"ts-jest": "^29.0.0",
71+
"ts-jest": "^29.2.5",
7272
"ts-loader": "^6.2.1",
7373
"ts-node": "^10.9.1",
7474
"tslib": "^2.2.0",

packages/cli-alias/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@codeshift/cli",
33
"version": "0.23.0",
4-
"type": "module",
54
"source": "src/index.ts",
65
"main": "dist/index.js",
76
"types": "dist/index.d.ts",

packages/cli-alias/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from '@hypermod/cli';
1+
import '@hypermod/cli';

packages/cli-alias/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "dist",
6-
"baseUrl": ".",
7-
"module": "NodeNext",
8-
"moduleResolution": "NodeNext"
6+
"baseUrl": "."
97
},
108
"include": ["src"],
119
"references": [

packages/cli/bin/hypermod-cli.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
#!/usr/bin/env node
2-
export * from '../dist/index.js';
2+
const path = require('path');
3+
4+
require(path.join('..', 'dist', 'index.js'));

packages/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "@hypermod/cli",
33
"version": "0.23.0",
4-
"type": "module",
54
"source": "src/index.ts",
65
"main": "dist/index.js",
76
"types": "dist/index.d.ts",

packages/cli/src/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import { readFileSync } from 'fs';
33
import chalk from 'chalk';
44
import { Command, Option, CommanderError } from 'commander';
55

6-
import main from './main.js';
7-
import list from './list.js';
8-
import init from './init.js';
9-
import validate from './validate.js';
10-
import { InvalidUserInputError, InvalidConfigError } from './errors.js';
11-
12-
const __dirname = path.dirname(new URL(import.meta.url).pathname);
6+
import main from './main';
7+
import list from './list';
8+
import init from './init';
9+
import validate from './validate';
10+
import { InvalidUserInputError, InvalidConfigError } from './errors';
1311

1412
const packageJson = readFileSync(
1513
path.join(__dirname, '..', 'package.json'),

packages/cli/src/list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import chalk from 'chalk';
22
import { PluginManager } from 'live-plugin-manager';
33

4-
import { fetchPackages } from './utils/fetch-package.js';
5-
import { getHypermodPackageName } from './utils/package-names.js';
4+
import { fetchPackages } from './utils/fetch-package';
5+
import { getHypermodPackageName } from './utils/package-names';
66

77
export default async function list(packages: string[]) {
88
const packageManager = new PluginManager();

packages/cli/src/main.ts

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@ import { installPackage } from '@antfu/install-pkg';
1010
import * as core from '@hypermod/core';
1111
import { fetchConfigAtPath } from '@hypermod/fetcher';
1212

13-
import { InvalidUserInputError } from './errors.js';
14-
import { fetchPackages } from './utils/fetch-package.js';
15-
import { mergeConfigs } from './utils/merge-configs.js';
16-
import {
17-
fetchConfigsForWorkspaces,
18-
getPackageJson,
19-
} from './utils/file-system.js';
20-
import { getConfigPrompt, getMultiConfigPrompt } from './prompt.js';
21-
22-
const __dirname = path.dirname(new URL(import.meta.url).pathname);
13+
import { InvalidUserInputError } from './errors';
14+
import { fetchPackages } from './utils/fetch-package';
15+
import { mergeConfigs } from './utils/merge-configs';
16+
import { fetchConfigsForWorkspaces, getPackageJson } from './utils/file-system';
17+
import { getConfigPrompt, getMultiConfigPrompt } from './prompt';
2318

2419
const ExperimentalModuleLoader = () => {
2520
const getInfo = (packageName: string) => {
@@ -161,33 +156,21 @@ export default async function main(
161156
*/
162157
const configFilePath = await findUp([
163158
'hypermod.config.js',
164-
'hypermod.config.cjs',
165-
'hypermod.config.mjs',
166159
'hypermod.config.ts',
167160
'hypermod.config.tsx',
168161
'src/hypermod.config.js',
169-
'src/hypermod.config.cjs',
170-
'src/hypermod.config.mjs',
171162
'src/hypermod.config.ts',
172163
'src/hypermod.config.tsx',
173164
'codemods/hypermod.config.js',
174-
'codemods/hypermod.config.cjs',
175-
'codemods/hypermod.config.mjs',
176165
'codemods/hypermod.config.ts',
177166
'codemods/hypermod.config.tsx',
178167
'codeshift.config.js',
179-
'codeshift.config.cjs',
180-
'codeshift.config.mjs',
181168
'codeshift.config.ts',
182169
'codeshift.config.tsx',
183170
'src/codeshift.config.js',
184-
'src/codeshift.config.cjs',
185-
'src/codeshift.config.mjs',
186171
'src/codeshift.config.ts',
187172
'src/codeshift.config.tsx',
188173
'codemods/codeshift.config.js',
189-
'codemods/codeshift.config.cjs',
190-
'codemods/codeshift.config.mjs',
191174
'codemods/codeshift.config.ts',
192175
'codemods/codeshift.config.tsx',
193176
]);

packages/cli/src/utils/fetch-package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
} from '@hypermod/fetcher';
1010
import { isValidConfig } from '@hypermod/validator';
1111

12-
import { getHypermodPackageName } from './package-names.js';
12+
import { getHypermodPackageName } from './package-names';
1313

1414
export async function fetchPackages(
1515
packageName: string,

packages/cli/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "dist",
6-
"baseUrl": ".",
7-
"module": "NodeNext",
8-
"moduleResolution": "NodeNext"
6+
"baseUrl": "."
97
},
108
"include": ["src"],
119
"references": [

0 commit comments

Comments
 (0)