@akanjs/config 0.0.38 → 0.0.40
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/index.d.ts +3 -0
- package/index.js +67 -358
- package/package.json +2 -5
- package/src/akanConfig.d.ts +140 -0
- package/src/akanConfig.js +141 -0
- package/src/baseConfigEnv.d.ts +9 -0
- package/src/baseConfigEnv.js +42 -0
- package/src/capacitor.base.config.d.ts +5 -0
- package/src/capacitor.base.config.js +74 -0
- package/src/nextConfig.d.ts +20 -0
- package/src/nextConfig.js +277 -0
- package/src/postcss.config.base.js +23 -0
- package/src/styles.css +450 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import 'next';
|
|
2
|
+
export { d as AkanConfigFile, b as AppConfig, a as AppConfigResult, e as AppScanResult, A as Arch, D as DeepPartial, E as ExplicitDependencies, F as FileConventionScanResult, c as LibConfig, L as LibConfigResult, f as LibScanResult, P as PkgScanResult, R as RunnerProps, W as WorkspaceScanResult, getAppConfig, g as getDefaultFileScan, getLibConfig, getNextConfig, makeAppConfig, makeLibConfig } from './src/akanConfig.js';
|
|
3
|
+
export { NextConfigFn, NextPlugin, NextPluginThatReturnsConfigFn, composePlugins, defaultNextConfigFile, withBase } from './src/nextConfig.js';
|
package/index.js
CHANGED
|
@@ -1,358 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
return config;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
var commandType = process.env.AKAN_COMMAND_TYPE?.includes("serve") ? "serve" : process.env.AKAN_COMMAND_TYPE?.includes("build") ? "build" : "deploy";
|
|
74
|
-
var withPWA = (0, import_next_pwa.default)({
|
|
75
|
-
dest: "public",
|
|
76
|
-
register: true,
|
|
77
|
-
skipWaiting: true,
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
79
|
-
runtimeCaching: import_cache.default,
|
|
80
|
-
disable: commandType === "serve"
|
|
81
|
-
});
|
|
82
|
-
var devDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN ?? "akanjs.com";
|
|
83
|
-
var withBase = (appName, config, libs, routes = []) => {
|
|
84
|
-
return composePlugins(
|
|
85
|
-
(0, import_bundle_analyzer.default)({ enabled: process.env.ANALYZE === "true" }),
|
|
86
|
-
...commandType !== "serve" || process.env.USE_PWA === "true" ? [withPWA] : []
|
|
87
|
-
)({
|
|
88
|
-
...config,
|
|
89
|
-
eslint: { ...config.eslint, ignoreDuringBuilds: true },
|
|
90
|
-
env: {
|
|
91
|
-
...config.env,
|
|
92
|
-
basePaths: routes.map(({ basePath }) => basePath).join(",")
|
|
93
|
-
},
|
|
94
|
-
transpilePackages: [
|
|
95
|
-
"swiper",
|
|
96
|
-
"ssr-window",
|
|
97
|
-
"dom7",
|
|
98
|
-
...libs.map((lib) => `@${lib}`),
|
|
99
|
-
"@akanjs/base",
|
|
100
|
-
"@akanjs/common",
|
|
101
|
-
"@akanjs/next",
|
|
102
|
-
"@akanjs/ui",
|
|
103
|
-
"@akanjs/client",
|
|
104
|
-
"@akanjs/server",
|
|
105
|
-
"@akanjs/service",
|
|
106
|
-
"@akanjs/signal",
|
|
107
|
-
"@akanjs/store",
|
|
108
|
-
"@akanjs/dictionary",
|
|
109
|
-
"@akanjs/constant",
|
|
110
|
-
"@akanjs/config",
|
|
111
|
-
"@akanjs/document"
|
|
112
|
-
],
|
|
113
|
-
reactStrictMode: commandType === "serve" ? false : true,
|
|
114
|
-
experimental: {
|
|
115
|
-
...config.experimental ?? {},
|
|
116
|
-
optimizePackageImports: [
|
|
117
|
-
...[appName, ...libs].map((lib) => [`@${lib}/ui`, `@${lib}/next`, `@${lib}/common`, `@${lib}/client`]).flat(),
|
|
118
|
-
"@contract",
|
|
119
|
-
"@akanjs/next",
|
|
120
|
-
"@akanjs/common"
|
|
121
|
-
]
|
|
122
|
-
},
|
|
123
|
-
// modularizeImports: {
|
|
124
|
-
// "react-icons/?(((\\w*)?/?)*)": {
|
|
125
|
-
// transform: "@react-icons/all-files/{{ matches.[1] }}/{{member}}",
|
|
126
|
-
// skipDefaultConversion: true,
|
|
127
|
-
// },
|
|
128
|
-
// lodash: { transform: "lodash/{{member}}", preventFullImport: true },
|
|
129
|
-
// ...Object.fromEntries(
|
|
130
|
-
// [appName, ...libs].reduce(
|
|
131
|
-
// (acc, lib) => [
|
|
132
|
-
// ...acc,
|
|
133
|
-
// [`@${lib}/ui`, { transform: `@${lib}/ui/{{member}}`, skipDefaultConversion: true }],
|
|
134
|
-
// [`@${lib}/next`, { transform: `@${lib}/next/{{member}}`, skipDefaultConversion: true }],
|
|
135
|
-
// [`@${lib}/common`, { transform: `@${lib}/common/{{member}}`, skipDefaultConversion: true }],
|
|
136
|
-
// [`@${lib}/client`, { transform: `@${lib}/lib/{{ camelCase member }}`, skipDefaultConversion: true }],
|
|
137
|
-
// ],
|
|
138
|
-
// [
|
|
139
|
-
// ["@contract", { transform: `@contract/src/{{member}}`, skipDefaultConversion: true }],
|
|
140
|
-
// [`@akanjs/next`, { transform: `@akanjs/next/src/{{member}}`, skipDefaultConversion: true }],
|
|
141
|
-
// [`@akanjs/common`, { transform: `@akanjs/common/src/{{member}}`, skipDefaultConversion: true }],
|
|
142
|
-
// ]
|
|
143
|
-
// )
|
|
144
|
-
// ),
|
|
145
|
-
// ...(config.modularizeImports ?? {}),
|
|
146
|
-
// },
|
|
147
|
-
images: {
|
|
148
|
-
formats: ["image/avif", "image/webp"],
|
|
149
|
-
...config.images ?? {},
|
|
150
|
-
remotePatterns: [
|
|
151
|
-
...config.images?.remotePatterns ?? [],
|
|
152
|
-
...routes.map(({ domains }) => [
|
|
153
|
-
...domains.main?.map((domain) => ({ protocol: "https", hostname: `**.${domain}` })) ?? [],
|
|
154
|
-
...domains.develop?.map((domain) => ({ protocol: "https", hostname: `**.${domain}` })) ?? [],
|
|
155
|
-
...domains.debug?.map((domain) => ({ protocol: "https", hostname: `**.${domain}` })) ?? []
|
|
156
|
-
]).flat(),
|
|
157
|
-
{ protocol: "https", hostname: `**.${devDomain}` }
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
webpack: (config2) => {
|
|
161
|
-
config2.resolve.alias.canvas = false;
|
|
162
|
-
config2.resolve.alias.encoding = false;
|
|
163
|
-
if (process.env.USE_AKANJS_PKGS === "true")
|
|
164
|
-
config2.resolve.alias["@akanjs/config"] = import_path.default.resolve(__dirname, "../../../../pkgs/@akanjs/config");
|
|
165
|
-
return config2;
|
|
166
|
-
},
|
|
167
|
-
redirects() {
|
|
168
|
-
return routes.map(({ basePath, domains }) => [
|
|
169
|
-
{ basePath, domain: `${basePath}-debug.${devDomain}` },
|
|
170
|
-
{ basePath, domain: `${basePath}-develop.${devDomain}` },
|
|
171
|
-
{ basePath, domain: `${basePath}-main.${devDomain}` },
|
|
172
|
-
...domains.main?.map((domain) => ({ basePath, domain })) ?? [],
|
|
173
|
-
...domains.develop?.map((domain) => ({ basePath, domain })) ?? [],
|
|
174
|
-
...domains.debug?.map((domain) => ({ basePath, domain })) ?? []
|
|
175
|
-
]).flat().map(({ basePath, domain }) => ({
|
|
176
|
-
source: `/:locale/${basePath}/:path*`,
|
|
177
|
-
has: [{ type: "host", value: domain }],
|
|
178
|
-
permanent: true,
|
|
179
|
-
destination: "/:locale/:path*"
|
|
180
|
-
}));
|
|
181
|
-
},
|
|
182
|
-
rewrites() {
|
|
183
|
-
return routes.map(({ basePath, domains }) => [
|
|
184
|
-
{ basePath, domain: `${basePath}-debug.${devDomain}` },
|
|
185
|
-
{ basePath, domain: `${basePath}-develop.${devDomain}` },
|
|
186
|
-
{ basePath, domain: `${basePath}-main.${devDomain}` },
|
|
187
|
-
...domains.main?.map((domain) => ({ basePath, domain })) ?? [],
|
|
188
|
-
...domains.develop?.map((domain) => ({ basePath, domain })) ?? [],
|
|
189
|
-
...domains.debug?.map((domain) => ({ basePath, domain })) ?? []
|
|
190
|
-
]).flat().map(({ basePath, domain }) => [
|
|
191
|
-
{
|
|
192
|
-
source: "/:locale",
|
|
193
|
-
has: [{ type: "host", value: domain }],
|
|
194
|
-
destination: `/:locale/${basePath}`
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
source: `/:locale/:path((?!${basePath}$)(?!admin(?:/|$)).*)`,
|
|
198
|
-
has: [{ type: "host", value: domain }],
|
|
199
|
-
destination: `/:locale/${basePath}/:path*`
|
|
200
|
-
}
|
|
201
|
-
]).flat();
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
};
|
|
205
|
-
var defaultNextConfigFile = `import "tsconfig-paths/register";
|
|
206
|
-
|
|
207
|
-
import { getNextConfig } from "@akanjs/config";
|
|
208
|
-
|
|
209
|
-
import appInfo from "./akan.app.json";
|
|
210
|
-
import config from "./akan.config";
|
|
211
|
-
|
|
212
|
-
export default getNextConfig(config, appInfo);
|
|
213
|
-
`;
|
|
214
|
-
|
|
215
|
-
// pkgs/@akanjs/config/src/akanConfig.ts
|
|
216
|
-
var makeAppConfig = (config, props = {}) => {
|
|
217
|
-
const baseConfigEnv = getBaseConfigEnv(props.appName);
|
|
218
|
-
const {
|
|
219
|
-
appName = baseConfigEnv.appName,
|
|
220
|
-
repoName = baseConfigEnv.repoName,
|
|
221
|
-
serveDomain = baseConfigEnv.serveDomain,
|
|
222
|
-
env = baseConfigEnv.env,
|
|
223
|
-
command = "build"
|
|
224
|
-
} = props;
|
|
225
|
-
return {
|
|
226
|
-
rootLib: config.rootLib,
|
|
227
|
-
libs: config.libs ?? [],
|
|
228
|
-
backend: {
|
|
229
|
-
dockerfile: config.backend?.dockerfile ?? `FROM node:22-slim
|
|
230
|
-
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
|
231
|
-
RUN apt-get update && apt-get upgrade -y
|
|
232
|
-
RUN apt-get install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils udev
|
|
233
|
-
ARG TARGETARCH
|
|
234
|
-
RUN if [ "$TARGETARCH" = "amd64" ]; then wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-debian92-x86_64-100.3.1.deb && apt-get install -y ./mongodb-database-tools-*.deb && rm -f mongodb-database-tools-*.deb; fi
|
|
235
|
-
RUN apt-get install -y git redis build-essential python3
|
|
236
|
-
RUN rm -rf /var/lib/apt/lists/*
|
|
237
|
-
RUN mkdir -p /workspace
|
|
238
|
-
WORKDIR /workspace
|
|
239
|
-
COPY ./package.json ./package.json
|
|
240
|
-
RUN npx pnpm i --prod
|
|
241
|
-
COPY . .
|
|
242
|
-
ENV PORT 8080
|
|
243
|
-
ENV NODE_OPTIONS=--max_old_space_size=8192
|
|
244
|
-
ENV NEXT_PUBLIC_REPO_NAME=${repoName}
|
|
245
|
-
ENV NEXT_PUBLIC_SERVE_DOMAIN=${serveDomain}
|
|
246
|
-
ENV NEXT_PUBLIC_APP_NAME=${appName}
|
|
247
|
-
ENV NEXT_PUBLIC_ENV=${env}
|
|
248
|
-
ENV NEXT_PUBLIC_OPERATION_MODE=cloud
|
|
249
|
-
CMD ["node", "main.js"]`,
|
|
250
|
-
explicitDependencies: config.backend?.explicitDependencies ?? []
|
|
251
|
-
},
|
|
252
|
-
frontend: {
|
|
253
|
-
dockerfile: config.frontend?.dockerfile ?? `FROM node:22-alpine
|
|
254
|
-
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
|
255
|
-
RUN apk --no-cache add git
|
|
256
|
-
RUN mkdir -p /workspace
|
|
257
|
-
WORKDIR /workspace
|
|
258
|
-
COPY ./package.json ./package.json
|
|
259
|
-
RUN npx pnpm i --prod
|
|
260
|
-
COPY . .
|
|
261
|
-
ENV PORT 4200
|
|
262
|
-
ENV NODE_OPTIONS=--max_old_space_size=8192
|
|
263
|
-
ENV NEXT_PUBLIC_REPO_NAME=${repoName}
|
|
264
|
-
ENV NEXT_PUBLIC_SERVE_DOMAIN=${serveDomain}
|
|
265
|
-
ENV NEXT_PUBLIC_APP_NAME=${appName}
|
|
266
|
-
ENV NEXT_PUBLIC_ENV=${env}
|
|
267
|
-
ENV NEXT_PUBLIC_OPERATION_MODE=cloud
|
|
268
|
-
CMD ["npm", "start"]`,
|
|
269
|
-
nextConfig: withBase(
|
|
270
|
-
appName,
|
|
271
|
-
config.frontend?.nextConfig ? typeof config.frontend.nextConfig === "function" ? config.frontend.nextConfig() : config.frontend.nextConfig : {},
|
|
272
|
-
config.libs ?? [],
|
|
273
|
-
config.frontend?.routes
|
|
274
|
-
),
|
|
275
|
-
explicitDependencies: config.frontend?.explicitDependencies ?? []
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
var getAppConfig = async (appRoot, props) => {
|
|
280
|
-
const akanConfigPath = import_path2.default.join(appRoot, "akan.config.ts");
|
|
281
|
-
if (!import_fs.default.existsSync(akanConfigPath))
|
|
282
|
-
throw new Error(`application akan.config.ts is not found ${appRoot}`);
|
|
283
|
-
const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
|
|
284
|
-
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
285
|
-
return makeAppConfig(config, props);
|
|
286
|
-
};
|
|
287
|
-
var makeLibConfig = (config, props = {}) => {
|
|
288
|
-
return {
|
|
289
|
-
rootLib: config.rootLib,
|
|
290
|
-
libs: config.libs ?? [],
|
|
291
|
-
backend: {
|
|
292
|
-
explicitDependencies: config.backend?.explicitDependencies ?? []
|
|
293
|
-
},
|
|
294
|
-
frontend: {
|
|
295
|
-
explicitDependencies: config.frontend?.explicitDependencies ?? []
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
};
|
|
299
|
-
var getLibConfig = async (libRoot, props) => {
|
|
300
|
-
const akanConfigPath = import_path2.default.join(libRoot, "akan.config.ts");
|
|
301
|
-
if (!import_fs.default.existsSync(akanConfigPath))
|
|
302
|
-
throw new Error(`library akan.config.ts is not found ${libRoot}`);
|
|
303
|
-
const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
|
|
304
|
-
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
305
|
-
return makeLibConfig(config, props);
|
|
306
|
-
};
|
|
307
|
-
var getNextConfig = (configImp, appData) => {
|
|
308
|
-
const appInfo = appData;
|
|
309
|
-
const baseConfigEnv = getBaseConfigEnv(appInfo.name);
|
|
310
|
-
const props = {
|
|
311
|
-
appName: baseConfigEnv.appName,
|
|
312
|
-
repoName: baseConfigEnv.repoName,
|
|
313
|
-
serveDomain: baseConfigEnv.serveDomain,
|
|
314
|
-
env: baseConfigEnv.env,
|
|
315
|
-
command: "build"
|
|
316
|
-
};
|
|
317
|
-
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
318
|
-
const akanConfig = makeAppConfig(config, props);
|
|
319
|
-
return akanConfig.frontend.nextConfig;
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
// pkgs/@akanjs/config/index.ts
|
|
323
|
-
var getDefaultFileScan = () => ({
|
|
324
|
-
constants: {
|
|
325
|
-
databases: [],
|
|
326
|
-
scalars: []
|
|
327
|
-
},
|
|
328
|
-
dictionary: {
|
|
329
|
-
databases: [],
|
|
330
|
-
services: [],
|
|
331
|
-
scalars: []
|
|
332
|
-
},
|
|
333
|
-
documents: {
|
|
334
|
-
databases: [],
|
|
335
|
-
scalars: []
|
|
336
|
-
},
|
|
337
|
-
services: {
|
|
338
|
-
databases: [],
|
|
339
|
-
services: [],
|
|
340
|
-
scalars: []
|
|
341
|
-
},
|
|
342
|
-
signal: {
|
|
343
|
-
databases: [],
|
|
344
|
-
services: [],
|
|
345
|
-
scalars: []
|
|
346
|
-
},
|
|
347
|
-
store: {
|
|
348
|
-
databases: [],
|
|
349
|
-
services: [],
|
|
350
|
-
scalars: []
|
|
351
|
-
},
|
|
352
|
-
components: {
|
|
353
|
-
databases: [],
|
|
354
|
-
services: [],
|
|
355
|
-
scalars: []
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
})();
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
getDefaultFileScan: () => getDefaultFileScan
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(index_exports);
|
|
25
|
+
__reExport(index_exports, require("./src/akanConfig"), module.exports);
|
|
26
|
+
__reExport(index_exports, require("./src/nextConfig"), module.exports);
|
|
27
|
+
const getDefaultFileScan = /* @__PURE__ */ __name(() => ({
|
|
28
|
+
constants: {
|
|
29
|
+
databases: [],
|
|
30
|
+
scalars: []
|
|
31
|
+
},
|
|
32
|
+
dictionary: {
|
|
33
|
+
databases: [],
|
|
34
|
+
services: [],
|
|
35
|
+
scalars: []
|
|
36
|
+
},
|
|
37
|
+
documents: {
|
|
38
|
+
databases: [],
|
|
39
|
+
scalars: []
|
|
40
|
+
},
|
|
41
|
+
services: {
|
|
42
|
+
databases: [],
|
|
43
|
+
services: [],
|
|
44
|
+
scalars: []
|
|
45
|
+
},
|
|
46
|
+
signal: {
|
|
47
|
+
databases: [],
|
|
48
|
+
services: [],
|
|
49
|
+
scalars: []
|
|
50
|
+
},
|
|
51
|
+
store: {
|
|
52
|
+
databases: [],
|
|
53
|
+
services: [],
|
|
54
|
+
scalars: []
|
|
55
|
+
},
|
|
56
|
+
components: {
|
|
57
|
+
databases: [],
|
|
58
|
+
services: [],
|
|
59
|
+
scalars: []
|
|
60
|
+
}
|
|
61
|
+
}), "getDefaultFileScan");
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
getDefaultFileScan,
|
|
65
|
+
...require("./src/akanConfig"),
|
|
66
|
+
...require("./src/nextConfig")
|
|
67
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -10,10 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/akan-team/akanjs.git",
|
|
11
11
|
"directory": "pkgs/@akanjs/config"
|
|
12
12
|
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@next/bundle-analyzer": "^15.1.3",
|
|
15
|
-
"next-pwa": "^5.6.0"
|
|
16
|
-
},
|
|
13
|
+
"dependencies": {},
|
|
17
14
|
"main": "./index.js",
|
|
18
15
|
"engines": {
|
|
19
16
|
"node": ">=22"
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { NextConfig } from 'next';
|
|
2
|
+
import './nextConfig.js';
|
|
3
|
+
|
|
4
|
+
declare const makeAppConfig: (config: DeepPartial<AppConfigResult>, props?: Partial<RunnerProps>) => AppConfigResult;
|
|
5
|
+
declare const getAppConfig: (appRoot: string, props: RunnerProps) => Promise<AppConfigResult>;
|
|
6
|
+
declare const makeLibConfig: (config: DeepPartial<LibConfigResult>, props?: Partial<RunnerProps>) => LibConfigResult;
|
|
7
|
+
declare const getLibConfig: (libRoot: string, props: RunnerProps) => Promise<LibConfigResult>;
|
|
8
|
+
declare const getNextConfig: (configImp: AppConfig, appData: any) => NextConfig | (() => Promise<NextConfig> | NextConfig);
|
|
9
|
+
|
|
10
|
+
interface RunnerProps {
|
|
11
|
+
appName: string;
|
|
12
|
+
repoName: string;
|
|
13
|
+
serveDomain: string;
|
|
14
|
+
env: "testing" | "debug" | "develop" | "main";
|
|
15
|
+
command?: string;
|
|
16
|
+
}
|
|
17
|
+
type Arch = "amd64" | "arm64";
|
|
18
|
+
type ExplicitDependencies = string[] | {
|
|
19
|
+
[key in Arch]: string[];
|
|
20
|
+
};
|
|
21
|
+
interface AppConfigResult {
|
|
22
|
+
rootLib?: string;
|
|
23
|
+
libs: string[];
|
|
24
|
+
backend: {
|
|
25
|
+
dockerfile: string;
|
|
26
|
+
explicitDependencies: ExplicitDependencies;
|
|
27
|
+
};
|
|
28
|
+
frontend: {
|
|
29
|
+
dockerfile: string;
|
|
30
|
+
nextConfig: NextConfig | (() => Promise<NextConfig> | NextConfig);
|
|
31
|
+
routes?: {
|
|
32
|
+
basePath?: string;
|
|
33
|
+
domains: {
|
|
34
|
+
main?: string[];
|
|
35
|
+
develop?: string[];
|
|
36
|
+
debug?: string[];
|
|
37
|
+
};
|
|
38
|
+
}[];
|
|
39
|
+
explicitDependencies: ExplicitDependencies;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface LibConfigResult {
|
|
43
|
+
rootLib?: string;
|
|
44
|
+
libs: string[];
|
|
45
|
+
backend: {
|
|
46
|
+
explicitDependencies: ExplicitDependencies;
|
|
47
|
+
};
|
|
48
|
+
frontend: {
|
|
49
|
+
explicitDependencies: ExplicitDependencies;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
type DeepPartial<T> = {
|
|
53
|
+
[P in keyof T]?: T[P] extends any[] ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
54
|
+
};
|
|
55
|
+
type AppConfig = DeepPartial<AppConfigResult> | ((props: RunnerProps) => DeepPartial<AppConfigResult>);
|
|
56
|
+
type LibConfig = DeepPartial<LibConfigResult> | ((props: RunnerProps) => DeepPartial<LibConfigResult>);
|
|
57
|
+
interface AkanConfigFile {
|
|
58
|
+
default: NextConfig;
|
|
59
|
+
}
|
|
60
|
+
interface FileConventionScanResult {
|
|
61
|
+
constants: {
|
|
62
|
+
databases: string[];
|
|
63
|
+
scalars: string[];
|
|
64
|
+
};
|
|
65
|
+
dictionary: {
|
|
66
|
+
databases: string[];
|
|
67
|
+
services: string[];
|
|
68
|
+
scalars: string[];
|
|
69
|
+
};
|
|
70
|
+
documents: {
|
|
71
|
+
databases: string[];
|
|
72
|
+
scalars: string[];
|
|
73
|
+
};
|
|
74
|
+
services: {
|
|
75
|
+
databases: string[];
|
|
76
|
+
services: string[];
|
|
77
|
+
scalars: string[];
|
|
78
|
+
};
|
|
79
|
+
signal: {
|
|
80
|
+
databases: string[];
|
|
81
|
+
services: string[];
|
|
82
|
+
scalars: string[];
|
|
83
|
+
};
|
|
84
|
+
store: {
|
|
85
|
+
databases: string[];
|
|
86
|
+
services: string[];
|
|
87
|
+
scalars: string[];
|
|
88
|
+
};
|
|
89
|
+
components: {
|
|
90
|
+
databases: string[];
|
|
91
|
+
services: string[];
|
|
92
|
+
scalars: string[];
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
declare const getDefaultFileScan: () => FileConventionScanResult;
|
|
96
|
+
interface AppScanResult {
|
|
97
|
+
name: string;
|
|
98
|
+
type: "app" | "lib";
|
|
99
|
+
akanConfig: AppConfigResult;
|
|
100
|
+
files: FileConventionScanResult;
|
|
101
|
+
libDeps: string[];
|
|
102
|
+
pkgDeps: string[];
|
|
103
|
+
dependencies: string[];
|
|
104
|
+
libs: {
|
|
105
|
+
[key: string]: LibScanResult;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
interface LibScanResult {
|
|
109
|
+
name: string;
|
|
110
|
+
type: "app" | "lib";
|
|
111
|
+
akanConfig: LibConfigResult;
|
|
112
|
+
files: FileConventionScanResult;
|
|
113
|
+
libDeps: string[];
|
|
114
|
+
pkgDeps: string[];
|
|
115
|
+
dependencies: string[];
|
|
116
|
+
libs: {
|
|
117
|
+
[key: string]: LibScanResult;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
interface PkgScanResult {
|
|
121
|
+
name: string;
|
|
122
|
+
pkgDeps: string[];
|
|
123
|
+
dependencies: string[];
|
|
124
|
+
}
|
|
125
|
+
interface WorkspaceScanResult {
|
|
126
|
+
appNames: string[];
|
|
127
|
+
libNames: string[];
|
|
128
|
+
pkgNames: string[];
|
|
129
|
+
apps: {
|
|
130
|
+
[key: string]: AppScanResult;
|
|
131
|
+
};
|
|
132
|
+
libs: {
|
|
133
|
+
[key: string]: LibScanResult;
|
|
134
|
+
};
|
|
135
|
+
pkgs: {
|
|
136
|
+
[key: string]: PkgScanResult;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { type Arch as A, type DeepPartial as D, type ExplicitDependencies as E, type FileConventionScanResult as F, type LibConfigResult as L, type PkgScanResult as P, type RunnerProps as R, type WorkspaceScanResult as W, type AppConfigResult as a, type AppConfig as b, type LibConfig as c, type AkanConfigFile as d, type AppScanResult as e, type LibScanResult as f, getDefaultFileScan as g, getAppConfig, getLibConfig, getNextConfig, makeAppConfig, makeLibConfig };
|