@phreshos/cli 0.1.54 → 0.1.55

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/install.js CHANGED
@@ -15,8 +15,9 @@ import { prepareOfficialProgram } from "./program-release.js";
15
15
  * production Program is derived and sent. The command remains authoring
16
16
  * metadata and never becomes part of the installed Program.
17
17
  *
18
- * Installation remains distinct from execution unless `run` is explicitly
19
- * requested. A run created here belongs to the installed Program and
18
+ * The System applies the Program's startup declaration during installation.
19
+ * `run` explicitly requests an additional Process. A run created here belongs
20
+ * to the installed Program and
20
21
  * therefore outlives this command; `phresh start` and `phresh dev` remain
21
22
  * attached authoring runs whose lifetime is the terminal's.
22
23
  */
@@ -203,7 +203,7 @@ export default class SystemLifecycle {
203
203
  }
204
204
  }
205
205
  async function provisionSetup() {
206
- await installProgram({ name: "setup", run: true, announce: false });
206
+ await installProgram({ name: "setup", announce: false });
207
207
  }
208
208
  function definition(installation, executable) {
209
209
  return {
@@ -45,6 +45,12 @@ bun run pack
45
45
  `verify` checks the source, builds both Endpoints, and validates the packaged
46
46
  Program shape.
47
47
 
48
+ `check` performs static checks, `build` creates distributable output, and `test`
49
+ runs Vitest assertions from `tests/`. Run `build` before testing built artifacts.
50
+ `verify` runs `check`, `build`, and `test` in order. Operational tooling belongs
51
+ in `scripts/`; tests and their fixtures belong in `tests/`. Verification uses
52
+ the committed dependency graph without local package substitutions.
53
+
48
54
  ## Related repositories
49
55
 
50
56
  - [`@phreshos/cli`](https://github.com/PhreshOS/cli) bundles this repository for
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "phresh",
3
3
  "private": true,
4
- "version": "0.1.32",
4
+ "version": "0.1.33",
5
5
  "description": "The official PhreshOS starter Program.",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -14,21 +14,22 @@
14
14
  "starter"
15
15
  ],
16
16
  "dependencies": {
17
- "@phreshos/client": "^0.1.38",
18
- "@phreshos/core": "^0.1.42",
19
- "@phreshos/react": "^0.1.21",
20
- "@phreshos/server": "^0.1.42",
17
+ "@phreshos/client": "^0.1.39",
18
+ "@phreshos/core": "^0.1.43",
19
+ "@phreshos/react": "^0.1.22",
20
+ "@phreshos/server": "^0.1.43",
21
21
  "react": "^19.2.8",
22
22
  "react-dom": "^19.2.8"
23
23
  },
24
24
  "devDependencies": {
25
- "@phreshos/cli": "^0.1.54",
25
+ "@phreshos/cli": "^0.1.55",
26
26
  "@types/node": "^26.4.0",
27
27
  "@types/react": "^19.2.18",
28
28
  "@types/react-dom": "^19.2.5",
29
29
  "@vitejs/plugin-react": "^6.1.1",
30
30
  "typescript": "^7.0.2",
31
31
  "vite": "^8.2.2",
32
- "vite-node": "^6.0.0"
32
+ "vite-node": "^6.0.0",
33
+ "vitest": "^4.1.10"
33
34
  }
34
35
  }
@@ -4,7 +4,7 @@ export default defineConfig({
4
4
  identity: "phresh",
5
5
  name: "Phresh Program",
6
6
  description: "A minimal counter with direct Client and Server endpoints.",
7
- version: "0.1.32",
7
+ version: "0.1.33",
8
8
  icon: "icon.png",
9
9
  categories: ["Development"],
10
10
  keywords: ["example", "counter", "client", "server"],
@@ -0,0 +1,19 @@
1
+ import assert from "node:assert/strict"
2
+ import { readFileSync } from "node:fs"
3
+ import config from "../phresh.config"
4
+ import manifest from "../package.json" with { type: "json" }
5
+ import { test } from "vitest"
6
+
7
+ test("build contract", async () => {
8
+ assert.equal(config.identity, "phresh")
9
+ assert.equal(config.name, "Phresh Program")
10
+ assert.equal(config.version, manifest.version)
11
+ assert.equal(config.server?.location, "dist/server")
12
+ assert.equal(config.server?.entryFile, "main.js")
13
+ assert.equal(config.server?.development?.startCommand, "vite-node server/main.ts")
14
+ assert.equal(config.client?.location, "dist/client")
15
+ assert.deepEqual(config.client?.size, { width: 600, height: 500 })
16
+
17
+ assert(readFileSync("dist/client/index.html", "utf8").length > 0)
18
+ assert(readFileSync("dist/server/main.js", "utf8").length > 0)
19
+ }, 120_000)
@@ -0,0 +1,24 @@
1
+ import { expect, test, vi } from "vitest"
2
+
3
+ const boundary = vi.hoisted(() => ({
4
+ answer: vi.fn(),
5
+ subscribe: vi.fn(),
6
+ publish: vi.fn()
7
+ }))
8
+
9
+ vi.mock("@phreshos/server", () => ({ context: boundary }))
10
+
11
+ test("counter reads and published changes describe the same server state", async () => {
12
+ await import("../server/main")
13
+ expect(boundary.answer).toHaveBeenCalledWith("read", expect.any(Function))
14
+ expect(boundary.subscribe).toHaveBeenCalledWith("increment", expect.any(Function))
15
+ const read = boundary.answer.mock.calls[0]![1] as () => number
16
+ const increment = boundary.subscribe.mock.calls[0]![1] as () => void
17
+ expect(read()).toBe(0)
18
+ increment()
19
+ expect(read()).toBe(1)
20
+ expect(boundary.publish).toHaveBeenLastCalledWith("changed", 1)
21
+ increment()
22
+ expect(read()).toBe(2)
23
+ expect(boundary.publish).toHaveBeenLastCalledWith("changed", 2)
24
+ })
@@ -0,0 +1,25 @@
1
+ import { defineConfig } from "vitest/config"
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ pool: "forks",
6
+ maxWorkers: 2,
7
+ projects: [
8
+ {
9
+ extends: true,
10
+ test: {
11
+ name: "default",
12
+ include: [
13
+ "tests/**/*.test.{ts,tsx,mjs}"
14
+ ],
15
+ exclude: [
16
+ "tests/**/*.platform.test.*",
17
+ "tests/**/*.live.test.*"
18
+ ],
19
+ environment: "node",
20
+ testTimeout: 30000
21
+ }
22
+ }
23
+ ]
24
+ }
25
+ })
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "repository": "PhreshOS/phresh-program",
3
- "version": "0.1.32",
4
- "sha256": "2644513c80b924eda546f257f853bbc03619c5b9bd2b510259d4f87ecd126f4a",
3
+ "version": "0.1.33",
4
+ "sha256": "1976ed8a044998c7bf4da403c66c4965e986425044a78cf648ec3cc6e715dd5b",
5
5
  "development": true
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phreshos/cli",
3
3
  "type": "module",
4
- "version": "0.1.54",
4
+ "version": "0.1.55",
5
5
  "description": "The Phresh command-line interface for Program projects and system management.",
6
6
  "engines": {
7
7
  "node": ">=20.10"
@@ -47,8 +47,8 @@
47
47
  "packageManager": "bun@1.3.14",
48
48
  "dependencies": {
49
49
  "@clack/prompts": "^1.7.0",
50
- "@phreshos/core": "^0.1.43",
51
- "@phreshos/node": "^0.1.18",
50
+ "@phreshos/core": "^0.1.44",
51
+ "@phreshos/node": "^0.1.19",
52
52
  "adm-zip": "^0.6.0",
53
53
  "cli-table3": "^0.6.5",
54
54
  "commander": "^15.0.0",