king-design-analyzer 2.0.1 → 2.0.3

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,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  require('../chunk-YTEYDSDW.js');
4
- var chunkCEPXZKU4_js = require('../chunk-CEPXZKU4.js');
4
+ var chunkATICOJFK_js = require('../chunk-ATICOJFK.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "analyzeCodeWithAST", {
9
9
  enumerable: true,
10
- get: function () { return chunkCEPXZKU4_js.analyzeCodeWithAST; }
10
+ get: function () { return chunkATICOJFK_js.analyzeCodeWithAST; }
11
11
  });
12
12
  Object.defineProperty(exports, "componentRegistry", {
13
13
  enumerable: true,
14
- get: function () { return chunkCEPXZKU4_js.componentRegistry; }
14
+ get: function () { return chunkATICOJFK_js.componentRegistry; }
15
15
  });
@@ -1,2 +1,2 @@
1
1
  import '../chunk-5H7N2A5X.mjs';
2
- export { analyzeCodeWithAST, componentRegistry } from '../chunk-RQBLMKWL.mjs';
2
+ export { analyzeCodeWithAST, componentRegistry } from '../chunk-LRFJMATV.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkCEPXZKU4_js = require('./chunk-CEPXZKU4.js');
3
+ var chunkATICOJFK_js = require('./chunk-ATICOJFK.js');
4
4
  var chunk2L37YJOJ_js = require('./chunk-2L37YJOJ.js');
5
5
 
6
6
  // src/tools/unifiedValidator.ts
@@ -63,7 +63,7 @@ function validateCompilation(code) {
63
63
  }
