@patternfly/ast-helpers 0.2.4 → 0.2.8
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.md +35 -0
- package/package.json +2 -2
- package/stringify.js +16 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.2.8 (2022-01-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/ast-helpers
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 0.2.7 (2022-01-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* TS to JS conversion - Ability to spread props within components & allow for empty tags (fragments) ([#2816](https://github.com/patternfly/patternfly-org/issues/2816)) ([96e9706](https://github.com/patternfly/patternfly-org/commit/96e9706b05bb5ce18434a7a0dfde67c4e535e749))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 0.2.6 (2022-01-19)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @patternfly/ast-helpers
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## 0.2.5 (2022-01-19)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @patternfly/ast-helpers
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## 0.2.4 (2022-01-18)
|
|
7
42
|
|
|
8
43
|
**Note:** Version bump only for package @patternfly/ast-helpers
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/ast-helpers",
|
|
3
3
|
"description": "Acorn AST helpers for working with live code",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"author": "Red Hat",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"acorn-static-class-features": "^1.0.0",
|
|
16
16
|
"astring": "^1.7.5"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "a340ed592f9b329f04b92b37662f49727372c762"
|
|
19
19
|
}
|
package/stringify.js
CHANGED
|
@@ -212,18 +212,18 @@ const es2017GeneratorJSX = {
|
|
|
212
212
|
},
|
|
213
213
|
// {...props}
|
|
214
214
|
JSXSpreadAttribute(node, state) {
|
|
215
|
-
state.write('...
|
|
215
|
+
state.write(' {...');
|
|
216
216
|
if (node.argument.type === 'LogicalExpression') {
|
|
217
|
+
state.write('(');
|
|
217
218
|
this[node.argument.left.type](node.argument.left, state);
|
|
218
|
-
state.write(
|
|
219
|
-
state.write(node.argument.operator);
|
|
220
|
-
state.write(' ');
|
|
219
|
+
state.write(` ${node.argument.operator} `);
|
|
221
220
|
this[node.argument.right.type](node.argument.right, state);
|
|
221
|
+
state.write(')');
|
|
222
222
|
}
|
|
223
223
|
else {
|
|
224
224
|
this[node.argument.type](node.argument, state);
|
|
225
225
|
}
|
|
226
|
-
state.write('
|
|
226
|
+
state.write('}');
|
|
227
227
|
},
|
|
228
228
|
// <></>
|
|
229
229
|
JSXFragment(node, state) {
|
|
@@ -232,8 +232,17 @@ const es2017GeneratorJSX = {
|
|
|
232
232
|
attributes: [],
|
|
233
233
|
name: {
|
|
234
234
|
type: 'JSXIdentifier',
|
|
235
|
-
name: '
|
|
236
|
-
}
|
|
235
|
+
name: ''
|
|
236
|
+
},
|
|
237
|
+
type: 'JSXOpeningElement'
|
|
238
|
+
},
|
|
239
|
+
closingElement: {
|
|
240
|
+
attributes: [],
|
|
241
|
+
name: {
|
|
242
|
+
type: 'JSXIdentifier',
|
|
243
|
+
name: ''
|
|
244
|
+
},
|
|
245
|
+
type: 'JSXClosingElement'
|
|
237
246
|
},
|
|
238
247
|
children: node.children
|
|
239
248
|
}, state);
|