@antdv-next/nuxt 1.0.0-beta.1

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.
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ import { createCache, provideStyleContext } from "@antdv-next/cssinjs";
3
+ export default defineNuxtPlugin(
4
+ (nuxtApp) => {
5
+ try {
6
+ const cache = createCache();
7
+ const ssrEvent = nuxtApp.ssrContext?.event;
8
+ provideStyleContext(nuxtApp.vueApp, {
9
+ value: {
10
+ cache,
11
+ defaultCache: false,
12
+ ...ssrEvent ? { mock: "server" } : {}
13
+ }
14
+ });
15
+ if (ssrEvent) {
16
+ ssrEvent.context.__antdvCssInJsCache = cache;
17
+ }
18
+ } catch (error) {
19
+ console.error("[antdv-next/nuxt] Failed to initialize CSS-in-JS:", error);
20
+ }
21
+ }
22
+ );
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nitropack/types").NitroAppPlugin;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import { defineNitroPlugin } from "nitropack/runtime";
2
+ import { extractStyle } from "@antdv-next/cssinjs";
3
+ export default defineNitroPlugin((nitro) => {
4
+ nitro.hooks.hook("render:html", (html, { event }) => {
5
+ const cache = event.context.__antdvCssInJsCache;
6
+ if (cache) {
7
+ try {
8
+ const style = extractStyle(cache);
9
+ if (style) {
10
+ html.head.unshift(style);
11
+ }
12
+ } catch (error) {
13
+ console.error("[antdv-next/nuxt] Failed to extract CSS-in-JS styles:", error);
14
+ }
15
+ }
16
+ });
17
+ });
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@antdv-next/nuxt",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "Antdv Next Nuxt module",
5
+ "repository": "antdv-next/nuxt",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.mts",
11
+ "import": "./dist/module.mjs"
12
+ }
13
+ },
14
+ "main": "./dist/module.mjs",
15
+ "typesVersions": {
16
+ "*": {
17
+ ".": [
18
+ "./dist/types.d.mts"
19
+ ]
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "workspaces": [
26
+ "playground"
27
+ ],
28
+ "peerDependencies": {
29
+ "@antdv-next/icons": ">=1.0.1",
30
+ "antdv-next": ">=1.0.4-beta.2",
31
+ "nuxt": ">=4.0.0"
32
+ },
33
+ "dependencies": {
34
+ "@antdv-next/cssinjs": "^1.0.3-beta.1",
35
+ "@nuxt/kit": "^4.3.1",
36
+ "vite-plugin-dayjs": "^1.0.1"
37
+ },
38
+ "devDependencies": {
39
+ "@antdv-next/icons": "^1.0.1",
40
+ "@nuxt/devtools": "^3.2.1",
41
+ "@nuxt/eslint-config": "^1.15.1",
42
+ "@nuxt/module-builder": "^1.0.2",
43
+ "@nuxt/schema": "^4.3.1",
44
+ "@nuxt/test-utils": "^4.0.0",
45
+ "@types/jsdom": "^27.0.0",
46
+ "@types/node": "latest",
47
+ "antdv-next": "^1.0.3",
48
+ "changelogen": "^0.6.2",
49
+ "eslint": "^9.39.2",
50
+ "jsdom": "^28.1.0",
51
+ "nitropack": "^2.13.1",
52
+ "nuxt": "^4.3.1",
53
+ "typescript": "~5.9.3",
54
+ "vitest": "^4.0.18",
55
+ "vue": "^3.5.28",
56
+ "vue-tsc": "^3.2.4"
57
+ },
58
+ "scripts": {
59
+ "dev": "npm run dev:prepare && nuxt dev playground",
60
+ "dev:build": "nuxt build playground",
61
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
62
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
63
+ "lint": "eslint .",
64
+ "test": "vitest run",
65
+ "test:watch": "vitest watch",
66
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
67
+ }
68
+ }