Skip to content

Commit b22db02

Browse files
chore: remove @next and clean (#176)
1 parent 74e61e5 commit b22db02

File tree

20 files changed

+40
-51
lines changed

20 files changed

+40
-51
lines changed

.github/workflows/codemod_publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ jobs:
106106
- name: Authenticate with Codemod registry
107107
env:
108108
CODEMOD_TOKEN: ${{ secrets.CODEMOD_TOKEN }}
109-
run: npx codemod@next login --api-key "$CODEMOD_TOKEN"
109+
run: npx codemod login --api-key "$CODEMOD_TOKEN"
110110

111111
- name: Publish codemod
112112
working-directory: ${{ steps.parse-tag.outputs.codemod-path }}
113-
run: npx codemod@next publish
113+
run: npx codemod publish
114114

115115
- name: Create release summary
116116
env:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ registry:
8989
- [Codemod CLI Reference](https://docs.codemod.com/cli/cli-reference)
9090
- [Codemod Workflow Documentation](https://docs.codemod.com/cli/workflows)
9191
- [Codemod Studio Documentation](https://docs.codemod.com/codemod-studio)
92-
- [JSSG API Reference](https://docs.codemod.com/cli/cli-reference#cli-command-reference)
92+
- [JS ast-grep (jssg) API reference](https://docs.codemod.com/cli/cli-reference#cli-command-reference)
9393
- [ast-grep Documentation](https://ast-grep.github.io/)
9494
9595
## Development Workflow

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ This repository contains codemods (automated migrations) for "userland" code. Th
1313
To run the transform scripts use [`codemod`](https://go.codemod.com/github) command below:
1414

1515
```console
16-
$ npx codemod <transform> --target <path> [...options]
16+
npx codemod @nodejs/<recipe>
1717
```
1818

19-
* `transform` - name of transform. see available transforms below.
20-
* `path` - directory to transform. defaults to the current directory.
21-
2219
See the [codemod CLI doc](https://go.codemod.com/cli-docs) for a full list of available commands.
2320

2421
## Available codemods
2522

26-
You can find official Node.js codemods in the [Codemod Registry](https://codemod.com/registry?author=nodejs). Additionally, community-contributed Node.js codemods are available in the [Codemod Registry](https://codemod.link/nodejs-official).
23+
You can find official Node.js codemods in the [Codemod Registry](https://codemod.link/nodejs-official).
2724

2825
## Acknowledgments
2926

package-lock.json

Lines changed: 17 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

recipes/create-require-from-path/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Handle DEP0130 via transforming `createRequireFromPath` to `createRequire`.",
55
"type": "module",
66
"scripts": {
7-
"test": "npx codemod@next jssg test -l typescript ./src/workflow.ts ./"
7+
"test": "npx codemod jssg test -l typescript ./src/workflow.ts ./"
88
},
99
"repository": {
1010
"type": "git",
@@ -16,10 +16,9 @@
1616
"license": "MIT",
1717
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/create-require-from-path/README.md",
1818
"devDependencies": {
19-
"@types/node": "^24.2.1",
2019
"@codemod.com/jssg-types": "^1.0.3"
2120
},
2221
"dependencies": {
23-
"@nodejs/codemod-utils": "0.0.0"
22+
"@nodejs/codemod-utils": "*"
2423
}
2524
}

recipes/create-require-from-path/src/workflow.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function transform(root: SgRoot): string | null {
2626
let hasChanges = false;
2727

2828
// Step 1: Find and update destructuring assignments from require('module') or require('node:module')
29-
// @ts-ignore - ast-grep types are not fully compatible with JSSG types
3029
const requireStatements = getNodeRequireCalls(root, "module");
3130

3231
for (const statement of requireStatements) {
@@ -48,7 +47,6 @@ export default function transform(root: SgRoot): string | null {
4847
}
4948
}
5049

51-
// @ts-ignore - ast-grep types are not fully compatible with JSSG types
5250
const importStatements = getNodeImportStatements(root, "module");
5351

5452
for (const statement of importStatements) {

recipes/import-assertions-to-attributes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import data from './data.json' with { type: 'json' };
1515
Run this codemod with:
1616

1717
```sh
18-
npx codemod@next nodejs/import-assertions-to-attributes
18+
npx codemod nodejs/import-assertions-to-attributes
1919
```
2020

2121
## When is it useful?

recipes/import-assertions-to-attributes/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Replace `assert` import attribute to the `with` ECMAScript import attribute.",
55
"type": "module",
66
"scripts": {
7-
"test": "npx codemod@next jssg test -l typescript ./src/workflow.ts ./"
7+
"test": "npx codemod jssg test -l typescript ./src/workflow.ts ./"
88
},
99
"repository": {
1010
"type": "git",
@@ -16,7 +16,6 @@
1616
"license": "MIT",
1717
"homepage": "https://github.com/nodejs/userland-migrations/tree/main/import-assertions-to-attributes#readme",
1818
"devDependencies": {
19-
"@types/node": "^24.2.1",
2019
"@codemod.com/jssg-types": "^1.0.3"
2120
}
2221
}

recipes/process-main-module/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Handle DEP0138 via transforming `process.mainModule` to `require.main`.",
55
"type": "module",
66
"scripts": {
7-
"test": "npx codemod@next jssg test -l typescript ./src/workflow.ts ./"
7+
"test": "npx codemod jssg test -l typescript ./src/workflow.ts ./"
88
},
99
"repository": {
1010
"type": "git",
@@ -16,10 +16,9 @@
1616
"license": "MIT",
1717
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/process-main-module/README.md",
1818
"devDependencies": {
19-
"@types/node": "^24.2.1",
2019
"@codemod.com/jssg-types": "^1.0.3"
2120
},
2221
"dependencies": {
23-
"@nodejs/codemod-utils": "0.0.0"
22+
"@nodejs/codemod-utils": "*"
2423
}
2524
}

recipes/process-main-module/src/workflow.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export default function transform(root: SgRoot): string | null {
2929
},
3030
];
3131

32-
// @ts-ignore - ast-grep types are not fully compatible with JSSG types
3332
const requireDeclarations = getNodeRequireCalls(root, "process");
3433

3534
const destructureDeclarations = rootNode.findAll({
@@ -48,7 +47,6 @@ export default function transform(root: SgRoot): string | null {
4847
for (const declarationNode of [...requireDeclarations, ...destructureDeclarations]) {
4948
// Step 1: Get all requires from module nodule:process that is destructuring mainModule:
5049
if (declarationNode.text().includes("mainModule")) {
51-
// @ts-ignore - ast-grep types are not fully compatible with JSSG types
5250
const result = removeBinding(declarationNode, "mainModule");
5351

5452
if (result) {

0 commit comments

Comments
 (0)