@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.
Files changed (2) hide show
  1. package/index.js +314 -303
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,208 +1,220 @@
1
- (() => {
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined")
12
- return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
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
- // pkgs/@akanjs/config/src/akanConfig.ts
33
- var import_fs = __toESM(__require("fs"));
34
- var import_path2 = __toESM(__require("path"));
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
- // pkgs/@akanjs/config/src/baseConfigEnv.ts
37
- var getBaseConfigEnv = (appName = process.env.NEXT_PUBLIC_APP_NAME) => {
38
- if (!appName)
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
- // pkgs/@akanjs/config/src/nextConfig.ts
53
- var import_bundle_analyzer = __toESM(__require("@next/bundle-analyzer"));
54
- var import_next_pwa = __toESM(__require("next-pwa"));
55
- var import_cache = __toESM(__require("next-pwa/cache"));
56
- var import_path = __toESM(__require("path"));
57
- var composePlugins = (...plugins) => {
58
- return function(baseConfig) {
59
- return async function combined(phase, context) {
60
- let config = baseConfig;
61
- for (const plugin of plugins) {
62
- const fn = plugin;
63
- const configOrFn = fn(config);
64
- if (typeof configOrFn === "function")
65
- config = await configOrFn(phase, context);
66
- else
67
- config = configOrFn;
68
- }
69
- return config;
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
- 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",
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/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*`,
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
- 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
+ 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
- // 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
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
- explicitDependencies: config.backend?.explicitDependencies ?? []
251
- },
252
- frontend: {
253
- dockerfile: config.frontend?.dockerfile ?? `FROM node:22-alpine
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
- 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);
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
- 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
- };
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
- 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;
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
- // 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
- })();
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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/config",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"