@snappedly-tools/shipyard 0.9.1 → 0.9.2-staging.36240532373

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/dist/main.js CHANGED
@@ -289,7 +289,7 @@ function getNextStepsLines() {
289
289
  "2. If using a model subscription, sign in. For Codex:",
290
290
  ` codex --config 'cli_auth_credentials_store="file"' login`,
291
291
  " test -f ~/.codex/auth.json",
292
- `3. If the runner installed successfully, start it with \`npx ${CLI_NAME} runner start\`; otherwise run \`npx ${CLI_NAME} run\`.`
292
+ `3. Start the repository runner with \`npx ${CLI_NAME} runner start\`.`
293
293
  ];
294
294
  }
295
295
  function getTemplatesDir() {
@@ -1261,15 +1261,6 @@ var installRepositoryRunner = async (options, adapters = defaultAdapters) => {
1261
1261
  reportProgress(options, 8, progressTotal, "Installed wake-up workflow");
1262
1262
  return { name: runnerName, repository, version, runnerDir };
1263
1263
  };
1264
-
1265
- // src/InitRepositoryRunner.ts
1266
- var repositoryRunnerNextSteps = () => [
1267
- `Ensure ${REPOSITORY_RUNNER_WORKFLOW_PATH} is committed and pushed to the repository's default branch`,
1268
- `Keep the foreground controller open with \`npx ${CLI_NAME} runner start\``,
1269
- `Inspect it from another terminal with \`npx ${CLI_NAME} runner status\``,
1270
- `Stop it with \`npx ${CLI_NAME} runner stop\``,
1271
- `Unregister and delete its protected files with \`npx ${CLI_NAME} runner remove\``
1272
- ];
1273
1264
  var errorText = (error) => {
1274
1265
  if (error !== null && typeof error === "object" && "stderr" in error) {
1275
1266
  const stderr = error.stderr;
@@ -1292,6 +1283,9 @@ var commitAndPushInitSetup = (repoDir) => {
1292
1283
  if (existsSync(join(repoDir, REPOSITORY_RUNNER_WORKFLOW_PATH))) {
1293
1284
  paths.push(REPOSITORY_RUNNER_WORKFLOW_PATH);
1294
1285
  }
1286
+ for (const packageFile of ["package.json", "package-lock.json"]) {
1287
+ if (existsSync(join(repoDir, packageFile))) paths.push(packageFile);
1288
+ }
1295
1289
  execFileSync("git", ["add", "--", ...paths], {
1296
1290
  cwd: repoDir,
1297
1291
  stdio: "ignore"
@@ -2387,7 +2381,7 @@ var runnerCommand = Command.make(
2387
2381
  purgeRunnerCommand
2388
2382
  ])
2389
2383
  );
2390
- var VERSION = "0.9.1" ;
2384
+ var VERSION = "0.9.2-staging.36240532373" ;
2391
2385
  var SHIPYARD_PACKAGE_NAME = "@snappedly-tools/shipyard";
2392
2386
  var isMissingPath = (error) => error !== null && typeof error === "object" && "code" in error && error.code === "ENOENT";
2393
2387
  var lstatIfPresent = async (path) => {
@@ -2461,6 +2455,7 @@ var removeShipyardRepositoryFiles = async (options) => {
2461
2455
  };
2462
2456
 
2463
2457
  // src/cli.ts
2458
+ var execFileAsync3 = promisify(execFile);
2464
2459
  var imageNameOption = Options.text("image-name").pipe(
2465
2460
  Options.withDescription("Docker image name"),
2466
2461
  Options.optional
@@ -2802,8 +2797,7 @@ var initCommand = Command.make(
2802
2797
  initialValue: DEFAULT_AGENT_NAME,
2803
2798
  options: agents.map((a) => ({
2804
2799
  value: a.name,
2805
- label: a.label,
2806
- hint: `Default model: ${a.defaultModel}`
2800
+ label: a.label
2807
2801
  }))
2808
2802
  })
2809
2803
  )
@@ -2930,14 +2924,26 @@ var initCommand = Command.make(
2930
2924
  ]
2931
2925
  ];
2932
2926
  for (const [index, [name, description, color]] of labels.entries()) {
2933
- try {
2934
- execSync(
2935
- `gh label create "${name}" --description "${description}" --color "${color}" --force`,
2936
- { cwd, stdio: "ignore" }
2937
- );
2938
- } catch {
2939
- failedLabels.push(name);
2940
- }
2927
+ const created = yield* Effect.promise(
2928
+ () => execFileAsync3(
2929
+ "gh",
2930
+ [
2931
+ "label",
2932
+ "create",
2933
+ name,
2934
+ "--description",
2935
+ description,
2936
+ "--color",
2937
+ color,
2938
+ "--force"
2939
+ ],
2940
+ { cwd }
2941
+ ).then(
2942
+ () => true,
2943
+ () => false
2944
+ )
2945
+ );
2946
+ if (!created) failedLabels.push(name);
2941
2947
  progressAt(
2942
2948
  24 + Math.round((index + 1) / labels.length * 10),
2943
2949
  "Provisioning GitHub labels"
@@ -3056,7 +3062,7 @@ var initCommand = Command.make(
3056
3062
  const confirmed = yield* Effect.promise(
3057
3063
  () => whilePrompt(
3058
3064
  () => clack2.confirm({
3059
- message: "Commit .shipyard/ and any generated runner workflow, then push this branch to origin? Sandboxes need the setup committed. The push also sends any local commits not already on origin.",
3065
+ message: "Commit .shipyard/, any generated runner workflow, and package.json/package-lock.json when present, then push this branch to origin? Sandboxes need the setup committed. The push also sends any local commits not already on origin.",
3060
3066
  initialValue: true
3061
3067
  })
3062
3068
  )
@@ -3126,10 +3132,6 @@ var initCommand = Command.make(
3126
3132
  progressAt(100, "Initialization complete");
3127
3133
  })
3128
3134
  );
3129
- yield* d.text("Repository runner next steps:");
3130
- for (const [index, line] of repositoryRunnerNextSteps().entries()) {
3131
- yield* d.text(styleText("dim", `${index + 1}. ${line}`));
3132
- }
3133
3135
  yield* d.status("Init complete!", "success");
3134
3136
  const nextSteps = getNextStepsLines();
3135
3137
  for (const [i, line] of nextSteps.entries()) {