zerodep-css-nuxt 0.1.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/LICENSE +21 -0
- package/README.md +20 -0
- package/dist/index.js +1 -0
- package/dist/runtime/client.js +1 -0
- package/dist/runtime/server.js +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/runtime/client.d.ts +2 -0
- package/dist/types/runtime/server.d.ts +2 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kenconnet666
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# zerodep-css-nuxt
|
|
2
|
+
|
|
3
|
+
Nuxt 4 的 Node SSR、样式恢复和预渲染接入。要求 Node 24+;组件作者 API 来自 zerodep-css-vue。
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add zerodep-css-nuxt zerodep-css-vue
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
// nuxt.config.ts
|
|
11
|
+
export default defineNuxtConfig({ modules: ['zerodep-css-nuxt'] });
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
模块默认安装 bx 插件,按请求创建宿主并在客户端恢复样式。项目仍需通过 createCssContext 定义自己的作者类型并在根组件提供实例。
|
|
15
|
+
|
|
16
|
+
可设置 `modules: [['zerodep-css-nuxt', { inlineBindings: false }]]` 以使用适合严格 CSP 的样式表变量路径;`bindings: false` 关闭编译转换。
|
|
17
|
+
|
|
18
|
+
动态 nonce 使用 event.context.zerodepCssNonce,应用自行设置匹配的 CSP 响应头。当前支持 Node SSR 和静态预渲染;流式 SSR、边缘部署尚未验收。
|
|
19
|
+
|
|
20
|
+
[完整接入与 CSP](https://github.com/kenconnet666/zerodep-css/blob/main/docs/metaframeworks.md) · [组件用法](https://github.com/kenconnet666/zerodep-css/blob/main/docs/getting-started.md)
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{addPlugin as n,addVitePlugin as r,createResolver as s,defineNuxtModule as t}from"@nuxt/kit";import d from"zerodep-css-vue/vite";var u=t({meta:{name:"zerodep-css-nuxt",compatibility:{nuxt:"^4.0.0"}},defaults:{bindings:!0,inlineBindings:!0},setup(e){e.bindings&&r(d({inlineBindings:e.inlineBindings}));let i=s(import.meta.url);n({src:i.resolve("./runtime/server.js"),mode:"server",order:-30}),n({src:i.resolve("./runtime/client.js"),mode:"client",order:-30})}});export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineNuxtPlugin as e}from"nuxt/app";import{hydrateCss as r}from"zerodep-css-vue";var p=e({name:"zerodep-css:restore",enforce:"pre",setup(){r()}});export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineNuxtPlugin as c}from"nuxt/app";import{createServerCssHost as p,provideCssHost as d,serializeCssRules as i}from"zerodep-css-vue/server";var u=c({name:"zerodep-css:host",enforce:"pre",setup(s){let n=s.ssrContext?.event?.context.zerodepCssNonce,e=p({nonce:typeof n=="string"?n:void 0});d(s.vueApp,e),s.hook("app:rendered",({ssrContext:o})=>{let{cssText:t,manifest:r}=i(e.rules());o?.head.push({style:[{key:"zerodep-css","data-zerodep-css":"",innerHTML:t,nonce:e.nonce}],script:[{key:"zerodep-css-manifest",type:"application/json","data-zerodep-css":"",innerHTML:r,nonce:e.nonce}]})})}});export{u as default};
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zerodep-css-nuxt",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"node": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@nuxt/kit": "4.5.2",
|
|
13
|
+
"zerodep-css-vue": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"nuxt": "^4.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"nuxt": "4.5.2"
|
|
20
|
+
},
|
|
21
|
+
"description": "Node SSR and hydration integration for zerodep-css and Nuxt 4.",
|
|
22
|
+
"author": "kenconnet666",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=24"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/kenconnet666/zerodep-css.git",
|
|
29
|
+
"directory": "nuxt"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/kenconnet666/zerodep-css#readme",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/kenconnet666/zerodep-css/issues"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE",
|
|
39
|
+
"THIRD_PARTY_NOTICES.md"
|
|
40
|
+
],
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public",
|
|
43
|
+
"registry": "https://registry.npmjs.org/"
|
|
44
|
+
},
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
48
|
+
"check": "tsc -p tsconfig.json --noEmit"
|
|
49
|
+
}
|
|
50
|
+
}
|