@vuecast/astro-module 0.0.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @vuecast/astro-module
2
+
3
+ Write Vue SFCs (instead of `.astro` pages) in Astro projects.
4
+
5
+ ## Documentation
6
+
7
+ For detailed setup instructions, configuration, and usage examples, please refer to the [main documentation](../../README.md#vuecastastro-module).
8
+
9
+ ## License
10
+
11
+ MIT
@@ -0,0 +1,8 @@
1
+ import { AstroIntegration } from 'astro';
2
+
3
+ interface VuecastAstroPluginOptions {
4
+ }
5
+
6
+ declare function vuecastAstroIntegration(options: VuecastAstroPluginOptions): AstroIntegration;
7
+
8
+ export { vuecastAstroIntegration as VuecastAstro, vuecastAstroIntegration as default };
@@ -0,0 +1,8 @@
1
+ import { AstroIntegration } from 'astro';
2
+
3
+ interface VuecastAstroPluginOptions {
4
+ }
5
+
6
+ declare function vuecastAstroIntegration(options: VuecastAstroPluginOptions): AstroIntegration;
7
+
8
+ export { vuecastAstroIntegration as VuecastAstro, vuecastAstroIntegration as default };
package/dist/index.mjs ADDED
@@ -0,0 +1,32 @@
1
+ function vuecastAstroIntegration(options) {
2
+ return {
3
+ name: "@vuecast/astro",
4
+ hooks: {
5
+ "astro:config:setup": async (params) => {
6
+ const { updateConfig, addPageExtension, addRenderer } = params;
7
+ addRenderer({
8
+ name: "vuecast:astro",
9
+ serverEntrypoint: "./node_modules/@astrojs/vue/dist/server.js"
10
+ });
11
+ addPageExtension(".vue");
12
+ updateConfig({
13
+ vite: {
14
+ plugins: [{
15
+ name: "vuecast-post",
16
+ async transform(code, id) {
17
+ if (!id.endsWith(".vue"))
18
+ return;
19
+ const regex = /(\]\))(;?\n?)$/;
20
+ const replacement = ",[Symbol.for('astro.needsHeadRendering'),true]$1";
21
+ code = code.replace(regex, replacement);
22
+ return code;
23
+ }
24
+ }]
25
+ }
26
+ });
27
+ }
28
+ }
29
+ };
30
+ }
31
+
32
+ export { vuecastAstroIntegration as VuecastAstro, vuecastAstroIntegration as default };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@vuecast/astro-module",
3
+ "version": "0.0.2-beta.0",
4
+ "type": "module",
5
+ "description": "Astro integration for Vue SFC pages",
6
+ "main": "./dist/index.mjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.cjs",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "unbuild",
21
+ "publish-beta": "npm run build && npm run increment-beta-version && npm publish --tag beta",
22
+ "increment-beta-version": "npm version prerelease --preid=beta"
23
+ },
24
+ "keywords": [
25
+ "vue",
26
+ "astro",
27
+ "sfc",
28
+ "meta-framework"
29
+ ],
30
+ "author": "",
31
+ "license": "MIT",
32
+ "devDependencies": {
33
+ "unbuild": "^2.0.0"
34
+ }
35
+ }