@akanjs/cli 2.3.3 → 2.3.4-rc.1
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 +19 -11
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -222,16 +222,16 @@ class CloudApi {
|
|
|
222
222
|
Authorization: `Bearer ${this.#accessToken.jwt}`
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
async uploadEnv(
|
|
225
|
+
async uploadEnv(devProjectId, file) {
|
|
226
226
|
const formData = new FormData;
|
|
227
|
-
formData.append("devProjectId",
|
|
227
|
+
formData.append("devProjectId", devProjectId);
|
|
228
228
|
formData.append("file", file);
|
|
229
|
-
const data = await this.#api.post(`/uploadEnv/${
|
|
229
|
+
const data = await this.#api.post(`/uploadEnv/${devProjectId}`, formData);
|
|
230
230
|
return data;
|
|
231
231
|
}
|
|
232
|
-
async downloadEnv(
|
|
232
|
+
async downloadEnv(devProjectId) {
|
|
233
233
|
const localPath = `${this.#workspace.workspaceRoot}/local/env.tar`;
|
|
234
|
-
await this.#api.getFile(`/downloadEnv/${
|
|
234
|
+
await this.#api.getFile(`/downloadEnv/${devProjectId}`, localPath);
|
|
235
235
|
return localPath;
|
|
236
236
|
}
|
|
237
237
|
async getRemoteAuthToken(remoteId) {
|
|
@@ -14006,8 +14006,8 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
14006
14006
|
exec2.cwdPath
|
|
14007
14007
|
]);
|
|
14008
14008
|
}
|
|
14009
|
-
async writeTopLevelEnv(workspace,
|
|
14010
|
-
await workspace.writeFile(".env", `AKAN_WORKSPACE_ID=${
|
|
14009
|
+
async writeTopLevelEnv(workspace, devProjectId) {
|
|
14010
|
+
await workspace.writeFile(".env", `AKAN_WORKSPACE_ID=${devProjectId}
|
|
14011
14011
|
|
|
14012
14012
|
# organization configuration, no need to change
|
|
14013
14013
|
AKAN_PUBLIC_REPO_NAME=${workspace.repoName}
|
|
@@ -14109,11 +14109,19 @@ class WorkspaceScript extends script("workspace", [
|
|
|
14109
14109
|
for (const appName of appNames)
|
|
14110
14110
|
await this.applicationScript.sync(AppExecutor.from(workspace, appName));
|
|
14111
14111
|
}
|
|
14112
|
-
async init(
|
|
14112
|
+
async init(devProjectId, workspace) {
|
|
14113
|
+
const [bunfigExists, packageJsonExists, tsconfigExists] = await Promise.all([
|
|
14114
|
+
workspace.exists("bunfig.toml"),
|
|
14115
|
+
workspace.exists("package.json"),
|
|
14116
|
+
workspace.exists("tsconfig.json")
|
|
14117
|
+
]);
|
|
14118
|
+
const isRoot = bunfigExists && packageJsonExists && tsconfigExists;
|
|
14119
|
+
if (!isRoot)
|
|
14120
|
+
throw new Error("Current directory is not a root workspace");
|
|
14113
14121
|
const spinner2 = workspace.spinning("Initializing workspace...");
|
|
14114
14122
|
try {
|
|
14115
|
-
await this.workspaceRunner.writeTopLevelEnv(workspace,
|
|
14116
|
-
await this.cloudScript.downloadEnv(workspace,
|
|
14123
|
+
await this.workspaceRunner.writeTopLevelEnv(workspace, devProjectId);
|
|
14124
|
+
await this.cloudScript.downloadEnv(workspace, devProjectId);
|
|
14117
14125
|
spinner2.succeed("Workspace initialized");
|
|
14118
14126
|
} catch (error) {
|
|
14119
14127
|
spinner2.fail("Workspace initialization failed");
|
|
@@ -14161,7 +14169,7 @@ class WorkspaceCommand extends command("workspace", [WorkspaceScript], ({ public
|
|
|
14161
14169
|
syncAll: target({ desc: "Sync dependencies and configuration for all apps and libraries" }).with(Workspace).exec(async function(workspace) {
|
|
14162
14170
|
await this.workspaceScript.syncAll(workspace);
|
|
14163
14171
|
}),
|
|
14164
|
-
init: target({ desc: "Initialize the workspace" }).arg("devProjectId", String, { desc: "the ID of the workspace" }).with(Workspace).exec(async function(workspace) {
|
|
14172
|
+
init: target({ desc: "Initialize the workspace", runsOnWorkspaceRoot: false }).arg("devProjectId", String, { desc: "the ID of the workspace" }).with(Workspace).exec(async function(devProjectId, workspace) {
|
|
14165
14173
|
await this.workspaceScript.init(devProjectId, workspace);
|
|
14166
14174
|
})
|
|
14167
14175
|
})) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4-rc.1",
|
|
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.
|
|
38
|
+
"akanjs": "2.3.4-rc.1",
|
|
39
39
|
"chalk": "^5.6.2",
|
|
40
40
|
"commander": "^14.0.3",
|
|
41
41
|
"daisyui": "^5.5.20",
|