Initial commit
This commit is contained in:
59
node_modules/@astrojs/vue/LICENSE
generated
vendored
Normal file
59
node_modules/@astrojs/vue/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Fred K. Schott
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/sveltejs/kit repository:
|
||||
|
||||
Copyright (c) 2020 [these people](https://github.com/sveltejs/kit/graphs/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
"""
|
||||
|
||||
"""
|
||||
This license applies to parts of the `packages/create-astro` and `packages/astro` subdirectories originating from the https://github.com/vitejs/vite repository:
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
"""
|
||||
38
node_modules/@astrojs/vue/README.md
generated
vendored
Normal file
38
node_modules/@astrojs/vue/README.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# @astrojs/vue 💚
|
||||
|
||||
This **[Astro integration][astro-integration]** enables server-side rendering and client-side hydration for your [Vue 3](https://vuejs.org/) components.
|
||||
|
||||
## Documentation
|
||||
|
||||
Read the [`@astrojs/vue` docs][docs]
|
||||
|
||||
## Support
|
||||
|
||||
- Get help in the [Astro Discord][discord]. Post questions in our `#support` forum, or visit our dedicated `#dev` channel to discuss current development and more!
|
||||
|
||||
- Check our [Astro Integration Documentation][astro-integration] for more on integrations.
|
||||
|
||||
- Submit bug reports and feature requests as [GitHub issues][issues].
|
||||
|
||||
## Contributing
|
||||
|
||||
This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! These links will help you get started:
|
||||
|
||||
- [Contributor Manual][contributing]
|
||||
- [Code of Conduct][coc]
|
||||
- [Community Guide][community]
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
Copyright (c) 2023–present [Astro][astro]
|
||||
|
||||
[astro]: https://astro.build/
|
||||
[docs]: https://docs.astro.build/en/guides/integrations-guide/vue/
|
||||
[contributing]: https://github.com/withastro/astro/blob/main/CONTRIBUTING.md
|
||||
[coc]: https://github.com/withastro/.github/blob/main/CODE_OF_CONDUCT.md
|
||||
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md
|
||||
[discord]: https://astro.build/chat/
|
||||
[issues]: https://github.com/withastro/astro/issues
|
||||
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
|
||||
2
node_modules/@astrojs/vue/dist/client.d.ts
generated
vendored
Normal file
2
node_modules/@astrojs/vue/dist/client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
declare const _default: (element: HTMLElement) => (Component: any, props: Record<string, any>, slotted: Record<string, any>, { client }: Record<string, string>) => Promise<void>;
|
||||
export default _default;
|
||||
48
node_modules/@astrojs/vue/dist/client.js
generated
vendored
Normal file
48
node_modules/@astrojs/vue/dist/client.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { setup } from "virtual:@astrojs/vue/app";
|
||||
import { createApp, createSSRApp, h, Suspense } from "vue";
|
||||
import StaticHtml from "./static-html.js";
|
||||
let appMap = /* @__PURE__ */ new WeakMap();
|
||||
var client_default = (element) => async (Component, props, slotted, { client }) => {
|
||||
if (!element.hasAttribute("ssr")) return;
|
||||
const name = Component.name ? `${Component.name} Host` : void 0;
|
||||
const slots = {};
|
||||
for (const [key, value] of Object.entries(slotted)) {
|
||||
slots[key] = () => h(StaticHtml, { value, name: key === "default" ? void 0 : key });
|
||||
}
|
||||
const isHydrate = client !== "only";
|
||||
const bootstrap = isHydrate ? createSSRApp : createApp;
|
||||
let appInstance = appMap.get(element);
|
||||
if (!appInstance) {
|
||||
appInstance = {
|
||||
props,
|
||||
slots
|
||||
};
|
||||
const app = bootstrap({
|
||||
name,
|
||||
render() {
|
||||
let content = h(Component, appInstance.props, appInstance.slots);
|
||||
appInstance.component = this;
|
||||
if (isAsync(Component.setup)) {
|
||||
content = h(Suspense, null, content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
});
|
||||
app.config.idPrefix = element.getAttribute("prefix") ?? void 0;
|
||||
await setup(app);
|
||||
app.mount(element, isHydrate);
|
||||
appMap.set(element, appInstance);
|
||||
element.addEventListener("astro:unmount", () => app.unmount(), { once: true });
|
||||
} else {
|
||||
appInstance.props = props;
|
||||
appInstance.slots = slots;
|
||||
appInstance.component.$forceUpdate();
|
||||
}
|
||||
};
|
||||
function isAsync(fn) {
|
||||
const constructor = fn?.constructor;
|
||||
return constructor && constructor.name === "AsyncFunction";
|
||||
}
|
||||
export {
|
||||
client_default as default
|
||||
};
|
||||
2
node_modules/@astrojs/vue/dist/context.d.ts
generated
vendored
Normal file
2
node_modules/@astrojs/vue/dist/context.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import type { SSRResult } from 'astro';
|
||||
export declare function incrementId(rendererContextResult: SSRResult): string;
|
||||
24
node_modules/@astrojs/vue/dist/context.js
generated
vendored
Normal file
24
node_modules/@astrojs/vue/dist/context.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const contexts = /* @__PURE__ */ new WeakMap();
|
||||
const ID_PREFIX = "s";
|
||||
function getContext(rendererContextResult) {
|
||||
if (contexts.has(rendererContextResult)) {
|
||||
return contexts.get(rendererContextResult);
|
||||
}
|
||||
const ctx = {
|
||||
currentIndex: 0,
|
||||
get id() {
|
||||
return ID_PREFIX + this.currentIndex.toString();
|
||||
}
|
||||
};
|
||||
contexts.set(rendererContextResult, ctx);
|
||||
return ctx;
|
||||
}
|
||||
function incrementId(rendererContextResult) {
|
||||
const ctx = getContext(rendererContextResult);
|
||||
const id = ctx.id;
|
||||
ctx.currentIndex++;
|
||||
return id;
|
||||
}
|
||||
export {
|
||||
incrementId
|
||||
};
|
||||
76
node_modules/@astrojs/vue/dist/editor.cjs
generated
vendored
Normal file
76
node_modules/@astrojs/vue/dist/editor.cjs
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var editor_exports = {};
|
||||
__export(editor_exports, {
|
||||
toTSX: () => toTSX
|
||||
});
|
||||
module.exports = __toCommonJS(editor_exports);
|
||||
var import_compiler_sfc = require("@vue/compiler-sfc");
|
||||
function toTSX(code, className) {
|
||||
let result = `export default function ${className}__AstroComponent_(_props: import('@astrojs/vue/vue-shims.d.ts').PropsWithHTMLAttributes<Record<string, any>>): any {}`;
|
||||
try {
|
||||
const parsedResult = (0, import_compiler_sfc.parse)(code);
|
||||
if (parsedResult.errors.length > 0) {
|
||||
return `
|
||||
let ${className}__AstroComponent_: Error
|
||||
export default ${className}__AstroComponent_
|
||||
`;
|
||||
}
|
||||
const regularScriptBlockContent = parsedResult.descriptor.script?.content ?? "";
|
||||
const { scriptSetup } = parsedResult.descriptor;
|
||||
if (scriptSetup) {
|
||||
const codeWithoutComments = scriptSetup.content.replace(/\/\/.*|\/\*[\s\S]*?\*\//g, "");
|
||||
const definePropsType = /defineProps<([\s\S]+?)>\s?\(\)/.exec(codeWithoutComments);
|
||||
const propsGeneric = scriptSetup.attrs.generic;
|
||||
const propsGenericType = propsGeneric ? `<${propsGeneric}>` : "";
|
||||
if (definePropsType) {
|
||||
result = `
|
||||
${regularScriptBlockContent}
|
||||
${scriptSetup.content}
|
||||
|
||||
export default function ${className}__AstroComponent_${propsGenericType}(_props: import('@astrojs/vue/vue-shims.d.ts').PropsWithHTMLAttributes<${definePropsType[1]}>): any {
|
||||
<div></div>
|
||||
}
|
||||
`;
|
||||
} else {
|
||||
const defineProps = /defineProps\([\s\S]+?\)/.exec(codeWithoutComments);
|
||||
if (defineProps) {
|
||||
result = `
|
||||
import { defineProps } from 'vue';
|
||||
|
||||
${regularScriptBlockContent}
|
||||
|
||||
const Props = ${defineProps[0]}
|
||||
|
||||
export default function ${className}__AstroComponent_${propsGenericType}(_props: import('@astrojs/vue/vue-shims.d.ts').PropsWithHTMLAttributes<typeof Props>): any {
|
||||
<div></div>
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
toTSX
|
||||
});
|
||||
1
node_modules/@astrojs/vue/dist/editor.d.cts
generated
vendored
Normal file
1
node_modules/@astrojs/vue/dist/editor.d.cts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function toTSX(code: string, className: string): string;
|
||||
12
node_modules/@astrojs/vue/dist/index.d.ts
generated
vendored
Normal file
12
node_modules/@astrojs/vue/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { Options as VueOptions } from '@vitejs/plugin-vue';
|
||||
import type { Options as VueJsxOptions } from '@vitejs/plugin-vue-jsx';
|
||||
import type { AstroIntegration, AstroRenderer } from 'astro';
|
||||
import type { VitePluginVueDevToolsOptions } from 'vite-plugin-vue-devtools';
|
||||
interface Options extends VueOptions {
|
||||
jsx?: boolean | VueJsxOptions;
|
||||
appEntrypoint?: string;
|
||||
devtools?: boolean | Omit<VitePluginVueDevToolsOptions, 'appendTo'>;
|
||||
}
|
||||
declare function getRenderer(): AstroRenderer;
|
||||
export { getRenderer as getContainerRenderer };
|
||||
export default function (options?: Options): AstroIntegration;
|
||||
142
node_modules/@astrojs/vue/dist/index.js
generated
vendored
Normal file
142
node_modules/@astrojs/vue/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
import path from "node:path";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { MagicString } from "@vue/compiler-sfc";
|
||||
const VIRTUAL_MODULE_ID = "virtual:@astrojs/vue/app";
|
||||
const RESOLVED_VIRTUAL_MODULE_ID = `\0${VIRTUAL_MODULE_ID}`;
|
||||
function getRenderer() {
|
||||
return {
|
||||
name: "@astrojs/vue",
|
||||
clientEntrypoint: "@astrojs/vue/client.js",
|
||||
serverEntrypoint: "@astrojs/vue/server.js"
|
||||
};
|
||||
}
|
||||
function getJsxRenderer() {
|
||||
return {
|
||||
name: "@astrojs/vue (jsx)",
|
||||
clientEntrypoint: "@astrojs/vue/client.js",
|
||||
serverEntrypoint: "@astrojs/vue/server.js"
|
||||
};
|
||||
}
|
||||
function virtualAppEntrypoint(options) {
|
||||
let isBuild;
|
||||
let root;
|
||||
let appEntrypoint;
|
||||
return {
|
||||
name: "@astrojs/vue/virtual-app",
|
||||
config(_, { command }) {
|
||||
isBuild = command === "build";
|
||||
},
|
||||
configResolved(config) {
|
||||
root = config.root;
|
||||
if (options?.appEntrypoint) {
|
||||
appEntrypoint = options.appEntrypoint.startsWith(".") ? path.resolve(root, options.appEntrypoint) : options.appEntrypoint;
|
||||
}
|
||||
},
|
||||
resolveId(id) {
|
||||
if (id == VIRTUAL_MODULE_ID) {
|
||||
return RESOLVED_VIRTUAL_MODULE_ID;
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (id === RESOLVED_VIRTUAL_MODULE_ID) {
|
||||
if (appEntrypoint) {
|
||||
return `import * as mod from ${JSON.stringify(appEntrypoint)};
|
||||
|
||||
export const setup = async (app) => {
|
||||
if ('default' in mod) {
|
||||
await mod.default(app);
|
||||
} else {
|
||||
${!isBuild ? `console.warn("[@astrojs/vue] appEntrypoint \`" + ${JSON.stringify(
|
||||
appEntrypoint
|
||||
)} + "\` does not export a default function. Check out https://docs.astro.build/en/guides/integrations-guide/vue/#appentrypoint.");` : ""}
|
||||
}
|
||||
}`;
|
||||
}
|
||||
return `export const setup = () => {};`;
|
||||
}
|
||||
},
|
||||
// Ensure that Vue components reference appEntrypoint directly
|
||||
// This allows Astro to associate global styles imported in this file
|
||||
// with the pages they should be injected to
|
||||
transform(code, id) {
|
||||
if (!appEntrypoint) return;
|
||||
if (id.endsWith(".vue")) {
|
||||
const s = new MagicString(code);
|
||||
s.prepend(`import ${JSON.stringify(appEntrypoint)};
|
||||
`);
|
||||
return {
|
||||
code: s.toString(),
|
||||
map: s.generateMap({ hires: "boundary" })
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
async function getViteConfiguration(command, options) {
|
||||
const vueOptions = {
|
||||
...options,
|
||||
template: {
|
||||
...options?.template,
|
||||
transformAssetUrls: false
|
||||
}
|
||||
};
|
||||
vueOptions.compiler ??= await import("vue/compiler-sfc");
|
||||
const config = {
|
||||
optimizeDeps: {
|
||||
// We add `vue` here as `@vitejs/plugin-vue` doesn't add it and we want to prevent
|
||||
// re-optimization if the `vue` import is only encountered later.
|
||||
include: ["@astrojs/vue/client.js", "vue"],
|
||||
exclude: ["@astrojs/vue/server.js", VIRTUAL_MODULE_ID]
|
||||
},
|
||||
plugins: [vue(vueOptions), virtualAppEntrypoint(vueOptions)],
|
||||
ssr: {
|
||||
noExternal: ["vuetify", "vueperslides", "primevue"]
|
||||
}
|
||||
};
|
||||
if (options?.jsx) {
|
||||
const vueJsx = (await import("@vitejs/plugin-vue-jsx")).default;
|
||||
const jsxOptions = typeof options.jsx === "object" ? options.jsx : void 0;
|
||||
config.plugins?.push(vueJsx(jsxOptions));
|
||||
}
|
||||
if (command === "dev" && options?.devtools) {
|
||||
const vueDevTools = (await import("vite-plugin-vue-devtools")).default;
|
||||
const devToolsOptions = typeof options.devtools === "object" ? options.devtools : {};
|
||||
config.plugins?.push(
|
||||
vueDevTools({
|
||||
...devToolsOptions,
|
||||
appendTo: VIRTUAL_MODULE_ID
|
||||
})
|
||||
);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
function index_default(options) {
|
||||
return {
|
||||
name: "@astrojs/vue",
|
||||
hooks: {
|
||||
"astro:config:setup": async ({ addRenderer, updateConfig, command }) => {
|
||||
addRenderer(getRenderer());
|
||||
if (options?.jsx) {
|
||||
addRenderer(getJsxRenderer());
|
||||
}
|
||||
updateConfig({ vite: await getViteConfiguration(command, options) });
|
||||
},
|
||||
"astro:config:done": ({ logger, config }) => {
|
||||
if (!options?.jsx) return;
|
||||
const knownJsxRenderers = ["@astrojs/react", "@astrojs/preact", "@astrojs/solid-js"];
|
||||
const enabledKnownJsxRenderers = config.integrations.filter(
|
||||
(renderer) => knownJsxRenderers.includes(renderer.name)
|
||||
);
|
||||
if (enabledKnownJsxRenderers.length > 1 && !options?.include && !options?.exclude) {
|
||||
logger.warn(
|
||||
"More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/solid-js/#combining-multiple-jsx-frameworks for more information."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
index_default as default,
|
||||
getRenderer as getContainerRenderer
|
||||
};
|
||||
3
node_modules/@astrojs/vue/dist/server.d.ts
generated
vendored
Normal file
3
node_modules/@astrojs/vue/dist/server.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { NamedSSRLoadedRendererValue } from 'astro';
|
||||
declare const renderer: NamedSSRLoadedRendererValue;
|
||||
export default renderer;
|
||||
41
node_modules/@astrojs/vue/dist/server.js
generated
vendored
Normal file
41
node_modules/@astrojs/vue/dist/server.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { setup } from "virtual:@astrojs/vue/app";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "vue/server-renderer";
|
||||
import { incrementId } from "./context.js";
|
||||
import StaticHtml from "./static-html.js";
|
||||
async function check(Component) {
|
||||
return !!Component["ssrRender"] || !!Component["__ssrInlineRender"];
|
||||
}
|
||||
async function renderToStaticMarkup(Component, inputProps, slotted, metadata) {
|
||||
let prefix;
|
||||
if (this && this.result) {
|
||||
prefix = incrementId(this.result);
|
||||
}
|
||||
const attrs = { prefix };
|
||||
const slots = {};
|
||||
const props = { ...inputProps };
|
||||
delete props.slot;
|
||||
for (const [key, value] of Object.entries(slotted)) {
|
||||
slots[key] = () => h(StaticHtml, {
|
||||
value,
|
||||
name: key === "default" ? void 0 : key,
|
||||
// Adjust how this is hydrated only when the version of Astro supports `astroStaticSlot`
|
||||
hydrate: metadata?.astroStaticSlot ? !!metadata.hydrate : true
|
||||
});
|
||||
}
|
||||
const app = createSSRApp({ render: () => h(Component, props, slots) });
|
||||
app.config.idPrefix = prefix;
|
||||
await setup(app);
|
||||
const html = await renderToString(app);
|
||||
return { html, attrs };
|
||||
}
|
||||
const renderer = {
|
||||
name: "@astrojs/vue",
|
||||
check,
|
||||
renderToStaticMarkup,
|
||||
supportsAstroStaticSlot: true
|
||||
};
|
||||
var server_default = renderer;
|
||||
export {
|
||||
server_default as default
|
||||
};
|
||||
33
node_modules/@astrojs/vue/dist/static-html.d.ts
generated
vendored
Normal file
33
node_modules/@astrojs/vue/dist/static-html.d.ts
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Astro passes `children` as a string of HTML, so we need
|
||||
* a wrapper `div` to render that content as VNodes.
|
||||
*
|
||||
* This is the Vue + JSX equivalent of using `<div v-html="value" />`
|
||||
*/
|
||||
declare const StaticHtml: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
||||
value: StringConstructor;
|
||||
name: StringConstructor;
|
||||
hydrate: {
|
||||
type: BooleanConstructor;
|
||||
default: boolean;
|
||||
};
|
||||
}>, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
||||
[key: string]: any;
|
||||
}>), {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
||||
value: StringConstructor;
|
||||
name: StringConstructor;
|
||||
hydrate: {
|
||||
type: BooleanConstructor;
|
||||
default: boolean;
|
||||
};
|
||||
}>> & Readonly<{}>, {
|
||||
hydrate: boolean;
|
||||
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
||||
/**
|
||||
* Other frameworks have `shouldComponentUpdate` in order to signal
|
||||
* that this subtree is entirely static and will not be updated
|
||||
*
|
||||
* Fortunately, Vue is smart enough to figure that out without any
|
||||
* help from us, so this just works out of the box!
|
||||
*/
|
||||
export default StaticHtml;
|
||||
20
node_modules/@astrojs/vue/dist/static-html.js
generated
vendored
Normal file
20
node_modules/@astrojs/vue/dist/static-html.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { defineComponent, h } from "vue";
|
||||
const StaticHtml = defineComponent({
|
||||
props: {
|
||||
value: String,
|
||||
name: String,
|
||||
hydrate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
setup({ name, value, hydrate }) {
|
||||
if (!value) return () => null;
|
||||
let tagName = hydrate ? "astro-slot" : "astro-static-slot";
|
||||
return () => h(tagName, { name, innerHTML: value });
|
||||
}
|
||||
});
|
||||
var static_html_default = StaticHtml;
|
||||
export {
|
||||
static_html_default as default
|
||||
};
|
||||
4
node_modules/@astrojs/vue/dist/types.d.ts
generated
vendored
Normal file
4
node_modules/@astrojs/vue/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { SSRResult } from 'astro';
|
||||
export type RendererContext = {
|
||||
result: SSRResult;
|
||||
};
|
||||
0
node_modules/@astrojs/vue/dist/types.js
generated
vendored
Normal file
0
node_modules/@astrojs/vue/dist/types.js
generated
vendored
Normal file
64
node_modules/@astrojs/vue/package.json
generated
vendored
Normal file
64
node_modules/@astrojs/vue/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "@astrojs/vue",
|
||||
"version": "5.1.4",
|
||||
"description": "Use Vue components within Astro",
|
||||
"type": "module",
|
||||
"types": "./dist/index.d.ts",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/withastro/astro.git",
|
||||
"directory": "packages/integrations/vue"
|
||||
},
|
||||
"keywords": [
|
||||
"astro-integration",
|
||||
"astro-component",
|
||||
"renderer",
|
||||
"vue"
|
||||
],
|
||||
"bugs": "https://github.com/withastro/astro/issues",
|
||||
"homepage": "https://docs.astro.build/en/guides/integrations-guide/vue/",
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./editor": "./dist/editor.cjs",
|
||||
"./client.js": "./dist/client.js",
|
||||
"./server.js": "./dist/server.js",
|
||||
"./vue-shims.d.ts": "./vue-shims.d.ts",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"vue-shims.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"@vitejs/plugin-vue": "5.2.4",
|
||||
"@vitejs/plugin-vue-jsx": "^4.2.0",
|
||||
"@vue/compiler-sfc": "^3.5.26",
|
||||
"vite": "^6.4.1",
|
||||
"vite-plugin-vue-devtools": "^7.7.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cheerio": "1.1.2",
|
||||
"linkedom": "^0.18.12",
|
||||
"vue": "^3.5.26",
|
||||
"astro": "5.16.7",
|
||||
"astro-scripts": "0.0.14"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^5.0.0",
|
||||
"vue": "^3.2.30"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18.20.8 || ^20.3.0 || >=22.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"build": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist && tsc",
|
||||
"build:ci": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist",
|
||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||
"test": "astro-scripts test \"test/**/*.test.js\""
|
||||
}
|
||||
}
|
||||
5
node_modules/@astrojs/vue/vue-shims.d.ts
generated
vendored
Normal file
5
node_modules/@astrojs/vue/vue-shims.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { JSX } from 'astro/jsx-runtime';
|
||||
|
||||
export type AstroClientDirectives = JSX.AstroComponentDirectives;
|
||||
|
||||
export type PropsWithHTMLAttributes<T> = T & astroHTML.JSX.HTMLAttributes & AstroClientDirectives;
|
||||
Reference in New Issue
Block a user