@queryweave/nuxt 0.1.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/index.d.ts +22 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +3 -0
- package/dist/runtime/plugin.d.ts +15 -0
- package/dist/runtime/plugin.d.ts.map +1 -0
- package/dist/runtime/plugin.js +23 -0
- package/dist/runtime/plugin.js.map +1 -0
- package/dist/shared/adapter.js +26 -0
- package/dist/shared/adapter.js.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 QueryWeave contributors
|
|
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,19 @@
|
|
|
1
|
+
# `@queryweave/nuxt`
|
|
2
|
+
|
|
3
|
+
A minimal Nuxt module and runtime plugin.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
export default defineNuxtConfig({
|
|
7
|
+
modules: ["@queryweave/nuxt"],
|
|
8
|
+
queryweave: { autoImports: true, enabled: true },
|
|
9
|
+
});
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The module registers the runtime plugin and auto-imports `useQueryModel` and
|
|
13
|
+
`provideQueryAdapter`. The plugin creates one Vue Router adapter per Vue application instance,
|
|
14
|
+
which is per request on the server, so nothing is shared between concurrent renders and no browser
|
|
15
|
+
global is read during server rendering. The first render already sees the decoded query, so
|
|
16
|
+
hydration matches.
|
|
17
|
+
|
|
18
|
+
Module-time exports and `./runtime` exports stay separate, and no runtime state is held at module
|
|
19
|
+
scope. The Nuxt-specific API is deliberately small and not final.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { NuxtModule } from "@nuxt/schema";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Module-time surface.
|
|
5
|
+
*
|
|
6
|
+
* Nothing here runs per request. Request-scoped state is created by the runtime plugin, which is
|
|
7
|
+
* registered below and exported separately under `@queryweave/nuxt/runtime`.
|
|
8
|
+
*/
|
|
9
|
+
/** Options accepted under the `queryweave` key of `nuxt.config`. */
|
|
10
|
+
interface QueryWeaveModuleOptions {
|
|
11
|
+
/** Register auto-imports for the Vue binding. Enabled by default. */
|
|
12
|
+
readonly autoImports?: boolean;
|
|
13
|
+
/** Register the runtime plugin. Enabled by default. */
|
|
14
|
+
readonly enabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The module is annotated explicitly so the generated declaration stays self-contained. Without
|
|
18
|
+
* it, the inferred type references type parameters a consumer cannot resolve.
|
|
19
|
+
*/
|
|
20
|
+
declare const queryWeaveModule: NuxtModule<QueryWeaveModuleOptions>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { QueryWeaveModuleOptions, queryWeaveModule as default };
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;UAWiB;;WAEN;;WAEA;;;;;;cAOL,kBAAkB,WAAW"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { addImports, addPlugin, createResolver, defineNuxtModule } from "@nuxt/kit";
|
|
2
|
+
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* The module is annotated explicitly so the generated declaration stays self-contained. Without
|
|
6
|
+
* it, the inferred type references type parameters a consumer cannot resolve.
|
|
7
|
+
*/
|
|
8
|
+
const queryWeaveModule = defineNuxtModule({
|
|
9
|
+
meta: {
|
|
10
|
+
name: "@queryweave/nuxt",
|
|
11
|
+
configKey: "queryweave",
|
|
12
|
+
compatibility: { nuxt: ">=4.0.0" }
|
|
13
|
+
},
|
|
14
|
+
defaults: {
|
|
15
|
+
autoImports: true,
|
|
16
|
+
enabled: true
|
|
17
|
+
},
|
|
18
|
+
setup(options) {
|
|
19
|
+
if (options.enabled === false) return;
|
|
20
|
+
addPlugin(createResolver(import.meta.url).resolve("./runtime/plugin"));
|
|
21
|
+
if (options.autoImports === false) return;
|
|
22
|
+
addImports([{
|
|
23
|
+
name: "useQueryModel",
|
|
24
|
+
from: "@queryweave/vue"
|
|
25
|
+
}, {
|
|
26
|
+
name: "provideQueryAdapter",
|
|
27
|
+
from: "@queryweave/vue"
|
|
28
|
+
}]);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { queryWeaveModule as default };
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { addImports, addPlugin, createResolver, defineNuxtModule } from \"@nuxt/kit\";\nimport type { NuxtModule } from \"@nuxt/schema\";\n\n/**\n * Module-time surface.\n *\n * Nothing here runs per request. Request-scoped state is created by the runtime plugin, which is\n * registered below and exported separately under `@queryweave/nuxt/runtime`.\n */\n\n/** Options accepted under the `queryweave` key of `nuxt.config`. */\nexport interface QueryWeaveModuleOptions {\n /** Register auto-imports for the Vue binding. Enabled by default. */\n readonly autoImports?: boolean;\n /** Register the runtime plugin. Enabled by default. */\n readonly enabled?: boolean;\n}\n\n/**\n * The module is annotated explicitly so the generated declaration stays self-contained. Without\n * it, the inferred type references type parameters a consumer cannot resolve.\n */\nconst queryWeaveModule: NuxtModule<QueryWeaveModuleOptions> =\n defineNuxtModule<QueryWeaveModuleOptions>({\n meta: {\n name: \"@queryweave/nuxt\",\n configKey: \"queryweave\",\n compatibility: {\n nuxt: \">=4.0.0\",\n },\n },\n defaults: {\n autoImports: true,\n enabled: true,\n },\n setup(options: QueryWeaveModuleOptions) {\n if (options.enabled === false) {\n return;\n }\n\n const resolver = createResolver(import.meta.url);\n addPlugin(resolver.resolve(\"./runtime/plugin\"));\n\n if (options.autoImports === false) {\n return;\n }\n\n addImports([\n { name: \"useQueryModel\", from: \"@queryweave/vue\" },\n { name: \"provideQueryAdapter\", from: \"@queryweave/vue\" },\n ]);\n },\n });\n\nexport default queryWeaveModule;\n"],"mappings":";;;;;;;AAsBA,MAAM,mBACJ,iBAA0C;CACxC,MAAM;EACJ,MAAM;EACN,WAAW;EACX,eAAe,EACb,MAAM,UACR;CACF;CACA,UAAU;EACR,aAAa;EACb,SAAS;CACX;CACA,MAAM,SAAkC;EACtC,IAAI,QAAQ,YAAY,OACtB;EAIF,UADiB,eAAe,OAAO,KAAK,GAC3B,CAAC,CAAC,QAAQ,kBAAkB,CAAC;EAE9C,IAAI,QAAQ,gBAAgB,OAC1B;EAGF,WAAW,CACT;GAAE,MAAM;GAAiB,MAAM;EAAkB,GACjD;GAAE,MAAM;GAAuB,MAAM;EAAkB,CACzD,CAAC;CACH;AACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VueRouterQueryAdapter, VueRouterQueryAdapter as VueRouterQueryAdapter$1 } from "@queryweave/vue-router";
|
|
2
|
+
import { QueryAdapter } from "@queryweave/core";
|
|
3
|
+
import { App } from "vue";
|
|
4
|
+
import { Router } from "vue-router";
|
|
5
|
+
//#region src/runtime/adapter.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Request-scoped runtime wiring.
|
|
8
|
+
*
|
|
9
|
+
* Every helper here takes the Vue application and router it should serve. Nothing is stored at
|
|
10
|
+
* module scope, so a server rendering two requests never shares adapter state between them.
|
|
11
|
+
*/
|
|
12
|
+
/** Create the adapter a Nuxt application should use. */
|
|
13
|
+
declare function createNuxtQueryAdapter(router: Router): VueRouterQueryAdapter$1;
|
|
14
|
+
/**
|
|
15
|
+
* Install an adapter into one Vue application instance.
|
|
16
|
+
*
|
|
17
|
+
* Any adapter is accepted, so an application can substitute its own without leaving the module.
|
|
18
|
+
*/
|
|
19
|
+
declare function installQueryAdapter(app: App, adapter: QueryAdapter): void;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { type VueRouterQueryAdapter, createNuxtQueryAdapter, installQueryAdapter };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/runtime/adapter.ts"],"mappings":";;;;;;;;;;;;iBAcgB,uBAAuB,QAAQ,SAAS;;;;;;iBASxC,oBAAoB,KAAK,KAAK,SAAS"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/runtime/plugin.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Registers one adapter per Vue application instance.
|
|
4
|
+
*
|
|
5
|
+
* Nuxt creates a fresh application for every server render, so the adapter is request-scoped by
|
|
6
|
+
* construction. No runtime global is read here, which keeps server rendering safe.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import("nuxt/app").Plugin<{
|
|
9
|
+
queryWeaveAdapter: import("@queryweave/vue-router").VueRouterQueryAdapter;
|
|
10
|
+
}> & import("nuxt/app").ObjectPlugin<{
|
|
11
|
+
queryWeaveAdapter: import("@queryweave/vue-router").VueRouterQueryAdapter;
|
|
12
|
+
}>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { _default as default };
|
|
15
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","names":[],"sources":["../../src/runtime/plugin.ts"],"mappings":";;;;;;;cAKA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { n as installQueryAdapter, t as createNuxtQueryAdapter } from "../shared/adapter.js";
|
|
2
|
+
import { defineNuxtPlugin } from "nuxt/app";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/plugin.ts
|
|
5
|
+
/**
|
|
6
|
+
* Registers one adapter per Vue application instance.
|
|
7
|
+
*
|
|
8
|
+
* Nuxt creates a fresh application for every server render, so the adapter is request-scoped by
|
|
9
|
+
* construction. No runtime global is read here, which keeps server rendering safe.
|
|
10
|
+
*/
|
|
11
|
+
var plugin_default = defineNuxtPlugin({
|
|
12
|
+
name: "queryweave:adapter",
|
|
13
|
+
setup(nuxtApp) {
|
|
14
|
+
const router = nuxtApp["$router"];
|
|
15
|
+
const adapter = createNuxtQueryAdapter(router);
|
|
16
|
+
installQueryAdapter(nuxtApp.vueApp, adapter);
|
|
17
|
+
return { provide: { queryWeaveAdapter: adapter } };
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { plugin_default as default };
|
|
23
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","names":[],"sources":["../../src/runtime/plugin.ts"],"sourcesContent":["import { defineNuxtPlugin } from \"nuxt/app\";\nimport type { Router } from \"vue-router\";\n\nimport { createNuxtQueryAdapter, installQueryAdapter } from \"./adapter\";\n\n/**\n * Registers one adapter per Vue application instance.\n *\n * Nuxt creates a fresh application for every server render, so the adapter is request-scoped by\n * construction. No runtime global is read here, which keeps server rendering safe.\n */\nexport default defineNuxtPlugin({\n name: \"queryweave:adapter\",\n setup(nuxtApp) {\n const router = nuxtApp[\"$router\"] as Router;\n const adapter = createNuxtQueryAdapter(router);\n installQueryAdapter(nuxtApp.vueApp, adapter);\n\n return {\n provide: {\n queryWeaveAdapter: adapter,\n },\n };\n },\n});\n"],"mappings":";;;;;;;;;;AAWA,qBAAe,iBAAiB;CAC9B,MAAM;CACN,MAAM,SAAS;EACb,MAAM,SAAS,QAAQ;EACvB,MAAM,UAAU,uBAAuB,MAAM;EAC7C,oBAAoB,QAAQ,QAAQ,OAAO;EAE3C,OAAO,EACL,SAAS,EACP,mBAAmB,QACrB,EACF;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { queryAdapterKey } from "@queryweave/vue";
|
|
2
|
+
import { createVueRouterAdapter } from "@queryweave/vue-router";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/adapter.ts
|
|
5
|
+
/**
|
|
6
|
+
* Request-scoped runtime wiring.
|
|
7
|
+
*
|
|
8
|
+
* Every helper here takes the Vue application and router it should serve. Nothing is stored at
|
|
9
|
+
* module scope, so a server rendering two requests never shares adapter state between them.
|
|
10
|
+
*/
|
|
11
|
+
/** Create the adapter a Nuxt application should use. */
|
|
12
|
+
function createNuxtQueryAdapter(router) {
|
|
13
|
+
return createVueRouterAdapter(router);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Install an adapter into one Vue application instance.
|
|
17
|
+
*
|
|
18
|
+
* Any adapter is accepted, so an application can substitute its own without leaving the module.
|
|
19
|
+
*/
|
|
20
|
+
function installQueryAdapter(app, adapter) {
|
|
21
|
+
app.provide(queryAdapterKey, adapter);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { installQueryAdapter as n, createNuxtQueryAdapter as t };
|
|
26
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","names":[],"sources":["../../src/runtime/adapter.ts"],"sourcesContent":["import type { QueryAdapter } from \"@queryweave/core\";\nimport { queryAdapterKey } from \"@queryweave/vue\";\nimport { createVueRouterAdapter, type VueRouterQueryAdapter } from \"@queryweave/vue-router\";\nimport type { App } from \"vue\";\nimport type { Router } from \"vue-router\";\n\n/**\n * Request-scoped runtime wiring.\n *\n * Every helper here takes the Vue application and router it should serve. Nothing is stored at\n * module scope, so a server rendering two requests never shares adapter state between them.\n */\n\n/** Create the adapter a Nuxt application should use. */\nexport function createNuxtQueryAdapter(router: Router): VueRouterQueryAdapter {\n return createVueRouterAdapter(router);\n}\n\n/**\n * Install an adapter into one Vue application instance.\n *\n * Any adapter is accepted, so an application can substitute its own without leaving the module.\n */\nexport function installQueryAdapter(app: App, adapter: QueryAdapter): void {\n app.provide(queryAdapterKey, adapter);\n}\n"],"mappings":";;;;;;;;;;;AAcA,SAAgB,uBAAuB,QAAuC;CAC5E,OAAO,uBAAuB,MAAM;AACtC;;;;;;AAOA,SAAgB,oBAAoB,KAAU,SAA6B;CACzE,IAAI,QAAQ,iBAAiB,OAAO;AACtC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@queryweave/nuxt",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Nuxt module and runtime integration contracts for QueryWeave.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nuxt",
|
|
7
|
+
"query",
|
|
8
|
+
"state",
|
|
9
|
+
"url",
|
|
10
|
+
"vue"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/boussadjra/queryweave#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/boussadjra/queryweave/issues"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/boussadjra/queryweave.git",
|
|
20
|
+
"directory": "packages/nuxt"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./runtime": {
|
|
36
|
+
"types": "./dist/runtime/index.d.ts",
|
|
37
|
+
"import": "./dist/runtime/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./runtime/plugin": {
|
|
40
|
+
"types": "./dist/runtime/plugin.d.ts",
|
|
41
|
+
"import": "./dist/runtime/plugin.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public",
|
|
46
|
+
"provenance": true
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@nuxt/kit": "4.5.0",
|
|
50
|
+
"@nuxt/schema": "4.5.0",
|
|
51
|
+
"@queryweave/core": "0.1.0-alpha.1",
|
|
52
|
+
"@queryweave/vue": "0.1.0-alpha.1",
|
|
53
|
+
"@queryweave/vue-router": "0.1.0-alpha.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"nuxt": "4.5.0",
|
|
57
|
+
"vue": "3.5.40",
|
|
58
|
+
"vue-router": "5.2.0",
|
|
59
|
+
"@queryweave/typescript-config": "0.0.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"nuxt": ">=4.5.0 <5",
|
|
63
|
+
"vue": ">=3.5.0 <4",
|
|
64
|
+
"vue-router": ">=5.2.0 <6"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=24.18.0"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "tsdown",
|
|
71
|
+
"dev": "tsdown --watch",
|
|
72
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
73
|
+
"test:types": "tsc -p tsconfig.json",
|
|
74
|
+
"package:check": "publint --strict && attw --pack . --profile esm-only",
|
|
75
|
+
"clean": "node ../../scripts/clean-package.mjs"
|
|
76
|
+
}
|
|
77
|
+
}
|