putout 29.4.0 → 29.5.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,23 @@
1
+ 2023.05.07, v29.5.0
2
+
3
+ fix:
4
+ - 1757c6ae1 @putout/plugin-convert-optional-to-logical: rm comment
5
+
6
+ feature:
7
+ - f60550be7 package: escover v3.2.2
8
+ - 37d740eaa putout: improve support of @putout/printer: shebang
9
+ - 20f19c8ed @putout/operate: compute: exclude reassigned ObjectExpressions (#140)
10
+ - acf836d68 @putout/plugin-convert-optional-to-logical: simplify
11
+ - 7ee4cc264 @putout/plugin-convert-optional-to-logical: add
12
+ - cc80a96c9 @putout/plugin-putout: create-test: add support of ESM
13
+
14
+ 2023.05.03, v29.4.1
15
+
16
+ feature:
17
+ - 28d0f1b4e package: @putout/plugin-apply-template-literals v2.0.0
18
+ - 17b92de5f @putout/plugin-apply-termplate-literlas: drop support of 🐊 < 29
19
+ - 88bb5cac1 @putout/plugin-apply-template-literals: add support of CallExpression inside TemplateLiteral
20
+
1
21
  2023.04.28, v29.4.0
2
22
 
3
23
  fix:
package/lib/putout.js CHANGED
@@ -12,7 +12,7 @@ const {
12
12
  template,
13
13
  } = require('@putout/engine-parser');
14
14
 
15
- const cutShebang = require('./cut-shebang');
15
+ const {cutShebang, mergeShebang} = require('./shebang');
16
16
  const isString = (a) => typeof a === 'string';
17
17
 
18
18
  const defaultOpts = (opts = {}) => {
@@ -72,7 +72,7 @@ module.exports = (source, opts) => {
72
72
  sourceMapName,
73
73
  printer,
74
74
  });
75
- const code = `${shebang}${printed}`;
75
+ const code = mergeShebang(shebang, printed);
76
76
 
77
77
  return {
78
78
  code,
@@ -1,6 +1,15 @@
1
1
  'use strict';
2
2
 
3
- module.exports = (source) => {
3
+ const maybeNewline = (a) => a[0] === '\n' ? a : `\n${a}`;
4
+
5
+ module.exports.mergeShebang = (shebang, source) => {
6
+ if (!shebang)
7
+ return source;
8
+
9
+ return shebang + maybeNewline(source);
10
+ };
11
+
12
+ module.exports.cutShebang = (source) => {
4
13
  if (source.indexOf('#'))
5
14
  return [source, ''];
6
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "29.4.0",
3
+ "version": "29.5.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",
@@ -75,7 +75,7 @@
75
75
  "@putout/plugin-apply-early-return": "^2.0.0",
76
76
  "@putout/plugin-apply-flat-map": "^2.0.0",
77
77
  "@putout/plugin-apply-optional-chaining": "^3.0.0",
78
- "@putout/plugin-apply-template-literals": "^1.0.0",
78
+ "@putout/plugin-apply-template-literals": "^2.0.0",
79
79
  "@putout/plugin-browserlist": "^1.0.0",
80
80
  "@putout/plugin-conditions": "^1.0.0",
81
81
  "@putout/plugin-convert-apply-to-spread": "^3.0.0",
@@ -205,7 +205,7 @@
205
205
  "babel-plugin-transform-inline-consecutive-adds": "^0.5.0-alpha.9",
206
206
  "c8": "^7.5.0",
207
207
  "currify": "^4.0.0",
208
- "escover": "^2.1.0",
208
+ "escover": "^3.2.2",
209
209
  "eslint": "^8.0.1",
210
210
  "eslint-plugin-n": "^15.2.4",
211
211
  "eslint-plugin-putout": "^17.0.0",