putout 33.7.0 → 33.8.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,20 @@
1
+ 2023.11.18, v33.8.1
2
+
3
+ feature:
4
+ - 970b3b33b putout: supported-files: fullstore
5
+
6
+ 2023.11.18, v33.8.0
7
+
8
+ fix:
9
+ - d79f6a49e putout: loader: use putoutAsync
10
+
11
+ feature:
12
+ - be92475be putout: enable nodejs filesystem rules
13
+ - a8e501db1 @putout/plugin-nodejs: mjs-file: add
14
+ - f85820fca @putout/plugin-nodejs: cjs-file: add
15
+ - 4e80a6f73 @putout/operator-match-files: add additional check of provided files
16
+ - be49cc530 @putout/operator-match-files: autodetect json/js
17
+
1
18
  2023.11.17, v33.7.0
2
19
 
3
20
  fix:
@@ -2,8 +2,10 @@
2
2
 
3
3
  const {normalize} = require('path');
4
4
  const picomatch = require('picomatch');
5
+ const fullstore = require('fullstore');
6
+
7
+ const isMatchStore = fullstore();
5
8
 
6
- let isMatch = Boolean;
7
9
  let patterns = [];
8
10
 
9
11
  const rmDuplicates = (a) => Array.from(new Set(a));
@@ -11,13 +13,18 @@ const rmDuplicates = (a) => Array.from(new Set(a));
11
13
  module.exports.add = (array) => {
12
14
  patterns = rmDuplicates(patterns.concat(array));
13
15
 
14
- isMatch = picomatch(patterns, {
16
+ const isMatch = picomatch(patterns, {
15
17
  dot: true,
16
18
  matchBase: true,
17
19
  });
20
+
21
+ isMatchStore(isMatch);
18
22
  };
19
23
 
20
- module.exports.isSupported = (name) => isMatch(name);
24
+ module.exports.isSupported = (name) => {
25
+ const isMatch = isMatchStore();
26
+ return isMatch(name);
27
+ };
21
28
 
22
29
  module.exports.getSupportedGlob = (file) => normalize(`${file}/**/{${patterns.join(',')}}`);
23
30
 
package/lib/loader.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import process from 'node:process';
2
- import putout from './putout.js';
2
+ import {putoutAsync} from './putout.js';
3
3
  import ignores from './ignores.js';
4
4
  import parseOptions from './parse-options/index.js';
5
5
 
@@ -23,9 +23,8 @@ const toLoad = (transformSource) => async (url, context, defaultLoad) => {
23
23
  };
24
24
  };
25
25
 
26
- export const transformSource = (source, context) => {
26
+ export const transformSource = async (source, context) => {
27
27
  const {url} = context;
28
-
29
28
  const name = url.replace('file://', '');
30
29
 
31
30
  const options = parseOptions({
@@ -37,7 +36,7 @@ export const transformSource = (source, context) => {
37
36
  source,
38
37
  };
39
38
 
40
- const {code} = putout(source, {
39
+ const {code} = await putoutAsync(source, {
41
40
  printer: 'putout',
42
41
  ...options,
43
42
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "33.7.0",
3
+ "version": "33.8.1",
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",
package/putout.json CHANGED
@@ -30,6 +30,10 @@
30
30
  "setupTests.*": {
31
31
  "remove-empty/import": "off"
32
32
  },
33
+ ".filesystem.json": {
34
+ "nodejs/cjs-file": "on",
35
+ "nodejs/mjs-file": "on"
36
+ },
33
37
  "*.md": {
34
38
  "conditions/apply-consistent-blocks": "off",
35
39
  "conditions/convert-comparison-to-boolean": "off",