@monosmith/plugin-sdk 0.7.0 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monosmith/plugin-sdk",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "The TypeScript SDK for writing smith plugins: the protocol's types, the serve loop, a test host, the conformance checks, templating and key-order-keeping JSON editing. No runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2605,6 +2605,17 @@ export const protocolSchema = {
2605
2605
  },
2606
2606
  "description": "Outputs are directories relative to the project root, restored on a cache hit."
2607
2607
  },
2608
+ "ship": {
2609
+ "type": "array",
2610
+ "items": {
2611
+ "type": "string"
2612
+ },
2613
+ "description": "Ship names what the task makes in a tool's work folder that the project ships: globs relative to the project root (\"../../dist/cargo/debug/api\"). After the task succeeds, smith hard-links each match into the project's shipped folder (ProjectBuildDir), a folder file by file, under its base name, and copies a file it cannot link. A glob that matches nothing is skipped. Such a task lists the shipped folder in Outputs, never the tool's work folder: a cache restore empties each output folder first."
2614
+ },
2615
+ "release": {
2616
+ "$ref": "#/$defs/TaskProfile",
2617
+ "description": "Release is the task as `smith run --release` runs it: the command of the optimised profile (\"cargo build --release\") and what that profile ships. Nil means the task has one profile and runs the same way with the flag. The cache key holds the command, so each profile has its own cache entry."
2618
+ },
2608
2619
  "dependsOn": {
2609
2620
  "type": "array",
2610
2621
  "items": {
@@ -2640,6 +2651,29 @@ export const protocolSchema = {
2640
2651
  "command"
2641
2652
  ]
2642
2653
  },
2654
+ "TaskProfile": {
2655
+ "description": "TaskProfile is another build profile of a task: the command that builds it and what it ships (see Task.Ship).",
2656
+ "type": "object",
2657
+ "properties": {
2658
+ "command": {
2659
+ "type": "array",
2660
+ "items": {
2661
+ "type": "string"
2662
+ },
2663
+ "description": "Command is an argv array; it is never passed through a shell."
2664
+ },
2665
+ "ship": {
2666
+ "type": "array",
2667
+ "items": {
2668
+ "type": "string"
2669
+ },
2670
+ "description": "Ship names what this profile makes in a tool's work folder that the project ships, as Task.Ship does. Empty means the task ships nothing."
2671
+ }
2672
+ },
2673
+ "required": [
2674
+ "command"
2675
+ ]
2676
+ },
2643
2677
  "ToolInstall": {
2644
2678
  "description": "ToolInstall is one way to get a tool with a package manager. Manager is one of: \"winget\", \"brew\", \"brew-cask\", \"apt\", \"dnf\", \"pacman\", \"npm\", \"uv\", \"fnm\", \"rustup\", \"cargo\" and \"go\" (go install, for a tool published as a Go module). The host builds the exact command from the manager and Package; Package may hold {major}, {major.minor} and {version} (the whole version), which the pinned or suggested version fills. The language's own installers (uv, fnm, rustup, cargo) are offered only when they are already on the machine.",
2645
2679
  "type": "object",
@@ -1408,6 +1408,22 @@ export interface Task {
1408
1408
  inputs?: string[];
1409
1409
  /** Outputs are directories relative to the project root, restored on a cache hit. */
1410
1410
  outputs?: string[];
1411
+ /**
1412
+ * Ship names what the task makes in a tool's work folder that the project ships: globs relative
1413
+ * to the project root ("../../dist/cargo/debug/api"). After the task succeeds, smith hard-links
1414
+ * each match into the project's shipped folder (ProjectBuildDir), a folder file by file, under
1415
+ * its base name, and copies a file it cannot link. A glob that matches nothing is skipped. Such a
1416
+ * task lists the shipped folder in Outputs, never the tool's work folder: a cache restore empties
1417
+ * each output folder first.
1418
+ */
1419
+ ship?: string[];
1420
+ /**
1421
+ * Release is the task as `smith run --release` runs it: the command of the optimised profile
1422
+ * ("cargo build --release") and what that profile ships. Nil means the task has one profile and
1423
+ * runs the same way with the flag. The cache key holds the command, so each profile has its own
1424
+ * cache entry.
1425
+ */
1426
+ release?: TaskProfile;
1411
1427
  /**
1412
1428
  * DependsOn lists task names: "build" runs this project's build first, "^build" runs the build of
1413
1429
  * every project this one imports first.
@@ -1437,6 +1453,19 @@ export interface Task {
1437
1453
  /** ServeTimeout is how long to wait for ServeURL, as a Go duration ("60s"); empty means 60s. */
1438
1454
  serveTimeout?: string;
1439
1455
  }
1456
+ /**
1457
+ * TaskProfile is another build profile of a task: the command that builds it and what it ships (see
1458
+ * Task.Ship).
1459
+ */
1460
+ export interface TaskProfile {
1461
+ /** Command is an argv array; it is never passed through a shell. */
1462
+ command: string[];
1463
+ /**
1464
+ * Ship names what this profile makes in a tool's work folder that the project ships, as Task.Ship
1465
+ * does. Empty means the task ships nothing.
1466
+ */
1467
+ ship?: string[];
1468
+ }
1440
1469
  /**
1441
1470
  * ToolInstall is one way to get a tool with a package manager. Manager is one of: "winget", "brew",
1442
1471
  * "brew-cask", "apt", "dnf", "pacman", "npm", "uv", "fnm", "rustup", "cargo" and "go" (go install,