@vue/language-core 3.2.3 → 3.2.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/lib/languagePlugin.js +1 -0
- package/lib/plugins.js +1 -1
- package/lib/types.d.ts +2 -1
- package/package.json +2 -2
package/lib/languagePlugin.js
CHANGED
|
@@ -64,6 +64,7 @@ function createVueLanguagePlugin(ts, compilerOptions, vueCompilerOptions, asFile
|
|
|
64
64
|
},
|
|
65
65
|
compilerOptions,
|
|
66
66
|
vueCompilerOptions,
|
|
67
|
+
config: {},
|
|
67
68
|
};
|
|
68
69
|
const plugins = (0, plugins_1.createPlugins)(pluginContext);
|
|
69
70
|
const fileRegistry = getVueFileRegistry(compilerOptions, vueCompilerOptions, plugins);
|
package/lib/plugins.js
CHANGED
|
@@ -56,7 +56,7 @@ function createPlugins(pluginContext) {
|
|
|
56
56
|
.flatMap(plugin => {
|
|
57
57
|
try {
|
|
58
58
|
const moduleConfig = plugin.__moduleConfig ?? {};
|
|
59
|
-
const instance = plugin({ ...pluginContext,
|
|
59
|
+
const instance = plugin({ ...pluginContext, config: moduleConfig });
|
|
60
60
|
if (Array.isArray(instance)) {
|
|
61
61
|
for (let i = 0; i < instance.length; i++) {
|
|
62
62
|
instance[i].name ??= `${moduleConfig.name} (${i})`;
|
package/lib/types.d.ts
CHANGED
|
@@ -97,13 +97,14 @@ export interface VueLanguagePluginReturn {
|
|
|
97
97
|
}[];
|
|
98
98
|
resolveEmbeddedCode?(fileName: string, sfc: Sfc, embeddedFile: VueEmbeddedCode): void;
|
|
99
99
|
}
|
|
100
|
-
export type VueLanguagePlugin
|
|
100
|
+
export type VueLanguagePlugin<T extends Record<string, any> = {}> = (ctx: {
|
|
101
101
|
modules: {
|
|
102
102
|
typescript: typeof ts;
|
|
103
103
|
'@vue/compiler-dom': typeof CompilerDOM;
|
|
104
104
|
};
|
|
105
105
|
compilerOptions: ts.CompilerOptions;
|
|
106
106
|
vueCompilerOptions: VueCompilerOptions;
|
|
107
|
+
config: T;
|
|
107
108
|
}) => VueLanguagePluginReturn | VueLanguagePluginReturn[];
|
|
108
109
|
export interface SfcBlock {
|
|
109
110
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-core",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"@volar/typescript": "2.4.27",
|
|
29
29
|
"@vue/compiler-sfc": "^3.5.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "f0ede303fadb192a59068b4b667b0405523d24c8"
|
|
32
32
|
}
|