putout 32.15.0 → 32.16.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.
package/ChangeLog CHANGED
@@ -1,3 +1,37 @@
1
+ 2023.11.07, v32.16.0
2
+
3
+ fix:
4
+ - 47a7dea06 @putout/processor-filesystem: init
5
+ - 52274ed96 @putout/operate: traverseProperties: path
6
+ - 0e1855807 @putout/cli-choose-formatter: no .putout.json
7
+
8
+ feature:
9
+ - 8eb0ac092 @putout/plugin-putout: declare: findFiles, renameFile
10
+ - 127c173f0 putout: @putout/operator-filesystem v1.0.1
11
+ - e87678d74 putout: @putout/plugin-filesystem: add
12
+ - e33a6cf10 @putout/processor-filesystem: @putout/cli-filesystem v1.0.0
13
+ - e2f6e8075 putout: @putout/processor-filesystem v1.0.0
14
+ - bfec7f7c1 putout: @putout/plugin-filesystem v1.0.0
15
+ - 32456ff4d @putout/processor-filesystem: init
16
+ - 2e0098939 putout: @putout/operator-filesystem: add
17
+ - 4e45f05e5 @putout/plugin-filesystem: add
18
+ - c020b1077 eslint-plugin-putout: @stylistic/eslint-plugin-ts v1.0.0
19
+ - aa5808cb2 eslint-plugin-putout: @stylistic/eslint-plugin-jsx v1.0.0
20
+ - e22c2d267 @putout/eslint-config: @stylistic/eslint-plugin-js v1.0.0
21
+ - a21c7e8ad @putout/cli-filesystem: add
22
+ - c6e5581cf @putout/processor-filesystem: add
23
+ - 0f9ba929b @putout/operator-filesystem: add
24
+ - 3eca2e295 @putout/test: preTest: 1 -> name of a plugin
25
+ - 9d9a53a35 @putout/operate: traverseProperties: improve
26
+ - 88b5e0899 @putout/plugin-github: update-actions: actions/checkout, actions/setup-node v4
27
+ - 48c2fde76 @putout/cli-choose-formatter: preserve formatter options
28
+
29
+ 2023.11.03, v32.15.1
30
+
31
+ feature:
32
+ - d28e4a8eb putout: printer: yaml
33
+ - 6c262ec18 putout: printer: use deep merge
34
+
1
35
  2023.11.03, v32.15.0
2
36
 
3
37
  fix:
@@ -1,3 +1,5 @@
1
+ import deepMerge from 'deepmerge';
2
+
1
3
  const {isArray} = Array;
2
4
  const maybeArray = (a) => isArray(a) ? a : [a];
3
5
 
@@ -25,11 +27,20 @@ export const configurePrinter = (name, printerOptions) => {
25
27
  if (printer !== 'putout')
26
28
  return printerOptions;
27
29
 
30
+ const mergedOptions = deepMerge(parseOptions(ext), options);
31
+
32
+ return [printer, mergedOptions];
33
+ };
34
+
35
+ function parseOptions(ext) {
28
36
  if (ext === 'json')
29
- return [printer, JSON];
37
+ return JSON;
38
+
39
+ if (ext === 'yml{json}')
40
+ return JSON;
30
41
 
31
42
  if (ext === 'md{json}')
32
- return [printer, {
43
+ return {
33
44
  format: {
34
45
  ...DefaultMarkdown.format,
35
46
  ...JSON.format,
@@ -38,13 +49,13 @@ export const configurePrinter = (name, printerOptions) => {
38
49
  ...DefaultMarkdown.semantics,
39
50
  ...JSON.semantics,
40
51
  },
41
- }];
52
+ };
42
53
 
43
54
  if (ext === 'md{js}')
44
- return [printer, DefaultMarkdown];
55
+ return DefaultMarkdown;
45
56
 
46
57
  if (ext === 'md{ts}')
47
- return [printer, DefaultMarkdown];
58
+ return DefaultMarkdown;
48
59
 
49
- return [printer, options];
50
- };
60
+ return {};
61
+ }
package/lib/putout.js CHANGED
@@ -234,6 +234,7 @@ module.exports.operator = {
234
234
  ...require('@putout/operator-declare'),
235
235
  ...require('@putout/operator-regexp'),
236
236
  ...require('@putout/operator-add-args'),
237
+ ...require('@putout/operator-filesystem'),
237
238
  };
238
239
 
239
240
  module.exports.ignores = require('./ignores');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "32.15.0",
3
+ "version": "32.16.0",
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",
@@ -71,6 +71,7 @@
71
71
  "@putout/operate": "^11.0.0",
72
72
  "@putout/operator-add-args": "^7.0.0",
73
73
  "@putout/operator-declare": "^8.0.0",
74
+ "@putout/operator-filesystem": "^1.0.1",
74
75
  "@putout/operator-regexp": "^1.0.0",
75
76
  "@putout/plugin-apply-at": "^2.0.0",
76
77
  "@putout/plugin-apply-destructuring": "^7.0.0",
@@ -105,6 +106,7 @@
105
106
  "@putout/plugin-eslint": "^5.0.0",
106
107
  "@putout/plugin-extract-object-properties": "^9.0.0",
107
108
  "@putout/plugin-extract-sequence-expressions": "^3.0.0",
109
+ "@putout/plugin-filesystem": "^1.0.0",
108
110
  "@putout/plugin-for-of": "^3.0.0",
109
111
  "@putout/plugin-github": "^9.0.0",
110
112
  "@putout/plugin-gitignore": "^3.0.0",
@@ -166,6 +168,7 @@
166
168
  "@putout/plugin-typescript": "^5.0.0",
167
169
  "@putout/plugin-webpack": "^3.0.0",
168
170
  "@putout/processor-css": "^7.0.0",
171
+ "@putout/processor-filesystem": "^1.0.0",
169
172
  "@putout/processor-ignore": "^4.0.0",
170
173
  "@putout/processor-javascript": "^5.0.0",
171
174
  "@putout/processor-json": "^7.0.0",
package/putout.json CHANGED
@@ -10,7 +10,8 @@
10
10
  "markdown",
11
11
  "ignore",
12
12
  "yaml",
13
- "css"
13
+ "css",
14
+ "filesystem"
14
15
  ],
15
16
  "match": {
16
17
  "*.{mjs,ts,tsx,mts}": {
@@ -239,6 +240,7 @@
239
240
  "logical-expressions",
240
241
  "types",
241
242
  "conditions",
242
- "for-of"
243
+ "for-of",
244
+ "filesystem"
243
245
  ]
244
246
  }