@putout/plugin-nodejs 16.4.0 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,10 +38,6 @@ const isPackage = ({value}) => /package(\.json)?$/.test(value);
38
38
 
39
39
  export const match = () => ({
40
40
  'const __a = require(__b)': ({__b}, path) => {
41
- // exclude jsons while not supported
42
- if (/\.json/.test(__b.value))
43
- return false;
44
-
45
41
  if (path.scope.getBinding('require'))
46
42
  return false;
47
43
 
@@ -91,12 +87,8 @@ export const replace = () => ({
91
87
  return applyDynamicImport(path);
92
88
  }
93
89
 
94
- // disabled while not supported
95
- // https://babeljs.io/blog/2023/05/26/7.22.0#import-attributes-15536-15620
96
- //
97
- // const isJSON = /\.json$/.test(value);
98
- // const assertion = !isJSON ? '' : 'with { type: "json" }';
99
- const assertion = '';
90
+ const isJSON = /\.json$/.test(value);
91
+ const assertion = !isJSON ? '' : 'with { type: "json" }';
100
92
 
101
93
  if (isObjectPattern(__a)) {
102
94
  const imports = [];
@@ -1,14 +1,37 @@
1
1
  export default {
2
- callbackify: `import {callbackify} from 'util'`,
3
- formatWithOptions: `import {formatWithOptions} from 'util'`,
4
- getSystemErrorMap: `import {getSystemErrorMap} from 'util'`,
5
- getSystemErrorName: `import {getSystemErrorName} from 'util'`,
6
- inherits: `import {inherits} from 'util'`,
7
- inspect: `import {inspect} from 'util'`,
8
- isDeepStrictEqual: `import {isDeepStrictEqual} from 'util'`,
9
- promisify: `import {promisify} from 'util'`,
10
- stripVTControlCharacters: `import {stripVTControlCharacters} from 'util'`,
11
- toUSVString: `import {toUSVString} from 'util'`,
12
- TextDecoder: `import {TextDecoder} from 'util'`,
13
- TextEncoder: `import {TextEncoder} from 'util'`,
2
+ MIMEParams: `import {MIMEParams} from 'node:util'`,
3
+ MIMEType: `import {MIMEType} from 'node:util'`,
4
+ TextDecoder: `import {TextDecoder} from 'node:util'`,
5
+ TextEncoder: `import {TextEncoder} from 'node:util'`,
6
+ _errnoException: `import {_errnoException} from 'node:util'`,
7
+ _exceptionWithHostPort: `import {_exceptionWithHostPort} from 'node:util'`,
8
+ _extend: `import {_extend} from 'node:util'`,
9
+ aborted: `import {aborted} from 'node:util'`,
10
+ callbackify: `import {callbackify} from 'node:util'`,
11
+ debug: `import {debug} from 'node:util'`,
12
+ debuglog: `import {debuglog} from 'node:util'`,
13
+ default: `import {default} from 'node:util'`,
14
+ deprecate: `import {deprecate} from 'node:util'`,
15
+ diff: `import {diff} from 'node:util'`,
16
+ format: `import {format} from 'node:util'`,
17
+ formatWithOptions: `import {formatWithOptions} from 'node:util'`,
18
+ getCallSite: `import {getCallSite} from 'node:util'`,
19
+ getCallSites: `import {getCallSites} from 'node:util'`,
20
+ getSystemErrorMap: `import {getSystemErrorMap} from 'node:util'`,
21
+ getSystemErrorMessage: `import {getSystemErrorMessage} from 'node:util'`,
22
+ getSystemErrorName: `import {getSystemErrorName} from 'node:util'`,
23
+ inherits: `import {inherits} from 'node:util'`,
24
+ inspect: `import {inspect} from 'node:util'`,
25
+ isArray: `import {isArray} from 'node:util'`,
26
+ isDeepStrictEqual: `import {isDeepStrictEqual} from 'node:util'`,
27
+ parseArgs: `import {parseArgs} from 'node:util'`,
28
+ parseEnv: `import {parseEnv} from 'node:util'`,
29
+ promisify: `import {promisify} from 'node:util'`,
30
+ setTraceSigInt: `import {setTraceSigInt} from 'node:util'`,
31
+ stripVTControlCharacters: `import {stripVTControlCharacters} from 'node:util'`,
32
+ styleText: `import {styleText} from 'node:util'`,
33
+ toUSVString: `import {toUSVString} from 'node:util'`,
34
+ transferableAbortController: `import {transferableAbortController} from 'node:util'`,
35
+ transferableAbortSignal: `import {transferableAbortSignal} from 'node:util'`,
36
+ types: `import {types} from 'node:util'`,
14
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-nodejs",
3
- "version": "16.4.0",
3
+ "version": "17.1.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to transform code to new API of Node.js",
@@ -45,11 +45,11 @@
45
45
  "@putout/plugin-putout": "*",
46
46
  "@putout/plugin-reuse-duplicate-init": "*",
47
47
  "@putout/plugin-typescript": "*",
48
- "@putout/test": "^13.0.0",
48
+ "@putout/test": "^14.0.0",
49
49
  "c8": "^10.0.0",
50
50
  "eslint": "^9.0.0",
51
51
  "eslint-plugin-n": "^17.0.0",
52
- "eslint-plugin-putout": "^27.0.0",
52
+ "eslint-plugin-putout": "^28.0.0",
53
53
  "madrun": "^11.0.0",
54
54
  "montag": "^1.2.1",
55
55
  "nodemon": "^3.0.1"