@isomorph.ai/cli 0.4.1-rc.1 → 0.4.2
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/README.md
CHANGED
|
@@ -50,6 +50,6 @@ isomorph status | retry | promote --operation <reference> (promote: [--app-roo
|
|
|
50
50
|
|
|
51
51
|
## Development
|
|
52
52
|
|
|
53
|
-
Built from the [governance control plane](https://github.com/Fourier-Labs-AI/harbour-governance-control-plane) repository: `npm ci`, `npm run build --prefix packages/harbour-cli`, tests in `tests/cli-kit.test.ts` and `tests/cli-packaging-contract.test.ts`.
|
|
53
|
+
Built from the [governance control plane](https://github.com/Fourier-Labs-AI/harbour-governance-control-plane) repository: `npm ci`, `npm run build --prefix packages/harbour-cli`, tests in `tests/cli-kit.test.ts` and `tests/cli-packaging-contract.test.ts`. Merge is release (`docs/adr/0021`): a PR that bumps the version in `packages/harbour-cli/package.json` — the one file that carries it; `src/version.ts` reads it at runtime — is tagged `cli-v<version>` by `CLI release automation` the moment it lands on `main`, and `Release Isomorph CLI` publishes that version under `latest` through npm trusted publishing. A version that already exists on npm is never republished. A prerelease (`X.Y.Z-rc.N`) publishes under `candidate` and is never required. When the release embeds a new kit bundle, bump `harbour.kitBundle.version` in the same PR and run `npm run kit-bundle:sync` there: it regenerates the embedded manifest and the server's `src/kit-bundle-expectation.generated.ts` from one fetch. 0.2.0 and 0.2.1 (the rename) were published by hand from their merge commits before the trusted publisher existed for `@isomorph.ai/cli`, which is why their `cli-v` release runs show red.
|
|
54
54
|
|
|
55
55
|
Connect with `isomorph connect name@getlokal.com`: the CLI asks the platform which company admits the email's domain (`https://platform.isomorph.ai/start/getlokal.com.json` — the same policies that admit the person at sign-in) and saves that company's profile. Only the domain is sent, not the email. When no company admits the domain, or more than one does, the CLI prints the platform's sentence (ask IT, or run the printed `isomorph connect <link>`) and saves nothing; a company's console page (`platform.isomorph.ai/t/<company>`) is accepted as the link. `isomorph login` then prints the company it signed in to and what IT has set up there. Company sign-in and access checks still apply.
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const PACKAGE_NAME = "@isomorph.ai/cli";
|
|
5
|
+
/**
|
|
6
|
+
* The version of the CLI that is running, read from this package's own
|
|
7
|
+
* `package.json` — the one place a release bumps (docs/adr/0021). It is found
|
|
8
|
+
* by walking up from this module: one directory in a checkout
|
|
9
|
+
* (`packages/harbour-cli/src/`), four in the published package
|
|
10
|
+
* (`dist/packages/harbour-cli/src/`). Release Isomorph CLI compares this
|
|
11
|
+
* value with the packed `package.json` before it publishes, so a walk that
|
|
12
|
+
* found the wrong file would fail the release, not a builder.
|
|
13
|
+
*/
|
|
14
|
+
export const CLI_VERSION = runningPackageVersion();
|
|
15
|
+
function runningPackageVersion() {
|
|
16
|
+
let directory = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
for (let depth = 0; depth < 8; depth += 1) {
|
|
18
|
+
const candidate = readPackage(join(directory, "package.json"));
|
|
19
|
+
if (candidate?.name === PACKAGE_NAME && typeof candidate.version === "string")
|
|
20
|
+
return candidate.version;
|
|
21
|
+
const parent = dirname(directory);
|
|
22
|
+
if (parent === directory)
|
|
23
|
+
break;
|
|
24
|
+
directory = parent;
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`${PACKAGE_NAME}: no package.json found above ${fileURLToPath(import.meta.url)}`);
|
|
27
|
+
}
|
|
28
|
+
function readPackage(path) {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|