abckit 0.0.40 → 0.0.41
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.d.mts +9 -14
- package/dist/module.mjs +4 -40
- package/dist/runtime/server/plugins/s3-storage.js +9 -11
- package/package.json +1 -1
package/dist/module.d.mts
CHANGED
|
@@ -155,20 +155,6 @@ declare module '@nuxt/schema' {
|
|
|
155
155
|
interface AppConfig extends BreadcrumbsConfig, SetupConfig {
|
|
156
156
|
}
|
|
157
157
|
interface RuntimeConfig {
|
|
158
|
-
dragonfly: {
|
|
159
|
-
host: string;
|
|
160
|
-
port: number;
|
|
161
|
-
password: string;
|
|
162
|
-
url?: string;
|
|
163
|
-
};
|
|
164
|
-
s3: {
|
|
165
|
-
accessKeyId: string;
|
|
166
|
-
secretAccessKey: string;
|
|
167
|
-
endpoint: string;
|
|
168
|
-
bucket: string;
|
|
169
|
-
region: string;
|
|
170
|
-
publicUrl: string;
|
|
171
|
-
};
|
|
172
158
|
polar: {
|
|
173
159
|
accessToken: string;
|
|
174
160
|
checkoutSuccessUrl: string;
|
|
@@ -204,6 +190,15 @@ declare module '@nuxt/schema' {
|
|
|
204
190
|
};
|
|
205
191
|
}
|
|
206
192
|
}
|
|
193
|
+
declare module 'nitro/types' {
|
|
194
|
+
interface NitroRuntimeConfig {
|
|
195
|
+
modules: {
|
|
196
|
+
redis: boolean;
|
|
197
|
+
s3: boolean;
|
|
198
|
+
disk: boolean;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
207
202
|
|
|
208
203
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
209
204
|
|
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addTypeTemplate, addServerScanDir, addRouteMiddleware, defineNuxtModule, createResolver } from '@nuxt/kit';
|
|
1
|
+
import { updateRuntimeConfig, addTypeTemplate, addServerScanDir, addRouteMiddleware, defineNuxtModule, createResolver } from '@nuxt/kit';
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { networkInterfaces } from 'node:os';
|
|
@@ -79,26 +79,6 @@ const VITE_EXCLUDE_PACKAGES = [
|
|
|
79
79
|
"@capacitor/haptics",
|
|
80
80
|
"@unovis/vue"
|
|
81
81
|
];
|
|
82
|
-
const DRAGONFLY_DEFAULTS = {
|
|
83
|
-
host: "dragonfly",
|
|
84
|
-
port: 6379,
|
|
85
|
-
password: "",
|
|
86
|
-
url: ""
|
|
87
|
-
};
|
|
88
|
-
const S3_DEFAULTS = {
|
|
89
|
-
accessKeyId: "",
|
|
90
|
-
secretAccessKey: "",
|
|
91
|
-
endpoint: "",
|
|
92
|
-
bucket: "",
|
|
93
|
-
region: "auto",
|
|
94
|
-
publicUrl: ""
|
|
95
|
-
};
|
|
96
|
-
const POLAR_DEFAULTS = {
|
|
97
|
-
accessToken: "",
|
|
98
|
-
checkoutSuccessUrl: "/checkout/success",
|
|
99
|
-
server: "sandbox",
|
|
100
|
-
webhookSecret: ""
|
|
101
|
-
};
|
|
102
82
|
const IMGPROXY_DEFAULTS = {
|
|
103
83
|
storageUrl: "",
|
|
104
84
|
cdnDomains: []
|
|
@@ -171,11 +151,6 @@ declare module 'h3' {
|
|
|
171
151
|
|
|
172
152
|
export {}
|
|
173
153
|
`;
|
|
174
|
-
const GRAPHQL_SCALARS = {
|
|
175
|
-
Timestamp: "string",
|
|
176
|
-
File: "File",
|
|
177
|
-
Decimal: "string"
|
|
178
|
-
};
|
|
179
154
|
|
|
180
155
|
const isMobileBuild = process.env.MOBILE_BUILD === "true" || process.env.NUXT_PUBLIC_MOBILE_DEV === "true";
|
|
181
156
|
const isMobileDev = process.env.MOBILE_DEV === "true" || process.env.NUXT_PUBLIC_MOBILE_DEV === "true";
|
|
@@ -203,9 +178,6 @@ function setupRuntimeConfig(nuxt, options, isSentryEnabled) {
|
|
|
203
178
|
oauthProvider: options.auth?.oauthProvider ?? false
|
|
204
179
|
}
|
|
205
180
|
};
|
|
206
|
-
nuxt.options.runtimeConfig.dragonfly = defu(nuxt.options.runtimeConfig.dragonfly, DRAGONFLY_DEFAULTS);
|
|
207
|
-
nuxt.options.runtimeConfig.s3 = defu(nuxt.options.runtimeConfig.s3, S3_DEFAULTS);
|
|
208
|
-
nuxt.options.runtimeConfig.polar = defu(nuxt.options.runtimeConfig.polar, POLAR_DEFAULTS);
|
|
209
181
|
nuxt.options.runtimeConfig.imgproxy = defu(nuxt.options.runtimeConfig.imgproxy, IMGPROXY_DEFAULTS);
|
|
210
182
|
nuxt.options.runtimeConfig.storage = defu(nuxt.options.runtimeConfig.storage, STORAGE_DEFAULTS);
|
|
211
183
|
nuxt.options.runtimeConfig.public = defu(nuxt.options.runtimeConfig.public, {
|
|
@@ -214,6 +186,9 @@ function setupRuntimeConfig(nuxt, options, isSentryEnabled) {
|
|
|
214
186
|
debug: nuxt.options.dev,
|
|
215
187
|
imgproxy: IMGPROXY_DEFAULTS
|
|
216
188
|
});
|
|
189
|
+
updateRuntimeConfig({
|
|
190
|
+
modules: options.modules
|
|
191
|
+
});
|
|
217
192
|
}
|
|
218
193
|
function setupAppHead(nuxt) {
|
|
219
194
|
const siteUrl = nuxt.options.runtimeConfig.public.siteUrl;
|
|
@@ -254,20 +229,9 @@ function setupNitro(nuxt, resolve, isGraphqlEnabled) {
|
|
|
254
229
|
tasks: true,
|
|
255
230
|
asyncContext: true
|
|
256
231
|
});
|
|
257
|
-
nuxt.options.nitro.esbuild = defu(nuxt.options.nitro.esbuild, {
|
|
258
|
-
options: { target: "esnext" }
|
|
259
|
-
});
|
|
260
232
|
if (isGraphqlEnabled) {
|
|
261
233
|
nuxt.options.nitro.modules = nuxt.options.nitro.modules || [];
|
|
262
234
|
nuxt.options.nitro.modules.push("nitro-graphql");
|
|
263
|
-
nuxt.options.nitro.graphql = defu(nuxt.options.nitro.graphql, {
|
|
264
|
-
framework: "graphql-yoga",
|
|
265
|
-
codegen: {
|
|
266
|
-
server: { scalars: GRAPHQL_SCALARS },
|
|
267
|
-
client: { scalars: GRAPHQL_SCALARS }
|
|
268
|
-
},
|
|
269
|
-
scaffold: false
|
|
270
|
-
});
|
|
271
235
|
}
|
|
272
236
|
nuxt.options.ionic = defu(nuxt.options.ionic, {
|
|
273
237
|
integrations: { icons: false },
|
|
@@ -7,26 +7,24 @@ import s3Driver from "unstorage/drivers/s3";
|
|
|
7
7
|
export default definePlugin(() => {
|
|
8
8
|
const config = useRuntimeConfig();
|
|
9
9
|
const storage = useStorage();
|
|
10
|
-
const storageConfig = config.
|
|
10
|
+
const storageConfig = config.modules;
|
|
11
11
|
if (storageConfig.redis) {
|
|
12
12
|
const dragonflyUrl = process.env.NUXT_DRAGONFLY_URL || process.env.DRAGONFLY_URL || process.env.REDIS_URL;
|
|
13
|
-
const dragonflyConfig = config.dragonfly || {};
|
|
14
13
|
const dragonflyDriver = dragonflyUrl ? redisDriver({ url: dragonflyUrl }) : redisDriver({
|
|
15
|
-
host:
|
|
16
|
-
port:
|
|
17
|
-
password:
|
|
14
|
+
host: process.env.NUXT_DRAGONFLY_HOST || process.env.DRAGONFLY_HOST || "dragonfly",
|
|
15
|
+
port: Number.parseInt(process.env.NUXT_DRAGONFLY_PORT || process.env.DRAGONFLY_PORT || "6379", 10),
|
|
16
|
+
password: process.env.NUXT_DRAGONFLY_PASSWORD || process.env.DRAGONFLY_PASSWORD || "",
|
|
18
17
|
db: 0
|
|
19
18
|
});
|
|
20
19
|
storage.mount("redis", dragonflyDriver);
|
|
21
20
|
}
|
|
22
21
|
if (storageConfig.s3) {
|
|
23
|
-
const s3Config = config.s3;
|
|
24
22
|
const driver = s3Driver({
|
|
25
|
-
accessKeyId:
|
|
26
|
-
secretAccessKey:
|
|
27
|
-
endpoint:
|
|
28
|
-
bucket:
|
|
29
|
-
region:
|
|
23
|
+
accessKeyId: process.env.NITRO_S3_ACCESS_KEY_ID,
|
|
24
|
+
secretAccessKey: process.env.NITRO_S3_SECRET_ACCESS_KEY,
|
|
25
|
+
endpoint: process.env.NITRO_S3_ENDPOINT,
|
|
26
|
+
bucket: process.env.NITRO_S3_BUCKET,
|
|
27
|
+
region: process.env.NITRO_S3_REGION
|
|
30
28
|
});
|
|
31
29
|
storage.mount("r2", driver);
|
|
32
30
|
}
|