@sigmaott/base-next 1.4.60 → 1.4.61
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/nuxt.config.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { writeFileSync } from
|
|
2
|
-
import { resolve as resolveFs } from
|
|
3
|
-
import type { NuxtPage } from
|
|
4
|
-
import { createResolver } from
|
|
5
|
-
import generateMenuRoutes from
|
|
6
|
-
import { transformRouteToMenu } from
|
|
7
|
-
import { sharedModules } from
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { resolve as resolveFs } from "node:path";
|
|
3
|
+
import type { NuxtPage } from "nuxt/schema";
|
|
4
|
+
import { createResolver } from "@nuxt/kit";
|
|
5
|
+
import generateMenuRoutes from "./src/utils/gen-routes";
|
|
6
|
+
import { transformRouteToMenu } from "./src/utils/utils";
|
|
7
|
+
import { sharedModules } from "./nuxt-config";
|
|
8
8
|
|
|
9
|
-
const { resolve } = createResolver(import.meta.url)
|
|
9
|
+
const { resolve } = createResolver(import.meta.url);
|
|
10
10
|
|
|
11
11
|
export default defineNuxtConfig({
|
|
12
|
-
srcDir:
|
|
12
|
+
srcDir: "src/",
|
|
13
13
|
ssr: false,
|
|
14
14
|
modules: [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
resolve(
|
|
21
|
-
|
|
15
|
+
"@vueuse/nuxt",
|
|
16
|
+
"@pinia/nuxt",
|
|
17
|
+
"@element-plus/nuxt",
|
|
18
|
+
"@vue-macros/nuxt",
|
|
19
|
+
"@nuxtjs/i18n",
|
|
20
|
+
resolve("./src/modules/api-party/module.ts"),
|
|
21
|
+
"@unocss/nuxt",
|
|
22
22
|
// '@nuxt/fonts',
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
"v-lazy-show/nuxt",
|
|
24
|
+
"dayjs-nuxt",
|
|
25
25
|
...sharedModules,
|
|
26
26
|
],
|
|
27
27
|
i18n: {
|
|
28
28
|
lazy: true,
|
|
29
|
-
strategy:
|
|
30
|
-
langDir:
|
|
29
|
+
strategy: "no_prefix",
|
|
30
|
+
langDir: "../../base-next/locales",
|
|
31
31
|
locales: [
|
|
32
|
-
{ code:
|
|
33
|
-
{ code:
|
|
32
|
+
{ code: "en", file: "en.yaml" },
|
|
33
|
+
{ code: "vi", file: "vi.yaml" },
|
|
34
34
|
],
|
|
35
|
-
vueI18n:
|
|
35
|
+
vueI18n: "./i18n.config.ts",
|
|
36
36
|
},
|
|
37
37
|
experimental: {
|
|
38
38
|
// when using generate, payload js assets included in sw precache manifest
|
|
@@ -49,18 +49,18 @@ export default defineNuxtConfig({
|
|
|
49
49
|
apiParty: {
|
|
50
50
|
allowClient: true,
|
|
51
51
|
},
|
|
52
|
-
optimizeDeps: { exclude: [
|
|
52
|
+
optimizeDeps: { exclude: ["vue"] },
|
|
53
53
|
|
|
54
54
|
css: [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
resolve(
|
|
55
|
+
"@unocss/reset/tailwind-compat.css",
|
|
56
|
+
"vue-json-pretty/lib/styles.css",
|
|
57
|
+
resolve("./src/assets/scss/index.scss"),
|
|
58
58
|
],
|
|
59
59
|
|
|
60
60
|
nitro: {
|
|
61
61
|
esbuild: {
|
|
62
62
|
options: {
|
|
63
|
-
target:
|
|
63
|
+
target: "esnext",
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
},
|
|
@@ -69,64 +69,52 @@ export default defineNuxtConfig({
|
|
|
69
69
|
dirs: [
|
|
70
70
|
// './constants',
|
|
71
71
|
// all hooks, helper folders in components folder
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
"components/**/*/hooks/*.ts",
|
|
73
|
+
"components/**/*/helpers/*.ts",
|
|
74
74
|
],
|
|
75
75
|
presets: [
|
|
76
76
|
{
|
|
77
|
-
from:
|
|
77
|
+
from: "@tanstack/vue-query",
|
|
78
78
|
imports: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
"useInfiniteQuery",
|
|
80
|
+
"useIsFetching",
|
|
81
|
+
"useIsMutating",
|
|
82
|
+
"useMutation",
|
|
83
|
+
"useQueries",
|
|
84
|
+
"useQuery",
|
|
85
|
+
"useQueryClient",
|
|
86
|
+
"useQueryProvider",
|
|
87
87
|
],
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
|
-
from:
|
|
90
|
+
from: "@antfu/utils",
|
|
91
91
|
imports: [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
"ensurePrefix",
|
|
93
|
+
"ensureSuffix",
|
|
94
|
+
"objectKeys",
|
|
95
|
+
"objectMap",
|
|
96
|
+
"sleep",
|
|
97
97
|
],
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
|
-
from:
|
|
101
|
-
imports: [
|
|
102
|
-
'joinURL',
|
|
103
|
-
'resolveURL',
|
|
104
|
-
'withQuery',
|
|
105
|
-
],
|
|
100
|
+
from: "ufo",
|
|
101
|
+
imports: ["joinURL", "resolveURL", "withQuery"],
|
|
106
102
|
},
|
|
107
103
|
{
|
|
108
|
-
from:
|
|
109
|
-
imports: [
|
|
110
|
-
'klona',
|
|
111
|
-
],
|
|
104
|
+
from: "klona",
|
|
105
|
+
imports: ["klona"],
|
|
112
106
|
},
|
|
113
107
|
{
|
|
114
|
-
from:
|
|
115
|
-
imports: [
|
|
116
|
-
'defu',
|
|
117
|
-
],
|
|
108
|
+
from: "defu",
|
|
109
|
+
imports: ["defu"],
|
|
118
110
|
},
|
|
119
111
|
{
|
|
120
|
-
from:
|
|
121
|
-
imports: [
|
|
122
|
-
'equals',
|
|
123
|
-
],
|
|
112
|
+
from: "remeda",
|
|
113
|
+
imports: ["equals"],
|
|
124
114
|
},
|
|
125
115
|
{
|
|
126
|
-
from:
|
|
127
|
-
imports: [
|
|
128
|
-
'dayjs',
|
|
129
|
-
],
|
|
116
|
+
from: "element-plus",
|
|
117
|
+
imports: ["dayjs"],
|
|
130
118
|
},
|
|
131
119
|
],
|
|
132
120
|
},
|
|
@@ -134,24 +122,24 @@ export default defineNuxtConfig({
|
|
|
134
122
|
css: {
|
|
135
123
|
preprocessorOptions: {
|
|
136
124
|
scss: {
|
|
137
|
-
additionalData: `@use "${resolve(
|
|
125
|
+
additionalData: `@use "${resolve("./src/assets/scss/element/index.scss")}" as element;`,
|
|
138
126
|
},
|
|
139
127
|
},
|
|
140
128
|
},
|
|
141
129
|
optimizeDeps: {
|
|
142
|
-
needsInterop: [
|
|
130
|
+
needsInterop: ["mediainfo.js"],
|
|
143
131
|
include: [
|
|
144
132
|
"dayjs",
|
|
145
133
|
"dayjs/plugin/utc",
|
|
146
134
|
"dayjs/plugin/timezone",
|
|
147
135
|
"dayjs/plugin/customParseFormat",
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
136
|
+
"axios",
|
|
137
|
+
"validator/lib/isIP",
|
|
138
|
+
"validator/lib/isEmail",
|
|
139
|
+
"clipboard",
|
|
140
|
+
"deepmerge",
|
|
141
|
+
"swagger-client",
|
|
142
|
+
"mediainfo.js",
|
|
155
143
|
"video.js",
|
|
156
144
|
],
|
|
157
145
|
},
|
|
@@ -161,90 +149,90 @@ export default defineNuxtConfig({
|
|
|
161
149
|
},
|
|
162
150
|
vue: {
|
|
163
151
|
compilerOptions: {
|
|
164
|
-
isCustomElement: tag => tag.startsWith(
|
|
152
|
+
isCustomElement: (tag) => tag.startsWith("micro-app"),
|
|
165
153
|
},
|
|
166
154
|
},
|
|
167
155
|
hooks: {
|
|
168
|
-
|
|
156
|
+
"pages:extend": function (pages) {
|
|
169
157
|
// remove routes
|
|
170
158
|
function removePagesMatching(pattern: RegExp, pages: NuxtPage[] = []) {
|
|
171
|
-
const pagesToRemove = []
|
|
159
|
+
const pagesToRemove = [];
|
|
172
160
|
for (const page of pages) {
|
|
173
|
-
if (pattern.test(page.file))
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
else
|
|
177
|
-
removePagesMatching(pattern, page.children)
|
|
161
|
+
if (pattern.test(page.file)) pagesToRemove.push(page);
|
|
162
|
+
else removePagesMatching(pattern, page.children);
|
|
178
163
|
}
|
|
179
|
-
for (const page of pagesToRemove)
|
|
180
|
-
pages.splice(pages.indexOf(page), 1)
|
|
164
|
+
for (const page of pagesToRemove) pages.splice(pages.indexOf(page), 1);
|
|
181
165
|
}
|
|
182
|
-
removePagesMatching(/.*\/components\/.*$/, pages)
|
|
166
|
+
removePagesMatching(/.*\/components\/.*$/, pages);
|
|
183
167
|
|
|
184
168
|
// the problem is that we dont have page metadata
|
|
185
|
-
generateMenuRoutes({ routes: transformRouteToMenu(pages) })
|
|
169
|
+
generateMenuRoutes({ routes: transformRouteToMenu(pages) });
|
|
186
170
|
},
|
|
187
|
-
|
|
188
|
-
writeFileSync(
|
|
171
|
+
"build:before": function () {
|
|
172
|
+
writeFileSync(
|
|
173
|
+
resolveFs("./src/public/build-time.json"),
|
|
174
|
+
JSON.stringify(Date.now(), null, 2),
|
|
175
|
+
);
|
|
189
176
|
},
|
|
190
177
|
},
|
|
191
178
|
components: [
|
|
192
179
|
{
|
|
193
|
-
path: resolve(
|
|
194
|
-
extensions: [
|
|
195
|
-
prefix:
|
|
180
|
+
path: resolve("./src/components"),
|
|
181
|
+
extensions: ["vue"],
|
|
182
|
+
prefix: "SS",
|
|
196
183
|
},
|
|
197
184
|
],
|
|
198
185
|
runtimeConfig: {
|
|
199
186
|
public: {
|
|
200
187
|
apiBase: process.env.NUXT_PUBLIC_API_BASE,
|
|
188
|
+
version: process.env.VERSION,
|
|
201
189
|
},
|
|
202
190
|
apiParty: {
|
|
203
191
|
endpoints: {
|
|
204
192
|
authServiceApi: {
|
|
205
|
-
schema: resolve(
|
|
193
|
+
schema: resolve("./src/schemas/authServiceApi.json"),
|
|
206
194
|
},
|
|
207
195
|
libraryApi: {
|
|
208
|
-
schema: resolve(
|
|
196
|
+
schema: resolve("./src/schemas/libraryApi.json"),
|
|
209
197
|
},
|
|
210
198
|
machineApi: {
|
|
211
|
-
schema: resolve(
|
|
199
|
+
schema: resolve("./src/schemas/machineApi.json"),
|
|
212
200
|
},
|
|
213
201
|
licenseApi: {
|
|
214
|
-
schema: resolve(
|
|
202
|
+
schema: resolve("./src/schemas/licenseApi.json"),
|
|
215
203
|
},
|
|
216
204
|
billingApi: {
|
|
217
|
-
schema: resolve(
|
|
205
|
+
schema: resolve("./src/schemas/billingApi.json"),
|
|
218
206
|
},
|
|
219
207
|
notificationApi: {
|
|
220
|
-
schema: resolve(
|
|
208
|
+
schema: resolve("./src/schemas/notificationApi.json"),
|
|
221
209
|
},
|
|
222
210
|
lrmApi: {
|
|
223
|
-
schema: resolve(
|
|
211
|
+
schema: resolve("./src/schemas/lrmApi.json"),
|
|
224
212
|
},
|
|
225
213
|
transcodeApi: {
|
|
226
|
-
schema: resolve(
|
|
214
|
+
schema: resolve("./src/schemas/transcodeApi.json"),
|
|
227
215
|
},
|
|
228
216
|
playoutApi: {
|
|
229
|
-
schema: resolve(
|
|
217
|
+
schema: resolve("./src/schemas/playoutApi.json"),
|
|
230
218
|
},
|
|
231
219
|
metricApi: {
|
|
232
|
-
schema: resolve(
|
|
220
|
+
schema: resolve("./src/schemas/metricApi.json"),
|
|
233
221
|
},
|
|
234
222
|
vodApi: {
|
|
235
|
-
schema: resolve(
|
|
223
|
+
schema: resolve("./src/schemas/vodApi.json"),
|
|
236
224
|
},
|
|
237
225
|
livestreamApi: {
|
|
238
|
-
schema: resolve(
|
|
226
|
+
schema: resolve("./src/schemas/livestreamApi.json"),
|
|
239
227
|
},
|
|
240
228
|
ssaiApi: {
|
|
241
|
-
schema: resolve(
|
|
229
|
+
schema: resolve("./src/schemas/ssaiApi.json"),
|
|
242
230
|
},
|
|
243
231
|
vastControlApi: {
|
|
244
|
-
schema: resolve(
|
|
232
|
+
schema: resolve("./src/schemas/vastControlApi.json"),
|
|
245
233
|
},
|
|
246
234
|
chatApi: {
|
|
247
|
-
schema: resolve(
|
|
235
|
+
schema: resolve("./src/schemas/chatApi.json"),
|
|
248
236
|
},
|
|
249
237
|
},
|
|
250
238
|
},
|
|
@@ -255,23 +243,23 @@ export default defineNuxtConfig({
|
|
|
255
243
|
devtools: {
|
|
256
244
|
enabled: true,
|
|
257
245
|
componentInspector: {
|
|
258
|
-
toggleComboKey:
|
|
259
|
-
launchEditor:
|
|
246
|
+
toggleComboKey: "meta-shift",
|
|
247
|
+
launchEditor: "cursor",
|
|
260
248
|
},
|
|
261
249
|
},
|
|
262
250
|
routeRules: {
|
|
263
|
-
|
|
251
|
+
"/**": {
|
|
264
252
|
// enable CORS
|
|
265
253
|
cors: true, // if enabled, also needs cors-preflight-request.ts Nitro middleware to answer CORS preflight requests
|
|
266
254
|
headers: {
|
|
267
255
|
// CORS headers
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
256
|
+
"Access-Control-Allow-Origin": "*", // 'http://example:6006', has to be set to the requesting domain that you want to send the credentials back to
|
|
257
|
+
"Access-Control-Allow-Methods": "*", // 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS'
|
|
258
|
+
"Access-Control-Allow-Credentials": "true",
|
|
259
|
+
"Access-Control-Allow-Headers": "*", // 'Origin, Content-Type, Accept, Authorization, X-Requested-With'
|
|
260
|
+
"Access-Control-Expose-Headers": "*",
|
|
261
|
+
"Access-Control-Max-Age": "0", // 7200 = caching 2 hours (Chromium default), https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age#directives
|
|
274
262
|
},
|
|
275
263
|
},
|
|
276
264
|
},
|
|
277
|
-
})
|
|
265
|
+
});
|