@akanjs/cli 0.0.148 → 0.0.149
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/cjs/index.js +60 -19
- package/cjs/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -18
- package/cjs/src/templates/app/app/[lang]/(__appName__)/styles.css.template +19 -0
- package/cjs/src/templates/app/app/index.html.template +13 -0
- package/cjs/src/templates/app/capacitor.config.ts.template +8 -0
- package/cjs/src/templates/app/env/env.client.debug.ts.template +7 -0
- package/cjs/src/templates/app/env/env.client.develop.ts.template +7 -0
- package/cjs/src/templates/app/env/env.client.local.ts.template +7 -0
- package/cjs/src/templates/app/env/env.client.main.ts.template +7 -0
- package/cjs/src/templates/app/env/env.client.testing.ts.template +7 -0
- package/cjs/src/templates/app/env/env.server.debug.ts.template +15 -0
- package/cjs/src/templates/app/env/env.server.develop.ts.template +15 -0
- package/cjs/src/templates/app/env/env.server.local.ts.template +15 -0
- package/cjs/src/templates/app/env/env.server.main.ts.template +15 -0
- package/cjs/src/templates/app/env/env.server.testing.ts.template +7 -0
- package/cjs/src/templates/app/main.js +2 -1
- package/cjs/src/templates/app/page.test.ts.template +10 -0
- package/cjs/src/templates/app/playwright.config.ts.template +6 -0
- package/cjs/src/templates/app/postcss.config.js.template +10 -0
- package/cjs/src/templates/app/public/manifest.json.template +67 -0
- package/cjs/src/templates/app/tsconfig.json.template +22 -0
- package/cjs/src/templates/app/tsconfig.spec.json.template +7 -0
- package/cjs/src/templates/libRoot/.gitignore.template +15 -0
- package/cjs/src/templates/libRoot/env/env.server.example.ts.template +7 -0
- package/cjs/src/templates/libRoot/env/env.server.testing.ts.template +7 -0
- package/cjs/src/templates/libRoot/package.json.template +4 -0
- package/cjs/src/templates/libRoot/tsconfig.json.template +13 -0
- package/cjs/src/templates/libRoot/tsconfig.spec.json.template +7 -0
- package/cjs/src/templates/localDev/docker-compose.yaml.template +36 -0
- package/cjs/src/templates/pkgRoot/tsconfig.json.template +15 -0
- package/cjs/src/templates/workspaceRoot/.env.template +20 -0
- package/cjs/src/templates/workspaceRoot/.gitignore.template +118 -0
- package/cjs/src/templates/workspaceRoot/.prettierignore.template +10 -0
- package/cjs/src/templates/workspaceRoot/.prettierrc.json.template +6 -0
- package/cjs/src/templates/workspaceRoot/.swcrc.template +9 -0
- package/cjs/src/templates/workspaceRoot/.vscode/settings.json.template +13 -0
- package/cjs/src/templates/workspaceRoot/README.md.template +37 -0
- package/cjs/src/templates/workspaceRoot/eslint.config.ts.template +3 -0
- package/cjs/src/templates/workspaceRoot/package.json.template +43 -0
- package/cjs/src/templates/workspaceRoot/tsconfig.json.template +29 -0
- package/esm/index.js +61 -20
- package/esm/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -18
- package/esm/src/templates/app/app/[lang]/(__appName__)/styles.css.template +19 -0
- package/esm/src/templates/app/app/index.html.template +13 -0
- package/esm/src/templates/app/capacitor.config.ts.template +8 -0
- package/esm/src/templates/app/env/env.client.debug.ts.template +7 -0
- package/esm/src/templates/app/env/env.client.develop.ts.template +7 -0
- package/esm/src/templates/app/env/env.client.local.ts.template +7 -0
- package/esm/src/templates/app/env/env.client.main.ts.template +7 -0
- package/esm/src/templates/app/env/env.client.testing.ts.template +7 -0
- package/esm/src/templates/app/env/env.server.debug.ts.template +15 -0
- package/esm/src/templates/app/env/env.server.develop.ts.template +15 -0
- package/esm/src/templates/app/env/env.server.local.ts.template +15 -0
- package/esm/src/templates/app/env/env.server.main.ts.template +15 -0
- package/esm/src/templates/app/env/env.server.testing.ts.template +7 -0
- package/esm/src/templates/app/main.js +2 -1
- package/esm/src/templates/app/page.test.ts.template +10 -0
- package/esm/src/templates/app/playwright.config.ts.template +6 -0
- package/esm/src/templates/app/postcss.config.js.template +10 -0
- package/esm/src/templates/app/public/manifest.json.template +67 -0
- package/esm/src/templates/app/tsconfig.json.template +22 -0
- package/esm/src/templates/app/tsconfig.spec.json.template +7 -0
- package/esm/src/templates/libRoot/.gitignore.template +15 -0
- package/esm/src/templates/libRoot/env/env.server.example.ts.template +7 -0
- package/esm/src/templates/libRoot/env/env.server.testing.ts.template +7 -0
- package/esm/src/templates/libRoot/package.json.template +4 -0
- package/esm/src/templates/libRoot/tsconfig.json.template +13 -0
- package/esm/src/templates/libRoot/tsconfig.spec.json.template +7 -0
- package/esm/src/templates/localDev/docker-compose.yaml.template +36 -0
- package/esm/src/templates/pkgRoot/tsconfig.json.template +15 -0
- package/esm/src/templates/workspaceRoot/.env.template +20 -0
- package/esm/src/templates/workspaceRoot/.gitignore.template +118 -0
- package/esm/src/templates/workspaceRoot/.prettierignore.template +10 -0
- package/esm/src/templates/workspaceRoot/.prettierrc.json.template +6 -0
- package/esm/src/templates/workspaceRoot/.swcrc.template +9 -0
- package/esm/src/templates/workspaceRoot/.vscode/settings.json.template +13 -0
- package/esm/src/templates/workspaceRoot/README.md.template +37 -0
- package/esm/src/templates/workspaceRoot/eslint.config.ts.template +3 -0
- package/esm/src/templates/workspaceRoot/package.json.template +43 -0
- package/esm/src/templates/workspaceRoot/tsconfig.json.template +29 -0
- package/package.json +1 -1
- package/src/application/application.command.d.ts +1 -0
- package/src/application/application.runner.d.ts +6 -1
- package/src/application/application.script.d.ts +3 -1
- package/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -18
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
**/dist
|
|
2
|
+
/node_modules
|
|
3
|
+
/.akan
|
|
4
|
+
.vscode/*
|
|
5
|
+
.DS_Store
|
|
6
|
+
Thumbs.db
|
|
7
|
+
*.env
|
|
8
|
+
**/node_modules
|
|
9
|
+
/data
|
|
10
|
+
apps/*/data
|
|
11
|
+
/releases
|
|
12
|
+
apps/*/scripts
|
|
13
|
+
**/.env
|
|
14
|
+
**/env.client.debug.ts
|
|
15
|
+
**/env.client.develop.ts
|
|
16
|
+
**/env.client.main.ts
|
|
17
|
+
**/env.client.testing.ts
|
|
18
|
+
**/env.server.debug.ts
|
|
19
|
+
**/env.server.develop.ts
|
|
20
|
+
**/env.server.main.ts
|
|
21
|
+
**/env.server.testing.ts
|
|
22
|
+
**/*secrets.yaml
|
|
23
|
+
**/kubeconfig.yaml
|
|
24
|
+
**/secrets.*
|
|
25
|
+
**/.idea
|
|
26
|
+
apps/**/src/schema.gql
|
|
27
|
+
.next
|
|
28
|
+
dump
|
|
29
|
+
local
|
|
30
|
+
|
|
31
|
+
# Xcode
|
|
32
|
+
build/
|
|
33
|
+
*.pbxuser
|
|
34
|
+
!default.pbxuser
|
|
35
|
+
*.mode1v3
|
|
36
|
+
!default.mode1v3
|
|
37
|
+
*.mode2v3
|
|
38
|
+
!default.mode2v3
|
|
39
|
+
*.perspectivev3
|
|
40
|
+
!default.perspectivev3
|
|
41
|
+
xcuserdata
|
|
42
|
+
*.xccheckout
|
|
43
|
+
*.moved-aside
|
|
44
|
+
DerivedData
|
|
45
|
+
*.hmap
|
|
46
|
+
*.ipa
|
|
47
|
+
*.xcuserstate
|
|
48
|
+
|
|
49
|
+
# **/android
|
|
50
|
+
build/
|
|
51
|
+
.gradle
|
|
52
|
+
local.properties
|
|
53
|
+
*.iml
|
|
54
|
+
*.hprof
|
|
55
|
+
.cxx/
|
|
56
|
+
*.keystore
|
|
57
|
+
!debug.keystore
|
|
58
|
+
|
|
59
|
+
**/public/precache.*.*.js
|
|
60
|
+
**/public/sw.js
|
|
61
|
+
**/public/workbox-*.js
|
|
62
|
+
**/public/worker-*.js
|
|
63
|
+
**/public/fallback-*.js
|
|
64
|
+
**/public/precache.*.*.js.map
|
|
65
|
+
**/public/sw.js.map
|
|
66
|
+
**/public/workbox-*.js.map
|
|
67
|
+
**/public/worker-*.js.map
|
|
68
|
+
**/public/fallback-*.js
|
|
69
|
+
**/public/libs
|
|
70
|
+
|
|
71
|
+
**/vendor/bundle/
|
|
72
|
+
**/ios/App/App/public
|
|
73
|
+
**/ios/App/App/Podfile.lock
|
|
74
|
+
**/ios/App/App.pbxproj
|
|
75
|
+
**/*-secret.yaml
|
|
76
|
+
|
|
77
|
+
# Akanjs files
|
|
78
|
+
**/akan.app.json
|
|
79
|
+
**/akan.lib.json
|
|
80
|
+
**/akan.pkg.json
|
|
81
|
+
**/next.config.ts
|
|
82
|
+
**/next-env.d.ts
|
|
83
|
+
apps/**/lib/__lib/**
|
|
84
|
+
libs/**/lib/__lib/**
|
|
85
|
+
apps/*/lib/cnst.ts
|
|
86
|
+
apps/*/lib/cnst_.ts
|
|
87
|
+
apps/*/lib/dict.ts
|
|
88
|
+
apps/*/lib/db.ts
|
|
89
|
+
apps/*/lib/fetch.ts
|
|
90
|
+
apps/*/lib/srv.ts
|
|
91
|
+
apps/*/lib/st.ts
|
|
92
|
+
apps/*/lib/sig.ts
|
|
93
|
+
apps/*/lib/store.ts
|
|
94
|
+
apps/*/lib/usePage.ts
|
|
95
|
+
apps/*/lib/__scalar/_server.ts
|
|
96
|
+
apps/*/client.ts
|
|
97
|
+
apps/*/server.ts
|
|
98
|
+
libs/*/lib/cnst.ts
|
|
99
|
+
libs/*/lib/cnst_.ts
|
|
100
|
+
libs/*/lib/dict.ts
|
|
101
|
+
libs/*/lib/db.ts
|
|
102
|
+
libs/*/lib/fetch.ts
|
|
103
|
+
libs/*/lib/srv.ts
|
|
104
|
+
libs/*/lib/st.ts
|
|
105
|
+
libs/*/lib/sig.ts
|
|
106
|
+
libs/*/lib/store.ts
|
|
107
|
+
libs/*/lib/usePage.ts
|
|
108
|
+
libs/*/lib/__scalar/_server.ts
|
|
109
|
+
libs/*/client.ts
|
|
110
|
+
libs/*/server.ts
|
|
111
|
+
libs/*/index.ts
|
|
112
|
+
# **/capacitor.config.ts
|
|
113
|
+
# **/postcss.config.js
|
|
114
|
+
# **/playwright.config.ts
|
|
115
|
+
# **/jest.config.ts
|
|
116
|
+
# **/next-env.d.ts
|
|
117
|
+
# **/tsconfig.json
|
|
118
|
+
# **/tsconfig.spec.json
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"testing.saveBeforeTest": false,
|
|
3
|
+
"jest.autoRun": "false",
|
|
4
|
+
"jestTestExplorer.flattenExplorer": false,
|
|
5
|
+
"eslint.validate": ["json"],
|
|
6
|
+
"prettier.configPath": ".prettierrc.json",
|
|
7
|
+
"tailwindCSS.classAttributes": ["class", "className", ".*Class", ".*ClassName"],
|
|
8
|
+
"colorize.languages": ["typescript", "javascript", "css", "scss"],
|
|
9
|
+
"typescript.tsserver.maxTsServerMemory": 16384,
|
|
10
|
+
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
11
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
12
|
+
"eslint.useFlatConfig": true
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
## Get Started
|
|
2
|
+
|
|
3
|
+
Run the code below.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm run downloadEnv # Need to register your public key
|
|
7
|
+
|
|
8
|
+
npm i -g akan pnpm
|
|
9
|
+
|
|
10
|
+
pnpm i
|
|
11
|
+
|
|
12
|
+
cat <<EOF >> .env
|
|
13
|
+
# organization configuration, no need to change
|
|
14
|
+
NEXT_PUBLIC_REPO_NAME=<%= repoName %>
|
|
15
|
+
NEXT_PUBLIC_SERVE_DOMAIN="<%= serveDomain %>"
|
|
16
|
+
|
|
17
|
+
# development branch, debug, develop, main, etc. mainly it changes databases.
|
|
18
|
+
NEXT_PUBLIC_ENV=debug
|
|
19
|
+
|
|
20
|
+
# local, cloud, edge it changes the connection point of the clients.
|
|
21
|
+
NEXT_PUBLIC_OPERATION_MODE=local
|
|
22
|
+
# hybrid app specific config, will be depreciated in the future
|
|
23
|
+
APP_OPERATION_MODE=local
|
|
24
|
+
|
|
25
|
+
# backend service mode, federation, batch, all
|
|
26
|
+
SERVER_MODE=federation
|
|
27
|
+
|
|
28
|
+
# analyze the bundle size
|
|
29
|
+
ANALYZE=false
|
|
30
|
+
|
|
31
|
+
# log level, debug, info, warn, error
|
|
32
|
+
NEXT_PUBLIC_LOG_LEVEL=debug
|
|
33
|
+
EOF
|
|
34
|
+
|
|
35
|
+
akan serve-backend <%= appName %>
|
|
36
|
+
# or akan serve-frontend <%= appName %>, etc
|
|
37
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= repoName %>",
|
|
3
|
+
"description": "<%= repoName %> workspace",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"next": "15.3.2",
|
|
7
|
+
"react": "18.3.1",
|
|
8
|
+
"react-dom": "18.3.1",
|
|
9
|
+
"tailwindcss": "^4.1.7",
|
|
10
|
+
"daisyui": "^5.0.35"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"@tailwindcss/postcss": "^4.1.7",
|
|
14
|
+
"@types/react": "18.3.1",
|
|
15
|
+
"@types/react-dom": "18.3.1",
|
|
16
|
+
"crypto-browserify": "^3.12.1",
|
|
17
|
+
"eslint": "^9.19.0",
|
|
18
|
+
"https-browserify": "^1.0.0",
|
|
19
|
+
"jest": "^29.7.0",
|
|
20
|
+
"jiti": "^2.4.2",
|
|
21
|
+
"os-browserify": "^0.3.0",
|
|
22
|
+
"prettier": "^3.5.3",
|
|
23
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
24
|
+
"process": "^0.11.10",
|
|
25
|
+
"stream-browserify": "^3.0.0",
|
|
26
|
+
"stream-http": "^3.2.0",
|
|
27
|
+
"tailwind-scrollbar": "4.0.2",
|
|
28
|
+
"tailwindcss-animation-delay": "^2.0.2",
|
|
29
|
+
"tailwindcss-radix": "^4.0.2",
|
|
30
|
+
"ts-jest": "^29.3.4",
|
|
31
|
+
"url-polyfill": "^1.1.13",
|
|
32
|
+
"vite": "^6.3.5",
|
|
33
|
+
"vite-plugin-commonjs": "^0.10.4",
|
|
34
|
+
"vite-plugin-node-polyfills": "^0.23.0",
|
|
35
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
36
|
+
"vm-browserify": "^1.1.2"
|
|
37
|
+
},
|
|
38
|
+
"packageManager": "pnpm@10.11.0",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=22",
|
|
41
|
+
"pnpm": ">=10"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compileOnSave": false,
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": ".",
|
|
5
|
+
"sourceMap": true,
|
|
6
|
+
"declaration": false,
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"emitDecoratorMetadata": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
13
|
+
"importHelpers": false,
|
|
14
|
+
"target": "es2022",
|
|
15
|
+
"module": "esnext",
|
|
16
|
+
"types": ["node", "webpack-env", "vite/client", "kakao.maps.d.ts", "jest"],
|
|
17
|
+
"lib": ["es2017", "dom", "webworker"],
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"skipDefaultLibCheck": true,
|
|
20
|
+
"strictNullChecks": true,
|
|
21
|
+
"baseUrl": ".",
|
|
22
|
+
"jsx": "preserve",
|
|
23
|
+
"resolveJsonModule": true,
|
|
24
|
+
"paths": {
|
|
25
|
+
"@/*": ["*"]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"exclude": ["**/node_modules", "tmp", "**/ios", "**/android"]
|
|
29
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -589,7 +589,7 @@ var withBase = (appName, config, libs, routes = []) => {
|
|
|
589
589
|
eslint: { ...config.eslint, ignoreDuringBuilds: true },
|
|
590
590
|
env: {
|
|
591
591
|
...config.env,
|
|
592
|
-
basePaths:
|
|
592
|
+
basePaths: routes.map(({ basePath: basePath2 }) => basePath2).join(",")
|
|
593
593
|
},
|
|
594
594
|
transpilePackages: ["swiper", "ssr-window", "dom7"],
|
|
595
595
|
reactStrictMode: commandType === "start" ? false : true,
|
|
@@ -755,7 +755,6 @@ CMD ["npm", "start"]`,
|
|
|
755
755
|
config.libs ?? [],
|
|
756
756
|
config.frontend?.routes
|
|
757
757
|
),
|
|
758
|
-
routes: config.frontend?.routes,
|
|
759
758
|
explicitDependencies: config.frontend?.explicitDependencies ?? []
|
|
760
759
|
},
|
|
761
760
|
mobile: {
|
|
@@ -3424,7 +3423,7 @@ var LibraryScript = class {
|
|
|
3424
3423
|
};
|
|
3425
3424
|
|
|
3426
3425
|
// pkgs/@akanjs/cli/src/application/application.runner.ts
|
|
3427
|
-
import { confirm as confirm2, input as input4 } from "@inquirer/prompts";
|
|
3426
|
+
import { confirm as confirm2, input as input4, select as select5 } from "@inquirer/prompts";
|
|
3428
3427
|
import { StringOutputParser } from "@langchain/core/output_parsers";
|
|
3429
3428
|
import { PromptTemplate as PromptTemplate2 } from "@langchain/core/prompts";
|
|
3430
3429
|
import { RunnableSequence as RunnableSequence2 } from "@langchain/core/runnables";
|
|
@@ -3469,6 +3468,34 @@ var ApplicationRunner = class {
|
|
|
3469
3468
|
await app.syncAssets(scanResult.akanConfig.libs);
|
|
3470
3469
|
return scanResult;
|
|
3471
3470
|
}
|
|
3471
|
+
async getScriptFilename(app) {
|
|
3472
|
+
if (!app.exists("scripts")) {
|
|
3473
|
+
app.mkdir("scripts");
|
|
3474
|
+
throw new Error(`No script files found. make a script file in apps/${app.name}/scripts folder`);
|
|
3475
|
+
}
|
|
3476
|
+
const scriptFiles = (await app.readdir("scripts")).filter((file) => file.endsWith(".ts"));
|
|
3477
|
+
const scriptFile = await select5({
|
|
3478
|
+
message: "Select script to run",
|
|
3479
|
+
choices: scriptFiles.map((file) => ({ name: file, value: file.replace(".ts", "") }))
|
|
3480
|
+
});
|
|
3481
|
+
return scriptFile;
|
|
3482
|
+
}
|
|
3483
|
+
async runScript(app, filename) {
|
|
3484
|
+
const buildResult = await esbuild2.build({
|
|
3485
|
+
write: true,
|
|
3486
|
+
entryPoints: [`${app.cwdPath}/scripts/${filename}.ts`],
|
|
3487
|
+
bundle: true,
|
|
3488
|
+
format: "cjs",
|
|
3489
|
+
packages: "external",
|
|
3490
|
+
platform: "node",
|
|
3491
|
+
outdir: `${app.cwdPath}/scripts`,
|
|
3492
|
+
logLevel: "warning"
|
|
3493
|
+
});
|
|
3494
|
+
await app.spawn("node", [`scripts/${filename}.js`], {
|
|
3495
|
+
stdio: "inherit",
|
|
3496
|
+
env: this.#getEnv(app)
|
|
3497
|
+
});
|
|
3498
|
+
}
|
|
3472
3499
|
#getEnv(app, env = {}) {
|
|
3473
3500
|
const rootEnv = dotenv3.parse(app.workspace.readFile(".env"));
|
|
3474
3501
|
return {
|
|
@@ -3536,10 +3563,10 @@ var ApplicationRunner = class {
|
|
|
3536
3563
|
setTimeout(() => openBrowser("http://localhost:8080/backend/graphql"), 3e3);
|
|
3537
3564
|
await app.dist.spawn("node", ["--watch", "backend/main.js"], { env, stdio: "inherit" });
|
|
3538
3565
|
}
|
|
3539
|
-
async buildFrontend(app) {
|
|
3566
|
+
async buildFrontend(app, { spawnOptions } = {}) {
|
|
3540
3567
|
const { env } = await this.#prepareCommand(app, "build", "frontend");
|
|
3541
3568
|
const akanConfig = await app.getConfig("build");
|
|
3542
|
-
await app.spawn("npx", ["next", "build", "--no-lint"], { env });
|
|
3569
|
+
await app.spawn("npx", ["next", "build", "--no-lint"], { env, ...spawnOptions });
|
|
3543
3570
|
const buildResult = await esbuild2.build({
|
|
3544
3571
|
entryPoints: [`${app.cwdPath}/next.config.ts`],
|
|
3545
3572
|
outdir: `${app.dist.cwdPath}/frontend`,
|
|
@@ -3579,8 +3606,6 @@ var ApplicationRunner = class {
|
|
|
3579
3606
|
async #getViteConfig(app, command) {
|
|
3580
3607
|
const { env } = await this.#prepareCommand(app, command, "csr");
|
|
3581
3608
|
const tsconfig = app.workspace.getTsConfig();
|
|
3582
|
-
const akanConfig = await app.getConfig();
|
|
3583
|
-
const basePaths = akanConfig.frontend.routes ? [...new Set(akanConfig.frontend.routes.map(({ basePath: basePath2 }) => basePath2))].join(",") : void 0;
|
|
3584
3609
|
const processEnv = env;
|
|
3585
3610
|
const akanjsPrefix = process.env.USE_AKANJS_PKGS === "true" ? `${app.workspace.workspaceRoot}/pkgs/` : "";
|
|
3586
3611
|
const config = vite.defineConfig({
|
|
@@ -3644,8 +3669,7 @@ var ApplicationRunner = class {
|
|
|
3644
3669
|
APP_OPERATION_MODE: processEnv.APP_OPERATION_MODE ?? "local",
|
|
3645
3670
|
AKAN_WORKSPACE_ROOT: app.workspace.workspaceRoot,
|
|
3646
3671
|
AKAN_APP_ROOT: app.cwdPath,
|
|
3647
|
-
RENDER_ENV: "csr"
|
|
3648
|
-
basePaths
|
|
3672
|
+
RENDER_ENV: "csr"
|
|
3649
3673
|
},
|
|
3650
3674
|
"process.platform": JSON.stringify("browser"),
|
|
3651
3675
|
"process.version": JSON.stringify(process.version)
|
|
@@ -3947,6 +3971,11 @@ var ApplicationScript = class {
|
|
|
3947
3971
|
spinner.succeed("Application scanned");
|
|
3948
3972
|
return scanResult;
|
|
3949
3973
|
}
|
|
3974
|
+
async script(app, filename) {
|
|
3975
|
+
const scriptFilename = filename ?? await this.#runner.getScriptFilename(app);
|
|
3976
|
+
await this.syncApplication(app);
|
|
3977
|
+
await this.#runner.runScript(app, scriptFilename);
|
|
3978
|
+
}
|
|
3950
3979
|
async build(app) {
|
|
3951
3980
|
await this.syncApplication(app);
|
|
3952
3981
|
await Promise.all([this.buildBackend(app, { sync: false }), this.buildFrontend(app, { sync: false })]);
|
|
@@ -3955,11 +3984,7 @@ var ApplicationScript = class {
|
|
|
3955
3984
|
await this.syncApplication(app);
|
|
3956
3985
|
if (app.workspace.getBaseDevEnv().env === "local")
|
|
3957
3986
|
await this.dbup(app.workspace);
|
|
3958
|
-
await Promise.all([
|
|
3959
|
-
this.startBackend(app, { open: open2, sync: false }),
|
|
3960
|
-
this.startFrontend(app, { open: open2, sync: false }),
|
|
3961
|
-
this.startCsr(app, { open: open2, sync: false })
|
|
3962
|
-
]);
|
|
3987
|
+
await Promise.all([this.startBackend(app, { open: open2, sync: false }), this.startFrontend(app, { open: open2, sync: false })]);
|
|
3963
3988
|
}
|
|
3964
3989
|
async buildBackend(app, { sync = true } = {}) {
|
|
3965
3990
|
if (sync)
|
|
@@ -3981,12 +4006,16 @@ var ApplicationScript = class {
|
|
|
3981
4006
|
}
|
|
3982
4007
|
});
|
|
3983
4008
|
}
|
|
3984
|
-
async buildFrontend(app, { sync = true } = {}) {
|
|
4009
|
+
async buildFrontend(app, { sync = true, standalone = false } = {}) {
|
|
3985
4010
|
if (sync)
|
|
3986
4011
|
await this.syncApplication(app);
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
4012
|
+
if (standalone)
|
|
4013
|
+
await this.#runner.buildFrontend(app, { spawnOptions: { stdio: "inherit" } });
|
|
4014
|
+
else {
|
|
4015
|
+
const spinner = app.spinning("Building frontend...");
|
|
4016
|
+
await this.#runner.buildFrontend(app);
|
|
4017
|
+
spinner.succeed(`Frontend built in dist/apps/${app.name}/frontend`);
|
|
4018
|
+
}
|
|
3990
4019
|
}
|
|
3991
4020
|
async startFrontend(app, { open: open2 = false, turbo = false, sync = true } = {}) {
|
|
3992
4021
|
if (sync)
|
|
@@ -4113,6 +4142,9 @@ var ApplicationCommand = class {
|
|
|
4113
4142
|
async syncApplication(app) {
|
|
4114
4143
|
await this.applicationScript.syncApplication(app);
|
|
4115
4144
|
}
|
|
4145
|
+
async script(app, filename) {
|
|
4146
|
+
await this.applicationScript.script(app, filename);
|
|
4147
|
+
}
|
|
4116
4148
|
async build(app) {
|
|
4117
4149
|
await this.applicationScript.build(app);
|
|
4118
4150
|
}
|
|
@@ -4120,7 +4152,7 @@ var ApplicationCommand = class {
|
|
|
4120
4152
|
await this.applicationScript.buildBackend(app);
|
|
4121
4153
|
}
|
|
4122
4154
|
async buildFrontend(app) {
|
|
4123
|
-
await this.applicationScript.buildFrontend(app);
|
|
4155
|
+
await this.applicationScript.buildFrontend(app, { standalone: true });
|
|
4124
4156
|
}
|
|
4125
4157
|
async buildCsr(app) {
|
|
4126
4158
|
await this.applicationScript.buildCsr(app);
|
|
@@ -4194,6 +4226,11 @@ __decorateClass([
|
|
|
4194
4226
|
Target.Public(),
|
|
4195
4227
|
__decorateParam(0, App())
|
|
4196
4228
|
], ApplicationCommand.prototype, "syncApplication", 1);
|
|
4229
|
+
__decorateClass([
|
|
4230
|
+
Target.Public(),
|
|
4231
|
+
__decorateParam(0, App()),
|
|
4232
|
+
__decorateParam(1, Argument("filename", { desc: "name of script", nullable: true }))
|
|
4233
|
+
], ApplicationCommand.prototype, "script", 1);
|
|
4197
4234
|
__decorateClass([
|
|
4198
4235
|
Target.Public({ short: true }),
|
|
4199
4236
|
__decorateParam(0, App())
|
|
@@ -4344,7 +4381,11 @@ var PackageRunner = class {
|
|
|
4344
4381
|
if (pkg.name === "@akanjs/cli")
|
|
4345
4382
|
await builder.build({
|
|
4346
4383
|
bundle: true,
|
|
4347
|
-
additionalEntryPoints: [
|
|
4384
|
+
additionalEntryPoints: [
|
|
4385
|
+
`${pkg.cwdPath}/src/templates/**/*.ts`,
|
|
4386
|
+
`${pkg.cwdPath}/src/templates/**/*.template`,
|
|
4387
|
+
`${pkg.cwdPath}/src/guidelines/**/*.md`
|
|
4388
|
+
]
|
|
4348
4389
|
});
|
|
4349
4390
|
else
|
|
4350
4391
|
await builder.build();
|
|
@@ -559,24 +559,6 @@ Key features:
|
|
|
559
559
|
- Simultaneous Korean/English address provision
|
|
560
560
|
- Modal address search
|
|
561
561
|
|
|
562
|
-
### 26. Field.KoreanCityDistrict
|
|
563
|
-
|
|
564
|
-
\`\`\`typescript
|
|
565
|
-
interface KoreanCityDistrictProps {
|
|
566
|
-
city: string | null;
|
|
567
|
-
onChangeCity: (city: string | null) => void;
|
|
568
|
-
district: string | null;
|
|
569
|
-
onChangeDistrict: (district: string | null) => void;
|
|
570
|
-
disabled?: boolean;
|
|
571
|
-
}
|
|
572
|
-
\`\`\`
|
|
573
|
-
Key features:
|
|
574
|
-
|
|
575
|
-
- Hardcoded Korean region data
|
|
576
|
-
- Two-level selection (city/province → district/county)
|
|
577
|
-
- Includes detailed regions: 25 districts in Seoul, 16 in Busan, etc.
|
|
578
|
-
- Linked selection (district activates after city selection)
|
|
579
|
-
|
|
580
562
|
## Common Patterns and Features
|
|
581
563
|
|
|
582
564
|
### 1. Caching System
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "@akanjs/config/styles.css";
|
|
3
|
+
|
|
4
|
+
@plugin "daisyui" {
|
|
5
|
+
logs: false;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@plugin "daisyui/theme" {
|
|
9
|
+
name: "light";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@plugin "daisyui/theme" {
|
|
13
|
+
name: "dark";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@theme {
|
|
17
|
+
--font-lemonmilk: var(--font-lemonmilk);
|
|
18
|
+
--font-pretendard: var(--font-pretendard);
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title><%= appName %></title>
|
|
6
|
+
<base href="/" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/csr.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { baseEnv } from "@akanjs/base";
|
|
2
|
+
|
|
3
|
+
import type { ModulesOptions } from "../lib/option";
|
|
4
|
+
|
|
5
|
+
export const env: ModulesOptions = {
|
|
6
|
+
...baseEnv,
|
|
7
|
+
hostname: null,
|
|
8
|
+
redis: {},
|
|
9
|
+
mongo: { password: "S20n-D2bUg" },
|
|
10
|
+
security: {
|
|
11
|
+
verifies: [["password", "phone", "naver", "kakao"]],
|
|
12
|
+
sso: {},
|
|
13
|
+
},
|
|
14
|
+
rootAdminInfo: { accountId: "akamirofficial@gmail.com", password: "akamir190319" },
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { baseEnv } from "@akanjs/base";
|
|
2
|
+
|
|
3
|
+
import type { ModulesOptions } from "../lib/option";
|
|
4
|
+
|
|
5
|
+
export const env: ModulesOptions = {
|
|
6
|
+
...baseEnv,
|
|
7
|
+
hostname: null,
|
|
8
|
+
redis: {},
|
|
9
|
+
mongo: { password: "S20n-D2VeL0p-0905*" },
|
|
10
|
+
security: {
|
|
11
|
+
verifies: [["password", "phone", "naver", "kakao"]],
|
|
12
|
+
sso: {},
|
|
13
|
+
},
|
|
14
|
+
rootAdminInfo: { accountId: "akamirofficial@gmail.com", password: "akamir190319" },
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { baseEnv } from "@akanjs/base";
|
|
2
|
+
|
|
3
|
+
import type { ModulesOptions } from "../lib/option";
|
|
4
|
+
|
|
5
|
+
export const env: ModulesOptions = {
|
|
6
|
+
...baseEnv,
|
|
7
|
+
hostname: null,
|
|
8
|
+
redis: {},
|
|
9
|
+
mongo: {},
|
|
10
|
+
security: {
|
|
11
|
+
verifies: [["password", "phone", "naver", "kakao"]],
|
|
12
|
+
sso: {},
|
|
13
|
+
},
|
|
14
|
+
rootAdminInfo: { accountId: "akamirofficial@gmail.com", password: "akamir190319" },
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { baseEnv } from "@akanjs/base";
|
|
2
|
+
|
|
3
|
+
import type { ModulesOptions } from "../lib/option";
|
|
4
|
+
|
|
5
|
+
export const env: ModulesOptions = {
|
|
6
|
+
...baseEnv,
|
|
7
|
+
hostname: null,
|
|
8
|
+
redis: {},
|
|
9
|
+
mongo: { password: "S20n-m@In-0905*-SEON" },
|
|
10
|
+
security: {
|
|
11
|
+
verifies: [["password", "phone", "naver", "kakao"]],
|
|
12
|
+
sso: {},
|
|
13
|
+
},
|
|
14
|
+
rootAdminInfo: { accountId: "akamirofficial@gmail.com", password: "akamir190319" },
|
|
15
|
+
};
|
|
@@ -9,7 +9,8 @@ import { registerModules } from "./server";
|
|
|
9
9
|
const bootstrap = async () => {
|
|
10
10
|
const serverMode = process.env.SERVER_MODE as "federation" | "batch" | "all" | null;
|
|
11
11
|
if (!serverMode) throw new Error("SERVER_MODE environment variable is not defined");
|
|
12
|
-
await createNestApp({ registerModules, serverMode, env });
|
|
12
|
+
const app = await createNestApp({ registerModules, serverMode, env });
|
|
13
|
+
return () => app.close();
|
|
13
14
|
};
|
|
14
15
|
void bootstrap();
|
|
15
16
|
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import { PageAgent } from "@akanjs/next";
|
|
2
|
+
// import { expect, test } from "@playwright/test";
|
|
3
|
+
|
|
4
|
+
// test.describe("index page", () => {
|
|
5
|
+
// test("has title", async ({ page }) => {
|
|
6
|
+
// const agent = new PageAgent(page);
|
|
7
|
+
// await agent.goto("/");
|
|
8
|
+
// expect(agent.page).toBeTruthy();
|
|
9
|
+
// });
|
|
10
|
+
// });
|