{"name":"@astrojs/compiler","version":"0.1.0-canary.33","_id":"@astrojs/compiler@0.1.0-canary.33","dist":{"shasum":"4d4b67737d2744cfa595414026d34422a42205f3","tarball":"http://registry-npm.ywwl.com/@astrojs/compiler/download/@astrojs/compiler-0.1.0-canary.33.tgz","fileCount":18,"integrity":"sha512-YIJdacxw0ra0D9yd4WwRzpWCrhEeyXwTSLPJ3ZwyZb/KTRibKZ9Doa6jy6/Qdiyeymr384t96/ONcQ55/a2X7A==","signatures":[{"sig":"MEUCIQCKVTSu0Yoj4y1TR7ONz0qf8ASx5QhG+Eb4tddnUlQ20AIgenOCTpMjlNWaQaee6a/tdxZuR/iINVuRLEFs/RKXpAU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":629907,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMppoCRA9TVsSAnZWagAAca8P/jO0dFadw98xnBt6a5LR\nwYf1eiaiH7GFC6NVnUHaeUS59wzuL9C86usw7bSyKu2mL6lKUQkQtAl9XiZ8\nNhxEhhIHmyvT2JElEqx32/zDSPPcMtrqKCNfya7Kfjv+1VngzmS7OSDAJ/Uw\n4vGpuqf/T3A/t+a9I8GF4IIrhXO7PxFXiiQ2T/ibOLQBut+5T51Fo3yjAJ2p\nD4QHJTU9/lQPJqm5NGIBbC6mGrSu6tKaRUgz5Yhl8ikwO5A6SybhPBlbDGhh\nRjGdq9e8QoHdCqj0laM0pYRdw1ltClvWgLmylvn8iJot12pY4HwIfvj1yyI+\nvWvMJmzuz8E4T7EpBZzaUsiUTK/YZeNZsnpTv/jH7/bMO5dUXVGK3CSDHqC0\n1bPEwUN+pbkHwSLz6iRPVHasHSUD7sT60m6eg1ppzd+eGBmGfLaSYe7gE0AA\nEaJQWCnHT/1CSGHbNZfnM1+4ITByZjdjte/HtEfwr2gaj0++tE/WpmKPBnKh\nevfyDSyNhhKt0HucajDT/WnNqYApJjwZeN2zGeF6NSHKgExU9dxlR2Lz8zLy\n4t3GShPJYzKwDgYiODCLOnuJDGC8tucs/MLyM4ZlVs60TWp+ebYOhq7pcwoC\nr0qIRmZ/Z0DLkidRFNkzuruo3xNCGqMdpbXgaz6TTXN8C5pRD5fHGJUAa3HF\nVls8\r\n=s/MT\r\n-----END PGP SIGNATURE-----\r\n","size":229622,"noattachment":false,"key":"/@astrojs/compiler/-/@astrojs/compiler-0.1.0-canary.33.tgz"},"main":"./node/index.js","type":"module","volta":{"node":"16.6.2"},"exports":{".":{"import":"./node/index.js","browser":"./browser/index.js","default":"./browser/index.js"},"./internal":"./shared/shim.js","./astro.wasm":"./astro.wasm"},"scripts":{"build":"tsc -p .","prepublish":"npm run build"},"_npmUser":{"name":"natemoo-re","email":"nate@natemoo.re"},"_npmVersion":"7.5.2","description":"Experimental WASM compiler for Astro.","directories":{},"_nodeVersion":"16.6.2","dependencies":{"typescript":"^4.3.5"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^16.4.12"},"_npmOperationalInternal":{"tmp":"tmp/compiler_0.1.0-canary.33_1630706280819_0.23043924658157966","host":"s3://npm-registry-packages"},"readme":"# Astro Compiler\n\nAstro’s [Go](https://golang.org/) + WASM compiler.\n\n## Install\n\n```\nnpm install @astrojs/compiler\n```\n\n## Usage\n\n#### Transform `.astro` to valid TypeScript\n\nThe Astro compiler can convert `.astro` syntax to a TypeScript Module whose default export generates HTML.\n\n**Some notes**...\n\n- TypeScript is valid `.astro` syntax! The output code may need an additional post-processing step to generate valid JavaScript.\n- `.astro` files rely on a server implementation exposed as `astro/runtime/server/index.js` in the Node ecosystem. Other runtimes currently need to bring their own rendering implementation and reference it via `internalURL`. This is a pain point we're looking into fixing.\n\n```js\nimport { transform } from '@astrojs/compiler';\n\nconst result = await transform(source, {\n  filename: '/Users/astro/Code/project/src/pages/index.astro',\n  sourcemap: 'both',\n  internalURL: 'astro/runtime/server/index.js',\n});\n```\n\n#### Parse `.astro` and return an AST\n\nThe Astro compiler can emit an AST using the `parse` method.\n\n**Some notes**...\n\n- Position data is currently incomplete and in some cases incorrect. We're working on it!\n- A `TextNode` can represent both HTML `text` and JavaScript/TypeScript source code.\n- The `@astrojs/compiler/utils` entrypoint exposes a `walk` function that can be used to traverse the AST. It also exposes the `is` helper which can be used as guards to derive the proper types for each `node`.\n\n```js\nimport { parse } from '@astrojs/compiler';\nimport { walk, is } from '@astrojs/compiler/utils';\n\nconst result = await parse(source, {\n  position: false, // defaults to `true`\n});\n\nwalk(result.ast, (node) => {\n  // `tag` nodes are `element` | `custom-element` | `component`\n  if (is.tag(node)) {\n    console.log(node.name);\n  }\n});\n```\n\n## Develop\n\n### VSCode / CodeSpaces\n\nA `devcontainer` configuration is available for use with VSCode's [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) and GitHub CodeSpaces.\n\n## Contributing\n\n[CONTRIBUTING.md](/CONTRIBUTING.md)\n","publish_time":1630706280996,"maintainers":[{"name":"natemoo-re","email":"nate@natemoo.re"},{"name":"fredkschott","email":"fkschott@gmail.com"},{"name":"matthewp","email":"matthew@matthewphillips.info"}],"_cnpm_publish_time":1630706280996,"dist-tags":{"beta":"3.0.0-beta.1","canary":"0.1.0-canary.36","latest":"4.0.0","metadata-preview":"0.16.0-metadata-preview","next":"0.20.0-next.2","next--compact":"0.0.0-compact-20231220212312","next--dual":"0.0.0-dual-20230531170756","next--dynamic-slot-names":"0.0.0-dynamic-slot-names-20240111152903","next--err-jsx-comments-in-expr":"0.0.0-err-jsx-comments-in-expr-20231218110825","next--escaped-slash-tsx":"0.0.0-escaped-slash-tsx-20231227120419","next--fragment-in-tr-issue":"0.0.0-fragment-in-tr-issue-20231223214149","next--github-actions":"0.0.0-github-actions-20240228180311","next--head-body-content":"0.0.0-head-body-content-20240329184853","next--head-bubbling":"0.0.0-head-bubbling-20230216202235","next--head-metadata":"0.0.0-head-metadata-20230316175054","next--join-base":"0.0.0-join-base-20221208164627","next--jsx-attr-issue":"0.0.0-jsx-attr-issue-20231224202721","next--literal":"0.0.0-literal-20240329135330","next--literal-parsing":"0.0.0-literal-parsing-20240308150251","next--map-export":"0.0.0-map-export-20230418133923","next--mk-slot-expr-fix":"0.0.0-mk-slot-expr-fix-20240130083013","next--module-id":"0.0.0-module-id-20221205161912","next--namespaced-attribute-nospace":"0.0.0-namespaced-attribute-nospace-20230220235307","next--next-result-create-astro":"0.0.0-next-result-create-astro-20250926081949","next--no-panic":"0.0.0-no-panic-20231221205336","next--propagation-metadata":"0.0.0-propagation-metadata-20230907164537","next--render-script":"0.0.0-render-script-20251003120459","next--scopedStyleStrategy":"0.0.0-scopedStyleStrategy-20230501165917","next--script-order":"0.0.0-script-order-20251002140654","next--server-islands":"0.0.0-server-islands-20240620184241","next--set-directive-fix":"0.0.0-set-directive-fix-20230222151355","next--slot-pass":"0.0.0-slot-pass-20230206210453","next--slot-stream":"0.0.0-slot-stream-20230406193056","next--sourcemap":"0.0.0-sourcemap-20230103195910","next--sync":"0.0.0-sync-20230418131144","next--table-tr-expr-issue":"0.0.0-table-tr-expr-issue-20231223194846","next--teardown":"0.0.0-teardown-20230228094908","next--test-non-admin-snapshot":"0.0.0-test-non-admin-snapshot-20240308150815","next--transition-reload":"0.0.0-transition-reload-20240211162919","next--tsx-comments-whitespace":"0.0.0-tsx-comments-whitespace-20231228223836","next--tsx-prefix":"0.0.0-tsx-prefix-20231229054418","next--view-transitions":"0.0.0-view-transitions-20230731144215","next--wasm":"0.11.0-next--wasm.0","next--win":"0.0.0-win-20221104182719","next--windows":"0.0.0-windows-20221104181455","no-canonical":"0.19.0-pre.0","pre":"0.15.2-pre.0","render-head-pre":"0.17.0-pre.4","view-transitions":"1.7.0-pre.2"}}