king-design-analyzer 2.2.5 → 2.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  require('../chunk-YTEYDSDW.js');
4
- var chunk4ZZ6E4RS_js = require('../chunk-4ZZ6E4RS.js');
4
+ var chunkWA5RYYEX_js = require('../chunk-WA5RYYEX.js');
5
5
  require('../chunk-KF5YBEM5.js');
6
6
  require('../chunk-JSBRDJBE.js');
7
7
 
@@ -9,9 +9,9 @@ require('../chunk-JSBRDJBE.js');
9
9
 
10
10
  Object.defineProperty(exports, "analyzeCodeWithAST", {
11
11
  enumerable: true,
12
- get: function () { return chunk4ZZ6E4RS_js.analyzeCodeWithAST; }
12
+ get: function () { return chunkWA5RYYEX_js.analyzeCodeWithAST; }
13
13
  });
14
14
  Object.defineProperty(exports, "componentRegistry", {
15
15
  enumerable: true,
16
- get: function () { return chunk4ZZ6E4RS_js.componentRegistry; }
16
+ get: function () { return chunkWA5RYYEX_js.componentRegistry; }
17
17
  });
@@ -1,4 +1,4 @@
1
1
  import '../chunk-5H7N2A5X.mjs';
2
- export { analyzeCodeWithAST, componentRegistry } from '../chunk-ZW3HD2OD.mjs';
2
+ export { analyzeCodeWithAST, componentRegistry } from '../chunk-PRRBZ2JL.mjs';
3
3
  import '../chunk-QC6VTSA3.mjs';
4
4
  import '../chunk-UJCSKKID.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk4ZZ6E4RS_js = require('./chunk-4ZZ6E4RS.js');
3
+ var chunkWA5RYYEX_js = require('./chunk-WA5RYYEX.js');
4
4
  var chunkV5N65MRP_js = require('./chunk-V5N65MRP.js');
5
5
  var chunkDHLWNT53_js = require('./chunk-DHLWNT53.js');
6
6
 
@@ -64,7 +64,7 @@ function validateCompilation(code) {
64
64
  }
