{"name":"@vue/language-plugin-pug","version":"2.0.16","license":"MIT","_id":"@vue/language-plugin-pug@2.0.16","maintainers":[{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"}],"homepage":"https://github.com/vuejs/language-tools#readme","bugs":{"url":"https://github.com/vuejs/language-tools/issues"},"dist":{"shasum":"623e7e37ededbff35a537e4045d1acd1e61004bc","tarball":"http://registry-npm.ywwl.com/@vue/language-plugin-pug/download/@vue/language-plugin-pug-2.0.16.tgz","fileCount":5,"integrity":"sha512-7fyq0qD7rUrOyGje8lfZWRYf5ezIqr1VoyzUckSbfST5Q0wM8lxKlwffbyOJ2TSLpYitVelSx/JLVcohBu06Ww==","signatures":[{"sig":"MEYCIQCELEjMRr6/yGAZBXAJYNi3oJv8/XGmvO0lK03y1U6X9QIhAMmY5D3vhNE5eNKCoky9UNm9HVXot82iwTY0MnDwQ0/D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4141,"size":1960,"noattachment":false,"key":"/@vue/language-plugin-pug/-/@vue/language-plugin-pug-2.0.16.tgz"},"types":"./index.d.ts","gitHead":"95b78c38cbf75481ebb59e11956b592346f01d92","_npmUser":{"name":"johnsoncodehk","email":"johnsoncodehk@gmail.com"},"repository":{"url":"git+https://github.com/vuejs/language-tools.git","type":"git","directory":"packages/language-plugin-pug"},"_npmVersion":"lerna/3.3.3/node@v18.19.0+arm64 (darwin)","description":"A `VueLanguagePlugin` to support `<template lang=\"pug\">` for `@vue/language-server`.","directories":{},"_nodeVersion":"18.19.0","dependencies":{"@volar/source-map":"~2.2.0","volar-service-pug":"0.0.42"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"latest","@vue/language-core":"2.0.16"},"_npmOperationalInternal":{"tmp":"tmp/language-plugin-pug_2.0.16_1714534719212_0.9141190520011895","host":"s3://npm-registry-packages"},"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":1714534719385,"_cnpm_publish_time":1714534719385,"dist-tags":{"alpha":"4.0.0-alpha.3","latest":"3.3.14","v3.0":"3.0.11"}}