@putout/printer 1.81.4 → 1.82.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,13 @@
1
+ 2023.05.07, v1.82.0
2
+
3
+ feature:
4
+ - 55727fa @putout/printer: add support of ExportAllDeclaration
5
+
6
+ 2023.05.05, v1.81.5
7
+
8
+ feature:
9
+ - b8367bc @putout/printer: improve support of newline in FunctionDeclaration inside of ExportDeclaration
10
+
1
11
  2023.05.04, v1.81.4
2
12
 
3
13
  feature:
@@ -1,7 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  const {markAfter} = require('../../mark');
4
- const {isNext} = require('../../is');
4
+
5
+ const {
6
+ isNext,
7
+ isNextParent,
8
+ } = require('../../is');
5
9
 
6
10
  module.exports.FunctionDeclaration = {
7
11
  print(path, {print, maybe}) {
@@ -27,9 +31,7 @@ module.exports.FunctionDeclaration = {
27
31
  print(') ');
28
32
  print('__body');
29
33
  },
30
- afterSatisfy: () => [
31
- isNext,
32
- ],
34
+ afterSatisfy: () => [isNext, isNextParent],
33
35
  after(path, {write}) {
34
36
  write.newline();
35
37
  markAfter(path);
@@ -6,7 +6,6 @@ const {
6
6
  isForOf,
7
7
  isCoupleLines,
8
8
  exists,
9
-
10
9
  } = require('../is');
11
10
 
12
11
  module.exports.ObjectPattern = (path, {indent, print, maybe}) => {
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports.ExportAllDeclaration = (path, {print}) => {
4
+ print('export * from ');
5
+ print('__source');
6
+ print(';');
7
+ };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const {isNewlineBetweenSiblings} = require('../is');
3
+ const {isNewlineBetweenSiblings} = require('../../is');
4
4
 
5
5
  const {
6
6
  markAfter,
7
7
  isMarkedAfter,
8
- } = require('../mark');
8
+ } = require('../../mark');
9
9
 
10
10
  const isDeclarationNewline = (path) => isMarkedAfter(path.get('declaration'));
11
11
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {isNext} = require('../is');
3
+ const {isNext} = require('../../is');
4
4
 
5
5
  const notClass = (path) => {
6
6
  if (!isNext(path))
@@ -10,11 +10,13 @@ const TryStatements = require('./try-statements');
10
10
  const {DebuggerStatement} = require('./debugger-statement');
11
11
  const {ForStatement} = require('./for-statement');
12
12
  const importDeclarations = require('./import-declaration/import-declaration');
13
- const exportDeclarations = require('./export-declarations');
13
+ const exportDeclarations = require('./export-declaration/export-declaration');
14
+ const {ExportAllDeclaration} = require('./export-declaration/export-all-declaration');
15
+
14
16
  const {WhileStatement} = require('./while-statement');
15
17
  const {SwitchStatement} = require('./switch-statement');
16
18
  const {ForInStatement} = require('./for-in-statement');
17
- const {ExportDefaultDeclaration} = require('./export-default-declaration');
19
+ const {ExportDefaultDeclaration} = require('./export-declaration/export-default-declaration');
18
20
  const {BreakStatement} = require('./break-statement');
19
21
 
20
22
  const {
@@ -30,6 +32,7 @@ module.exports = {
30
32
  ExportSpecifier,
31
33
  ExportNamespaceSpecifier,
32
34
  ExportDefaultDeclaration,
35
+ ExportAllDeclaration,
33
36
  VariableDeclaration,
34
37
  IfStatement,
35
38
  ForStatement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "1.81.4",
3
+ "version": "1.82.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Simplest possible opinionated Babel AST printer fro 🐊Putout",