@tsslint/cli 1.5.6 → 1.5.8

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/index.js CHANGED
@@ -21,6 +21,7 @@ const lightYellow = (s) => '\x1b[93m' + s + _reset;
21
21
  // https://talyian.github.io/ansicolors/
22
22
  const tsColor = (s) => '\x1b[34m' + s + _reset;
23
23
  const vueColor = (s) => '\x1b[32m' + s + _reset;
24
+ const vueVineColor = (s) => '\x1b[38;5;48m' + s + _reset;
24
25
  const mdxColor = (s) => '\x1b[33m' + s + _reset;
25
26
  const astroColor = (s) => '\x1b[38;5;209m' + s + _reset;
26
27
  let threads = 1;
@@ -55,6 +56,9 @@ class Project {
55
56
  if (this.languages.includes('vue')) {
56
57
  labels.push(vueColor('Vue'));
57
58
  }
59
+ if (this.languages.includes('vue-vine')) {
60
+ labels.push(vueVineColor('Vue Vine'));
61
+ }
58
62
  if (this.languages.includes('mdx')) {
59
63
  labels.push(mdxColor('MDX'));
60
64
  }
@@ -103,6 +107,8 @@ class Project {
103
107
  '--projects',
104
108
  '--vue-project',
105
109
  '--vue-projects',
110
+ '--vue-vine-project',
111
+ '--vue-vine-projects',
106
112
  '--mdx-project',
107
113
  '--mdx-projects',
108
114
  '--astro-project',
@@ -114,6 +120,9 @@ class Project {
114
120
  options: [{
115
121
  label: 'Vue',
116
122
  value: 'vue',
123
+ }, {
124
+ label: 'Vue Vine',
125
+ value: 'vue-vine',
117
126
  }, {
118
127
  label: 'MDX',
119
128
  value: 'mdx',
@@ -161,11 +170,9 @@ class Project {
161
170
  command += ` --${language}-project ` + selectedTsconfigs.join(' ');
162
171
  }
163
172
  }
164
- clack.log.info(`Running: ${purple(command)}`);
173
+ clack.log.info(`${darkGray('Command:')} ${purple(command)}`);
165
174
  for (let tsconfig of selectedTsconfigs) {
166
- if (!tsconfig.startsWith('.')) {
167
- tsconfig = `./${tsconfig}`;
168
- }
175
+ tsconfig = resolvePath(tsconfig);
169
176
  tsconfigAndLanguages.set(tsconfig, languages);
170
177
  }
171
178
  }
@@ -179,6 +186,10 @@ class Project {
179
186
  projectFlags: ['--vue-project', '--vue-projects'],
180
187
  language: 'vue',
181
188
  },
189
+ {
190
+ projectFlags: ['--vue-vine-project', '--vue-vine-projects'],
191
+ language: 'vue-vine',
192
+ },
182
193
  {
183
194
  projectFlags: ['--mdx-project', '--mdx-projects'],
184
195
  projectsFlag: '--mdx-projects',
@@ -32,6 +32,43 @@ async function load(tsconfig, languages) {
32
32
  const vueLanguagePlugin = vue.createVueLanguagePlugin(ts, commonLine.options, commonLine.vueOptions, fileName => fileName);
33
33
  plugins.push(vueLanguagePlugin);
34
34
  }
35
+ if (languages.includes('vue-vine')) {
36
+ let vue;
37
+ let vueVine;
38
+ let pkgPath;
39
+ if (pkgPath = findPackageJson('@vue-vine/language-service')) {
40
+ const pkgDir = path.dirname(pkgPath);
41
+ vueVine = require('@vue-vine/language-service');
42
+ vue = require(require.resolve('@vue/language-core', { paths: [pkgDir] }));
43
+ }
44
+ else if (pkgPath = findPackageJson('vue-vine-tsc')) {
45
+ const pkgDir = path.dirname(pkgPath);
46
+ vue = require(require.resolve('@vue/language-core', { paths: [pkgDir] }));
47
+ vueVine = require(require.resolve('@vue/language-core', { paths: [pkgDir] }));
48
+ }
49
+ else {
50
+ const pkg = ts.findConfigFile(path.dirname(tsconfig), ts.sys.fileExists, 'package.json');
51
+ if (pkg) {
52
+ throw new Error('Please install @vue-vine/language-service or vue-vine-tsc to ' + path.relative(process.cwd(), pkg));
53
+ }
54
+ else {
55
+ throw new Error('Please install @vue-vine/language-service or vue-vine-tsc for ' + path.relative(process.cwd(), tsconfig));
56
+ }
57
+ }
58
+ const commonLine = vue.createParsedCommandLine(ts, ts.sys, tsconfig, true);
59
+ const globalTypesFilePath = vueVine.setupGlobalTypes(path.dirname(tsconfig), commonLine.vueOptions, ts.sys);
60
+ if (globalTypesFilePath) {
61
+ commonLine.vueOptions.__setupedGlobalTypes = {
62
+ absolutePath: globalTypesFilePath,
63
+ };
64
+ }
65
+ plugins.push(vue.createVueLanguagePlugin(ts, commonLine.options, commonLine.vueOptions, id => id));
66
+ plugins.push(vueVine.createVueVineLanguagePlugin(ts, {
67
+ compilerOptions: commonLine.options,
68
+ vueCompilerOptions: commonLine.vueOptions,
69
+ target: 'tsc',
70
+ }));
71
+ }
35
72
  if (languages.includes('mdx')) {
36
73
  let mdx;
37
74
  try {
@@ -69,10 +106,7 @@ async function load(tsconfig, languages) {
69
106
  cache.set(tsconfig, plugins);
70
107
  return plugins;
71
108
  function findPackageJson(pkgName) {
72
- try {
73
- return require.resolve(`${pkgName}/package.json`, { paths: [path.dirname(tsconfig)] });
74
- }
75
- catch { }
109
+ return ts.findConfigFile(path.dirname(tsconfig), ts.sys.fileExists, `node_modules/${pkgName}/package.json`);
76
110
  }
77
111
  }
78
112
  //# sourceMappingURL=languagePlugins.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/cli",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsslint": "./bin/tsslint.js"
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@clack/prompts": "^0.8.2",
19
- "@tsslint/config": "1.5.6",
20
- "@tsslint/core": "1.5.6",
19
+ "@tsslint/config": "1.5.8",
20
+ "@tsslint/core": "1.5.8",
21
21
  "@volar/language-core": "~2.4.0",
22
22
  "@volar/typescript": "~2.4.0",
23
23
  "glob": "^10.4.1",
@@ -27,6 +27,8 @@
27
27
  "typescript": "*"
28
28
  },
29
29
  "devDependencies": {
30
+ "@vue-vine/language-service": "latest",
30
31
  "@vue/language-core": "latest"
31
- }
32
+ },
33
+ "gitHead": "a164ff719def41ce69256fd7260e9e0fb1017e48"
32
34
  }