@wc-toolkit/cem-generator-fast 0.1.6 → 0.1.7
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/dist/index.js +10 -5
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ export function fastPlugin() {
|
|
|
5
5
|
return {
|
|
6
6
|
name: "fast",
|
|
7
7
|
shouldAnalyze(sourceText) {
|
|
8
|
-
return /from\s+["']@microsoft\/fast-(?:element|foundation)["']/.test(sourceText) ||
|
|
8
|
+
return (/from\s+["']@microsoft\/fast-(?:element|foundation)["']/.test(sourceText) ||
|
|
9
9
|
/extends\s+(?:FASTElement|FastElement)/.test(sourceText) ||
|
|
10
|
-
/@(?:customElement|attr)\b/.test(sourceText);
|
|
10
|
+
/@(?:customElement|attr)\b/.test(sourceText));
|
|
11
11
|
},
|
|
12
12
|
onFile(context) {
|
|
13
13
|
const fragment = {};
|
|
@@ -80,7 +80,8 @@ function extendsFastElement(node, checker) {
|
|
|
80
80
|
if (seen.has(expression))
|
|
81
81
|
return false;
|
|
82
82
|
seen.add(expression);
|
|
83
|
-
if (ts.isIdentifier(expression) &&
|
|
83
|
+
if (ts.isIdentifier(expression) &&
|
|
84
|
+
(expression.text === "FASTElement" || expression.text === "FastElement"))
|
|
84
85
|
return true;
|
|
85
86
|
if (!ts.isIdentifier(expression))
|
|
86
87
|
return false;
|
|
@@ -134,7 +135,9 @@ function getCustomElementTagName(node) {
|
|
|
134
135
|
return name && ts.isStringLiteralLike(name) ? name.text : undefined;
|
|
135
136
|
}
|
|
136
137
|
function getDecoratorName(decorator) {
|
|
137
|
-
const expression = ts.isCallExpression(decorator.expression)
|
|
138
|
+
const expression = ts.isCallExpression(decorator.expression)
|
|
139
|
+
? decorator.expression.expression
|
|
140
|
+
: decorator.expression;
|
|
138
141
|
return ts.isIdentifier(expression) ? expression.text : undefined;
|
|
139
142
|
}
|
|
140
143
|
function getAttrOptions(decorator) {
|
|
@@ -184,7 +187,9 @@ function getExportName(node) {
|
|
|
184
187
|
const modifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;
|
|
185
188
|
if (!modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword))
|
|
186
189
|
return undefined;
|
|
187
|
-
return modifiers.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword)
|
|
190
|
+
return modifiers.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword)
|
|
191
|
+
? "default"
|
|
192
|
+
: node.name?.text;
|
|
188
193
|
}
|
|
189
194
|
function mergeByName(...sources) {
|
|
190
195
|
const merged = new Map();
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wc-toolkit/cem-generator-fast",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "FAST detector plugin for generating Custom Elements Manifests.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"custom-elements",
|
|
7
|
+
"custom-elements-manifest",
|
|
8
|
+
"fast",
|
|
9
|
+
"web-components"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://cem-generator.wc-toolkit.com/plugins/fast/",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/wc-toolkit/cem-generator/issues"
|
|
14
|
+
},
|
|
5
15
|
"license": "MIT",
|
|
6
16
|
"repository": {
|
|
7
17
|
"type": "git",
|
|
8
18
|
"url": "git+https://github.com/wc-toolkit/cem-generator.git",
|
|
9
19
|
"directory": "packages/plugins/fast"
|
|
10
20
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
},
|
|
14
|
-
"homepage": "https://wc-toolkit.github.io/cem-generator/plugins/fast/",
|
|
15
|
-
"keywords": [
|
|
16
|
-
"custom-elements",
|
|
17
|
-
"custom-elements-manifest",
|
|
18
|
-
"web-components",
|
|
19
|
-
"fast"
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
20
23
|
],
|
|
21
24
|
"type": "module",
|
|
22
25
|
"main": "./dist/index.js",
|
|
23
26
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public",
|
|
29
29
|
"provenance": true
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"typescript": "^5.9.0",
|
|
33
|
-
"@wc-toolkit/cem-generator": "0.1.
|
|
34
|
-
"@wc-toolkit/cem-generator-utils": "0.1.
|
|
33
|
+
"@wc-toolkit/cem-generator": "0.1.7",
|
|
34
|
+
"@wc-toolkit/cem-generator-utils": "0.1.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@microsoft/fast-element": "^3.0.2"
|