putout 41.18.0 → 41.18.1

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,8 @@
1
+ 2026.02.05, v41.18.1
2
+
3
+ feature:
4
+ - d7b6677ac putout: remove loader: do not works as expected
5
+
1
6
  2026.02.05, v41.18.0
2
7
 
3
8
  feature:
@@ -15,15 +15,11 @@ export const createCommunication = () => {
15
15
  const newParentPort = new EventEmitter();
16
16
 
17
17
  assign(newWorker, {
18
- postMessage: (a) => {
19
- newParentPort.emit('message', a);
20
- },
18
+ postMessage: createPostMessage(newParentPort),
21
19
  });
22
20
 
23
21
  assign(newParentPort, {
24
- postMessage: (a) => {
25
- newWorker.emit('message', a);
26
- },
22
+ postMessage: createPostMessage(newWorker),
27
23
  });
28
24
 
29
25
  return {
@@ -32,3 +28,7 @@ export const createCommunication = () => {
32
28
  workerData: process.argv,
33
29
  };
34
30
  };
31
+
32
+ export const createPostMessage = (emitter) => (a) => {
33
+ emitter.emit('message', a);
34
+ };
package/bin/tracer.js CHANGED
@@ -14,10 +14,12 @@ import {dropInteractive} from './drop-interactive.js';
14
14
  const args = parseArgs(process.argv.slice(2));
15
15
  const write = stdout.write.bind(stdout);
16
16
 
17
+ /* c8 ignore start */
17
18
  if (!args.worker) {
18
19
  await import('./putout.js');
19
20
  halt();
20
21
  }
22
+ /* c8 ignore end */
21
23
 
22
24
  const slave = new URL('./putout.js', import.meta.url);
23
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "41.18.0",
3
+ "version": "41.18.1",
4
4
  "type": "module",
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",
@@ -19,7 +19,6 @@
19
19
  "./lint/json": "./lib/lint/json.js",
20
20
  "./transform": "./lib/transform.js",
21
21
  "./find-places": "./lib/find-places.js",
22
- "./register": "./lib/loader/register.js",
23
22
  "./ignores": "./lib/ignores.js",
24
23
  "./simple-import": "./lib/cli/simple-import.js"
25
24
  },
@@ -1,48 +0,0 @@
1
- import process from 'node:process';
2
- import {Buffer} from 'node:buffer';
3
- import {parseOptions} from '#parse-options';
4
- import {putoutAsync} from '../putout.js';
5
- import {ignores} from '../ignores.js';
6
-
7
- const cwd = process.cwd();
8
-
9
- const toLoad = (transformSource) => async (url, context, nextLoad) => {
10
- const {format, source: rawSource} = await nextLoad(url, context);
11
-
12
- if (format !== 'module')
13
- return nextLoad(url);
14
-
15
- const {source} = await transformSource(rawSource, {
16
- url,
17
- });
18
-
19
- return {
20
- format: 'module',
21
- source,
22
- };
23
- };
24
-
25
- export const transformSource = async (source, context) => {
26
- const {url} = context;
27
- const name = url.replace('file://', '');
28
-
29
- const options = parseOptions({
30
- name,
31
- });
32
-
33
- if (ignores(cwd, name, options))
34
- return {
35
- source,
36
- };
37
-
38
- const {code} = await putoutAsync(String(source), {
39
- printer: 'putout',
40
- ...options,
41
- });
42
-
43
- return {
44
- source: Buffer.from(code),
45
- };
46
- };
47
-
48
- export const load = toLoad(transformSource);
@@ -1,3 +0,0 @@
1
- import {register} from 'node:module';
2
-
3
- register('./loader.mjs', new URL('./loader.mjs', import.meta.url));