@akanjs/config 0.0.43 → 0.0.45
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.js +314 -303
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,208 +1,220 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
// pkgs/@akanjs/config/index.ts
|
|
30
|
+
var config_exports = {};
|
|
31
|
+
__export(config_exports, {
|
|
32
|
+
composePlugins: () => composePlugins,
|
|
33
|
+
defaultNextConfigFile: () => defaultNextConfigFile,
|
|
34
|
+
getAppConfig: () => getAppConfig,
|
|
35
|
+
getDefaultFileScan: () => getDefaultFileScan,
|
|
36
|
+
getLibConfig: () => getLibConfig,
|
|
37
|
+
getNextConfig: () => getNextConfig,
|
|
38
|
+
makeAppConfig: () => makeAppConfig,
|
|
39
|
+
makeLibConfig: () => makeLibConfig,
|
|
40
|
+
withBase: () => withBase
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(config_exports);
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
throw new Error("NEXT_PUBLIC_APP_NAME is not set");
|
|
40
|
-
const repoName = process.env.NEXT_PUBLIC_REPO_NAME;
|
|
41
|
-
if (!repoName)
|
|
42
|
-
throw new Error("NEXT_PUBLIC_REPO_NAME is not set");
|
|
43
|
-
const serveDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN;
|
|
44
|
-
if (!serveDomain)
|
|
45
|
-
throw new Error("NEXT_PUBLIC_SERVE_DOMAIN is not set");
|
|
46
|
-
const env = process.env.NEXT_PUBLIC_ENV ?? "debug";
|
|
47
|
-
if (!env)
|
|
48
|
-
throw new Error("NEXT_PUBLIC_ENV is not set");
|
|
49
|
-
return { appName, repoName, serveDomain, env };
|
|
50
|
-
};
|
|
44
|
+
// pkgs/@akanjs/config/src/akanConfig.ts
|
|
45
|
+
var import_fs = __toESM(require("fs"));
|
|
46
|
+
var import_path2 = __toESM(require("path"));
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
48
|
+
// pkgs/@akanjs/config/src/baseConfigEnv.ts
|
|
49
|
+
var getBaseConfigEnv = (appName = process.env.NEXT_PUBLIC_APP_NAME) => {
|
|
50
|
+
if (!appName)
|
|
51
|
+
throw new Error("NEXT_PUBLIC_APP_NAME is not set");
|
|
52
|
+
const repoName = process.env.NEXT_PUBLIC_REPO_NAME;
|
|
53
|
+
if (!repoName)
|
|
54
|
+
throw new Error("NEXT_PUBLIC_REPO_NAME is not set");
|
|
55
|
+
const serveDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN;
|
|
56
|
+
if (!serveDomain)
|
|
57
|
+
throw new Error("NEXT_PUBLIC_SERVE_DOMAIN is not set");
|
|
58
|
+
const env = process.env.NEXT_PUBLIC_ENV ?? "debug";
|
|
59
|
+
if (!env)
|
|
60
|
+
throw new Error("NEXT_PUBLIC_ENV is not set");
|
|
61
|
+
return { appName, repoName, serveDomain, env };
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// pkgs/@akanjs/config/src/nextConfig.ts
|
|
65
|
+
var import_bundle_analyzer = __toESM(require("@next/bundle-analyzer"));
|
|
66
|
+
var import_next_pwa = __toESM(require("next-pwa"));
|
|
67
|
+
var import_cache = __toESM(require("next-pwa/cache"));
|
|
68
|
+
var import_path = __toESM(require("path"));
|
|
69
|
+
var composePlugins = (...plugins) => {
|
|
70
|
+
return function(baseConfig) {
|
|
71
|
+
return async function combined(phase, context) {
|
|
72
|
+
let config = baseConfig;
|
|
73
|
+
for (const plugin of plugins) {
|
|
74
|
+
const fn = plugin;
|
|
75
|
+
const configOrFn = fn(config);
|
|
76
|
+
if (typeof configOrFn === "function")
|
|
77
|
+
config = await configOrFn(phase, context);
|
|
78
|
+
else
|
|
79
|
+
config = configOrFn;
|
|
80
|
+
}
|
|
81
|
+
return config;
|
|
71
82
|
};
|
|
72
83
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
84
|
+
};
|
|
85
|
+
var commandType = process.env.AKAN_COMMAND_TYPE?.includes("serve") ? "serve" : process.env.AKAN_COMMAND_TYPE?.includes("build") ? "build" : "deploy";
|
|
86
|
+
var withPWA = (0, import_next_pwa.default)({
|
|
87
|
+
dest: "public",
|
|
88
|
+
register: true,
|
|
89
|
+
skipWaiting: true,
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
91
|
+
runtimeCaching: import_cache.default,
|
|
92
|
+
disable: commandType === "serve"
|
|
93
|
+
});
|
|
94
|
+
var devDomain = process.env.NEXT_PUBLIC_SERVE_DOMAIN ?? "akanjs.com";
|
|
95
|
+
var withBase = (appName, config, libs, routes = []) => {
|
|
96
|
+
return composePlugins(
|
|
97
|
+
(0, import_bundle_analyzer.default)({ enabled: process.env.ANALYZE === "true" }),
|
|
98
|
+
...commandType !== "serve" || process.env.USE_PWA === "true" ? [withPWA] : []
|
|
99
|
+
)({
|
|
100
|
+
...config,
|
|
101
|
+
eslint: { ...config.eslint, ignoreDuringBuilds: true },
|
|
102
|
+
env: {
|
|
103
|
+
...config.env,
|
|
104
|
+
basePaths: routes.map(({ basePath }) => basePath).join(",")
|
|
105
|
+
},
|
|
106
|
+
transpilePackages: [
|
|
107
|
+
"swiper",
|
|
108
|
+
"ssr-window",
|
|
109
|
+
"dom7",
|
|
110
|
+
...libs.map((lib) => `@${lib}`),
|
|
111
|
+
"@akanjs/base",
|
|
112
|
+
"@akanjs/common",
|
|
113
|
+
"@akanjs/next",
|
|
114
|
+
"@akanjs/ui",
|
|
115
|
+
"@akanjs/client",
|
|
116
|
+
"@akanjs/server",
|
|
117
|
+
"@akanjs/service",
|
|
118
|
+
"@akanjs/signal",
|
|
119
|
+
"@akanjs/store",
|
|
120
|
+
"@akanjs/dictionary",
|
|
121
|
+
"@akanjs/constant",
|
|
122
|
+
"@akanjs/config",
|
|
123
|
+
"@akanjs/document"
|
|
124
|
+
],
|
|
125
|
+
reactStrictMode: commandType === "serve" ? false : true,
|
|
126
|
+
experimental: {
|
|
127
|
+
...config.experimental ?? {},
|
|
128
|
+
optimizePackageImports: [
|
|
129
|
+
...[appName, ...libs].map((lib) => [`@${lib}/ui`, `@${lib}/next`, `@${lib}/common`, `@${lib}/client`]).flat(),
|
|
130
|
+
"@contract",
|
|
101
131
|
"@akanjs/next",
|
|
102
|
-
"@akanjs/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
]).flat().map(({ basePath, domain }) => ({
|
|
176
|
-
source: `/:locale/${basePath}/:path*`,
|
|
132
|
+
"@akanjs/common"
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
// modularizeImports: {
|
|
136
|
+
// "react-icons/?(((\\w*)?/?)*)": {
|
|
137
|
+
// transform: "@react-icons/all-files/{{ matches.[1] }}/{{member}}",
|
|
138
|
+
// skipDefaultConversion: true,
|
|
139
|
+
// },
|
|
140
|
+
// lodash: { transform: "lodash/{{member}}", preventFullImport: true },
|
|
141
|
+
// ...Object.fromEntries(
|
|
142
|
+
// [appName, ...libs].reduce(
|
|
143
|
+
// (acc, lib) => [
|
|
144
|
+
// ...acc,
|
|
145
|
+
// [`@${lib}/ui`, { transform: `@${lib}/ui/{{member}}`, skipDefaultConversion: true }],
|
|
146
|
+
// [`@${lib}/next`, { transform: `@${lib}/next/{{member}}`, skipDefaultConversion: true }],
|
|
147
|
+
// [`@${lib}/common`, { transform: `@${lib}/common/{{member}}`, skipDefaultConversion: true }],
|
|
148
|
+
// [`@${lib}/client`, { transform: `@${lib}/lib/{{ camelCase member }}`, skipDefaultConversion: true }],
|
|
149
|
+
// ],
|
|
150
|
+
// [
|
|
151
|
+
// ["@contract", { transform: `@contract/src/{{member}}`, skipDefaultConversion: true }],
|
|
152
|
+
// [`@akanjs/next`, { transform: `@akanjs/next/src/{{member}}`, skipDefaultConversion: true }],
|
|
153
|
+
// [`@akanjs/common`, { transform: `@akanjs/common/src/{{member}}`, skipDefaultConversion: true }],
|
|
154
|
+
// ]
|
|
155
|
+
// )
|
|
156
|
+
// ),
|
|
157
|
+
// ...(config.modularizeImports ?? {}),
|
|
158
|
+
// },
|
|
159
|
+
images: {
|
|
160
|
+
formats: ["image/avif", "image/webp"],
|
|
161
|
+
...config.images ?? {},
|
|
162
|
+
remotePatterns: [
|
|
163
|
+
...config.images?.remotePatterns ?? [],
|
|
164
|
+
...routes.map(({ domains }) => [
|
|
165
|
+
...domains.main?.map((domain) => ({ protocol: "https", hostname: `**.${domain}` })) ?? [],
|
|
166
|
+
...domains.develop?.map((domain) => ({ protocol: "https", hostname: `**.${domain}` })) ?? [],
|
|
167
|
+
...domains.debug?.map((domain) => ({ protocol: "https", hostname: `**.${domain}` })) ?? []
|
|
168
|
+
]).flat(),
|
|
169
|
+
{ protocol: "https", hostname: `**.${devDomain}` }
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
webpack: (config2) => {
|
|
173
|
+
config2.resolve.alias.canvas = false;
|
|
174
|
+
config2.resolve.alias.encoding = false;
|
|
175
|
+
if (process.env.USE_AKANJS_PKGS === "true")
|
|
176
|
+
config2.resolve.alias["@akanjs/config"] = import_path.default.resolve(__dirname, "../../../../pkgs/@akanjs/config");
|
|
177
|
+
return config2;
|
|
178
|
+
},
|
|
179
|
+
redirects() {
|
|
180
|
+
return routes.map(({ basePath, domains }) => [
|
|
181
|
+
{ basePath, domain: `${basePath}-debug.${devDomain}` },
|
|
182
|
+
{ basePath, domain: `${basePath}-develop.${devDomain}` },
|
|
183
|
+
{ basePath, domain: `${basePath}-main.${devDomain}` },
|
|
184
|
+
...domains.main?.map((domain) => ({ basePath, domain })) ?? [],
|
|
185
|
+
...domains.develop?.map((domain) => ({ basePath, domain })) ?? [],
|
|
186
|
+
...domains.debug?.map((domain) => ({ basePath, domain })) ?? []
|
|
187
|
+
]).flat().map(({ basePath, domain }) => ({
|
|
188
|
+
source: `/:locale/${basePath}/:path*`,
|
|
189
|
+
has: [{ type: "host", value: domain }],
|
|
190
|
+
permanent: true,
|
|
191
|
+
destination: "/:locale/:path*"
|
|
192
|
+
}));
|
|
193
|
+
},
|
|
194
|
+
rewrites() {
|
|
195
|
+
return routes.map(({ basePath, domains }) => [
|
|
196
|
+
{ basePath, domain: `${basePath}-debug.${devDomain}` },
|
|
197
|
+
{ basePath, domain: `${basePath}-develop.${devDomain}` },
|
|
198
|
+
{ basePath, domain: `${basePath}-main.${devDomain}` },
|
|
199
|
+
...domains.main?.map((domain) => ({ basePath, domain })) ?? [],
|
|
200
|
+
...domains.develop?.map((domain) => ({ basePath, domain })) ?? [],
|
|
201
|
+
...domains.debug?.map((domain) => ({ basePath, domain })) ?? []
|
|
202
|
+
]).flat().map(({ basePath, domain }) => [
|
|
203
|
+
{
|
|
204
|
+
source: "/:locale",
|
|
177
205
|
has: [{ type: "host", value: domain }],
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
+
destination: `/:locale/${basePath}`
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
source: `/:locale/:path((?!${basePath}$)(?!admin(?:/|$)).*)`,
|
|
210
|
+
has: [{ type: "host", value: domain }],
|
|
211
|
+
destination: `/:locale/${basePath}/:path*`
|
|
212
|
+
}
|
|
213
|
+
]).flat();
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
var defaultNextConfigFile = `import "tsconfig-paths/register";
|
|
206
218
|
|
|
207
219
|
import { getNextConfig } from "@akanjs/config";
|
|
208
220
|
|
|
@@ -212,21 +224,21 @@ import config from "./akan.config";
|
|
|
212
224
|
export default getNextConfig(config, appInfo);
|
|
213
225
|
`;
|
|
214
226
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
// pkgs/@akanjs/config/src/akanConfig.ts
|
|
228
|
+
var makeAppConfig = (config, props = {}) => {
|
|
229
|
+
const baseConfigEnv = getBaseConfigEnv(props.appName);
|
|
230
|
+
const {
|
|
231
|
+
appName = baseConfigEnv.appName,
|
|
232
|
+
repoName = baseConfigEnv.repoName,
|
|
233
|
+
serveDomain = baseConfigEnv.serveDomain,
|
|
234
|
+
env = baseConfigEnv.env,
|
|
235
|
+
command = "build"
|
|
236
|
+
} = props;
|
|
237
|
+
return {
|
|
238
|
+
rootLib: config.rootLib,
|
|
239
|
+
libs: config.libs ?? [],
|
|
240
|
+
backend: {
|
|
241
|
+
dockerfile: config.backend?.dockerfile ?? `FROM node:22-slim
|
|
230
242
|
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
|
231
243
|
RUN apt-get update && apt-get upgrade -y
|
|
232
244
|
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
|
|
@@ -247,10 +259,10 @@ ENV NEXT_PUBLIC_APP_NAME=${appName}
|
|
|
247
259
|
ENV NEXT_PUBLIC_ENV=${env}
|
|
248
260
|
ENV NEXT_PUBLIC_OPERATION_MODE=cloud
|
|
249
261
|
CMD ["node", "main.js"]`,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
262
|
+
explicitDependencies: config.backend?.explicitDependencies ?? []
|
|
263
|
+
},
|
|
264
|
+
frontend: {
|
|
265
|
+
dockerfile: config.frontend?.dockerfile ?? `FROM node:22-alpine
|
|
254
266
|
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
|
255
267
|
RUN apk --no-cache add git
|
|
256
268
|
RUN mkdir -p /workspace
|
|
@@ -266,93 +278,92 @@ ENV NEXT_PUBLIC_APP_NAME=${appName}
|
|
|
266
278
|
ENV NEXT_PUBLIC_ENV=${env}
|
|
267
279
|
ENV NEXT_PUBLIC_OPERATION_MODE=cloud
|
|
268
280
|
CMD ["npm", "start"]`,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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);
|
|
281
|
+
nextConfig: withBase(
|
|
282
|
+
appName,
|
|
283
|
+
config.frontend?.nextConfig ? typeof config.frontend.nextConfig === "function" ? config.frontend.nextConfig() : config.frontend.nextConfig : {},
|
|
284
|
+
config.libs ?? [],
|
|
285
|
+
config.frontend?.routes
|
|
286
|
+
),
|
|
287
|
+
explicitDependencies: config.frontend?.explicitDependencies ?? []
|
|
288
|
+
}
|
|
286
289
|
};
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
290
|
+
};
|
|
291
|
+
var getAppConfig = async (appRoot, props) => {
|
|
292
|
+
const akanConfigPath = import_path2.default.join(appRoot, "akan.config.ts");
|
|
293
|
+
if (!import_fs.default.existsSync(akanConfigPath))
|
|
294
|
+
throw new Error(`application akan.config.ts is not found ${appRoot}`);
|
|
295
|
+
const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
|
|
296
|
+
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
297
|
+
return makeAppConfig(config, props);
|
|
298
|
+
};
|
|
299
|
+
var makeLibConfig = (config, props = {}) => {
|
|
300
|
+
return {
|
|
301
|
+
rootLib: config.rootLib,
|
|
302
|
+
libs: config.libs ?? [],
|
|
303
|
+
backend: {
|
|
304
|
+
explicitDependencies: config.backend?.explicitDependencies ?? []
|
|
305
|
+
},
|
|
306
|
+
frontend: {
|
|
307
|
+
explicitDependencies: config.frontend?.explicitDependencies ?? []
|
|
308
|
+
}
|
|
298
309
|
};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
318
|
-
const akanConfig = makeAppConfig(config, props);
|
|
319
|
-
return akanConfig.frontend.nextConfig;
|
|
310
|
+
};
|
|
311
|
+
var getLibConfig = async (libRoot, props) => {
|
|
312
|
+
const akanConfigPath = import_path2.default.join(libRoot, "akan.config.ts");
|
|
313
|
+
if (!import_fs.default.existsSync(akanConfigPath))
|
|
314
|
+
throw new Error(`library akan.config.ts is not found ${libRoot}`);
|
|
315
|
+
const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
|
|
316
|
+
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
317
|
+
return makeLibConfig(config, props);
|
|
318
|
+
};
|
|
319
|
+
var getNextConfig = (configImp, appData) => {
|
|
320
|
+
const appInfo = appData;
|
|
321
|
+
const baseConfigEnv = getBaseConfigEnv(appInfo.name);
|
|
322
|
+
const props = {
|
|
323
|
+
appName: baseConfigEnv.appName,
|
|
324
|
+
repoName: baseConfigEnv.repoName,
|
|
325
|
+
serveDomain: baseConfigEnv.serveDomain,
|
|
326
|
+
env: baseConfigEnv.env,
|
|
327
|
+
command: "build"
|
|
320
328
|
};
|
|
329
|
+
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
330
|
+
const akanConfig = makeAppConfig(config, props);
|
|
331
|
+
return akanConfig.frontend.nextConfig;
|
|
332
|
+
};
|
|
321
333
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
})();
|
|
334
|
+
// pkgs/@akanjs/config/index.ts
|
|
335
|
+
var getDefaultFileScan = () => ({
|
|
336
|
+
constants: {
|
|
337
|
+
databases: [],
|
|
338
|
+
scalars: []
|
|
339
|
+
},
|
|
340
|
+
dictionary: {
|
|
341
|
+
databases: [],
|
|
342
|
+
services: [],
|
|
343
|
+
scalars: []
|
|
344
|
+
},
|
|
345
|
+
documents: {
|
|
346
|
+
databases: [],
|
|
347
|
+
scalars: []
|
|
348
|
+
},
|
|
349
|
+
services: {
|
|
350
|
+
databases: [],
|
|
351
|
+
services: [],
|
|
352
|
+
scalars: []
|
|
353
|
+
},
|
|
354
|
+
signal: {
|
|
355
|
+
databases: [],
|
|
356
|
+
services: [],
|
|
357
|
+
scalars: []
|
|
358
|
+
},
|
|
359
|
+
store: {
|
|
360
|
+
databases: [],
|
|
361
|
+
services: [],
|
|
362
|
+
scalars: []
|
|
363
|
+
},
|
|
364
|
+
components: {
|
|
365
|
+
databases: [],
|
|
366
|
+
services: [],
|
|
367
|
+
scalars: []
|
|
368
|
+
}
|
|
369
|
+
});
|