@phreshos/cli 0.1.37 → 0.1.39
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 +1 -1
- package/dist/template/README.md +8 -9
- package/dist/template/{source/client → client}/app.tsx +4 -4
- package/dist/template/package.json +5 -5
- package/dist/template/phresh.config.ts +2 -2
- package/dist/template/scripts/build.ts +8 -1
- package/dist/template/server/main.ts +10 -0
- package/dist/template/vite.client.ts +2 -2
- package/dist/template/vite.config.ts +7 -1
- package/dist/template.json +2 -2
- package/package.json +3 -4
- package/dist/template/source/server/main.ts +0 -10
- /package/dist/template/{source/client → client}/index.html +0 -0
- /package/dist/template/{source/client → client}/main.tsx +0 -0
- /package/dist/template/{source/client → client}/style.css +0 -0
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ phresh dev --run-option-path=/notes.md --run-option-line=42
|
|
|
113
113
|
Read back by name, on either half:
|
|
114
114
|
|
|
115
115
|
```ts
|
|
116
|
-
const path = await
|
|
116
|
+
const path = await context.option("path")
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
**Options are text, all of them.** An option must mean the same thing
|
package/dist/template/README.md
CHANGED
|
@@ -8,17 +8,16 @@ bun install
|
|
|
8
8
|
bun run dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The complete
|
|
11
|
+
The complete Program is intentionally small:
|
|
12
12
|
|
|
13
13
|
```text
|
|
14
|
-
|
|
15
|
-
├──
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
└──
|
|
21
|
-
└── main.ts
|
|
14
|
+
client/
|
|
15
|
+
├── app.tsx
|
|
16
|
+
├── index.html
|
|
17
|
+
├── main.tsx
|
|
18
|
+
└── style.css
|
|
19
|
+
server/
|
|
20
|
+
└── main.ts
|
|
22
21
|
```
|
|
23
22
|
|
|
24
23
|
`app.tsx` owns the small React component. The two `main` files are direct
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { context } from "@phreshos/client"
|
|
2
2
|
import { useSubscribe } from "@phreshos/react"
|
|
3
3
|
import { useEffect, useState } from "react"
|
|
4
4
|
|
|
5
5
|
export default function App() {
|
|
6
6
|
const [count, setCount] = useState<number>()
|
|
7
7
|
|
|
8
|
-
useSubscribe(
|
|
8
|
+
useSubscribe(context.server, "changed", setCount)
|
|
9
9
|
|
|
10
10
|
useEffect(() => {
|
|
11
|
-
|
|
11
|
+
context.server.ask<number>("read").then(setCount)
|
|
12
12
|
}, [])
|
|
13
13
|
|
|
14
14
|
return <main>
|
|
15
15
|
<span>PhreshOS</span>
|
|
16
16
|
<h1>Server counter</h1>
|
|
17
17
|
<p>The Client talks directly to its Process Server.</p>
|
|
18
|
-
<button type="button" onClick={() =>
|
|
18
|
+
<button type="button" onClick={() => context.server.publish("increment")}>
|
|
19
19
|
Count is {count ?? "…"}
|
|
20
20
|
</button>
|
|
21
21
|
</main>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phresh",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.22",
|
|
5
5
|
"description": "The official PhreshOS starter Program.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"starter"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@phreshos/client": "^0.1.
|
|
17
|
+
"@phreshos/client": "^0.1.25",
|
|
18
18
|
"@phreshos/core": "^0.1.25",
|
|
19
|
-
"@phreshos/react": "^0.1.
|
|
20
|
-
"@phreshos/server": "^0.1.
|
|
19
|
+
"@phreshos/react": "^0.1.13",
|
|
20
|
+
"@phreshos/server": "^0.1.26",
|
|
21
21
|
"react": "^19.2.8",
|
|
22
22
|
"react-dom": "^19.2.8"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@phreshos/cli": "^0.1.
|
|
25
|
+
"@phreshos/cli": "^0.1.39",
|
|
26
26
|
"@types/node": "^26.2.0",
|
|
27
27
|
"@types/react": "^19.2.18",
|
|
28
28
|
"@types/react-dom": "^19.2.4",
|
|
@@ -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.
|
|
7
|
+
version: "0.1.22",
|
|
8
8
|
icon: "icon.png",
|
|
9
9
|
categories: ["Development"],
|
|
10
10
|
keywords: ["example", "counter", "client", "server"],
|
|
@@ -14,7 +14,7 @@ export default defineConfig({
|
|
|
14
14
|
location: "dist/server",
|
|
15
15
|
entryFile: "main.js",
|
|
16
16
|
development: {
|
|
17
|
-
startCommand: "vite-node
|
|
17
|
+
startCommand: "vite-node server/main.ts"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
client: {
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { externalDependencies } from "../vite.config"
|
|
1
2
|
import { rm, writeFile } from "node:fs/promises"
|
|
3
|
+
import packageConfig from "../package.json" with { type: "json" }
|
|
2
4
|
|
|
3
5
|
process.env.NODE_ENV = "production"
|
|
4
6
|
|
|
5
7
|
const { build } = await import("vite")
|
|
6
8
|
|
|
9
|
+
const dependencies: Partial<typeof packageConfig.dependencies> = {}
|
|
10
|
+
|
|
7
11
|
await rm("dist", { recursive: true, force: true })
|
|
12
|
+
|
|
13
|
+
for (const dependency of externalDependencies) dependencies[dependency] = packageConfig.dependencies[dependency]
|
|
14
|
+
|
|
8
15
|
await build({ configFile: "vite.config.ts", ssr: { noExternal: true } })
|
|
9
16
|
await build({ configFile: "vite.client.ts" })
|
|
10
|
-
await writeFile("dist/server/package.json", JSON.stringify({ type: "module" }))
|
|
17
|
+
await writeFile("dist/server/package.json", JSON.stringify({ type: "module", dependencies }))
|
|
@@ -3,7 +3,7 @@ import { defineConfig } from "vite"
|
|
|
3
3
|
import { resolve } from "node:path"
|
|
4
4
|
|
|
5
5
|
export default defineConfig({
|
|
6
|
-
root: "
|
|
6
|
+
root: "client",
|
|
7
7
|
plugins: [react()],
|
|
8
8
|
base: "./",
|
|
9
9
|
resolve: {
|
|
@@ -19,4 +19,4 @@ export default defineConfig({
|
|
|
19
19
|
emptyOutDir: true,
|
|
20
20
|
outDir: resolve(import.meta.dirname, "dist/client")
|
|
21
21
|
}
|
|
22
|
-
})
|
|
22
|
+
})
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import packageConfig from "./package.json" with { type: "json" }
|
|
1
2
|
import { defineConfig } from "vite"
|
|
2
3
|
import { resolve } from "node:path"
|
|
3
4
|
|
|
5
|
+
export const externalDependencies: (keyof typeof packageConfig.dependencies)[] = []
|
|
6
|
+
|
|
4
7
|
export default defineConfig({
|
|
5
|
-
root: "
|
|
8
|
+
root: "server",
|
|
9
|
+
ssr: {
|
|
10
|
+
external: externalDependencies
|
|
11
|
+
},
|
|
6
12
|
build: {
|
|
7
13
|
ssr: true,
|
|
8
14
|
emptyOutDir: true,
|
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.22",
|
|
4
|
+
"sha256": "f6892e1f1deee3764dbd5ac89fbe3884e2feb850a7a021ca2a0ff3df7e12db47",
|
|
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.39",
|
|
5
5
|
"description": "The Phresh command-line interface for Program projects and system management.",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.10"
|
|
@@ -49,11 +49,10 @@
|
|
|
49
49
|
"packageManager": "bun@1.3.14",
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@clack/prompts": "^1.7.0",
|
|
52
|
-
"@phreshos/core": "^0.1.
|
|
53
|
-
"@phreshos/node": "^0.1.
|
|
52
|
+
"@phreshos/core": "^0.1.26",
|
|
53
|
+
"@phreshos/node": "^0.1.5",
|
|
54
54
|
"adm-zip": "^0.6.0",
|
|
55
55
|
"commander": "^15.0.0",
|
|
56
|
-
"jiti": "^2.7.0",
|
|
57
56
|
"picocolors": "^1.1.1"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|