@marko/compiler 5.33.6 → 5.33.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.
|
@@ -208,7 +208,7 @@ function parseMarko(file) {
|
|
|
208
208
|
);
|
|
209
209
|
},
|
|
210
210
|
onTagTypeParams(part) {
|
|
211
|
-
|
|
211
|
+
currentBody.node.typeParameters = (0, _babelUtils.parseTypeParams)(
|
|
212
212
|
file,
|
|
213
213
|
parser.read(part.value),
|
|
214
214
|
part.start,
|
|
@@ -193,12 +193,12 @@ Object.assign(_printer.default.prototype, {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
if (node.body.params.length) {
|
|
196
|
-
if (node.typeParameters) {
|
|
196
|
+
if (node.body.typeParameters) {
|
|
197
197
|
if (!node.typeArguments) {
|
|
198
198
|
this.token(" ");
|
|
199
199
|
}
|
|
200
200
|
this.token("<");
|
|
201
|
-
this.printList(node.typeParameters.params, node);
|
|
201
|
+
this.printList(node.body.typeParameters.params, node);
|
|
202
202
|
this.token(">");
|
|
203
203
|
}
|
|
204
204
|
this.token("|");
|
|
@@ -147,7 +147,7 @@ const MarkoDefinitions = {
|
|
|
147
147
|
MarkoTagBody: {
|
|
148
148
|
aliases: ["Marko", "BlockParent", "Scope"],
|
|
149
149
|
builder: ["body", "params"],
|
|
150
|
-
visitor: ["params", "body"],
|
|
150
|
+
visitor: ["typeParameters", "params", "body"],
|
|
151
151
|
fields: {
|
|
152
152
|
params: {
|
|
153
153
|
validate: (0, _utils.chain)(
|
|
@@ -156,6 +156,10 @@ const MarkoDefinitions = {
|
|
|
156
156
|
),
|
|
157
157
|
default: []
|
|
158
158
|
},
|
|
159
|
+
typeParameters: {
|
|
160
|
+
validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration"),
|
|
161
|
+
optional: true
|
|
162
|
+
},
|
|
159
163
|
body: {
|
|
160
164
|
validate: (0, _utils.arrayOfType)([
|
|
161
165
|
"MarkoTag",
|
|
@@ -173,7 +177,14 @@ const MarkoDefinitions = {
|
|
|
173
177
|
MarkoTag: {
|
|
174
178
|
aliases: ["Marko", "Statement"],
|
|
175
179
|
builder: ["name", "attributes", "body", "arguments", "var"],
|
|
176
|
-
visitor: [
|
|
180
|
+
visitor: [
|
|
181
|
+
"name",
|
|
182
|
+
"typeArguments",
|
|
183
|
+
"attributes",
|
|
184
|
+
"body",
|
|
185
|
+
"arguments",
|
|
186
|
+
"var"],
|
|
187
|
+
|
|
177
188
|
fields: {
|
|
178
189
|
name: {
|
|
179
190
|
validate: (0, _utils.assertNodeType)("Expression")
|
|
@@ -193,17 +204,7 @@ const MarkoDefinitions = {
|
|
|
193
204
|
optional: true
|
|
194
205
|
},
|
|
195
206
|
typeArguments: {
|
|
196
|
-
validate: (0, _utils.
|
|
197
|
-
(0, _utils.assertValueType)("array"),
|
|
198
|
-
(0, _utils.assertEach)((0, _utils.assertNodeType)("TypeAnnotation"))
|
|
199
|
-
),
|
|
200
|
-
optional: true
|
|
201
|
-
},
|
|
202
|
-
typeParameters: {
|
|
203
|
-
validate: (0, _utils.chain)(
|
|
204
|
-
(0, _utils.assertValueType)("array"),
|
|
205
|
-
(0, _utils.assertEach)((0, _utils.assertNodeType)("TypeAnnotation"))
|
|
206
|
-
),
|
|
207
|
+
validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
|
|
207
208
|
optional: true
|
|
208
209
|
},
|
|
209
210
|
rawValue: {
|
package/dist/types.d.ts
CHANGED
|
@@ -1720,6 +1720,7 @@ export interface MarkoTagBody extends BaseNode {
|
|
|
1720
1720
|
type: "MarkoTagBody";
|
|
1721
1721
|
body: Array<MarkoTag | MarkoCDATA | MarkoText | MarkoPlaceholder | MarkoScriptlet | MarkoComment>;
|
|
1722
1722
|
params: Array<Identifier | Pattern | RestElement>;
|
|
1723
|
+
typeParameters: TSTypeParameterDeclaration | null;
|
|
1723
1724
|
}
|
|
1724
1725
|
|
|
1725
1726
|
export interface MarkoTag extends BaseNode {
|
|
@@ -1730,8 +1731,7 @@ export interface MarkoTag extends BaseNode {
|
|
|
1730
1731
|
arguments: Array<Expression | SpreadElement> | null;
|
|
1731
1732
|
var: LVal | null;
|
|
1732
1733
|
rawValue: string | null;
|
|
1733
|
-
typeArguments:
|
|
1734
|
-
typeParameters: Array<TypeAnnotation> | null;
|
|
1734
|
+
typeArguments: TSTypeParameterInstantiation | null;
|
|
1735
1735
|
}
|
|
1736
1736
|
|
|
1737
1737
|
/**
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
|
-
"version": "5.33.
|
|
3
|
+
"version": "5.33.8",
|
|
4
4
|
"description": "Marko template to JS compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@babel/runtime": "^7.16.0",
|
|
46
46
|
"@babel/traverse": "^7.16.0",
|
|
47
47
|
"@babel/types": "^7.16.0",
|
|
48
|
-
"@marko/babel-utils": "^6.3.
|
|
48
|
+
"@marko/babel-utils": "^6.3.4",
|
|
49
49
|
"complain": "^1.6.0",
|
|
50
50
|
"he": "^1.2.0",
|
|
51
51
|
"htmljs-parser": "^5.4.3",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"strip-json-comments": "^3.1.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@marko/translator-default": "^5.31.
|
|
64
|
+
"@marko/translator-default": "^5.31.8"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|