@akanjs/cli 2.3.5-rc.7 → 2.3.5-rc.9
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 +10 -3
- package/package.json +2 -2
- package/templates/workspaceRoot/README.ts +78 -0
package/index.js
CHANGED
|
@@ -13892,7 +13892,8 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
13892
13892
|
dirname: dirname2 = ".",
|
|
13893
13893
|
init = true,
|
|
13894
13894
|
akanVersion,
|
|
13895
|
-
registryUrl
|
|
13895
|
+
registryUrl,
|
|
13896
|
+
owner
|
|
13896
13897
|
}) {
|
|
13897
13898
|
const cwdPath = process.cwd();
|
|
13898
13899
|
const workspaceRoot = path41.join(cwdPath, dirname2, repoName);
|
|
@@ -14039,14 +14040,16 @@ class WorkspaceScript extends script("workspace", [
|
|
|
14039
14040
|
dirname: dirname2 = ".",
|
|
14040
14041
|
installLibs = false,
|
|
14041
14042
|
init = true,
|
|
14042
|
-
registryUrl
|
|
14043
|
+
registryUrl,
|
|
14044
|
+
owner
|
|
14043
14045
|
}) {
|
|
14044
14046
|
const akanVersion = await this.packageScript.version(null, { log: false });
|
|
14045
14047
|
const workspace = await this.workspaceRunner.createWorkspace(repoName, appName, {
|
|
14046
14048
|
dirname: dirname2,
|
|
14047
14049
|
init,
|
|
14048
14050
|
akanVersion,
|
|
14049
|
-
...registryUrl ? { registryUrl } : {}
|
|
14051
|
+
...registryUrl ? { registryUrl } : {},
|
|
14052
|
+
...owner ? { owner } : {}
|
|
14050
14053
|
});
|
|
14051
14054
|
if (installLibs) {
|
|
14052
14055
|
await this.libraryScript.installLibrary(workspace, "util");
|
|
@@ -14153,6 +14156,10 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
|
|
|
14153
14156
|
}).option("registry", String, {
|
|
14154
14157
|
desc: "npm registry URL for installing Akan packages",
|
|
14155
14158
|
default: process.env.AKAN_NPM_REGISTRY ?? "https://registry.npmjs.org"
|
|
14159
|
+
}).option("owner", String, {
|
|
14160
|
+
desc: "owner of the workspace",
|
|
14161
|
+
default: process.env.GITHUB_OWNER,
|
|
14162
|
+
nullable: true
|
|
14156
14163
|
}).exec(async function(workspaceName, app, dir, libs, init, registry) {
|
|
14157
14164
|
const appName = app || "app";
|
|
14158
14165
|
await this.workspaceScript.createWorkspace(workspaceName.toLowerCase().replace(/ /g, "-"), appName.toLowerCase().replace(/ /g, "-"), { dirname: dir, installLibs: libs, init, ...registry ? { registryUrl: registry } : {} });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.3.5-rc.
|
|
3
|
+
"version": "2.3.5-rc.9",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@langchain/openai": "^1.4.6",
|
|
36
36
|
"@tailwindcss/node": "^4.3.0",
|
|
37
37
|
"@trapezedev/project": "^7.1.4",
|
|
38
|
-
"akanjs": "2.3.5-rc.
|
|
38
|
+
"akanjs": "2.3.5-rc.9",
|
|
39
39
|
"chalk": "^5.6.2",
|
|
40
40
|
"commander": "^14.0.3",
|
|
41
41
|
"daisyui": "^5.5.20",
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
interface Dict {
|
|
2
|
+
appName: string;
|
|
3
|
+
owner?: string;
|
|
4
|
+
repoName: string;
|
|
5
|
+
}
|
|
6
|
+
export default function getContent(_scanInfo: null, dict: Dict) {
|
|
7
|
+
const codespacesUrl = `https://codespaces.new/${dict.owner}/${dict.repoName}?quickstart=1`;
|
|
8
|
+
const codespacesBadge = dict.owner
|
|
9
|
+
? `[](${codespacesUrl})`
|
|
10
|
+
: "";
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
filename: "README.md",
|
|
14
|
+
content: `${codespacesBadge}
|
|
15
|
+
# ${dict.repoName}
|
|
16
|
+
|
|
17
|
+
This workspace was created with [Akan.js](https://akanjs.com), a Bun-first full-stack TypeScript framework.
|
|
18
|
+
|
|
19
|
+
Akan lets you write business code once and connect it across web, server, fetch clients, state, database contracts,
|
|
20
|
+
and deployment artifacts with strict conventions.
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
Install dependencies:
|
|
25
|
+
|
|
26
|
+
\`\`\`bash
|
|
27
|
+
bun install
|
|
28
|
+
bun install -g @akanjs/cli
|
|
29
|
+
\`\`\`
|
|
30
|
+
|
|
31
|
+
Start the app:
|
|
32
|
+
|
|
33
|
+
\`\`\`bash
|
|
34
|
+
akan start ${dict.appName} --open
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
Build for production:
|
|
38
|
+
|
|
39
|
+
\`\`\`bash
|
|
40
|
+
akan build ${dict.appName}
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
## Project Structure
|
|
44
|
+
|
|
45
|
+
\`\`\`text
|
|
46
|
+
apps/${dict.appName}/
|
|
47
|
+
|-- akan.config.ts # app configuration
|
|
48
|
+
|-- page/ # route pages
|
|
49
|
+
|-- lib/ # app domain modules
|
|
50
|
+
|-- ui/ # app UI components
|
|
51
|
+
|-- env/ # runtime environment contracts
|
|
52
|
+
\`-- public/ # static assets
|
|
53
|
+
|
|
54
|
+
libs/ # shared libraries for multiple apps
|
|
55
|
+
pkgs/ # local packages, if your workspace grows into them
|
|
56
|
+
\`\`\`
|
|
57
|
+
|
|
58
|
+
## Where To Start
|
|
59
|
+
|
|
60
|
+
- Edit \`apps/${dict.appName}/page/_index.tsx\` to change the first page.
|
|
61
|
+
- Edit \`apps/${dict.appName}/akan.config.ts\` when the app needs routes, domains, base paths, or deployment options.
|
|
62
|
+
- Add business modules under \`apps/${dict.appName}/lib/\` when your app needs typed domain logic.
|
|
63
|
+
|
|
64
|
+
## Useful Commands
|
|
65
|
+
|
|
66
|
+
\`\`\`bash
|
|
67
|
+
akan start ${dict.appName}
|
|
68
|
+
akan build ${dict.appName}
|
|
69
|
+
akan lint ${dict.appName}
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
## Learn More
|
|
73
|
+
|
|
74
|
+
- Akan.js docs: https://akanjs.com/docs
|
|
75
|
+
- Package: https://www.npmjs.com/package/akanjs
|
|
76
|
+
`,
|
|
77
|
+
};
|
|
78
|
+
}
|