@cmssy/cli 19.26.1 → 19.26.3

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { dirname, join as join2, resolve } from "path";
11
11
  var DEFAULT_ADMIN_API_URL = "https://api.cmssy.io/graphql";
12
12
  var BAD_TOKEN_HINT = {
13
13
  message: "the cmssy API rejected the token",
14
- fix: "create an API token in the cmssy dashboard (Settings \u2192 API Tokens) and pass it via --token or CMSSY_API_TOKEN"
14
+ fix: "create an API token under API Tokens in the cmssy dashboard sidebar and pass it via --token or CMSSY_API_TOKEN"
15
15
  };
16
16
  var NEEDS_MANIFEST_WRITE_HINT = {
17
17
  message: "the token's user cannot write this workspace's block manifest",
@@ -1686,7 +1686,7 @@ function resolveToken(options, env) {
1686
1686
  if (!token) {
1687
1687
  throw new CliError(
1688
1688
  "no API token given",
1689
- "create an API token in the cmssy dashboard (Settings \u2192 API Tokens) and set CMSSY_API_TOKEN in the deploy environment, or pass --token cs_..."
1689
+ "create an API token under API Tokens in the cmssy dashboard sidebar and set CMSSY_API_TOKEN in the deploy environment, or pass --token cs_..."
1690
1690
  );
1691
1691
  }
1692
1692
  return token;
@@ -1934,7 +1934,7 @@ function resolveToken2(options, deps) {
1934
1934
  if (!token) {
1935
1935
  throw new CliError(
1936
1936
  "no API token given",
1937
- "create an API token in the cmssy dashboard (Settings \u2192 API Tokens), then run cmssy link --token cs_... or set CMSSY_API_TOKEN"
1937
+ "create an API token under API Tokens in the cmssy dashboard sidebar, then run cmssy link --token cs_... or set CMSSY_API_TOKEN"
1938
1938
  );
1939
1939
  }
1940
1940
  return token;
@@ -2019,9 +2019,16 @@ async function selectWorkspace(workspaces, options, deps) {
2019
2019
  const slugs = workspaces.map((workspace) => `${workspace.organizationSlug}/${workspace.slug}`).join(", ");
2020
2020
  if (options.workspace) {
2021
2021
  const wanted = options.workspace.trim();
2022
- const match = workspaces.find(
2022
+ const matches = workspaces.filter(
2023
2023
  (workspace) => workspace.slug === wanted || `${workspace.organizationSlug}/${workspace.slug}` === wanted
2024
2024
  );
2025
+ const match = matches[0];
2026
+ if (matches.length > 1) {
2027
+ throw new CliError(
2028
+ `"${wanted}" names a workspace in more than one organization`,
2029
+ `pass <organization>/<workspace> - one of: ${matches.map((workspace) => `${workspace.organizationSlug}/${workspace.slug}`).join(", ")}`
2030
+ );
2031
+ }
2025
2032
  if (!match) {
2026
2033
  throw new CliError(
2027
2034
  `no workspace named "${wanted}"`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/cli",
3
- "version": "19.26.1",
3
+ "version": "19.26.3",
4
4
  "description": "The cmssy CLI: `cmssy init` wires cmssy into an existing Next.js, Astro or React Router app; `cmssy link` connects it to a workspace and verifies the editor wiring.",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "esbuild": "^0.27.7",
31
- "@cmssy/core": "19.26.1"
31
+ "@cmssy/core": "19.26.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.0.0",