@phreshos/cli 0.1.17 → 0.1.19
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/derive.js +1 -0
- package/dist/pack.js +5 -1
- package/dist/project.js +3 -1
- package/dist/template/package.json +1 -1
- 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/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
|
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,6 +66,7 @@ function program(config, version) {
|
|
|
63
66
|
version,
|
|
64
67
|
description: config.description,
|
|
65
68
|
icon: config.icon ? "icon.png" : undefined,
|
|
69
|
+
agent: config.agent ? "agent.md" : undefined,
|
|
66
70
|
...config.server && { server: { location: "server", start: config.server.start, installCommand: config.server.installCommand, startCommand: config.server.startCommand } },
|
|
67
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
|
};
|
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"]) {
|
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.19",
|
|
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"
|