64
64
  async function validateAST(code) {
65
65
  try {
66
- const violations = await chunkCEPXZKU4_js.analyzeCodeWithAST(code);
66
+ const violations = await chunkATICOJFK_js.analyzeCodeWithAST(code);
67
67
  if (violations.length > 0) {
68
68
  return {
69
69
  name: "AST\u89C4\u5219\u68C0\u67E5",
@@ -1,4 +1,4 @@
1
- import { analyzeCodeWithAST } from './chunk-RQBLMKWL.mjs';
1
+ import { analyzeCodeWithAST } from './chunk-LRFJMATV.mjs';
2
2
  import { compileSFC } from './chunk-WJAGRAWV.mjs';
3
3
 
4
4
  // src/tools/unifiedValidator.ts
@@ -32,7 +32,7 @@ var path__namespace = /*#__PURE__*/_interopNamespace(path);
32
32
  var ts__namespace = /*#__PURE__*/_interopNamespace(ts);
33
33
 
34
34
  // src/analysis/componentRegistry.ts
35
- var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-CEPXZKU4.js', document.baseURI).href)));
35
+ var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ATICOJFK.js', document.baseURI).href)));
36
36
  var __dirname$1 = path__namespace.dirname(__filename$1);
37
37
  var ComponentRegistry = class {
38
38
  constructor() {
@@ -40,7 +40,8 @@ var ComponentRegistry = class {
40
40
  this.loaded = false;
41
41
  this.watcher = null;
42
42
  // Path to components directory relative to this module (works when installed as npm package)
43
- this.metadataPath = path__namespace.join(__dirname$1, "../../components");
43
+ // From dist/*.mjs -> ../components (one level up to package root, then into components)
44
+ this.metadataPath = path__namespace.join(__dirname$1, "../components");
44
45
  }
45
46
  async load() {
46
47
  if (this.loaded) return;
@@ -14,7 +14,8 @@ var ComponentRegistry = class {
14
14
  this.loaded = false;
15
15
  this.watcher = null;
16
16
  // Path to components directory relative to this module (works when installed as npm package)
17
- this.metadataPath = path.join(__dirname$1, "../../components");
17
+ // From dist/*.mjs -> ../components (one level up to package root, then into components)
18
+ this.metadataPath = path.join(__dirname$1, "../components");
18
19
  }
19
20
  async load() {
20
21
  if (this.loaded) return;
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunk6ZHVWMNH_js = require('../chunk-6ZHVWMNH.js');
4
- require('../chunk-CEPXZKU4.js');
3
+ var chunk2W4XVSA3_js = require('../chunk-2W4XVSA3.js');
4
+ require('../chunk-ATICOJFK.js');
5
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 chunk6ZHVWMNH_js.validateCode; }
11
+ get: function () { return chunk2W4XVSA3_js.validateCode; }
12
12
  });
13
13
  Object.defineProperty(exports, "validateCodeSync", {
14
14
  enumerable: true,
15
- get: function () { return chunk6ZHVWMNH_js.validateCodeSync; }
15
+ get: function () { return chunk2W4XVSA3_js.validateCodeSync; }
16
16
  });
@@ -1,3 +1,3 @@
1
- export { validateCode, validateCodeSync } from '../chunk-74XF3JB4.mjs';
2
- import '../chunk-RQBLMKWL.mjs';
1
+ export { validateCode, validateCodeSync } from '../chunk-56IDUUT3.mjs';
2
+ import '../chunk-LRFJMATV.mjs';
3
3
  import '../chunk-WJAGRAWV.mjs';
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@
3
3
  var chunkREPE4KTQ_js = require('./chunk-REPE4KTQ.js');
4
4
  require('./chunk-YTEYDSDW.js');
5
5
  var chunkBJXTWCDK_js = require('./chunk-BJXTWCDK.js');
6
- var chunk6ZHVWMNH_js = require('./chunk-6ZHVWMNH.js');
7
- var chunkCEPXZKU4_js = require('./chunk-CEPXZKU4.js');
6
+ var chunk2W4XVSA3_js = require('./chunk-2W4XVSA3.js');
7
+ var chunkATICOJFK_js = require('./chunk-ATICOJFK.js');
8
8
  var chunk2L37YJOJ_js = require('./chunk-2L37YJOJ.js');
9
9
 
10
10
 
@@ -19,19 +19,19 @@ Object.defineProperty(exports, "validateRuntimePrecheck", {
19
19
  });
20
20
  Object.defineProperty(exports, "validateCode", {
21
21
  enumerable: true,
22
- get: function () { return chunk6ZHVWMNH_js.validateCode; }
22
+ get: function () { return chunk2W4XVSA3_js.validateCode; }
23
23
  });
24
24
  Object.defineProperty(exports, "validateCodeSync", {
25
25
  enumerable: true,
26
- get: function () { return chunk6ZHVWMNH_js.validateCodeSync; }
26
+ get: function () { return chunk2W4XVSA3_js.validateCodeSync; }
27
27
  });
28
28
  Object.defineProperty(exports, "analyzeCodeWithAST", {
29
29
  enumerable: true,
30
- get: function () { return chunkCEPXZKU4_js.analyzeCodeWithAST; }
30
+ get: function () { return chunkATICOJFK_js.analyzeCodeWithAST; }
31
31
  });
32
32
  Object.defineProperty(exports, "componentRegistry", {
33
33
  enumerable: true,
34
- get: function () { return chunkCEPXZKU4_js.componentRegistry; }
34
+ get: function () { return chunkATICOJFK_js.componentRegistry; }
35
35
  });
36
36
  Object.defineProperty(exports, "compileSFC", {
37
37
  enumerable: true,
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  export { validateCompilation } from './chunk-YYKRQHUZ.mjs';
2
2
  import './chunk-5H7N2A5X.mjs';
3
3
  export { validateRuntimePrecheck } from './chunk-X7PYJSHF.mjs';
4
- export { validateCode, validateCodeSync } from './chunk-74XF3JB4.mjs';
5
- export { analyzeCodeWithAST, componentRegistry } from './chunk-RQBLMKWL.mjs';
4
+ export { validateCode, validateCodeSync } from './chunk-56IDUUT3.mjs';
5
+ export { analyzeCodeWithAST, componentRegistry } from './chunk-LRFJMATV.mjs';
6
6
  export { compileSFC, scopeStyles } from './chunk-WJAGRAWV.mjs';
@@ -2,7 +2,9 @@
2
2
 
3
3
  var fs = require('fs');
4
4
  var path = require('path');
5
+ var url = require('url');
5
6
 
7
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
8
  function _interopNamespace(e) {
7
9
  if (e && e.__esModule) return e;
8
10
  var n = Object.create(null);
@@ -25,7 +27,9 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
25
27
  var path__namespace = /*#__PURE__*/_interopNamespace(path);
26
28
 
27
29
  // src/metadata/index.ts
28
- var COMPONENTS_DIR = path__namespace.resolve(__dirname, "../../components");
30
+ var __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href)));
31
+ var __dirname$1 = path__namespace.dirname(__filename$1);
32
+ var COMPONENTS_DIR = path__namespace.resolve(__dirname$1, "../components");
29
33
  function getComponentsList() {
30
34
  try {
31
35
  return fs__namespace.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", ""));
@@ -1,8 +1,11 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
 
4
5
  // src/metadata/index.ts
5
- var COMPONENTS_DIR = path.resolve(__dirname, "../../components");
6
+ var __filename$1 = fileURLToPath(import.meta.url);
7
+ var __dirname$1 = path.dirname(__filename$1);
8
+ var COMPONENTS_DIR = path.resolve(__dirname$1, "../components");
6
9
  function getComponentsList() {
7
10
  try {
8
11
  return fs.readdirSync(COMPONENTS_DIR).filter((f) => f.endsWith(".json")).map((f) => f.replace(".json", ""));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "king-design-analyzer",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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",