Skip to content

Commit 4a7a7f7

Browse files
AugustinMauroyavivkellerJakobJingleheimer
authored
Feat(repl builtin modules): introduce (#149)
Co-authored-by: Aviv Keller <me@aviv.sh> Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
1 parent 421984e commit 4a7a7f7

26 files changed

+686
-10
lines changed

package-lock.json

Lines changed: 24 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# `repl.builtinModules` DEP0191
2+
3+
This recipe provides a guide for migrating from the deprecated `repl.builtinModules` & `repl._builtinLibs` to the new `module.builtinModules` property in Node.js.
4+
5+
See [DEP0191](https://nodejs.org/api/deprecations.html#DEP0191) and [DEP0142](https://nodejs.org/api/deprecations.html#DEP0142)
6+
7+
## Examples
8+
9+
**Before:**
10+
```js
11+
import repl from 'node:repl';
12+
13+
console.log(repl.builtinModules);
14+
console.log(repl._builtinLibs);
15+
```
16+
17+
**After:**
18+
```js
19+
import module from 'node:module';
20+
21+
console.log(module.builtinModules);
22+
console.log(module.builtinModules);
23+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
schema_version: "1.0"
2+
name: "@nodejs/repl-builtin-modules"
3+
version: 1.0.0
4+
description: Handle DEP0191 via transforming `repl.builtinModules` usage to `module.builtinModules`.
5+
author: Augustin Mauroy
6+
license: MIT
7+
workflow: workflow.yaml
8+
category: migration
9+
10+
targets:
11+
languages:
12+
- javascript
13+
- typescript
14+
15+
keywords:
16+
- transformation
17+
- migration
18+
- deprecation
19+
20+
registry:
21+
access: public
22+
visibility: public
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@nodejs/repl-builtin-modules",
3+
"version": "1.0.0",
4+
"description": "Handle DEP0191 via transforming `repl.builtinModules` usage to `module.builtinModules`.",
5+
"type": "module",
6+
"scripts": {
7+
"test": "npx codemod@next jssg test -l typescript ./src/workflow.ts ./",
8+
"test:update-snapshots": "npx codemod@next jssg test --update-snapshots -l typescript ./src/workflow.ts ./ "
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/nodejs/userland-migrations.git",
13+
"directory": "recipes/repl-builtin-modules",
14+
"bugs": "https://github.com/nodejs/userland-migrations/issues"
15+
},
16+
"author": "Augustin Mauroy",
17+
"license": "MIT",
18+
"homepage": "https://github.com/nodejs/userland-migrations/blob/main/recipes/repl-builtin-modules/README.md",
19+
"devDependencies": {
20+
"@codemod.com/jssg-types": "^1.0.3"
21+
},
22+
"dependencies": {
23+
"@nodejs/codemod-utils": "*"
24+
}
25+
}

0 commit comments

Comments
 (0)