@volar/vue-language-core
Advanced tools
Comparing version 1.0.0-beta.8 to 1.0.0-rc.0
@@ -10,5 +10,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _a; | ||
const downgradePropsAndEmitsToSetupReturnOnScriptSetup = vueCompilerOptions.experimentalDowngradePropsAndEmitsToSetupReturnOnScriptSetup === 'onlyJs' | ||
? lang === 'js' || lang === 'jsx' | ||
: !!vueCompilerOptions.experimentalDowngradePropsAndEmitsToSetupReturnOnScriptSetup; | ||
const bypassDefineComponent = vueCompilerOptions.bypassDefineComponentToExposePropsAndEmitsForJsScriptSetupComponents && lang === 'js' || lang === 'jsx'; | ||
const vueVersion = (_a = vueCompilerOptions.target) !== null && _a !== void 0 ? _a : 3; | ||
@@ -130,9 +128,7 @@ const vueLibName = (0, shared_2.getVueLibraryName)(vueVersion); | ||
} | ||
const warpperEnabled = vueCompilerOptions.experimentalComponentOptionsWrapperEnable === true | ||
|| (vueCompilerOptions.experimentalComponentOptionsWrapperEnable === 'onlyJs' && (lang === 'js' || lang === 'jsx')); | ||
if (isExportRawObject && warpperEnabled && (scriptRanges === null || scriptRanges === void 0 ? void 0 : scriptRanges.exportDefault)) { | ||
if (isExportRawObject && vueCompilerOptions.optionsWrapper.length && (scriptRanges === null || scriptRanges === void 0 ? void 0 : scriptRanges.exportDefault)) { | ||
addVirtualCode('script', 0, scriptRanges.exportDefault.expression.start); | ||
codeGen.push(vueCompilerOptions.experimentalComponentOptionsWrapper[0]); | ||
codeGen.push(vueCompilerOptions.optionsWrapper[0]); | ||
addVirtualCode('script', scriptRanges.exportDefault.expression.start, scriptRanges.exportDefault.expression.end); | ||
codeGen.push(vueCompilerOptions.experimentalComponentOptionsWrapper[1]); | ||
codeGen.push(vueCompilerOptions.optionsWrapper[1]); | ||
addVirtualCode('script', scriptRanges.exportDefault.expression.end, sfc.script.content.length); | ||
@@ -251,3 +247,3 @@ } | ||
} | ||
if (!downgradePropsAndEmitsToSetupReturnOnScriptSetup) { | ||
if (!bypassDefineComponent) { | ||
if (scriptSetupRanges.propsRuntimeArg || scriptSetupRanges.propsTypeArg) { | ||
@@ -289,3 +285,3 @@ codeGen.push(`props: (`); | ||
codeGen.push(`return {\n`); | ||
if (downgradePropsAndEmitsToSetupReturnOnScriptSetup) { | ||
if (bypassDefineComponent) { | ||
// fill $props | ||
@@ -379,3 +375,3 @@ if (scriptSetupRanges.propsTypeArg) { | ||
// fill ctx from props | ||
if (downgradePropsAndEmitsToSetupReturnOnScriptSetup) { | ||
if (bypassDefineComponent) { | ||
if (scriptSetupRanges.propsAssignName) { | ||
@@ -382,0 +378,0 @@ codeGen.push(`...${scriptSetupRanges.propsAssignName},\n`); |
@@ -16,11 +16,12 @@ import * as embedded from '@volar/language-core'; | ||
skipTemplateCodegen: boolean; | ||
dataAttributes: string[]; | ||
htmlAttributes: string[]; | ||
optionsWrapper: [string, string] | []; | ||
plugins: string[]; | ||
experimentalComponentOptionsWrapper: [string, string]; | ||
experimentalComponentOptionsWrapperEnable: boolean | 'onlyJs'; | ||
narrowingTypesInInlineHandlers: boolean; | ||
bypassDefineComponentToExposePropsAndEmitsForJsScriptSetupComponents: boolean; | ||
experimentalRuntimeMode: 'runtime-dom' | 'runtime-uni-app'; | ||
experimentalDowngradePropsAndEmitsToSetupReturnOnScriptSetup: boolean | 'onlyJs'; | ||
experimentalTemplateCompilerOptions: any; | ||
experimentalTemplateCompilerOptionsRequirePath: string | undefined; | ||
experimentalResolveStyleCssClasses: 'scoped' | 'always' | 'never'; | ||
experimentalAllowTypeNarrowingInInlineHandlers: boolean; | ||
} | ||
@@ -27,0 +28,0 @@ export type VueLanguagePlugin = (ctx: { |
@@ -39,9 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
function resolveVueCompilerOptions(vueOptions) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
const target = (_a = vueOptions.target) !== null && _a !== void 0 ? _a : 3; | ||
return Object.assign(Object.assign({}, vueOptions), { target, jsxTemplates: (_b = vueOptions.jsxTemplates) !== null && _b !== void 0 ? _b : false, strictTemplates: (_c = vueOptions.strictTemplates) !== null && _c !== void 0 ? _c : false, skipTemplateCodegen: (_d = vueOptions.skipTemplateCodegen) !== null && _d !== void 0 ? _d : false, plugins: (_e = vueOptions.plugins) !== null && _e !== void 0 ? _e : [], | ||
return Object.assign(Object.assign({}, vueOptions), { target, jsxTemplates: (_b = vueOptions.jsxTemplates) !== null && _b !== void 0 ? _b : false, strictTemplates: (_c = vueOptions.strictTemplates) !== null && _c !== void 0 ? _c : false, skipTemplateCodegen: (_d = vueOptions.skipTemplateCodegen) !== null && _d !== void 0 ? _d : false, dataAttributes: (_e = vueOptions.dataAttributes) !== null && _e !== void 0 ? _e : ['data-*'], htmlAttributes: (_f = vueOptions.htmlAttributes) !== null && _f !== void 0 ? _f : ['aria-*'], optionsWrapper: (_g = vueOptions.optionsWrapper) !== null && _g !== void 0 ? _g : (target >= 2.7 | ||
? [`(await import('vue')).defineComponent(`, `)`] | ||
: [`(await import('vue')).default.extend(`, `)`]), narrowingTypesInInlineHandlers: (_h = vueOptions.narrowingTypesInInlineHandlers) !== null && _h !== void 0 ? _h : false, plugins: (_j = vueOptions.plugins) !== null && _j !== void 0 ? _j : [], bypassDefineComponentToExposePropsAndEmitsForJsScriptSetupComponents: (_k = vueOptions.bypassDefineComponentToExposePropsAndEmitsForJsScriptSetupComponents) !== null && _k !== void 0 ? _k : true, | ||
// experimental | ||
experimentalComponentOptionsWrapper: (_f = vueOptions.experimentalComponentOptionsWrapper) !== null && _f !== void 0 ? _f : (target >= 2.7 | ||
? [`(await import('vue')).defineComponent(`, `)`] | ||
: [`(await import('vue')).default.extend(`, `)`]), experimentalComponentOptionsWrapperEnable: (_g = vueOptions.experimentalComponentOptionsWrapperEnable) !== null && _g !== void 0 ? _g : 'onlyJs', experimentalRuntimeMode: (_h = vueOptions.experimentalRuntimeMode) !== null && _h !== void 0 ? _h : 'runtime-dom', experimentalDowngradePropsAndEmitsToSetupReturnOnScriptSetup: (_j = vueOptions.experimentalDowngradePropsAndEmitsToSetupReturnOnScriptSetup) !== null && _j !== void 0 ? _j : 'onlyJs', experimentalTemplateCompilerOptions: (_k = vueOptions.experimentalTemplateCompilerOptions) !== null && _k !== void 0 ? _k : {}, experimentalTemplateCompilerOptionsRequirePath: (_l = vueOptions.experimentalTemplateCompilerOptionsRequirePath) !== null && _l !== void 0 ? _l : undefined, experimentalResolveStyleCssClasses: (_m = vueOptions.experimentalResolveStyleCssClasses) !== null && _m !== void 0 ? _m : 'scoped', experimentalAllowTypeNarrowingInInlineHandlers: (_o = vueOptions.experimentalAllowTypeNarrowingInInlineHandlers) !== null && _o !== void 0 ? _o : false }); | ||
experimentalRuntimeMode: (_l = vueOptions.experimentalRuntimeMode) !== null && _l !== void 0 ? _l : 'runtime-dom', experimentalTemplateCompilerOptions: (_m = vueOptions.experimentalTemplateCompilerOptions) !== null && _m !== void 0 ? _m : {}, experimentalTemplateCompilerOptionsRequirePath: (_o = vueOptions.experimentalTemplateCompilerOptionsRequirePath) !== null && _o !== void 0 ? _o : undefined, experimentalResolveStyleCssClasses: (_p = vueOptions.experimentalResolveStyleCssClasses) !== null && _p !== void 0 ? _p : 'scoped' }); | ||
} | ||
@@ -48,0 +48,0 @@ exports.resolveVueCompilerOptions = resolveVueCompilerOptions; |
{ | ||
"name": "@volar/vue-language-core", | ||
"version": "1.0.0-beta.8", | ||
"version": "1.0.0-rc.0", | ||
"main": "out/index.js", | ||
@@ -15,8 +15,5 @@ "license": "MIT", | ||
}, | ||
"devDependencies": { | ||
"typescript": "beta" | ||
}, | ||
"dependencies": { | ||
"@volar/language-core": "1.0.0-beta.8", | ||
"@volar/source-map": "1.0.0-beta.8", | ||
"@volar/language-core": "1.0.0-rc.0", | ||
"@volar/source-map": "1.0.0-rc.0", | ||
"@vue/compiler-dom": "^3.2.38", | ||
@@ -26,5 +23,9 @@ "@vue/compiler-sfc": "^3.2.38", | ||
"@vue/shared": "^3.2.38", | ||
"minimatch": "^5.1.0", | ||
"vue-template-compiler": "^2.7.10" | ||
}, | ||
"gitHead": "7c437b60144d4160410eb96e644e09665daeee6d" | ||
"devDependencies": { | ||
"@types/minimatch": "^5.1.2" | ||
}, | ||
"gitHead": "bababc1749ade3db8ea967fb16130fa6b09d4992" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
224237
8
4882
+ Addedminimatch@^5.1.0
+ Added@volar/language-core@1.0.0-rc.0(transitive)
+ Added@volar/source-map@1.0.0-rc.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedminimatch@5.1.6(transitive)
- Removed@volar/language-core@1.0.0-beta.8(transitive)
- Removed@volar/source-map@1.0.0-beta.8(transitive)
Updated@volar/source-map@1.0.0-rc.0