@braingrid/cli 0.2.58 → 0.2.59
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/CHANGELOG.md +7 -0
- package/dist/cli.js +58 -21
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.59] - 2026-03-11
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`braingrid init` should continue after update** — init now continues the setup flow after updating instead of exiting early, and saves `project.json` after project creation
|
|
15
|
+
- **Skip deprecated files during setup** — setup no longer fails when encountering deprecated files that were already removed
|
|
16
|
+
|
|
10
17
|
## [0.2.58] - 2026-03-06
|
|
11
18
|
|
|
12
19
|
### Added
|
package/dist/cli.js
CHANGED
|
@@ -226,7 +226,7 @@ async function axiosWithRetry(config2, options) {
|
|
|
226
226
|
|
|
227
227
|
// src/build-config.ts
|
|
228
228
|
var BUILD_ENV = true ? "production" : process.env.NODE_ENV === "test" ? "development" : "production";
|
|
229
|
-
var CLI_VERSION = true ? "0.2.
|
|
229
|
+
var CLI_VERSION = true ? "0.2.59" : "0.0.0-test";
|
|
230
230
|
var PRODUCTION_CONFIG = {
|
|
231
231
|
apiUrl: "https://app.braingrid.ai",
|
|
232
232
|
workosAuthUrl: "https://auth.braingrid.ai",
|
|
@@ -2380,6 +2380,7 @@ async function handleCompletion(shellArg, opts) {
|
|
|
2380
2380
|
}
|
|
2381
2381
|
|
|
2382
2382
|
// src/handlers/init.handlers.ts
|
|
2383
|
+
import { execSync as execSync4 } from "child_process";
|
|
2383
2384
|
import { access as access3 } from "fs/promises";
|
|
2384
2385
|
import { confirm as confirm2, input, select as select3 } from "@inquirer/prompts";
|
|
2385
2386
|
import chalk12 from "chalk";
|
|
@@ -3934,7 +3935,10 @@ async function _handleSetup(config2, opts) {
|
|
|
3934
3935
|
);
|
|
3935
3936
|
console.log(chalk10.bold(`\u{1F680} Setting up ${config2.name} integration...
|
|
3936
3937
|
`));
|
|
3937
|
-
const
|
|
3938
|
+
const deprecatedSet = new Set((config2.deprecatedFiles ?? []).map((f) => path7.resolve(f)));
|
|
3939
|
+
const operations = (await getFileList(config2.sourceDirs, config2.targetDirs)).filter(
|
|
3940
|
+
(op) => !deprecatedSet.has(path7.resolve(op.targetPath))
|
|
3941
|
+
);
|
|
3938
3942
|
const injectionFileExists = await fileExists(config2.injection.targetFile);
|
|
3939
3943
|
operations.push({
|
|
3940
3944
|
type: "inject",
|
|
@@ -4703,10 +4707,21 @@ async function handleInit(opts) {
|
|
|
4703
4707
|
if (shouldUpdate) {
|
|
4704
4708
|
const result = await handleUpdate({});
|
|
4705
4709
|
console.log(result.message);
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
+
try {
|
|
4711
|
+
const args = ["init"];
|
|
4712
|
+
if (opts.force) args.push("--force");
|
|
4713
|
+
if (opts.project) args.push("--project", opts.project);
|
|
4714
|
+
execSync4(`braingrid ${args.join(" ")}`, {
|
|
4715
|
+
stdio: "inherit",
|
|
4716
|
+
timeout: 12e4
|
|
4717
|
+
});
|
|
4718
|
+
return { success: true, message: "" };
|
|
4719
|
+
} catch {
|
|
4720
|
+
return {
|
|
4721
|
+
success: true,
|
|
4722
|
+
message: chalk12.dim("\nRun `braingrid init` again to complete setup.")
|
|
4723
|
+
};
|
|
4724
|
+
}
|
|
4710
4725
|
}
|
|
4711
4726
|
console.log();
|
|
4712
4727
|
}
|
|
@@ -4876,7 +4891,7 @@ async function handleInit(opts) {
|
|
|
4876
4891
|
console.log(chalk12.green("\u2705 Organization ID updated successfully\n"));
|
|
4877
4892
|
}
|
|
4878
4893
|
let gitInfo = await getGitRepositoryInfo();
|
|
4879
|
-
let project2;
|
|
4894
|
+
let project2 = null;
|
|
4880
4895
|
if (opts.project) {
|
|
4881
4896
|
try {
|
|
4882
4897
|
project2 = await projectService.getProject(opts.project);
|
|
@@ -4937,7 +4952,8 @@ async function handleInit(opts) {
|
|
|
4937
4952
|
message: chalk12.red("\u274C Repository information is incomplete")
|
|
4938
4953
|
};
|
|
4939
4954
|
}
|
|
4940
|
-
let response;
|
|
4955
|
+
let response = null;
|
|
4956
|
+
let handled404 = false;
|
|
4941
4957
|
try {
|
|
4942
4958
|
response = await projectService.listProjects({
|
|
4943
4959
|
repository_owner: owner,
|
|
@@ -4947,7 +4963,8 @@ async function handleInit(opts) {
|
|
|
4947
4963
|
if (error && typeof error === "object" && "response" in error) {
|
|
4948
4964
|
const axiosError = error;
|
|
4949
4965
|
if (axiosError.response?.status === 404) {
|
|
4950
|
-
|
|
4966
|
+
handled404 = true;
|
|
4967
|
+
const noProjectResult = await handleNoProjectForRepository(
|
|
4951
4968
|
owner,
|
|
4952
4969
|
name,
|
|
4953
4970
|
gitInfo,
|
|
@@ -4956,22 +4973,42 @@ async function handleInit(opts) {
|
|
|
4956
4973
|
projectService,
|
|
4957
4974
|
config2
|
|
4958
4975
|
);
|
|
4976
|
+
if (!noProjectResult.success || !noProjectResult.data) {
|
|
4977
|
+
return noProjectResult;
|
|
4978
|
+
}
|
|
4979
|
+
project2 = noProjectResult.data;
|
|
4980
|
+
} else {
|
|
4981
|
+
throw error;
|
|
4959
4982
|
}
|
|
4983
|
+
} else {
|
|
4984
|
+
throw error;
|
|
4960
4985
|
}
|
|
4961
|
-
throw error;
|
|
4962
4986
|
}
|
|
4963
|
-
if (
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4987
|
+
if (!handled404 && response) {
|
|
4988
|
+
if (response.projects.length === 0) {
|
|
4989
|
+
const noProjectResult = await handleNoProjectForRepository(
|
|
4990
|
+
owner,
|
|
4991
|
+
name,
|
|
4992
|
+
gitInfo,
|
|
4993
|
+
githubService,
|
|
4994
|
+
repositoryService,
|
|
4995
|
+
projectService,
|
|
4996
|
+
config2
|
|
4997
|
+
);
|
|
4998
|
+
if (!noProjectResult.success || !noProjectResult.data) {
|
|
4999
|
+
return noProjectResult;
|
|
5000
|
+
}
|
|
5001
|
+
project2 = noProjectResult.data;
|
|
5002
|
+
} else {
|
|
5003
|
+
project2 = response.projects[0];
|
|
5004
|
+
}
|
|
4973
5005
|
}
|
|
4974
|
-
|
|
5006
|
+
}
|
|
5007
|
+
if (!project2) {
|
|
5008
|
+
return {
|
|
5009
|
+
success: false,
|
|
5010
|
+
message: chalk12.red("\u274C Failed to determine project")
|
|
5011
|
+
};
|
|
4975
5012
|
}
|
|
4976
5013
|
log("INFO", "init", "project_found", `id=${project2.short_id} name=${project2.name}`);
|
|
4977
5014
|
const projectInfo = chalk12.bold("\n\u{1F4E6} BrainGrid Project Found\n\n") + chalk12.dim("Project: ") + chalk12.cyan(project2.name) + "\n" + chalk12.dim("ID: ") + chalk12.gray(project2.short_id) + "\n" + (project2.description ? `${chalk12.dim("Description: ") + chalk12.gray(project2.description)}
|