king-design-analyzer 1.0.3 → 1.0.4
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/ast/index.js +3 -3
- package/dist/ast/index.mjs +1 -1
- package/dist/{chunk-FQBDUMJD.js → chunk-242F4OP3.js} +2 -2
- package/dist/{chunk-UIHTWWBN.js → chunk-2L37YJOJ.js} +6 -6
- package/dist/{chunk-6S2QBZUD.js → chunk-PP2QAR54.js} +7 -8
- package/dist/{chunk-DHO63GQC.mjs → chunk-Q7NN5FIR.mjs} +1 -1
- package/dist/{chunk-VF5B4PW7.js → chunk-SR45IYML.js} +2 -2
- package/dist/{chunk-PH2WUQZA.js → chunk-UWULTWWY.js} +5 -5
- package/dist/{chunk-YCVB3UOP.mjs → chunk-VVHQZTF5.mjs} +2 -2
- package/dist/{chunk-RPNK7QXK.mjs → chunk-WJAGRAWV.mjs} +6 -6
- package/dist/{chunk-DJVJXIT7.mjs → chunk-XNWSQMT6.mjs} +1 -1
- package/dist/{chunk-6QIOW6QE.mjs → chunk-YNH7FZWF.mjs} +7 -8
- package/dist/full/index.js +5 -5
- package/dist/full/index.mjs +3 -3
- package/dist/index.js +13 -13
- package/dist/index.mjs +5 -5
- package/dist/runtime/index.js +4 -4
- package/dist/runtime/index.mjs +2 -2
- package/dist/static/index.js +5 -5
- package/dist/static/index.mjs +2 -2
- package/package.json +1 -1
package/dist/ast/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../chunk-YTEYDSDW.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkPP2QAR54_js = require('../chunk-PP2QAR54.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "analyzeCodeWithAST", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkPP2QAR54_js.analyzeCodeWithAST; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "componentRegistry", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkPP2QAR54_js.componentRegistry; }
|
|
15
15
|
});
|
package/dist/ast/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../chunk-5H7N2A5X.mjs';
|
|
2
|
-
export { analyzeCodeWithAST, componentRegistry } from '../chunk-
|
|
2
|
+
export { analyzeCodeWithAST, componentRegistry } from '../chunk-YNH7FZWF.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2L37YJOJ_js = require('./chunk-2L37YJOJ.js');
|
|
4
4
|
|
|
5
5
|
// src/static/index.ts
|
|
6
6
|
function validateCompilation(code) {
|
|
@@ -39,7 +39,7 @@ function validateCompilation(code) {
|
|
|
39
39
|
errors: ["SFC \u7ED3\u6784\u9519\u8BEF: \u7F3A\u5C11 <template> \u6216 <script> \u6807\u7B7E"]
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
const result =
|
|
42
|
+
const result = chunk2L37YJOJ_js.compileSFC(code, scopeId);
|
|
43
43
|
if (result.error) {
|
|
44
44
|
return {
|
|
45
45
|
name: "\u7F16\u8BD1\u68C0\u67E5",
|
|
@@ -70,13 +70,13 @@ function compileSFC(code, scopeId) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
}, visit2 = function(node) {
|
|
73
|
-
if (ts__namespace.
|
|
74
|
-
extractNames2(
|
|
75
|
-
}
|
|
76
|
-
|
|
73
|
+
if (ts__namespace.isVariableStatement(node)) {
|
|
74
|
+
node.declarationList.declarations.forEach((decl) => extractNames2(decl.name));
|
|
75
|
+
} else if (ts__namespace.isFunctionDeclaration(node) && node.name) {
|
|
76
|
+
varNames.add(node.name.text);
|
|
77
|
+
} else if (ts__namespace.isClassDeclaration(node) && node.name) {
|
|
77
78
|
varNames.add(node.name.text);
|
|
78
79
|
}
|
|
79
|
-
ts__namespace.forEachChild(node, visit2);
|
|
80
80
|
};
|
|
81
81
|
var extractNames = extractNames2, visit = visit2;
|
|
82
82
|
const sourceFile = ts__namespace.createSourceFile(
|
|
@@ -85,7 +85,7 @@ function compileSFC(code, scopeId) {
|
|
|
85
85
|
ts__namespace.ScriptTarget.Latest,
|
|
86
86
|
true
|
|
87
87
|
);
|
|
88
|
-
visit2
|
|
88
|
+
sourceFile.statements.forEach(visit2);
|
|
89
89
|
} catch (e) {
|
|
90
90
|
}
|
|
91
91
|
return {
|
|
@@ -223,13 +223,13 @@ function extractScriptBindings(scriptContent) {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
}, visit2 = function(node) {
|
|
226
|
-
if (ts__namespace.
|
|
227
|
-
extractNames2(
|
|
228
|
-
}
|
|
229
|
-
if (ts__namespace.isFunctionDeclaration(node) && node.name) {
|
|
226
|
+
if (ts__namespace.isVariableStatement(node)) {
|
|
227
|
+
node.declarationList.declarations.forEach((decl) => extractNames2(decl.name));
|
|
228
|
+
} else if (ts__namespace.isFunctionDeclaration(node) && node.name) {
|
|
230
229
|
bindings.add(node.name.text);
|
|
231
|
-
}
|
|
232
|
-
|
|
230
|
+
} else if (ts__namespace.isClassDeclaration(node) && node.name) {
|
|
231
|
+
bindings.add(node.name.text);
|
|
232
|
+
} else if (ts__namespace.isImportDeclaration(node)) {
|
|
233
233
|
const namedBindings = node.importClause?.namedBindings;
|
|
234
234
|
if (namedBindings && ts__namespace.isNamedImports(namedBindings)) {
|
|
235
235
|
namedBindings.elements.forEach((element) => {
|
|
@@ -240,7 +240,6 @@ function extractScriptBindings(scriptContent) {
|
|
|
240
240
|
bindings.add(node.importClause.name.text);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
ts__namespace.forEachChild(node, visit2);
|
|
244
243
|
};
|
|
245
244
|
var extractNames = extractNames2, visit = visit2;
|
|
246
245
|
const sourceFile = ts__namespace.createSourceFile(
|
|
@@ -249,7 +248,7 @@ function extractScriptBindings(scriptContent) {
|
|
|
249
248
|
ts__namespace.ScriptTarget.Latest,
|
|
250
249
|
true
|
|
251
250
|
);
|
|
252
|
-
visit2
|
|
251
|
+
sourceFile.statements.forEach(visit2);
|
|
253
252
|
} catch (err) {
|
|
254
253
|
return bindings;
|
|
255
254
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2L37YJOJ_js = require('./chunk-2L37YJOJ.js');
|
|
4
4
|
|
|
5
5
|
// src/runtime/index.ts
|
|
6
6
|
function validateRuntimePrecheck(code) {
|
|
7
7
|
const scopeId = `runtime-${Date.now()}`;
|
|
8
|
-
const { script, bindings, error } =
|
|
8
|
+
const { script, bindings, error } = chunk2L37YJOJ_js.compileSFC(code, scopeId);
|
|
9
9
|
if (error) {
|
|
10
10
|
return {
|
|
11
11
|
name: "\u8FD0\u884C\u65F6\u9884\u68C0\u67E5",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPP2QAR54_js = require('./chunk-PP2QAR54.js');
|
|
4
|
+
var chunk2L37YJOJ_js = require('./chunk-2L37YJOJ.js');
|
|
5
5
|
|
|
6
6
|
// src/tools/unifiedValidator.ts
|
|
7
7
|
function validateCompilation(code) {
|
|
@@ -40,7 +40,7 @@ function validateCompilation(code) {
|
|
|
40
40
|
errors: ["SFC \u7ED3\u6784\u9519\u8BEF: \u7F3A\u5C11 <template> \u6216 <script> \u6807\u7B7E"]
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
const result =
|
|
43
|
+
const result = chunk2L37YJOJ_js.compileSFC(code, scopeId);
|
|
44
44
|
if (result.error) {
|
|
45
45
|
return {
|
|
46
46
|
name: "\u7F16\u8BD1\u68C0\u67E5",
|
|
@@ -63,7 +63,7 @@ function validateCompilation(code) {
|
|
|
63
63
|
}
|
|
64
64
|
async function validateAST(code) {
|
|
65
65
|
try {
|
|
66
|
-
const violations = await
|
|
66
|
+
const violations = await chunkPP2QAR54_js.analyzeCodeWithAST(code);
|
|
67
67
|
if (violations.length > 0) {
|
|
68
68
|
return {
|
|
69
69
|
name: "AST\u89C4\u5219\u68C0\u67E5",
|
|
@@ -86,7 +86,7 @@ async function validateAST(code) {
|
|
|
86
86
|
}
|
|
87
87
|
function validateRuntimePrecheck(code) {
|
|
88
88
|
const scopeId = `runtime-${Date.now()}`;
|
|
89
|
-
const { script, bindings, error } =
|
|
89
|
+
const { script, bindings, error } = chunk2L37YJOJ_js.compileSFC(code, scopeId);
|
|
90
90
|
if (error) {
|
|
91
91
|
return {
|
|
92
92
|
name: "\u8FD0\u884C\u65F6\u9884\u68C0\u67E5",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { analyzeCodeWithAST } from './chunk-
|
|
2
|
-
import { compileSFC } from './chunk-
|
|
1
|
+
import { analyzeCodeWithAST } from './chunk-YNH7FZWF.mjs';
|
|
2
|
+
import { compileSFC } from './chunk-WJAGRAWV.mjs';
|
|
3
3
|
|
|
4
4
|
// src/tools/unifiedValidator.ts
|
|
5
5
|
function validateCompilation(code) {
|
|
@@ -48,13 +48,13 @@ function compileSFC(code, scopeId) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}, visit2 = function(node) {
|
|
51
|
-
if (ts.
|
|
52
|
-
extractNames2(
|
|
53
|
-
}
|
|
54
|
-
|
|
51
|
+
if (ts.isVariableStatement(node)) {
|
|
52
|
+
node.declarationList.declarations.forEach((decl) => extractNames2(decl.name));
|
|
53
|
+
} else if (ts.isFunctionDeclaration(node) && node.name) {
|
|
54
|
+
varNames.add(node.name.text);
|
|
55
|
+
} else if (ts.isClassDeclaration(node) && node.name) {
|
|
55
56
|
varNames.add(node.name.text);
|
|
56
57
|
}
|
|
57
|
-
ts.forEachChild(node, visit2);
|
|
58
58
|
};
|
|
59
59
|
var extractNames = extractNames2, visit = visit2;
|
|
60
60
|
const sourceFile = ts.createSourceFile(
|
|
@@ -63,7 +63,7 @@ function compileSFC(code, scopeId) {
|
|
|
63
63
|
ts.ScriptTarget.Latest,
|
|
64
64
|
true
|
|
65
65
|
);
|
|
66
|
-
visit2
|
|
66
|
+
sourceFile.statements.forEach(visit2);
|
|
67
67
|
} catch (e) {
|
|
68
68
|
}
|
|
69
69
|
return {
|
|
@@ -198,13 +198,13 @@ function extractScriptBindings(scriptContent) {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
}, visit2 = function(node) {
|
|
201
|
-
if (ts.
|
|
202
|
-
extractNames2(
|
|
203
|
-
}
|
|
204
|
-
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
201
|
+
if (ts.isVariableStatement(node)) {
|
|
202
|
+
node.declarationList.declarations.forEach((decl) => extractNames2(decl.name));
|
|
203
|
+
} else if (ts.isFunctionDeclaration(node) && node.name) {
|
|
205
204
|
bindings.add(node.name.text);
|
|
206
|
-
}
|
|
207
|
-
|
|
205
|
+
} else if (ts.isClassDeclaration(node) && node.name) {
|
|
206
|
+
bindings.add(node.name.text);
|
|
207
|
+
} else if (ts.isImportDeclaration(node)) {
|
|
208
208
|
const namedBindings = node.importClause?.namedBindings;
|
|
209
209
|
if (namedBindings && ts.isNamedImports(namedBindings)) {
|
|
210
210
|
namedBindings.elements.forEach((element) => {
|
|
@@ -215,7 +215,6 @@ function extractScriptBindings(scriptContent) {
|
|
|
215
215
|
bindings.add(node.importClause.name.text);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
ts.forEachChild(node, visit2);
|
|
219
218
|
};
|
|
220
219
|
var extractNames = extractNames2, visit = visit2;
|
|
221
220
|
const sourceFile = ts.createSourceFile(
|
|
@@ -224,7 +223,7 @@ function extractScriptBindings(scriptContent) {
|
|
|
224
223
|
ts.ScriptTarget.Latest,
|
|
225
224
|
true
|
|
226
225
|
);
|
|
227
|
-
visit2
|
|
226
|
+
sourceFile.statements.forEach(visit2);
|
|
228
227
|
} catch (err) {
|
|
229
228
|
return bindings;
|
|
230
229
|
}
|
package/dist/full/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkUWULTWWY_js = require('../chunk-UWULTWWY.js');
|
|
4
|
+
require('../chunk-PP2QAR54.js');
|
|
5
|
+
require('../chunk-2L37YJOJ.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "validateCode", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkUWULTWWY_js.validateCode; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "validateCodeSync", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkUWULTWWY_js.validateCodeSync; }
|
|
16
16
|
});
|
package/dist/full/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { validateCode, validateCodeSync } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { validateCode, validateCodeSync } from '../chunk-VVHQZTF5.mjs';
|
|
2
|
+
import '../chunk-YNH7FZWF.mjs';
|
|
3
|
+
import '../chunk-WJAGRAWV.mjs';
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk242F4OP3_js = require('./chunk-242F4OP3.js');
|
|
4
4
|
require('./chunk-YTEYDSDW.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunkSR45IYML_js = require('./chunk-SR45IYML.js');
|
|
6
|
+
var chunkUWULTWWY_js = require('./chunk-UWULTWWY.js');
|
|
7
|
+
var chunkPP2QAR54_js = require('./chunk-PP2QAR54.js');
|
|
8
|
+
var chunk2L37YJOJ_js = require('./chunk-2L37YJOJ.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
Object.defineProperty(exports, "validateCompilation", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk242F4OP3_js.validateCompilation; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "validateRuntimePrecheck", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkSR45IYML_js.validateRuntimePrecheck; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "validateCode", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkUWULTWWY_js.validateCode; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "validateCodeSync", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkUWULTWWY_js.validateCodeSync; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "analyzeCodeWithAST", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkPP2QAR54_js.analyzeCodeWithAST; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "componentRegistry", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkPP2QAR54_js.componentRegistry; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "compileSFC", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk2L37YJOJ_js.compileSFC; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "scopeStyles", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk2L37YJOJ_js.scopeStyles; }
|
|
43
43
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { validateCompilation } from './chunk-
|
|
1
|
+
export { validateCompilation } from './chunk-XNWSQMT6.mjs';
|
|
2
2
|
import './chunk-5H7N2A5X.mjs';
|
|
3
|
-
export { validateRuntimePrecheck } from './chunk-
|
|
4
|
-
export { validateCode, validateCodeSync } from './chunk-
|
|
5
|
-
export { analyzeCodeWithAST, componentRegistry } from './chunk-
|
|
6
|
-
export { compileSFC, scopeStyles } from './chunk-
|
|
3
|
+
export { validateRuntimePrecheck } from './chunk-Q7NN5FIR.mjs';
|
|
4
|
+
export { validateCode, validateCodeSync } from './chunk-VVHQZTF5.mjs';
|
|
5
|
+
export { analyzeCodeWithAST, componentRegistry } from './chunk-YNH7FZWF.mjs';
|
|
6
|
+
export { compileSFC, scopeStyles } from './chunk-WJAGRAWV.mjs';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkSR45IYML_js = require('../chunk-SR45IYML.js');
|
|
4
|
+
var chunk2L37YJOJ_js = require('../chunk-2L37YJOJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "validateRuntimePrecheck", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkSR45IYML_js.validateRuntimePrecheck; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "compileSFC", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk2L37YJOJ_js.compileSFC; }
|
|
15
15
|
});
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { validateRuntimePrecheck } from '../chunk-
|
|
2
|
-
export { compileSFC } from '../chunk-
|
|
1
|
+
export { validateRuntimePrecheck } from '../chunk-Q7NN5FIR.mjs';
|
|
2
|
+
export { compileSFC } from '../chunk-WJAGRAWV.mjs';
|
package/dist/static/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk242F4OP3_js = require('../chunk-242F4OP3.js');
|
|
4
|
+
var chunk2L37YJOJ_js = require('../chunk-2L37YJOJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "validateCompilation", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk242F4OP3_js.validateCompilation; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "compileSFC", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk2L37YJOJ_js.compileSFC; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "scopeStyles", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk2L37YJOJ_js.scopeStyles; }
|
|
19
19
|
});
|
package/dist/static/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { validateCompilation } from '../chunk-
|
|
2
|
-
export { compileSFC, scopeStyles } from '../chunk-
|
|
1
|
+
export { validateCompilation } from '../chunk-XNWSQMT6.mjs';
|
|
2
|
+
export { compileSFC, scopeStyles } from '../chunk-WJAGRAWV.mjs';
|
package/package.json
CHANGED