@putout/printer 5.17.0 → 5.19.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.10.02, v5.19.0
2
+
3
+ feature:
4
+ - 6c0de67 @putout/printer: ClassProperty: readonly
5
+
6
+ 2023.10.02, v5.18.0
7
+
8
+ feature:
9
+ - cc10a48 @putout/printer: maybe
10
+
1
11
  2023.10.02, v5.17.0
2
12
 
3
13
  feature:
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {maybeTypeAnnotation} = require('../literals/maybe-type-annotation');
3
+ const {maybeTypeAnnotation} = require('../maybe/maybe-type-annotation');
4
4
  const isForOf = ({parentPath}) => parentPath.parentPath.parentPath?.isForOfStatement();
5
5
 
6
6
  module.exports.ArrayPattern = maybeTypeAnnotation((path, {indent, maybe, print}, options) => {
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const {exists} = require('../../is');
4
- const {maybePrintTypeAnnotation} = require('../../literals/maybe-type-annotation');
5
- const {maybeDecorators} = require('./maybe-decorators');
4
+ const {maybePrintTypeAnnotation} = require('../../maybe/maybe-type-annotation');
5
+ const {maybeDecorators} = require('../../maybe/maybe-decorators');
6
6
 
7
7
  const processClassProperty = maybeDecorators((path, printer, semantics, {accessor} = {}) => {
8
8
  const {print, maybe} = printer;
@@ -19,6 +19,7 @@ const processClassProperty = maybeDecorators((path, printer, semantics, {accesso
19
19
 
20
20
  maybe.print(accessibility, `${accessibility} `);
21
21
  maybe.print(node.static, 'static ');
22
+ maybe.print(node.readonly, 'readonly ');
22
23
  maybe.print(declare, 'declare ');
23
24
 
24
25
  print('__key');
@@ -3,7 +3,7 @@
3
3
  const {isNext} = require('../../is');
4
4
  const {markAfter} = require('../../mark');
5
5
  const {maybeDecorators} = require('../../maybe-get');
6
- const {maybeDeclare} = require('../../typescript/namespace/maybeDeclare');
6
+ const {maybeDeclare} = require('../../maybe/maybe-declare');
7
7
  const {parseComments} = require('../../comment/comment');
8
8
 
9
9
  const isInsideExport = ({parentPath}) => parentPath.isExportDeclaration();
@@ -87,4 +87,3 @@ function classVisitor(path, printer, semantics) {
87
87
  maybe.indent(body.length);
88
88
  print('}');
89
89
  }
90
-
@@ -2,7 +2,7 @@
2
2
 
3
3
  const {isNext} = require('../../is');
4
4
  const {printParams} = require('./params');
5
- const {maybeDecorators} = require('../class/maybe-decorators');
5
+ const {maybeDecorators} = require('../../maybe/maybe-decorators');
6
6
 
7
7
  const ClassMethod = {
8
8
  print: maybeDecorators((path, printer, semantics) => {
@@ -15,7 +15,7 @@ const {
15
15
  } = require('../../is');
16
16
 
17
17
  const {checkMaxPropertiesInOneLine} = require('./max-properties-in-one-line');
18
- const {maybeTypeAnnotation} = require('../../literals/maybe-type-annotation');
18
+ const {maybeTypeAnnotation} = require('../../maybe/maybe-type-annotation');
19
19
 
20
20
  const isTwoLevelsDeep = ({parentPath}) => parentPath.parentPath.parentPath.isObjectProperty();
21
21
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {maybeTypeAnnotation} = require('../literals/maybe-type-annotation');
3
+ const {maybeTypeAnnotation} = require('../maybe/maybe-type-annotation');
4
4
 
5
5
  module.exports.RestElement = maybeTypeAnnotation((path, {print}) => {
6
6
  print('...');
@@ -2,7 +2,7 @@
2
2
 
3
3
  const {maybeDecorators} = require('../maybe-get');
4
4
  const {maybeParens} = require('../expressions/function/parens');
5
- const {maybeTypeAnnotation} = require('./maybe-type-annotation');
5
+ const {maybeTypeAnnotation} = require('../maybe/maybe-type-annotation');
6
6
 
7
7
  module.exports.Identifier = maybeParens(maybeTypeAnnotation((path, printer) => {
8
8
  const {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {isPrev} = require('../../is');
3
+ const {isPrev} = require('../is');
4
4
 
5
5
  module.exports.maybeDecorators = (visitor) => (path, printer, semantics, options) => {
6
6
  const {
@@ -14,7 +14,7 @@ const {maybeSpaceAfterKeyword} = require('./maybe-space-after-keyword');
14
14
 
15
15
  const {isConcatenation} = require('../../expressions/binary-expression/concatanate');
16
16
  const {parseLeadingComments} = require('../../comment/comment');
17
- const {maybeDeclare} = require('../../typescript/namespace/maybeDeclare');
17
+ const {maybeDeclare} = require('../../maybe/maybe-declare');
18
18
 
19
19
  const isParentTSModuleBlock = (path) => path.parentPath.isTSModuleBlock();
20
20
  const isParentBlock = (path) => /Program|BlockStatement|Export/.test(path.parentPath.type);
@@ -6,7 +6,7 @@ const {
6
6
  } = require('@putout/babel').types;
7
7
 
8
8
  const {isNext, isNextParent} = require('../../is');
9
- const {maybeDeclare} = require('../namespace/maybeDeclare');
9
+ const {maybeDeclare} = require('../../maybe/maybe-declare');
10
10
 
11
11
  module.exports.TSInterfaceDeclaration = {
12
12
  print: maybeDeclare((path, {print, indent}) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const {isNext} = require('../../is');
4
- const {maybeDeclare} = require('./maybeDeclare');
4
+ const {maybeDeclare} = require('../../maybe/maybe-declare');
5
5
 
6
6
  module.exports.TSModuleDeclaration = {
7
7
  print: maybeDeclare((path, {print}) => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const {maybeTypeAnnotation} = require('../literals/maybe-type-annotation');
3
+ const {maybeTypeAnnotation} = require('../maybe/maybe-type-annotation');
4
4
 
5
5
  module.exports.TSPropertySignature = maybeTypeAnnotation((path, {print, maybe}) => {
6
6
  const {optional} = path.node;
@@ -2,7 +2,7 @@
2
2
 
3
3
  const {isLast} = require('../../is');
4
4
  const {markAfter} = require('../../mark');
5
- const {maybeDeclare} = require('../namespace/maybeDeclare');
5
+ const {maybeDeclare} = require('../../maybe/maybe-declare');
6
6
  const isNextType = (a) => a.getNextSibling().isTSTypeAliasDeclaration();
7
7
 
8
8
  module.exports.TSTypeAliasDeclaration = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/printer",
3
- "version": "5.17.0",
3
+ "version": "5.19.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 for 🐊Putout",