65
65
  async function validateAST(code) {
66
66
  try {
67
- const violations = await chunk4ZZ6E4RS_js.analyzeCodeWithAST(code);
67
+ const violations = await chunkWA5RYYEX_js.analyzeCodeWithAST(code);
68
68
  if (violations.length > 0) {
69
69
  return {
70
70
  name: "AST\u89C4\u5219\u68C0\u67E5",
@@ -32439,6 +32439,18 @@ var HooksRegistry = class {
32439
32439
  }
32440
32440
  };
32441
32441
  var hooksRegistry = new HooksRegistry();
32442
+ var FALLBACK_PACKAGE_EXPORTS = {
32443
+ "@king-design/vue": [
32444
+ { name: "_$", kind: "value" },
32445
+ { name: "localize", kind: "value" },
32446
+ { name: "setTheme", kind: "value" },
32447
+ { name: "theme", kind: "value" },
32448
+ { name: "normalize", kind: "value" },
32449
+ { name: "bind", kind: "value" },
32450
+ { name: "MenuTitle", kind: "component" },
32451
+ { name: "View", kind: "component" }
32452
+ ]
32453
+ };
32442
32454
  function packagePathSegments(moduleSpecifier) {
32443
32455
  if (moduleSpecifier.startsWith("@")) {
32444
32456
  return moduleSpecifier.split("/").slice(0, 2);
@@ -32490,14 +32502,27 @@ var PackageExportRegistry = class {
32490
32502
  this.exportsByModule = /* @__PURE__ */ new Map();
32491
32503
  this.loadedModules = /* @__PURE__ */ new Set();
32492
32504
  }
32505
+ createFallbackExportsMap(moduleSpecifier) {
32506
+ const fallbackExports = FALLBACK_PACKAGE_EXPORTS[moduleSpecifier] || [];
32507
+ const exportsMap = /* @__PURE__ */ new Map();
32508
+ for (const item of fallbackExports) {
32509
+ exportsMap.set(item.name, {
32510
+ name: item.name,
32511
+ moduleSpecifier,
32512
+ kind: item.kind
32513
+ });
32514
+ }
32515
+ return exportsMap;
32516
+ }
32493
32517
  async load(moduleSpecifier) {
32494
32518
  if (this.loadedModules.has(moduleSpecifier)) {
32495
32519
  return;
32496
32520
  }
32521
+ const exportsMap = this.createFallbackExportsMap(moduleSpecifier);
32497
32522
  const entry = resolvePackageTypesEntry(moduleSpecifier);
32498
32523
  if (!entry) {
32499
32524
  this.loadedModules.add(moduleSpecifier);
32500
- this.exportsByModule.set(moduleSpecifier, /* @__PURE__ */ new Map());
32525
+ this.exportsByModule.set(moduleSpecifier, exportsMap);
32501
32526
  return;
32502
32527
  }
32503
32528
  const program = ts2.createProgram([entry], {
@@ -32510,11 +32535,10 @@ var PackageExportRegistry = class {
32510
32535
  const sourceFile = program.getSourceFile(entry);
32511
32536
  if (!sourceFile) {
32512
32537
  this.loadedModules.add(moduleSpecifier);
32513
- this.exportsByModule.set(moduleSpecifier, /* @__PURE__ */ new Map());
32538
+ this.exportsByModule.set(moduleSpecifier, exportsMap);
32514
32539
  return;
32515
32540
  }
32516
32541
  const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
32517
- const exportsMap = /* @__PURE__ */ new Map();
32518
32542
  if (moduleSymbol) {
32519
32543
  for (const symbol of checker.getExportsOfModule(moduleSymbol)) {
32520
32544
  const declarationFile = symbol.declarations?.[0]?.getSourceFile().fileName;
@@ -1,4 +1,4 @@
1
- import { analyzeCodeWithAST } from './chunk-ZW3HD2OD.mjs';
1
+ import { analyzeCodeWithAST } from './chunk-PRRBZ2JL.mjs';
2
2
  import { validateRuntimePrecheck } from './chunk-6HOIRUQB.mjs';
3
3
  import { compileSFC } from './chunk-4OTQAQ6J.mjs';
4
4
 
@@ -32464,6 +32464,18 @@ var HooksRegistry = class {
32464
32464
  }
32465
32465
  };
32466
32466
  var hooksRegistry = new HooksRegistry();
32467
+ var FALLBACK_PACKAGE_EXPORTS = {
32468
+ "@king-design/vue": [
32469
+ { name: "_$", kind: "value" },
32470
+ { name: "localize", kind: "value" },
32471
+ { name: "setTheme", kind: "value" },
32472
+ { name: "theme", kind: "value" },
32473
+ { name: "normalize", kind: "value" },
32474
+ { name: "bind", kind: "value" },
32475
+ { name: "MenuTitle", kind: "component" },
32476
+ { name: "View", kind: "component" }
32477
+ ]
32478
+ };
32467
32479
  function packagePathSegments(moduleSpecifier) {
32468
32480
  if (moduleSpecifier.startsWith("@")) {
32469
32481
  return moduleSpecifier.split("/").slice(0, 2);
@@ -32515,14 +32527,27 @@ var PackageExportRegistry = class {
32515
32527
  this.exportsByModule = /* @__PURE__ */ new Map();
32516
32528
  this.loadedModules = /* @__PURE__ */ new Set();
32517
32529
  }
32530
+ createFallbackExportsMap(moduleSpecifier) {
32531
+ const fallbackExports = FALLBACK_PACKAGE_EXPORTS[moduleSpecifier] || [];
32532
+ const exportsMap = /* @__PURE__ */ new Map();
32533
+ for (const item of fallbackExports) {
32534
+ exportsMap.set(item.name, {
32535
+ name: item.name,
32536
+ moduleSpecifier,
32537
+ kind: item.kind
32538
+ });
32539
+ }
32540
+ return exportsMap;
32541
+ }
32518
32542
  async load(moduleSpecifier) {
32519
32543
  if (this.loadedModules.has(moduleSpecifier)) {
32520
32544
  return;
32521
32545
  }
32546
+ const exportsMap = this.createFallbackExportsMap(moduleSpecifier);
32522
32547
  const entry = resolvePackageTypesEntry(moduleSpecifier);
32523
32548
  if (!entry) {
32524
32549
  this.loadedModules.add(moduleSpecifier);
32525
- this.exportsByModule.set(moduleSpecifier, /* @__PURE__ */ new Map());
32550
+ this.exportsByModule.set(moduleSpecifier, exportsMap);
32526
32551
  return;
32527
32552
  }
32528
32553
  const program = ts2__namespace.createProgram([entry], {
@@ -32535,11 +32560,10 @@ var PackageExportRegistry = class {
32535
32560
  const sourceFile = program.getSourceFile(entry);
32536
32561
  if (!sourceFile) {
32537
32562
  this.loadedModules.add(moduleSpecifier);
32538
- this.exportsByModule.set(moduleSpecifier, /* @__PURE__ */ new Map());
32563
+ this.exportsByModule.set(moduleSpecifier, exportsMap);
32539
32564
  return;
32540
32565
  }
32541
32566
  const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
32542
- const exportsMap = /* @__PURE__ */ new Map();
32543
32567
  if (moduleSymbol) {
32544
32568
  for (const symbol of checker.getExportsOfModule(moduleSymbol)) {
32545
32569
  const declarationFile = symbol.declarations?.[0]?.getSourceFile().fileName;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkGCHRZSCK_js = require('../chunk-GCHRZSCK.js');
4
- require('../chunk-4ZZ6E4RS.js');
3
+ var chunkDMYU3C54_js = require('../chunk-DMYU3C54.js');
4
+ require('../chunk-WA5RYYEX.js');
5
5
  require('../chunk-V5N65MRP.js');
6
6
  require('../chunk-DHLWNT53.js');
7
7
  require('../chunk-KF5YBEM5.js');
@@ -11,9 +11,9 @@ require('../chunk-JSBRDJBE.js');
11
11
 
12
12
  Object.defineProperty(exports, "validateCode", {
13
13
  enumerable: true,
14
- get: function () { return chunkGCHRZSCK_js.validateCode; }
14
+ get: function () { return chunkDMYU3C54_js.validateCode; }
15
15
  });
16
16
  Object.defineProperty(exports, "validateCodeSync", {
17
17
  enumerable: true,
18
- get: function () { return chunkGCHRZSCK_js.validateCodeSync; }
18
+ get: function () { return chunkDMYU3C54_js.validateCodeSync; }
19
19
  });
@@ -1,5 +1,5 @@
1
- export { validateCode, validateCodeSync } from '../chunk-SCECUJGJ.mjs';
2
- import '../chunk-ZW3HD2OD.mjs';
1
+ export { validateCode, validateCodeSync } from '../chunk-SKWAXONZ.mjs';
2
+ import '../chunk-PRRBZ2JL.mjs';
3
3
  import '../chunk-6HOIRUQB.mjs';
4
4
  import '../chunk-4OTQAQ6J.mjs';
5
5
  import '../chunk-QC6VTSA3.mjs';
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  var chunkJJ6AB4ZH_js = require('./chunk-JJ6AB4ZH.js');
4
4
  require('./chunk-YTEYDSDW.js');
5
- var chunkGCHRZSCK_js = require('./chunk-GCHRZSCK.js');
6
- var chunk4ZZ6E4RS_js = require('./chunk-4ZZ6E4RS.js');
5
+ var chunkDMYU3C54_js = require('./chunk-DMYU3C54.js');
6
+ var chunkWA5RYYEX_js = require('./chunk-WA5RYYEX.js');
7
7
  var chunkV5N65MRP_js = require('./chunk-V5N65MRP.js');
8
8
  var chunkDHLWNT53_js = require('./chunk-DHLWNT53.js');
9
9
  require('./chunk-KF5YBEM5.js');
@@ -17,19 +17,19 @@ Object.defineProperty(exports, "validateCompilation", {
17
17
  });
18
18
  Object.defineProperty(exports, "validateCode", {
19
19
  enumerable: true,
20
- get: function () { return chunkGCHRZSCK_js.validateCode; }
20
+ get: function () { return chunkDMYU3C54_js.validateCode; }
21
21
  });
22
22
  Object.defineProperty(exports, "validateCodeSync", {
23
23
  enumerable: true,
24
- get: function () { return chunkGCHRZSCK_js.validateCodeSync; }
24
+ get: function () { return chunkDMYU3C54_js.validateCodeSync; }
25
25
  });
26
26
  Object.defineProperty(exports, "analyzeCodeWithAST", {
27
27
  enumerable: true,
28
- get: function () { return chunk4ZZ6E4RS_js.analyzeCodeWithAST; }
28
+ get: function () { return chunkWA5RYYEX_js.analyzeCodeWithAST; }
29
29
  });
30
30
  Object.defineProperty(exports, "componentRegistry", {
31
31
  enumerable: true,
32
- get: function () { return chunk4ZZ6E4RS_js.componentRegistry; }
32
+ get: function () { return chunkWA5RYYEX_js.componentRegistry; }
33
33
  });
34
34
  Object.defineProperty(exports, "validateRuntimePrecheck", {
35
35
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  export { validateCompilation } from './chunk-NZL6T22V.mjs';
2
2
  import './chunk-5H7N2A5X.mjs';
3
- export { validateCode, validateCodeSync } from './chunk-SCECUJGJ.mjs';
4
- export { analyzeCodeWithAST, componentRegistry } from './chunk-ZW3HD2OD.mjs';
3
+ export { validateCode, validateCodeSync } from './chunk-SKWAXONZ.mjs';
4
+ export { analyzeCodeWithAST, componentRegistry } from './chunk-PRRBZ2JL.mjs';
5
5
  export { validateRuntimePrecheck } from './chunk-6HOIRUQB.mjs';
6
6
  export { compileSFC, scopeStyles } from './chunk-4OTQAQ6J.mjs';
7
7
  import './chunk-QC6VTSA3.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "king-design-analyzer",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "AST-based code analyzer for King Design Vue components with on-demand modular imports",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",