putout 34.0.1 → 34.0.2

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.
package/ChangeLog CHANGED
@@ -1,3 +1,11 @@
1
+ 2023.12.11, v34.0.2
2
+
3
+ feature:
4
+ - 8dc1419e7 putout: @putout/plugin-tape v13.0.0
5
+ - 08a6d22ed putout: loader: node v18 support
6
+ - 649f93cab @putout/plugin-tape: drop support of node < 18
7
+ - a9c79f088 @putout/plugin-tape: convert-equal-to-deep-equal: add support of Buffer.from
8
+
1
9
  2023.12.10, v34.0.1
2
10
 
3
11
  feature:
@@ -1,25 +1,23 @@
1
1
  import process from 'node:process';
2
- import {putoutAsync} from './putout.js';
3
- import ignores from './ignores.js';
4
- import parseOptions from './parse-options/index.js';
2
+ import {putoutAsync} from '../putout.js';
3
+ import ignores from '../ignores.js';
4
+ import parseOptions from '../parse-options/index.js';
5
5
 
6
6
  const cwd = process.cwd();
7
7
 
8
- const toLoad = (transformSource) => async (url, context, defaultLoad) => {
9
- const {source: rawSource} = await defaultLoad(url, context);
8
+ const toLoad = (transformSource) => async (url, context, nextLoad) => {
9
+ const {format, source: rawSource} = await nextLoad(url, context);
10
10
 
11
- if (!rawSource)
12
- return {
13
- format: 'commonjs',
14
- };
11
+ if (format !== 'module')
12
+ return nextLoad(url);
15
13
 
16
14
  const {source} = await transformSource(rawSource, {
17
15
  url,
18
16
  });
19
17
 
20
18
  return {
21
- source,
22
19
  format: 'module',
20
+ source,
23
21
  };
24
22
  };
25
23
 
@@ -42,7 +40,7 @@ export const transformSource = async (source, context) => {
42
40
  });
43
41
 
44
42
  return {
45
- source: code,
43
+ source: Buffer.from(code),
46
44
  };
47
45
  };
48
46
 
@@ -0,0 +1,3 @@
1
+ import {register} from 'node:module';
2
+
3
+ register('./loader.mjs', new URL('./loader.mjs', import.meta.url));
package/lib/putout.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  import putout from './putout.js';
2
2
 
3
- export {load} from './loader.mjs';
4
3
  export * from './putout.js';
5
4
  export default function(...a) {
6
5
  return putout(...a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "34.0.1",
3
+ "version": "34.0.2",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
@@ -21,7 +21,8 @@
21
21
  "./package.json": "./package.json",
22
22
  "./lint/json": "./lib/lint/json.mjs",
23
23
  "./transform": "./lib/transform.js",
24
- "./find-places": "./lib/find-places.js"
24
+ "./find-places": "./lib/find-places.js",
25
+ "./register": "./lib/loader/register.mjs"
25
26
  },
26
27
  "bin": {
27
28
  "putout": "bin/putout.mjs"
@@ -162,7 +163,7 @@
162
163
  "@putout/plugin-simplify-ternary": "^6.0.0",
163
164
  "@putout/plugin-split-nested-destructuring": "^3.0.0",
164
165
  "@putout/plugin-split-variable-declarations": "^3.0.0",
165
- "@putout/plugin-tape": "^12.0.0",
166
+ "@putout/plugin-tape": "^13.0.0",
166
167
  "@putout/plugin-try-catch": "^3.0.0",
167
168
  "@putout/plugin-types": "^3.0.0",
168
169
  "@putout/plugin-typescript": "^5.0.0",