mirror of
https://github.com/openprose/prose.git
synced 2026-09-19 05:55:05 +08:00
e4892c039d
Moves `@openprose/prose-cli` from `cli/` to `tools/cli/` and seeds a `tools/` convention at the repo root for shippable tooling published as standalone artifacts. Package internals are unchanged — only paths outside the package that hard-code the `cli/` segment were updated. ## What changed - `git mv cli tools/cli` — package files render as 100%-similarity renames, so `git log --follow` is preserved. - `.github/workflows/cli-publish.yml`, `.github/workflows/cli-release-check.yml`, and `.github/workflows/cli-real-harness-smoke.yml`: every literal `cli/` path (`paths:`, `working-directory:`, `cache-dependency-path:`, artifact `path:`, and inline `node`/`bash` invocations) now points at `tools/cli/`. `cli-skills-smoke.yml` had no `cli/` references and is untouched. - `tools/cli/package.json`: `repository.directory` and `homepage` flip to `tools/cli` so the npm registry "Repository" link resolves. - `README.md`: the badge nav, the prose-layout paragraph, and the repo layout table now point at `tools/cli/`, plus a new `tools/` row introducing the convention. - `RELEASE.md`: cross-references to `cli/RELEASE.md` updated. - `tools/cli/README.md`, `tools/cli/RELEASE.md`, `tools/cli/POST_RELEASE_PLAYTEST.md`: public installer URL updated to `https://raw.githubusercontent.com/openprose/prose/main/tools/cli/install.sh`.
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const testDir = dirname(fileURLToPath(import.meta.url));
|
|
const cliDir = resolve(testDir, "..", "..");
|
|
|
|
type PackageJson = {
|
|
bin?: Record<string, string>;
|
|
exports?: Record<string, { default?: string; types?: string }>;
|
|
files?: string[];
|
|
main?: string;
|
|
types?: string;
|
|
};
|
|
|
|
function readPackageJson(): PackageJson {
|
|
return JSON.parse(readFileSync(resolve(cliDir, "package.json"), "utf8")) as PackageJson;
|
|
}
|
|
|
|
describe("package smoke", () => {
|
|
it("publishes a single built CLI entrypoint through bin, main, and exports", () => {
|
|
const packageJson = readPackageJson();
|
|
|
|
expect(packageJson.bin?.prose).toBe("dist/index.js");
|
|
expect(packageJson.main).toBe("./dist/index.js");
|
|
expect(packageJson.types).toBe("./dist/index.d.ts");
|
|
expect(packageJson.exports?.["."]).toEqual({
|
|
default: "./dist/index.js",
|
|
types: "./dist/index.d.ts",
|
|
});
|
|
expect(packageJson.files).toEqual(expect.arrayContaining(["dist", "README.md", "LICENSE"]));
|
|
});
|
|
});
|