vue-component-meta 3.0.0-beta.1 → 3.0.0-beta.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.
Files changed (2) hide show
  1. package/lib/base.js +10 -5
  2. package/package.json +3 -3
package/lib/base.js CHANGED
@@ -32,13 +32,16 @@ function createCheckerBase(ts, tsconfig, checkerOptions = {}) {
32
32
  }
33
33
  function baseCreate(ts, getCommandLine, checkerOptions, rootPath, globalComponentName) {
34
34
  let commandLine = getCommandLine();
35
- let fileNames = commandLine.fileNames.map(path => path.replace(windowsPathReg, '/'));
35
+ /**
36
+ * Used to lookup if a file is referenced.
37
+ */
38
+ let fileNames = new Set(commandLine.fileNames.map(path => path.replace(windowsPathReg, '/')));
36
39
  let projectVersion = 0;
37
40
  const projectHost = {
38
41
  getCurrentDirectory: () => rootPath,
39
42
  getProjectVersion: () => projectVersion.toString(),
40
43
  getCompilationSettings: () => commandLine.options,
41
- getScriptFileNames: () => fileNames,
44
+ getScriptFileNames: () => [...fileNames],
42
45
  getProjectReferences: () => commandLine.projectReferences,
43
46
  };
44
47
  const globalComponentSnapshot = ts.ScriptSnapshot.fromString('<script setup lang="ts"></script>');
@@ -146,16 +149,18 @@ function baseCreate(ts, getCommandLine, checkerOptions, rootPath, globalComponen
146
149
  updateFile(fileName, text) {
147
150
  fileName = fileName.replace(windowsPathReg, '/');
148
151
  scriptSnapshots.set(fileName, ts.ScriptSnapshot.fromString(text));
152
+ // Ensure the file is referenced
153
+ fileNames.add(fileName);
149
154
  projectVersion++;
150
155
  },
151
156
  deleteFile(fileName) {
152
157
  fileName = fileName.replace(windowsPathReg, '/');
153
- fileNames = fileNames.filter(f => f !== fileName);
158
+ fileNames.delete(fileName);
154
159
  projectVersion++;
155
160
  },
156
161
  reload() {
157
162
  commandLine = getCommandLine();
158
- fileNames = commandLine.fileNames.map(path => path.replace(windowsPathReg, '/'));
163
+ fileNames = new Set(commandLine.fileNames.map(path => path.replace(windowsPathReg, '/')));
159
164
  this.clearCache();
160
165
  },
161
166
  clearCache() {
@@ -628,7 +633,7 @@ function readVueComponentDefaultProps(root, printer, ts) {
628
633
  if (initializer) {
629
634
  const expText = printer?.printNode(ts.EmitHint.Expression, initializer, ast) ?? initializer.getText(ast);
630
635
  result[name] = {
631
- default: expText
636
+ default: expText,
632
637
  };
633
638
  }
634
639
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-component-meta",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@volar/typescript": "2.4.14",
17
- "@vue/language-core": "3.0.0-beta.1",
17
+ "@vue/language-core": "3.0.0-beta.3",
18
18
  "path-browserify": "^1.0.1"
19
19
  },
20
20
  "peerDependencies": {
@@ -26,5 +26,5 @@
26
26
  "@types/path-browserify": "^1.0.1",
27
27
  "vue-component-type-helpers": "3.0.0-beta.1"
28
28
  },
29
- "gitHead": "7a2ea48123679387d7095a81ac49cfc667aeeabb"
29
+ "gitHead": "17e3beabc13e9eb59a82fb1a9f0252fd6685e444"
30
30
  }