@phreshos/cli 0.1.18 → 0.1.20
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 +4 -4
- package/dist/create.js +4 -1
- package/dist/derive.js +1 -2
- package/dist/pack.js +7 -3
- package/dist/project.js +3 -3
- package/dist/template/package.json +3 -3
- package/dist/template/phresh.config.ts +2 -2
- package/dist/template.json +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -399,10 +399,10 @@ are the canonical locations the package just created. An explicit
|
|
|
399
399
|
and means `true`. At least one declared half must resolve to true.
|
|
400
400
|
|
|
401
401
|
There is **no wrapping directory**: `program.json`, `server/`, `client/`,
|
|
402
|
-
|
|
403
|
-
directory it installs into from your program's `identity`.
|
|
404
|
-
|
|
405
|
-
|
|
402
|
+
optional `icon.png`, and optional `agent.md` sit at the package's root. The
|
|
403
|
+
system names the directory it installs into from your program's `identity`.
|
|
404
|
+
An authored agent document may use any project-relative path, while packaging
|
|
405
|
+
normalizes it to `agent.md`.
|
|
406
406
|
|
|
407
407
|
Nothing about the system moves because this exists. `program.json` is
|
|
408
408
|
still the only thing the system reads, and a package assembled by hand
|
package/dist/create.js
CHANGED
|
@@ -83,7 +83,10 @@ function template() {
|
|
|
83
83
|
function customize(directory, identity, name, manager) {
|
|
84
84
|
for (const path of textFiles(directory)) {
|
|
85
85
|
let content = readFileSync(path, "utf-8");
|
|
86
|
-
|
|
86
|
+
if (basename(path) === "phresh.config.ts") {
|
|
87
|
+
content = content.replace('identity: "phresh"', `identity: ${JSON.stringify(identity)}`);
|
|
88
|
+
}
|
|
89
|
+
content = content.replaceAll("Phresh Program", name);
|
|
87
90
|
if (basename(path) === "README.md") {
|
|
88
91
|
content = content
|
|
89
92
|
.replaceAll("bun install", `${manager} install`)
|
package/dist/derive.js
CHANGED
|
@@ -30,6 +30,7 @@ export default function derive(config, directory, which) {
|
|
|
30
30
|
// Where it already is. Unlike pack, which gives it its canonical
|
|
31
31
|
// name, this points into the authoring tree and leaves it alone.
|
|
32
32
|
icon: config.icon && resolve(directory, config.icon),
|
|
33
|
+
agent: config.agent && resolve(directory, config.agent),
|
|
33
34
|
// Beside the source, and said out loud. A program built from an
|
|
34
35
|
// object resolves what it leaves unsaid against the *system's*
|
|
35
36
|
// working directory — so silence here means a program keeps what
|
|
@@ -39,7 +40,6 @@ export default function derive(config, directory, which) {
|
|
|
39
40
|
...server && { server: {
|
|
40
41
|
location: resolve(directory, server.location),
|
|
41
42
|
start: server.start,
|
|
42
|
-
serviceable: server.serviceable,
|
|
43
43
|
installCommand: config.server?.installCommand,
|
|
44
44
|
startCommand: server.startCommand
|
|
45
45
|
} },
|
|
@@ -49,7 +49,6 @@ export default function derive(config, directory, which) {
|
|
|
49
49
|
...client && { client: {
|
|
50
50
|
location: /^https?:\/\//i.test(client.location) ? client.location : resolve(directory, client.location),
|
|
51
51
|
start: client.start,
|
|
52
|
-
serviceable: client.serviceable,
|
|
53
52
|
title: config.client?.title,
|
|
54
53
|
size: config.client?.size,
|
|
55
54
|
position: config.client?.position,
|
package/dist/pack.js
CHANGED
|
@@ -18,7 +18,8 @@ import build from "./build-command.js";
|
|
|
18
18
|
* a declared half always has a location, even when the system chose it.
|
|
19
19
|
*
|
|
20
20
|
* There is **no wrapping directory**. `program.json`, `server/`,
|
|
21
|
-
* `client
|
|
21
|
+
* `client/`, optional `icon.png`, and optional `agent.md` sit at the package's
|
|
22
|
+
* root, and the directory
|
|
22
23
|
* the system installs into is named from the program's own `identity`.
|
|
23
24
|
* The archive itself therefore needs no second naming layer.
|
|
24
25
|
*
|
|
@@ -44,6 +45,8 @@ export default async function pack(directory = process.cwd()) {
|
|
|
44
45
|
}
|
|
45
46
|
if (config.icon)
|
|
46
47
|
file(zip, directory, config.icon, "icon.png", "Program icon");
|
|
48
|
+
if (config.agent)
|
|
49
|
+
file(zip, directory, config.agent, "agent.md", "Program agent documentation");
|
|
47
50
|
zip.addFile("program.json", Buffer.from(JSON.stringify(program(config, version), null, 4) + "\n"));
|
|
48
51
|
const archive = `${config.identity}@${version ?? "0.0.0"}.zip`;
|
|
49
52
|
const bytes = zip.toBuffer();
|
|
@@ -63,8 +66,9 @@ function program(config, version) {
|
|
|
63
66
|
version,
|
|
64
67
|
description: config.description,
|
|
65
68
|
icon: config.icon ? "icon.png" : undefined,
|
|
66
|
-
|
|
67
|
-
...config.
|
|
69
|
+
agent: config.agent ? "agent.md" : undefined,
|
|
70
|
+
...config.server && { server: { location: "server", start: config.server.start, installCommand: config.server.installCommand, startCommand: config.server.startCommand } },
|
|
71
|
+
...config.client && { client: { location: "client", start: config.client.start, title: config.client.title, size: config.client.size, position: config.client.position, layer: config.client.layer, minimize: config.client.minimize } }
|
|
68
72
|
};
|
|
69
73
|
}
|
|
70
74
|
// What is at a half's location, where the package keeps it. A half that
|
package/dist/project.js
CHANGED
|
@@ -39,10 +39,12 @@ function coherent(config) {
|
|
|
39
39
|
throw new Error("A program's identity is kebab-case, because it is also the name of its directory");
|
|
40
40
|
if (!config.server && !config.client)
|
|
41
41
|
throw new Error("A program must have a server half, a client half, or both");
|
|
42
|
-
for (const field of ["name", "version", "description", "icon"]) {
|
|
42
|
+
for (const field of ["name", "version", "description", "icon", "agent"]) {
|
|
43
43
|
if (config[field] !== undefined && typeof config[field] !== "string")
|
|
44
44
|
throw new Error(`A program's ${field} must be text`);
|
|
45
45
|
}
|
|
46
|
+
if (config.agent !== undefined && config.agent.trim().length === 0)
|
|
47
|
+
throw new Error("A program's agent documentation must be a non-empty path");
|
|
46
48
|
if (config.buildCommand !== undefined && (typeof config.buildCommand !== "string" || config.buildCommand.trim().length === 0))
|
|
47
49
|
throw new Error("A program's buildCommand must be non-empty text");
|
|
48
50
|
for (const half of ["server", "client"]) {
|
|
@@ -55,8 +57,6 @@ function coherent(config) {
|
|
|
55
57
|
throw new Error(`A declared ${half} half must have a location`);
|
|
56
58
|
if (declared.start !== undefined && typeof declared.start !== "boolean")
|
|
57
59
|
throw new Error(`A declared ${half} endpoint's start default must be true or false`);
|
|
58
|
-
if (declared.serviceable !== undefined && typeof declared.serviceable !== "boolean")
|
|
59
|
-
throw new Error(`A declared ${half} endpoint's serviceable capability must be true or false`);
|
|
60
60
|
}
|
|
61
61
|
if (!(config.server && (config.server.start ?? true)) && !(config.client && (config.client.start ?? true)))
|
|
62
62
|
throw new Error("A Program's default Process must start a server endpoint, a client endpoint, or both");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "phresh
|
|
2
|
+
"name": "phresh",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.12",
|
|
5
5
|
"description": "The official PhreshOS starter Program.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"react-dom": "^19.2.8"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@phreshos/cli": "^0.1.
|
|
25
|
+
"@phreshos/cli": "^0.1.20",
|
|
26
26
|
"@types/node": "^26.2.0",
|
|
27
27
|
"@types/react": "^19.2.18",
|
|
28
28
|
"@types/react-dom": "^19.2.4",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineConfig } from "@phreshos/core"
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
identity: "phresh
|
|
4
|
+
identity: "phresh",
|
|
5
5
|
name: "Phresh Program",
|
|
6
6
|
description: "A minimal counter with direct Client and Server endpoints.",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.12",
|
|
8
8
|
icon: "icon.png",
|
|
9
9
|
buildCommand: "vite-node scripts/build.ts",
|
|
10
10
|
server: {
|
package/dist/template.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"repository": "PhreshOS/phresh-program",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"sha256": "
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"sha256": "408d2a1353c32d5ffe69773d115663d125311586394f8bcddd0a0e07f33da914",
|
|
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.
|
|
4
|
+
"version": "0.1.20",
|
|
5
5
|
"description": "The Phresh command-line interface for Program projects and system management.",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.10"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"packageManager": "bun@1.3.14",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@clack/prompts": "^1.7.0",
|
|
52
|
-
"@phreshos/core": "^0.1.
|
|
52
|
+
"@phreshos/core": "^0.1.12",
|
|
53
53
|
"adm-zip": "^0.6.0",
|
|
54
54
|
"commander": "^15.0.0",
|
|
55
55
|
"picocolors": "^1.1.1"
|