@monosmith/plugin-sdk 0.4.0 → 0.5.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.
@@ -21,7 +21,10 @@ function article(kind) {
21
21
  export async function checkGeneration(client, workspace, report) {
22
22
  const language = effectiveRoles(client.info).includes('language');
23
23
  const made = [];
24
+ const declared = client.info.kinds ?? [];
24
25
  for (const kind of ['app', 'lib', 'package']) {
26
+ if (declared.length > 0 && !declared.includes(kind))
27
+ continue;
25
28
  const name = `c${kind}`;
26
29
  const params = {
27
30
  kind,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monosmith/plugin-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.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",
@@ -642,6 +642,10 @@ export const protocolSchema = {
642
642
  }
643
643
  },
644
644
  "description": "DependsOn adds dependencies to tasks the project already has, by task name ({\"lint\": [\"slice-check\"]})."
645
+ },
646
+ "release": {
647
+ "$ref": "#/$defs/ReleaseDefaults",
648
+ "description": "Release is how the project's release files are made, for a project that releases through GitHub releases and leaves them out of its smith.toml [projects.<name>.release] table; what the table sets wins."
645
649
  }
646
650
  }
647
651
  },
@@ -1163,6 +1167,13 @@ export const protocolSchema = {
1163
1167
  "$ref": "#/$defs/Stack"
1164
1168
  },
1165
1169
  "description": "Stacks are ready-made stacks the plugin publishes."
1170
+ },
1171
+ "kinds": {
1172
+ "type": "array",
1173
+ "items": {
1174
+ "$ref": "#/$defs/ProjectKind"
1175
+ },
1176
+ "description": "Kinds are the project kinds the plugin can scaffold with generate. Absent or empty means all three (app, lib and package): what every plugin that says nothing does. A plugin that scaffolds only some, such as an app, lists them, so the host offers and the conformance suite asks for just those."
1166
1177
  }
1167
1178
  },
1168
1179
  "required": [
@@ -1627,6 +1638,43 @@ export const protocolSchema = {
1627
1638
  "auth"
1628
1639
  ]
1629
1640
  },
1641
+ "ReleaseDefaults": {
1642
+ "description": "ReleaseDefaults are release settings a plugin supplies for a project: the same fields as the release-from-a-command settings of smith.toml, used for the ones the project's table leaves out.",
1643
+ "type": "object",
1644
+ "properties": {
1645
+ "build": {
1646
+ "type": "string",
1647
+ "description": "Build is the shell command that makes the files, run at the workspace root on a runner of each platform."
1648
+ },
1649
+ "assets": {
1650
+ "type": "array",
1651
+ "items": {
1652
+ "type": "string"
1653
+ },
1654
+ "description": "Assets are workspace-relative globs of the files Build leaves."
1655
+ },
1656
+ "platforms": {
1657
+ "type": "array",
1658
+ "items": {
1659
+ "type": "string"
1660
+ },
1661
+ "description": "Platforms are the runner platforms (windows-x64, macos-arm64, macos-x64, linux-x64, linux-arm64)."
1662
+ },
1663
+ "assetName": {
1664
+ "type": "string",
1665
+ "description": "AssetName renames each file on upload; see the asset_name setting."
1666
+ },
1667
+ "checksums": {
1668
+ "type": "boolean",
1669
+ "description": "Checksums attaches a checksums file for the files a runner uploads."
1670
+ }
1671
+ },
1672
+ "required": [
1673
+ "build",
1674
+ "assets",
1675
+ "platforms"
1676
+ ]
1677
+ },
1630
1678
  "RemoveParams": {
1631
1679
  "description": "RemoveParams tells a plugin a project is being removed. The host deletes the project's directory first; the plugin cleans what it owns outside it (a go.work entry, a lockfile, an installed package).",
1632
1680
  "type": "object",
@@ -229,6 +229,12 @@ export interface Contribution {
229
229
  * ["slice-check"]}).
230
230
  */
231
231
  dependsOn?: Record<string, string[]>;
232
+ /**
233
+ * Release is how the project's release files are made, for a project that releases through GitHub
234
+ * releases and leaves them out of its smith.toml [projects.<name>.release] table; what the table
235
+ * sets wins.
236
+ */
237
+ release?: ReleaseDefaults;
232
238
  }
233
239
  /** Credential is a secret the release phase needs. */
234
240
  export interface Credential {
@@ -491,6 +497,13 @@ export interface InitializeResult {
491
497
  conflicts?: PluginRef[];
492
498
  /** Stacks are ready-made stacks the plugin publishes. */
493
499
  stacks?: Stack[];
500
+ /**
501
+ * Kinds are the project kinds the plugin can scaffold with generate. Absent or empty means all
502
+ * three (app, lib and package): what every plugin that says nothing does. A plugin that scaffolds
503
+ * only some, such as an app, lists them, so the host offers and the conformance suite asks for
504
+ * just those.
505
+ */
506
+ kinds?: ProjectKind[];
494
507
  }
495
508
  /**
496
509
  * Input is one input of an ActionStep. Values are written as quoted YAML strings, except true and
@@ -796,6 +809,28 @@ export interface Registry {
796
809
  */
797
810
  maven?: string;
798
811
  }
812
+ /**
813
+ * ReleaseDefaults are release settings a plugin supplies for a project: the same fields as the
814
+ * release-from-a-command settings of smith.toml, used for the ones the project's table leaves out.
815
+ */
816
+ export interface ReleaseDefaults {
817
+ /**
818
+ * Build is the shell command that makes the files, run at the workspace root on a runner of each
819
+ * platform.
820
+ */
821
+ build: string;
822
+ /** Assets are workspace-relative globs of the files Build leaves. */
823
+ assets: string[];
824
+ /**
825
+ * Platforms are the runner platforms (windows-x64, macos-arm64, macos-x64, linux-x64,
826
+ * linux-arm64).
827
+ */
828
+ platforms: string[];
829
+ /** AssetName renames each file on upload; see the asset_name setting. */
830
+ assetName?: string;
831
+ /** Checksums attaches a checksums file for the files a runner uploads. */
832
+ checksums?: boolean;
833
+ }
799
834
  /**
800
835
  * RemoveParams tells a plugin a project is being removed. The host deletes the project's directory
801
836
  * first; the plugin cleans what it owns outside it (a go.work entry, a lockfile, an installed