@monosmith/plugin-sdk 2.0.0-beta.11 → 2.0.0-beta.13
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 +1 -1
- package/protocol/protocol-schema.contract.js +27 -2
- package/protocol/protocol-types.contract.d.ts +43 -1
- package/scaffold/index.d.ts +1 -1
- package/scaffold/index.js +1 -1
- package/scaffold/scaffold-project.use-case.js +1 -1
- /package/scaffold/{scaffold-data.mapper.d.ts → template-fields.mapper.d.ts} +0 -0
- /package/scaffold/{scaffold-data.mapper.js → template-fields.mapper.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monosmith/plugin-sdk",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.13",
|
|
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",
|
|
@@ -643,6 +643,10 @@ export const protocolSchema = {
|
|
|
643
643
|
"type": "boolean",
|
|
644
644
|
"description": "Channels says a prerelease version the plugin publishes never takes the place of the stable one: the plugin publishes under PublishParams.Tag, a release channel's name, without moving the registry's stable pointer (npm's latest), or its registry orders a prerelease below the release (PyPI, NuGet) and needs no tag. A host does not publish a package of a release channel with a plugin that lacks it."
|
|
645
645
|
},
|
|
646
|
+
"packs": {
|
|
647
|
+
"type": "boolean",
|
|
648
|
+
"description": "Packs says publish honours PublishParams.PackDir: it writes the package file and publishes nowhere (registry = \"github-release\"). A host never calls publish with the setting on a plugin that lacks it, since the plugin would publish to the public registry."
|
|
649
|
+
},
|
|
646
650
|
"declared": {
|
|
647
651
|
"type": "boolean",
|
|
648
652
|
"description": "Declared says the plugin describes the projects smith.toml declares for its language (DiscoverParams.declared): folders with no manifest of their own. A plugin without it finds a project by its manifest only, and the host refuses a declaration for its language with a message that says so."
|
|
@@ -1303,15 +1307,28 @@ export const protocolSchema = {
|
|
|
1303
1307
|
]
|
|
1304
1308
|
},
|
|
1305
1309
|
"Finding": {
|
|
1306
|
-
"description": "Finding is one check. Every failed finding names its remedy.",
|
|
1310
|
+
"description": "Finding is one check. Every failed finding names its problem and its remedy.",
|
|
1307
1311
|
"type": "object",
|
|
1308
1312
|
"properties": {
|
|
1309
1313
|
"check": {
|
|
1310
|
-
"type": "string"
|
|
1314
|
+
"type": "string",
|
|
1315
|
+
"description": "Check is the rule, stated as it should hold (\"golangci-lint is 2.15.0, as in CI\"). A passing finding is listed by it."
|
|
1311
1316
|
},
|
|
1312
1317
|
"ok": {
|
|
1313
1318
|
"type": "boolean"
|
|
1314
1319
|
},
|
|
1320
|
+
"problem": {
|
|
1321
|
+
"type": "string",
|
|
1322
|
+
"description": "Problem is what is wrong, in one line (\"golangci-lint is 2.14.0, CI uses 2.15.0\"). A failed finding is listed by it; one without it is listed by its Check."
|
|
1323
|
+
},
|
|
1324
|
+
"project": {
|
|
1325
|
+
"type": "string",
|
|
1326
|
+
"description": "Project is the project the finding is about, as the workspace names it (\"web\"); empty for a finding about the workspace itself. The host files a finding under its project, so the Check, Problem and Detail need not name it."
|
|
1327
|
+
},
|
|
1328
|
+
"area": {
|
|
1329
|
+
"type": "string",
|
|
1330
|
+
"description": "Area is the part of the workspace a workspace-wide finding is about, in one lowercase word: \"toolchain\", \"ci\", \"lint\", \"dependencies\", \"release\", \"git\" or \"config\". A finding with a Project has none."
|
|
1331
|
+
},
|
|
1315
1332
|
"detail": {
|
|
1316
1333
|
"type": "string"
|
|
1317
1334
|
},
|
|
@@ -2056,6 +2073,10 @@ export const protocolSchema = {
|
|
|
2056
2073
|
"type": "string",
|
|
2057
2074
|
"description": "PropagationWait is the longest time a plugin waits, in a Finalize call, for the packages of the release to be fetchable from the registry: a duration such as \"15m\", \"0\" to not wait. Empty means the default. Only npm has such a wait. A publish never waits."
|
|
2058
2075
|
},
|
|
2076
|
+
"packDir": {
|
|
2077
|
+
"type": "string",
|
|
2078
|
+
"description": "PackDir, when set, turns the call into a pack: the plugin writes the package file of the project's ecosystem (npm tarball, wheel and sdist, .nupkg, .gem, .crate) and returns the files in PublishResult.Assets, and publishes nothing anywhere. A workspace-relative folder. The host sends it only to a plugin with the packs capability. In a dry run the plugin lists the files it would write, writes none, and reads no registry."
|
|
2079
|
+
},
|
|
2059
2080
|
"finalize": {
|
|
2060
2081
|
"type": "array",
|
|
2061
2082
|
"items": {
|
|
@@ -2204,6 +2225,10 @@ export const protocolSchema = {
|
|
|
2204
2225
|
"noPublish": {
|
|
2205
2226
|
"type": "boolean",
|
|
2206
2227
|
"description": "NoPublish means smith.toml says registry = \"none\": the release versions and tags the project and publishes it to no registry (a registry that builds from the tag, such as JitPack, does the rest)."
|
|
2228
|
+
},
|
|
2229
|
+
"packToRelease": {
|
|
2230
|
+
"type": "boolean",
|
|
2231
|
+
"description": "PackToRelease means smith.toml says registry = \"github-release\": the release packs the project into its ecosystem's package file and attaches it to the project's GitHub Release, publishing to no registry. The host sends PublishParams.PackDir to a plugin with the packs capability and never calls publish on one without it."
|
|
2207
2232
|
}
|
|
2208
2233
|
}
|
|
2209
2234
|
},
|
|
@@ -211,6 +211,12 @@ export interface Capabilities {
|
|
|
211
211
|
* plugin that lacks it.
|
|
212
212
|
*/
|
|
213
213
|
channels?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Packs says publish honours PublishParams.PackDir: it writes the package file and publishes
|
|
216
|
+
* nowhere (registry = "github-release"). A host never calls publish with the setting on a plugin
|
|
217
|
+
* that lacks it, since the plugin would publish to the public registry.
|
|
218
|
+
*/
|
|
219
|
+
packs?: boolean;
|
|
214
220
|
/**
|
|
215
221
|
* Declared says the plugin describes the projects smith.toml declares for its language
|
|
216
222
|
* (DiscoverParams.declared): folders with no manifest of their own. A plugin without it finds a
|
|
@@ -596,10 +602,31 @@ export interface FileEdit {
|
|
|
596
602
|
content?: string;
|
|
597
603
|
delete?: boolean;
|
|
598
604
|
}
|
|
599
|
-
/** Finding is one check. Every failed finding names its remedy. */
|
|
605
|
+
/** Finding is one check. Every failed finding names its problem and its remedy. */
|
|
600
606
|
export interface Finding {
|
|
607
|
+
/**
|
|
608
|
+
* Check is the rule, stated as it should hold ("golangci-lint is 2.15.0, as in CI"). A passing
|
|
609
|
+
* finding is listed by it.
|
|
610
|
+
*/
|
|
601
611
|
check: string;
|
|
602
612
|
ok: boolean;
|
|
613
|
+
/**
|
|
614
|
+
* Problem is what is wrong, in one line ("golangci-lint is 2.14.0, CI uses 2.15.0"). A failed
|
|
615
|
+
* finding is listed by it; one without it is listed by its Check.
|
|
616
|
+
*/
|
|
617
|
+
problem?: string;
|
|
618
|
+
/**
|
|
619
|
+
* Project is the project the finding is about, as the workspace names it ("web"); empty for a
|
|
620
|
+
* finding about the workspace itself. The host files a finding under its project, so the Check,
|
|
621
|
+
* Problem and Detail need not name it.
|
|
622
|
+
*/
|
|
623
|
+
project?: string;
|
|
624
|
+
/**
|
|
625
|
+
* Area is the part of the workspace a workspace-wide finding is about, in one lowercase word:
|
|
626
|
+
* "toolchain", "ci", "lint", "dependencies", "release", "git" or "config". A finding with a
|
|
627
|
+
* Project has none.
|
|
628
|
+
*/
|
|
629
|
+
area?: string;
|
|
603
630
|
detail?: string;
|
|
604
631
|
remedy?: string;
|
|
605
632
|
/** Warning true reports a problem without failing doctor. */
|
|
@@ -1102,6 +1129,14 @@ export interface PublishParams {
|
|
|
1102
1129
|
* means the default. Only npm has such a wait. A publish never waits.
|
|
1103
1130
|
*/
|
|
1104
1131
|
propagationWait?: string;
|
|
1132
|
+
/**
|
|
1133
|
+
* PackDir, when set, turns the call into a pack: the plugin writes the package file of the
|
|
1134
|
+
* project's ecosystem (npm tarball, wheel and sdist, .nupkg, .gem, .crate) and returns the files
|
|
1135
|
+
* in PublishResult.Assets, and publishes nothing anywhere. A workspace-relative folder. The host
|
|
1136
|
+
* sends it only to a plugin with the packs capability. In a dry run the plugin lists the files it
|
|
1137
|
+
* would write, writes none, and reads no registry.
|
|
1138
|
+
*/
|
|
1139
|
+
packDir?: string;
|
|
1105
1140
|
/**
|
|
1106
1141
|
* Finalize turns the call into the last phase of a release: nothing is published; for each move
|
|
1107
1142
|
* the plugin waits until its packages are fetchable, then moves the dist-tag. The host sends it
|
|
@@ -1195,6 +1230,13 @@ export interface Registries {
|
|
|
1195
1230
|
* rest).
|
|
1196
1231
|
*/
|
|
1197
1232
|
noPublish?: boolean;
|
|
1233
|
+
/**
|
|
1234
|
+
* PackToRelease means smith.toml says registry = "github-release": the release packs the project
|
|
1235
|
+
* into its ecosystem's package file and attaches it to the project's GitHub Release, publishing
|
|
1236
|
+
* to no registry. The host sends PublishParams.PackDir to a plugin with the packs capability and
|
|
1237
|
+
* never calls publish on one without it.
|
|
1238
|
+
*/
|
|
1239
|
+
packToRelease?: boolean;
|
|
1198
1240
|
}
|
|
1199
1241
|
/**
|
|
1200
1242
|
* Registry is a package registry smith.toml names in [registries.<name>]: a private feed (Azure
|
package/scaffold/index.d.ts
CHANGED
package/scaffold/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { scaffoldProject } from './scaffold-project.use-case.js';
|
|
2
|
-
export { scaffoldData } from './
|
|
2
|
+
export { scaffoldData } from './template-fields.mapper.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { writeTemplates } from '../templating/index.js';
|
|
2
|
-
import { scaffoldData } from './
|
|
2
|
+
import { scaffoldData } from './template-fields.mapper.js';
|
|
3
3
|
/**
|
|
4
4
|
* The answer to `generate` for a scaffold: renders the templates into the new
|
|
5
5
|
* project, never overwriting a file, and reports what it wrote. A language
|
|
File without changes
|
|
File without changes
|