@flowrunner/cli 0.1.0 → 0.1.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/dist/index.js CHANGED
@@ -4275,7 +4275,7 @@ var UnknownServerError = class extends CliError {
4275
4275
  }
4276
4276
  };
4277
4277
  var AiDocsMissingError = class extends CliError {
4278
- constructor(directory, message = `The installed flowrunner-cli ships no AI docs at ${directory}.`) {
4278
+ constructor(directory, message = `The installed FlowRunner CLI ships no AI docs at ${directory}.`) {
4279
4279
  super("FR_AI_DOCS_MISSING", message, "AiDocsMissingError");
4280
4280
  this.directory = directory;
4281
4281
  }
@@ -8815,7 +8815,7 @@ var import_path18 = __toESM(require("path"));
8815
8815
  // src/templates/package-root.ts
8816
8816
  var import_fs8 = __toESM(require("fs"));
8817
8817
  var import_path12 = __toESM(require("path"));
8818
- var PACKAGE_NAME = "flowrunner-cli";
8818
+ var PACKAGE_NAMES = ["@flowrunner/cli", "flowrunner-cli"];
8819
8819
  var cached = null;
8820
8820
  function findPackageRoot() {
8821
8821
  let dir = __dirname;
@@ -8823,7 +8823,7 @@ function findPackageRoot() {
8823
8823
  const manifest = import_path12.default.join(dir, "package.json");
8824
8824
  if (import_fs8.default.existsSync(manifest)) {
8825
8825
  try {
8826
- if (JSON.parse(import_fs8.default.readFileSync(manifest, "utf-8")).name === PACKAGE_NAME) {
8826
+ if (PACKAGE_NAMES.includes(JSON.parse(import_fs8.default.readFileSync(manifest, "utf-8")).name)) {
8827
8827
  return dir;
8828
8828
  }
8829
8829
  } catch {
@@ -8831,7 +8831,7 @@ function findPackageRoot() {
8831
8831
  }
8832
8832
  const parent = import_path12.default.dirname(dir);
8833
8833
  if (parent === dir) {
8834
- throw new Error(`Could not locate the "${PACKAGE_NAME}" package root above ${__dirname}`);
8834
+ throw new Error(`Could not locate the "${PACKAGE_NAMES[0]}" package root above ${__dirname}`);
8835
8835
  }
8836
8836
  dir = parent;
8837
8837
  }
@@ -9291,6 +9291,8 @@ function writeTestingFiles(projectRoot) {
9291
9291
 
9292
9292
  // src/operations/init/index.ts
9293
9293
  var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENTRIES];
9294
+ var CLI_PACKAGE = "@flowrunner/cli";
9295
+ var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
9294
9296
  function cliVersion() {
9295
9297
  return JSON.parse(import_fs13.default.readFileSync(import_path18.default.join(packageRoot(), "package.json"), "utf-8")).version;
9296
9298
  }
@@ -9311,7 +9313,7 @@ function addMissing(section, additions, placeholders = {}) {
9311
9313
  function writePackageJson(projectRoot, tests) {
9312
9314
  const fullPath = import_path18.default.join(projectRoot, "package.json");
9313
9315
  const version = cliVersion();
9314
- const devDependencies = { "flowrunner-cli": version, ...tests ? TEST_DEV_DEPENDENCIES : {} };
9316
+ const devDependencies = { [CLI_PACKAGE]: version, ...tests ? TEST_DEV_DEPENDENCIES : {} };
9315
9317
  const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
9316
9318
  if (!import_fs13.default.existsSync(fullPath)) {
9317
9319
  const manifest2 = {
@@ -9326,7 +9328,8 @@ function writePackageJson(projectRoot, tests) {
9326
9328
  return "created";
9327
9329
  }
9328
9330
  const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
9329
- const additions = manifest.dependencies?.["flowrunner-cli"] ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== "flowrunner-cli")) : devDependencies;
9331
+ const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
9332
+ const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
9330
9333
  manifest.devDependencies ??= {};
9331
9334
  manifest.scripts ??= {};
9332
9335
  const changed = [
@@ -9375,7 +9378,7 @@ cd services/<id> && npm install # add a dependency to one service
9375
9378
  npm test # run the unit suites in services/*/tests/
9376
9379
  \`\`\`
9377
9380
 
9378
- With \`npm i -g flowrunner-cli\` you can drop the \`npx\` and just write \`flowrunner cs\`. The global copy only
9381
+ With \`npm i -g @flowrunner/cli\` you can drop the \`npx\` and just write \`flowrunner cs\`. The global copy only
9379
9382
  launches the one in this project's \`node_modules\`, so the version pinned in \`package.json\` is still the one
9380
9383
  that runs.
9381
9384
 
@@ -9383,16 +9386,16 @@ To move this project to a newer CLI, upgrade the dependency and commit it \u2014
9383
9386
  runs, for you and for CI:
9384
9387
 
9385
9388
  \`\`\`bash
9386
- npm i -D flowrunner-cli@<version>
9389
+ npm i -D @flowrunner/cli@<version>
9387
9390
  \`\`\`
9388
9391
 
9389
- Updating the global copy (\`npm i -g flowrunner-cli@latest\`) is rarely needed and changes nothing here.
9392
+ Updating the global copy (\`npm i -g @flowrunner/cli@latest\`) is rarely needed and changes nothing here.
9390
9393
 
9391
9394
  Tests run each service the way the platform does, with HTTP intercepted at the socket \u2014 see
9392
9395
  \`sandbox/index.js\`, which \`${PORTABLE_CLI_COMMAND} init\` copied here for you to edit.
9393
9396
 
9394
9397
  The authoring reference the CLI ships lives in
9395
- \`node_modules/flowrunner-cli/ai-docs/instructions/service-code-format/\`. Point your AI agent at it \u2014 or run
9398
+ \`node_modules/@flowrunner/cli/ai-docs/instructions/service-code-format/\`. Point your AI agent at it \u2014 or run
9396
9399
  \`${PORTABLE_CLI_COMMAND} init-claude\` and Claude Code is wired up for you.
9397
9400
 
9398
9401
  \`flowrunner.json\` names the server and the workspace and belongs in git.