@toist/in 0.3.0 → 0.6.0
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/CHANGELOG.md +22 -3
- package/package.json +6 -2
- package/src/index.ts +26 -11
- package/src/upgrade.ts +45 -0
- package/templates/default/README.md +4 -4
- package/templates/default/_package.json +3 -3
- package/templates/default/kinds/custom.ts +1 -1
- package/templates/default/start.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,16 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@toist/in` are recorded here.
|
|
4
4
|
|
|
5
|
+
## 0.6.0 — 2026-05-05
|
|
6
|
+
|
|
7
|
+
**`bunx @toist/in` now upgrades existing instances.** Running without
|
|
8
|
+
arguments in a directory that has a `package.json` with `@toist/*` deps
|
|
9
|
+
bumps them all to the latest version — the same behaviour as the now-removed
|
|
10
|
+
`@toist/up` package. `@toist/up` is deprecated; migrate to `bunx @toist/in`.
|
|
11
|
+
|
|
12
|
+
Scaffold template pins `@toist/aja` and `@toist/spec` to `^0.6.0`.
|
|
13
|
+
|
|
14
|
+
## 0.5.0 — 2026-05-05
|
|
15
|
+
|
|
16
|
+
Lockstep version bump. Scaffold template pins `@toist/aja` and `@toist/spec` to `^0.5.0`.
|
|
17
|
+
|
|
18
|
+
## 0.4.0 — 2026-05-05
|
|
19
|
+
|
|
20
|
+
Lockstep version bump alongside `@toist/aja@0.4.0` (rename from `@toist/run`).
|
|
21
|
+
Scaffold template's `_package.json` now pins `@toist/aja` and `@toist/spec`
|
|
22
|
+
to `^0.4.0`.
|
|
23
|
+
|
|
5
24
|
## 0.3.0 — 2026-05-05
|
|
6
25
|
|
|
7
26
|
Lockstep version bump alongside the new `@toist/up` package. The scaffold
|
|
8
|
-
template's `_package.json` now pins `@toist/
|
|
27
|
+
template's `_package.json` now pins `@toist/aja` and `@toist/spec` to
|
|
9
28
|
`^0.3.0`. README mentions `bunx @toist/up` as the upgrade verb.
|
|
10
29
|
|
|
11
30
|
## 0.2.2 — 2026-05-05
|
|
12
31
|
|
|
13
|
-
Lockstep version bump alongside `@toist/
|
|
14
|
-
Scaffold template's `_package.json` now pins `@toist/
|
|
32
|
+
Lockstep version bump alongside `@toist/aja@0.2.2` (UI MIME-type fix).
|
|
33
|
+
Scaffold template's `_package.json` now pins `@toist/aja` and `@toist/spec`
|
|
15
34
|
to `^0.2.2` so freshly scaffolded instances pick up the fix.
|
|
16
35
|
|
|
17
36
|
## 0.2.1 — 2026-05-05
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toist/in",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Scaffold a new toist instance: bunx @toist/in <path>",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -8,5 +8,9 @@
|
|
|
8
8
|
"bin": {
|
|
9
9
|
"toist-in": "./src/index.ts"
|
|
10
10
|
},
|
|
11
|
-
"files": [
|
|
11
|
+
"files": [
|
|
12
|
+
"src/",
|
|
13
|
+
"templates/",
|
|
14
|
+
"CHANGELOG.md"
|
|
15
|
+
]
|
|
12
16
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// 2121 toist
|
|
3
|
-
// @toist/in — scaffold a new toist instance.
|
|
3
|
+
// @toist/in — scaffold a new toist instance, or upgrade an existing one.
|
|
4
4
|
//
|
|
5
|
-
// Usage:
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// pipelines/, resources/, data/, README.md, and .gitignore. Prints a
|
|
9
|
-
// suggested package.json snippet to stdout for the host to merge.
|
|
5
|
+
// Usage:
|
|
6
|
+
// bunx @toist/in <path> scaffold a new instance at <path>
|
|
7
|
+
// bunx @toist/in upgrade @toist/* deps in the current directory
|
|
10
8
|
|
|
9
|
+
import { existsSync } from "node:fs"
|
|
10
|
+
import { resolve } from "node:path"
|
|
11
11
|
import { scaffold } from "./scaffold.ts"
|
|
12
|
+
import { upgrade } from "./upgrade.ts"
|
|
12
13
|
|
|
13
14
|
const args = process.argv.slice(2)
|
|
14
|
-
const
|
|
15
|
+
const arg = args[0]
|
|
15
16
|
|
|
16
|
-
if (
|
|
17
|
-
console.log("bunx @toist/in <path>
|
|
17
|
+
if (arg === "--help" || arg === "-h") {
|
|
18
|
+
console.log("bunx @toist/in <path> scaffold a new toist instance at <path>")
|
|
19
|
+
console.log("bunx @toist/in upgrade @toist/* deps in the current directory")
|
|
18
20
|
console.log("")
|
|
19
21
|
console.log("Full docs: https://toist.in")
|
|
20
|
-
process.exit(
|
|
22
|
+
process.exit(0)
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
if (!arg) {
|
|
26
|
+
// No path given — upgrade if we're inside a toist instance, else error.
|
|
27
|
+
const pkgPath = resolve(process.cwd(), "package.json")
|
|
28
|
+
if (!existsSync(pkgPath)) {
|
|
29
|
+
console.error("No package.json found in the current directory.")
|
|
30
|
+
console.error("")
|
|
31
|
+
console.error("To scaffold a new instance: bunx @toist/in <path>")
|
|
32
|
+
console.error("To upgrade an existing one: run from the instance directory")
|
|
33
|
+
process.exit(1)
|
|
34
|
+
}
|
|
35
|
+
await upgrade()
|
|
36
|
+
} else {
|
|
37
|
+
await scaffold(arg)
|
|
38
|
+
}
|
package/src/upgrade.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// 2121 toist
|
|
3
|
+
// Upgrade @toist/* deps in the nearest package.json to latest.
|
|
4
|
+
// Called by @toist/in when run without a path argument in an existing instance.
|
|
5
|
+
|
|
6
|
+
import { readFile } from "node:fs/promises"
|
|
7
|
+
import { existsSync } from "node:fs"
|
|
8
|
+
import { resolve } from "node:path"
|
|
9
|
+
import { spawnSync } from "node:child_process"
|
|
10
|
+
|
|
11
|
+
export async function upgrade(cwd = process.cwd()): Promise<void> {
|
|
12
|
+
const pkgPath = resolve(cwd, "package.json")
|
|
13
|
+
if (!existsSync(pkgPath)) {
|
|
14
|
+
console.error(`No package.json in ${cwd}.`)
|
|
15
|
+
console.error("Run from your toist instance directory.")
|
|
16
|
+
process.exit(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const pkg = JSON.parse(await readFile(pkgPath, "utf8")) as {
|
|
20
|
+
dependencies?: Record<string, string>
|
|
21
|
+
devDependencies?: Record<string, string>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const all: Record<string, string> = {
|
|
25
|
+
...(pkg.dependencies ?? {}),
|
|
26
|
+
...(pkg.devDependencies ?? {}),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// @toist/in itself is excluded — it runs via bunx, no local copy needed.
|
|
30
|
+
const targets = Object.keys(all)
|
|
31
|
+
.filter((n) => n.startsWith("@toist/") && n !== "@toist/in")
|
|
32
|
+
.sort()
|
|
33
|
+
|
|
34
|
+
if (targets.length === 0) {
|
|
35
|
+
console.log("No @toist/* deps in package.json — nothing to upgrade.")
|
|
36
|
+
process.exit(0)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log(`Upgrading: ${targets.join(", ")}\n`)
|
|
40
|
+
const result = spawnSync("bun", ["update", "--latest", ...targets], {
|
|
41
|
+
stdio: "inherit",
|
|
42
|
+
cwd,
|
|
43
|
+
})
|
|
44
|
+
process.exit(result.status ?? 0)
|
|
45
|
+
}
|
|
@@ -11,7 +11,7 @@ Open `http://localhost:3000` to use the UI.
|
|
|
11
11
|
|
|
12
12
|
## Layout
|
|
13
13
|
|
|
14
|
-
- `start.ts` — bootstrap; calls `startRunner` from `@toist/
|
|
14
|
+
- `start.ts` — bootstrap; calls `startRunner` from `@toist/aja`
|
|
15
15
|
- `kinds/custom.ts` — register your domain-specific kinds here
|
|
16
16
|
- `pipelines/*.yaml` — pipeline definitions (per pipeline-spec)
|
|
17
17
|
- `resources/*.yaml` — resource definitions (per resource-spec)
|
|
@@ -20,11 +20,11 @@ Open `http://localhost:3000` to use the UI.
|
|
|
20
20
|
## Upgrading
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
|
-
bunx @toist/
|
|
23
|
+
bunx @toist/in
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
and bumps them to the latest
|
|
26
|
+
Run without arguments from the instance directory. Auto-detects every
|
|
27
|
+
`@toist/*` dep in `package.json` and bumps them to the latest version.
|
|
28
28
|
|
|
29
29
|
## More
|
|
30
30
|
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "bun start.ts",
|
|
7
|
-
"dev":
|
|
7
|
+
"dev": "bun --watch start.ts"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@toist/
|
|
11
|
-
"@toist/spec": "^0.
|
|
10
|
+
"@toist/aja": "^0.6.0",
|
|
11
|
+
"@toist/spec": "^0.6.0"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// 2121 toist — register your domain-specific kinds here.
|
|
2
2
|
//
|
|
3
|
-
// Each export should be a NodeKind<P, I>. See the @toist/
|
|
3
|
+
// Each export should be a NodeKind<P, I>. See the @toist/aja built-ins for
|
|
4
4
|
// reference shapes, and pipeline-spec / kind-spec at https://toist.in for
|
|
5
5
|
// the full contract.
|
|
6
6
|
//
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// 2121 toist instance bootstrap.
|
|
2
2
|
// See https://toist.in for the full quickstart.
|
|
3
3
|
|
|
4
|
-
import { startRunner } from "@toist/
|
|
4
|
+
import { startRunner } from "@toist/aja"
|
|
5
5
|
|
|
6
6
|
// Uncomment to register domain-specific kinds:
|
|
7
|
-
// import { register } from "@toist/
|
|
7
|
+
// import { register } from "@toist/aja"
|
|
8
8
|
// import * as customKinds from "./kinds/custom.ts"
|
|
9
9
|
// register(...Object.values(customKinds))
|
|
10
10
|
|