{"name":"svelte2tsx","version":"0.7.28","keywords":["svelte","typescript"],"author":{"name":"David Pershouse"},"license":"MIT","_id":"svelte2tsx@0.7.28","maintainers":[{"name":"dummdidumm","email":"sholthausen@web.de"},{"name":"svelte-language-tools-deploy","email":"svelte-language-tools-deploy@orta.io"},{"name":"orta","email":"orta.therox@gmail.com"},{"name":"halfnelson","email":"dpershouse@gmail.com"}],"homepage":"https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx","bugs":{"url":"https://github.com/sveltejs/language-tools/issues"},"dist":{"shasum":"c8a9c05090e9b34e878aa57a1876c4403d1dcfee","tarball":"http://registry-npm.ywwl.com/svelte2tsx/download/svelte2tsx-0.7.28.tgz","fileCount":11,"integrity":"sha512-TJjA+kU8AnkyoprZPgQACMfTX8N0MA5NsIL//h9IuHOxmmaCLluqhcZU+fCkWipi5c/pooHLFOMpqjhq4v7JLQ==","signatures":[{"sig":"MEQCIAaC8SiYKNyHtiWjwWbtx09oYTJmggmK3WgRLk5gWe0mAiBrfvfjqv1vgVLkxbnzMB4RIBGSlh41YgQzRfLrsqGPzg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/svelte2tsx@0.7.28","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":750431,"size":159191,"noattachment":false,"key":"/svelte2tsx/-/svelte2tsx-0.7.28.tgz"},"main":"index.js","type":"commonjs","_from":"file:svelte2tsx-0.7.28.tgz","types":"index.d.ts","module":"index.mjs","scripts":{"dev":"rollup -c -w","test":"mocha test/test.ts","build":"rollup -c"},"_npmUser":{"name":"svelte-language-tools-deploy","email":"svelte-language-tools-deploy@orta.io"},"_resolved":"/tmp/0aeff3fb22e493f512d8c173ad67c41a/svelte2tsx-0.7.28.tgz","_integrity":"sha512-TJjA+kU8AnkyoprZPgQACMfTX8N0MA5NsIL//h9IuHOxmmaCLluqhcZU+fCkWipi5c/pooHLFOMpqjhq4v7JLQ==","repository":{"url":"git+https://github.com/sveltejs/language-tools.git#master","type":"git"},"_npmVersion":"10.8.2","description":"Convert Svelte components to TSX for type checking","directories":{},"_nodeVersion":"20.18.0","dependencies":{"dedent-js":"^1.0.1","pascal-case":"^3.1.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^9.2.0","tslib":"^2.4.0","rollup":"3.7.5","svelte":"~4.2.19","tiny-glob":"^0.2.6","periscopic":"^2.0.2","typescript":"~5.6.3","@types/node":"^18.0.0","@types/mocha":"^9.1.0","@types/unist":"^2.0.3","@types/vfile":"^3.0.2","magic-string":"^0.30.11","@types/estree":"^0.0.42","estree-walker":"^2.0.1","builtin-modules":"^3.3.0","source-map-support":"^0.5.16","@rollup/plugin-json":"^6.0.0","rollup-plugin-delete":"^2.0.0","@rollup/plugin-commonjs":"^24.0.0","@jridgewell/trace-mapping":"^0.3.25","@rollup/plugin-typescript":"^10.0.0","@jridgewell/sourcemap-codec":"^1.5.0","@rollup/plugin-node-resolve":"^15.0.0"},"peerDependencies":{"svelte":"^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0","typescript":"^4.9.4 || ^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/svelte2tsx_0.7.28_1732306070938_0.5281784921712742","host":"s3://npm-registry-packages"},"readme":"# svelte2tsx\n\nConverts [Svelte](https://svelte.dev) component source into TSX. The TSX can be type checked using the included `svelte-jsx.d.ts` and `svelte-shims.d.ts`.\n\n_This project only converts svelte to tsx, type checking is left to consumers of this plugin such as language services_\n\n```typescript\ntype SvelteCompiledToTsx = {\n    code: string;\n    map: import('magic-string').SourceMap;\n};\n\nexport default function svelte2tsx(svelte: string): SvelteCompiledToTsx;\n```\n\nFor example\n\nInput.svelte\n\n```svelte\n<script>\n    export let world = 'name';\n</script>\n\n<h1>hello {world}</h1>\n```\n\nwill produce this ugly but type checkable TSX\n\n```tsx\n<></>;\nfunction render() {\n    let world = 'name';\n    <>\n        <h1>hello {world}</h1>\n    </>;\n    return { props: { world }, slots: {}, events: {} };\n}\n\nexport default class _World_ extends __sveltets_2_createSvelte2TsxComponent(\n    __sveltets_2_partial(__sveltets_2_with_any_event(render))\n) {}\n```\n\nwith a v3 SourceMap back to the original source.\n\nFor more examples of the transformations, see the `test/**/samples` folders\n\n## Credits\n\n-   [halfnelson](https://github.com/halfnelson) for creating `svelte2tsx`\n-   [pushkine](https://github.com/pushkine) for creating the source mapping test infrastructure\n","publish_time":1732306071155,"_cnpm_publish_time":1732306071155,"dist-tags":{"latest":"0.7.63"}}