{"name":"@vue/language-plugin-pug","version":"3.2.8","license":"MIT","_id":"@vue/language-plugin-pug@3.2.8","maintainers":[{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"},{"name":"kazariex","email":"mimorimaboroshi@gmail.com"}],"homepage":"https://github.com/vuejs/language-tools#readme","bugs":{"url":"https://github.com/vuejs/language-tools/issues"},"dist":{"shasum":"6a24fb49e6183f1246c5ce47f75be3b78d82c8a6","tarball":"http://registry-npm.ywwl.com/@vue/language-plugin-pug/download/@vue/language-plugin-pug-3.2.8.tgz","fileCount":9,"integrity":"sha512-wF0RShZf/oY5wZjVZNsrNIuqNIKIxKA7UEVmGUIjRpHh0q6RwqzawaAeUu7Zp/TozO0rqGp0rfZRSyydhUF/9g==","signatures":[{"sig":"MEUCIFmsLnyTxQ0Ly/xKIiu27pX98h1lt0vdyhR2dMYFku92AiEAiHborJjRhnaPb1/tA8SM6wBYj7Nb2syloJ65u50jfaE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@vue%2flanguage-plugin-pug@3.2.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21554,"size":6265,"noattachment":false,"key":"/@vue/language-plugin-pug/-/@vue/language-plugin-pug-3.2.8.tgz"},"types":"./index.d.ts","gitHead":"618bd6bfb19729726787df7b52fccda72c888c95","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:098685e0-a98b-431c-92d9-9afbade89089"}},"repository":{"url":"git+https://github.com/vuejs/language-tools.git","type":"git","directory":"packages/language-plugin-pug"},"_npmVersion":"lerna/5.2.1/node@v24.14.1+x64 (linux)","description":"<p>   <a href=\"https://www.npmjs.com/package/@vue/language-plugin-pug\"><img src=\"https://img.shields.io/npm/v/@vue/language-plugin-pug.svg?labelColor=18181B&color=1584FC\" alt=\"NPM version\"></a>   <a href=\"https://github.com/vuejs/language-tools/blob/maste","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"pug-lexer":"^5.0.1","pug-parser":"^6.0.0","muggle-string":"^0.4.1","@volar/source-map":"2.4.28","vscode-languageserver-textdocument":"^1.0.12"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.10.4","@vue/compiler-dom":"^3.5.0","@vue/language-core":"3.2.8"},"_npmOperationalInternal":{"tmp":"tmp/language-plugin-pug_3.2.8_1777883384966_0.7267623529578087","host":"s3://npm-registry-packages-npm-production"},"readme":"# @vue/language-plugin-pug\n\n<p>\n  <a href=\"https://www.npmjs.com/package/@vue/language-plugin-pug\"><img src=\"https://img.shields.io/npm/v/@vue/language-plugin-pug.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\nA Pug template language plugin for Vue Language Tools, enabling the use of `<template lang=\"pug\">` in Vue SFCs.\n\n## Installation\n\n```bash\nnpm install @vue/language-plugin-pug --save-dev\n```\n\n## Configuration\n\nAdd this plugin in `tsconfig.json`:\n\n```jsonc\n{\n  \"vueCompilerOptions\": {\n    \"plugins\": [\"@vue/language-plugin-pug\"]\n  }\n}\n```\n\n## Usage\n\nAfter configuration, you can use Pug syntax in Vue components:\n\n```vue\n<template lang=\"pug\">\ndiv.container\n  h1 {{ title }}\n  p {{ description }}\n  button(@click=\"handleClick\") Click me\n</template>\n\n<script setup lang=\"ts\">\nconst title = 'Hello'\nconst description = 'World'\nconst handleClick = () => console.log('clicked')\n</script>\n```\n\n## Features\n\nThis plugin implements the `VueLanguagePlugin` interface, providing:\n\n- **`getEmbeddedCodes`** - Identifies `<template lang=\"pug\">` blocks\n- **`resolveEmbeddedCode`** - Extracts Pug content as embedded code\n- **`compileSFCTemplate`** - Compiles Pug to HTML, then parses it into an AST using `@vue/compiler-dom`\n\n## How it Works\n\n1. Uses `pug-lexer` to convert Pug syntax into tokens\n2. Uses `pug-parser` to parse tokens into an AST\n3. Traverses the AST to generate HTML while building a source map\n4. Uses `@vue/compiler-dom.parse` to parse the HTML\n5. Uses `@vue/compiler-dom.transform` to transform the AST\n6. Maps error and warning positions back to the original Pug code via the source map\n\n## Related Packages\n\n- [`@vue/language-core`](../language-core) - Core module\n\n## License\n\n[MIT](https://github.com/vuejs/language-tools/blob/master/LICENSE) License\n","publish_time":1777883385108,"_cnpm_publish_time":1777883385108,"dist-tags":{"alpha":"4.0.0-alpha.3","latest":"3.3.14","v3.0":"3.0.11"}}