{"_id":"@vue/language-core@3.3.11","bugs":{"url":"https://github.com/vuejs/language-tools/issues"},"dist":{"shasum":"e5b6b5ad1fa1a37e032cf7668458cda7a5566b37","tarball":"http://registry-npm.ywwl.com/@vue/language-core/download/@vue/language-core-3.3.11.tgz","fileCount":154,"integrity":"sha512-QJmpliwAVpC/OxubIByPAhNzsQPRc8/gxlN2qnVzVfIMjMDz/9RnXRFoetjz5yEgXVXyp4LqhXq3V53PjmNzFw==","signatures":[{"sig":"MEUCIQCw0QcUIY/YD1XUyRB8uDWI2H3WBlOAiaqJ/7elDoJWAgIgI0kbrAA7DRyOMhlTr2cLAIhkYEjojv8HfzQ5hOw7jJo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD5UwILs2EX5dj4NFk4jjdMp4O1T4LkrwfBmLt9avV1igIhALFuZ070mcyxC5kbfRztyIWYRkYgpYa/ybLEHmk37bur"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@vue%2flanguage-core@3.3.11","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":390854,"size":72790,"noattachment":false,"key":"/@vue/language-core/-/@vue/language-core-3.3.11.tgz"},"name":"@vue/language-core","types":"./index.d.ts","gitHead":"f521b39b402ebaaa9ee70faf5a60a895544ed9e9","license":"MIT","scripts":{"generate-names":"node scripts/generate-names.js"},"version":"3.3.11","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2484c7ab-a2d1-43cc-b708-a916850a20f4"}},"homepage":"https://github.com/vuejs/language-tools#readme","repository":{"url":"git+https://github.com/vuejs/language-tools.git","type":"git","directory":"packages/language-core"},"_npmVersion":"lerna/5.6.0/node@v24.19.0+x64 (linux)","description":"<p>   <a href=\"https://www.npmjs.com/package/@vue/language-core\"><img src=\"https://img.shields.io/npm/v/@vue/language-core.svg?labelColor=18181B&color=1584FC\" alt=\"NPM version\"></a>   <a href=\"https://github.com/vuejs/language-tools/blob/master/LICENSE\"><","directories":{},"maintainers":[{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"},{"name":"kazariex","email":"mimorimaboroshi@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"picomatch":"^4.0.4","@vue/shared":"^3.5.0","alien-signals":"^3.2.1","muggle-string":"^0.4.1","path-browserify":"^1.0.1","@vue/compiler-dom":"^3.5.0","@volar/language-core":"2.4.28"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.0.1","@types/picomatch":"^4.0.3","@volar/typescript":"2.4.28","@vue/compiler-sfc":"^3.5.0","@types/path-browserify":"^1.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/language-core_3.3.11_1787306894400_0.8448932348069444"},"readme":"# @vue/language-core\n\n<p>\n  <a href=\"https://www.npmjs.com/package/@vue/language-core\"><img src=\"https://img.shields.io/npm/v/@vue/language-core.svg?labelColor=18181B&color=1584FC\" alt=\"NPM version\"></a>\n  <a href=\"https://github.com/vuejs/language-tools/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/vuejs/language-tools.svg?labelColor=18181B&color=1584FC\" alt=\"License\"></a>\n</p>\n\nThe core module for Vue Language Tools, responsible for parsing Vue Single File Components (SFCs) and transforming them into virtual code structures that TypeScript can understand. This package is a low-level dependency for `@vue/language-server` and `vue-tsc`.\n\n## Installation\n\n```bash\nnpm install @vue/language-core\n```\n\n## Core API\n\n### `createVueLanguagePlugin`\n\nCreates a Vue language plugin for integration with Volar language services.\n\n```typescript\nimport { createVueLanguagePlugin } from '@vue/language-core';\nimport type { LanguagePlugin } from '@volar/language-core';\nimport ts from 'typescript';\n\nconst plugin: LanguagePlugin<string> = createVueLanguagePlugin(\n  ts,\n  compilerOptions,    // ts.CompilerOptions\n  vueCompilerOptions, // VueCompilerOptions\n  (scriptId) => scriptId  // asFileName: Converts scriptId to a file name\n);\n```\n\n### `createParsedCommandLine`\n\nParses TypeScript and Vue compiler options from `tsconfig.json`.\n\n```typescript\nimport { createParsedCommandLine } from '@vue/language-core';\nimport ts from 'typescript';\n\nconst parsed = createParsedCommandLine(ts, ts.sys, '/path/to/tsconfig.json');\n// parsed.options: ts.CompilerOptions\n// parsed.vueOptions: VueCompilerOptions\n```\n\n### `parse`\n\nParses Vue SFC source code and returns an `SFCParseResult`.\n\n```typescript\nimport { parse } from '@vue/language-core';\n\nconst result = parse(`\n<template>\n  <div>{{ msg }}</div>\n</template>\n<script setup lang=\"ts\">\nconst msg = 'Hello'\n</script>\n`);\n\n// result.descriptor.template\n// result.descriptor.scriptSetup\n// result.descriptor.styles\n// result.errors\n```\n\n## `vueCompilerOptions`\n\nConfigure Vue compiler behavior through the `vueCompilerOptions` field in `tsconfig.json`:\n\n```jsonc\n{\n  \"compilerOptions\": { /* ... */ },\n  \"vueCompilerOptions\": {\n    \"target\": 3.5,\n    \"strictTemplates\": true,\n    \"plugins\": [\"@vue/language-plugin-pug\"]\n  }\n}\n```\n\n### File Handling Options\n\n| Option | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| `target` | `number \\| 'auto'` | `'auto'` | Vue version. `'auto'` reads from `node_modules/vue/package.json`. |\n| `extensions` | `string[]` | `['.vue']` | File extensions to be treated as Vue SFCs. |\n| `vitePressExtensions` | `string[]` | `[]` | File extensions to be treated as VitePress Markdown. |\n| `petiteVueExtensions` | `string[]` | `[]` | File extensions to be treated as Petite Vue HTML. |\n| `plugins` | `string[]` | `[]` | Custom language plugins, e.g., [`@vue/language-plugin-pug`](../language-plugin-pug). |\n\n### Type Checking Options\n\n| Option | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| `strictTemplates` | `boolean` | `false` | A convenience option that enables the four `check*` options below and `strictVModel`. |\n| `checkUnknownProps` | `boolean` | `false` | Check for unknown props. |\n| `checkUnknownEvents` | `boolean` | `false` | Check for unknown events. |\n| `checkUnknownComponents` | `boolean` | `false` | Check for unknown components. |\n| `checkUnknownDirectives` | `boolean` | `false` | Check for unknown directives. |\n| `strictVModel` | `boolean` | `false` | Strictly check v-model bindings. |\n| `strictCssModules` | `boolean` | `false` | Strictly check CSS Modules class names (not affected by `strictTemplates`). |\n\n### Advanced Options\n\n| Option | Type | Default | Description |\n| :--- | :--- | :--- | :--- |\n| `lib` | `string` | `'vue'` | Vue package name, used for generating import statements. |\n| `skipTemplateCodegen` | `boolean` | `false` | Skip virtual code generation for templates. |\n| `vapor` | `boolean` | `false` | Enable Vapor mode for all Vue SFCs. |\n| `fallthroughAttributes` | `boolean` | `false` | Enable type inference for fallthrough attributes. |\n| `checkRequiredFallthroughAttributes` | `boolean` | `false` | Check required fallthrough attributes. |\n| `jsxSlots` | `boolean` | `false` | Use JSX-style slots types. |\n| `dataAttributes` | `string[]` | `[]` | Allowed data-* attribute patterns. |\n| `htmlAttributes` | `string[]` | `['aria-*']` | Allowed HTML attribute patterns. |\n| `resolveStyleImports` | `boolean` | `false` | Resolve import statements in styles. |\n| `resolveStyleClassNames` | `boolean \\| 'scoped'` | `'scoped'` | Resolve class names in styles. |\n\n## Built-in Plugins\n\nThis package includes the following built-in plugins to handle different file types and blocks:\n\n### File Parsing Plugins\n\n| Plugin | Function | Controlled By |\n| :--- | :--- | :--- |\n| `file-vue` | Parses `.vue` files into an SFC structure. | `extensions` |\n| `file-md` | Parses Markdown files into an SFC structure. | `vitePressExtensions` |\n| `file-html` | Parses HTML files into an SFC structure. | `petiteVueExtensions` |\n\n### Virtual Code Generation Plugins\n\n| Plugin | Function |\n| :--- | :--- |\n| `vue-tsx` | Generates TypeScript virtual code from an SFC. |\n| `vue-template-html` | Compiles HTML templates. |\n| `vue-template-inline-ts` | Handles TypeScript expressions in templates. |\n| `vue-template-inline-css` | Handles inline styles in templates. |\n| `vue-style-css` | Compiles CSS styles. |\n| `vue-script-js` | Handles JavaScript script blocks. |\n\n### Embedded Code Extraction Plugins\n\n| Plugin | Function |\n| :--- | :--- |\n| `vue-sfc-template` | Extracts the `<template>` block. |\n| `vue-sfc-styles` | Extracts `<style>` blocks. |\n| `vue-sfc-scripts` | Extracts `<script>` blocks (for formatting). |\n| `vue-sfc-customblocks` | Extracts custom blocks. |\n\n## Related Packages\n\n- [`@vue/language-server`](../language-server) - Language Server\n- [`@vue/language-service`](../language-service) - Language Service\n- [`vue-tsc`](../tsc) - Command-line Type Checker\n\n## License\n\n[MIT](https://github.com/vuejs/language-tools/blob/master/LICENSE) License\n","publish_time":1787306894548,"_cnpm_publish_time":1787306894548,"dist-tags":{"alpha":"4.0.0-alpha.3","latest":"3.3.14","v3.0":"3.0.11"}}