@dyrected/nuxt 2.5.26 → 2.5.27
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/dist/module.mjs
CHANGED
|
@@ -49,14 +49,14 @@ const module = defineNuxtModule({
|
|
|
49
49
|
addImports([
|
|
50
50
|
{ name: "useDyrected", from: resolver.resolve("./runtime/composables/useDyrected") },
|
|
51
51
|
{ name: "useDyrectedClient", from: resolver.resolve("./runtime/composables/useDyrected") },
|
|
52
|
-
{ name: "
|
|
53
|
-
{ name: "
|
|
54
|
-
{ name: "
|
|
52
|
+
{ name: "useDyrected", from: "@dyrected/vue", as: "useDyrectedData" },
|
|
53
|
+
{ name: "useDyrectedCollection", from: "@dyrected/vue", as: "useDyrectedCollectionData" },
|
|
54
|
+
{ name: "useDyrectedGlobal", from: "@dyrected/vue", as: "useDyrectedGlobalData" },
|
|
55
55
|
{ name: "useDyrectedDoc", from: resolver.resolve("./runtime/composables/useDyrected") },
|
|
56
56
|
{ name: "useDyrectedCollection", from: resolver.resolve("./runtime/composables/useDyrected") },
|
|
57
57
|
{ name: "useDyrectedGlobal", from: resolver.resolve("./runtime/composables/useDyrected") },
|
|
58
58
|
{ name: "useDyrectedAuth", from: resolver.resolve("./runtime/composables/useDyrectedAuth") },
|
|
59
|
-
{ name: "useLivePreview", from:
|
|
59
|
+
{ name: "useLivePreview", from: "@dyrected/vue" }
|
|
60
60
|
]);
|
|
61
61
|
const runtimeConfig = {
|
|
62
62
|
...options,
|
|
@@ -186,12 +186,13 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
186
186
|
siteId: process.env.NUXT_PUBLIC_DYRECTED_SITE_ID || options.siteId || "default"
|
|
187
187
|
};
|
|
188
188
|
if (nuxt.options.vite) {
|
|
189
|
+
const adminRequire = createRequire(_require.resolve("@dyrected/admin"));
|
|
189
190
|
nuxt.options.vite.optimizeDeps = nuxt.options.vite.optimizeDeps || {};
|
|
190
191
|
nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
|
|
191
192
|
const toInclude = ["react", "react-dom", "react-router-dom", "@tanstack/react-query"];
|
|
192
193
|
for (const dep of toInclude) {
|
|
193
194
|
try {
|
|
194
|
-
_require.resolve(dep);
|
|
195
|
+
const resolved = dep === "react" || dep === "react-dom" ? _require.resolve(dep) : adminRequire.resolve(dep);
|
|
195
196
|
if (!nuxt.options.vite.optimizeDeps.include.includes(dep)) {
|
|
196
197
|
nuxt.options.vite.optimizeDeps.include.push(dep);
|
|
197
198
|
}
|
|
@@ -218,6 +219,10 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
218
219
|
const reactDomMain = _require.resolve("react-dom");
|
|
219
220
|
nuxt.options.vite.resolve.alias.react = join(reactMain, "..");
|
|
220
221
|
nuxt.options.vite.resolve.alias["react-dom"] = join(reactDomMain, "..");
|
|
222
|
+
const reactRouterDomMain = adminRequire.resolve("react-router-dom");
|
|
223
|
+
const reactQueryMain = adminRequire.resolve("@tanstack/react-query");
|
|
224
|
+
nuxt.options.vite.resolve.alias["react-router-dom"] = join(reactRouterDomMain, "..");
|
|
225
|
+
nuxt.options.vite.resolve.alias["@tanstack/react-query"] = join(reactQueryMain, "..");
|
|
221
226
|
} catch {
|
|
222
227
|
}
|
|
223
228
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type DyrectedClient, type BaseSchema } from '@dyrected/sdk';
|
|
2
|
-
import { useDyrected as useGenericDyrected, useDyrectedCollection as useGenericCollection, useDyrectedGlobal as useGenericGlobal } from '@dyrected/vue';
|
|
3
2
|
export declare const useDyrectedClient: <TSchema extends BaseSchema = any>() => DyrectedClient<TSchema>;
|
|
4
3
|
export declare const useDyrected: <TSchema extends BaseSchema = any>() => DyrectedClient<TSchema>;
|
|
5
|
-
export declare const useDyrectedData: typeof useGenericDyrected;
|
|
6
|
-
export declare const useDyrectedCollectionData: typeof useGenericCollection;
|
|
7
|
-
export declare const useDyrectedGlobalData: typeof useGenericGlobal;
|
|
8
4
|
export declare const useDyrectedDoc: <T = any, TSchema extends BaseSchema = any>(collection: keyof TSchema["collections"] | string, id: string, options?: {
|
|
9
5
|
depth?: number;
|
|
10
6
|
initialData?: T;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig, useAsyncData, useRequestFetch } from "#app";
|
|
2
2
|
import { createClient } from "@dyrected/sdk";
|
|
3
|
-
import {
|
|
4
|
-
useDyrected as useGenericDyrected,
|
|
5
|
-
useDyrectedCollection as useGenericCollection,
|
|
6
|
-
useDyrectedGlobal as useGenericGlobal
|
|
7
|
-
} from "@dyrected/vue";
|
|
8
3
|
function getClient() {
|
|
9
4
|
const config = useRuntimeConfig().public.dyrected;
|
|
10
5
|
const fetcher = useRequestFetch();
|
|
@@ -19,9 +14,6 @@ export const useDyrectedClient = () => {
|
|
|
19
14
|
return getClient();
|
|
20
15
|
};
|
|
21
16
|
export const useDyrected = useDyrectedClient;
|
|
22
|
-
export const useDyrectedData = useGenericDyrected;
|
|
23
|
-
export const useDyrectedCollectionData = useGenericCollection;
|
|
24
|
-
export const useDyrectedGlobalData = useGenericGlobal;
|
|
25
17
|
export const useDyrectedDoc = (collection, id, options) => {
|
|
26
18
|
const client = getClient();
|
|
27
19
|
return useAsyncData(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/nuxt",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/module.mjs",
|
|
6
6
|
"types": "./dist/module.d.ts",
|
|
@@ -17,10 +17,12 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@nuxt/kit": "^3.11.2",
|
|
19
19
|
"h3": "^1.15.0",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"@dyrected/
|
|
23
|
-
"@dyrected/
|
|
20
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
21
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
22
|
+
"@dyrected/core": "2.5.27",
|
|
23
|
+
"@dyrected/sdk": "2.5.27",
|
|
24
|
+
"@dyrected/admin": "2.5.27",
|
|
25
|
+
"@dyrected/vue": "2.5.27"
|
|
24
26
|
},
|
|
25
27
|
"peerDependencies": {
|
|
26
28
|
"nuxt": "^3.0.0",
|