@monosmith/plugin-sdk 2.0.0-beta.1 → 2.0.0-beta.10
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": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.10",
|
|
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",
|
|
@@ -175,6 +175,28 @@ export const protocolSchema = {
|
|
|
175
175
|
"capability": "dependencies",
|
|
176
176
|
"notification": false
|
|
177
177
|
},
|
|
178
|
+
"dependencies/link": {
|
|
179
|
+
"description": "Makes a project depend on a library of the same workspace and language, in the ecosystem's own form, then installs or locks as that needs.",
|
|
180
|
+
"params": {
|
|
181
|
+
"$ref": "#/$defs/LinkParams"
|
|
182
|
+
},
|
|
183
|
+
"result": {
|
|
184
|
+
"$ref": "#/$defs/LinkResult"
|
|
185
|
+
},
|
|
186
|
+
"capability": "link",
|
|
187
|
+
"notification": false
|
|
188
|
+
},
|
|
189
|
+
"dependencies/unlink": {
|
|
190
|
+
"description": "Removes the dependency of a project on a library of the same workspace.",
|
|
191
|
+
"params": {
|
|
192
|
+
"$ref": "#/$defs/UnlinkParams"
|
|
193
|
+
},
|
|
194
|
+
"result": {
|
|
195
|
+
"$ref": "#/$defs/DependencyResult"
|
|
196
|
+
},
|
|
197
|
+
"capability": "link",
|
|
198
|
+
"notification": false
|
|
199
|
+
},
|
|
178
200
|
"dependencies/declared": {
|
|
179
201
|
"description": "Lists the dependencies the manifests of the plugin's projects declare.",
|
|
180
202
|
"params": {
|
|
@@ -589,6 +611,10 @@ export const protocolSchema = {
|
|
|
589
611
|
"type": "boolean",
|
|
590
612
|
"description": "Dependencies installs and uninstalls packages in its projects."
|
|
591
613
|
},
|
|
614
|
+
"link": {
|
|
615
|
+
"type": "boolean",
|
|
616
|
+
"description": "Link makes a project depend on a library of the same workspace in the ecosystem's own form (a workspace dependency, a path dependency, a project reference), and takes it out again. A plugin without it is refused by the host with one sentence that tells the user to add the dependency by hand."
|
|
617
|
+
},
|
|
592
618
|
"declarations": {
|
|
593
619
|
"type": "boolean",
|
|
594
620
|
"description": "Declarations lists and rewrites declared dependency specs (sync, up)."
|
|
@@ -616,6 +642,10 @@ export const protocolSchema = {
|
|
|
616
642
|
"channels": {
|
|
617
643
|
"type": "boolean",
|
|
618
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
|
+
},
|
|
646
|
+
"declared": {
|
|
647
|
+
"type": "boolean",
|
|
648
|
+
"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."
|
|
619
649
|
}
|
|
620
650
|
}
|
|
621
651
|
},
|
|
@@ -688,6 +718,21 @@ export const protocolSchema = {
|
|
|
688
718
|
"description": {
|
|
689
719
|
"type": "string"
|
|
690
720
|
},
|
|
721
|
+
"title": {
|
|
722
|
+
"type": "string",
|
|
723
|
+
"description": "Title is the name shown to a person (\"Electron\" for electron). Without it the name is shown."
|
|
724
|
+
},
|
|
725
|
+
"aliases": {
|
|
726
|
+
"type": "array",
|
|
727
|
+
"items": {
|
|
728
|
+
"type": "string"
|
|
729
|
+
},
|
|
730
|
+
"description": "Aliases are words that find the choice when a person searches the catalogue (smith compose): \"desktop\", \"serverless\", \"web\"."
|
|
731
|
+
},
|
|
732
|
+
"layer": {
|
|
733
|
+
"type": "string",
|
|
734
|
+
"description": "Layer is where the choice sits in the stack of a project: \"framework\", \"shell\" (a desktop shell), \"host\" (where cloud code runs), \"test\", \"lint\", \"style\" or a layer of the plugin's own. Without it the layer is the axis. It is for display and grouping: the axis decides conflicts."
|
|
735
|
+
},
|
|
691
736
|
"language": {
|
|
692
737
|
"type": "string",
|
|
693
738
|
"description": "Language is the language plugin the choice applies to (\"node\")."
|
|
@@ -710,6 +755,10 @@ export const protocolSchema = {
|
|
|
710
755
|
"type": "boolean",
|
|
711
756
|
"description": "Default marks the choice the host adds when a selection needs its axis and has no choice on it."
|
|
712
757
|
},
|
|
758
|
+
"suggested": {
|
|
759
|
+
"type": "boolean",
|
|
760
|
+
"description": "Suggested marks the choice an asker pre-selects on its axis. The solver never adds it by itself: an axis that a choice needs and that has no Default is asked, and the person answers (ADR 0072)."
|
|
761
|
+
},
|
|
713
762
|
"many": {
|
|
714
763
|
"type": "boolean",
|
|
715
764
|
"description": "Many allows the choice next to other choices of its axis that are Many too. By default a selection has one choice per axis."
|
|
@@ -941,6 +990,28 @@ export const protocolSchema = {
|
|
|
941
990
|
"projects"
|
|
942
991
|
]
|
|
943
992
|
},
|
|
993
|
+
"DeclaredProject": {
|
|
994
|
+
"description": "DeclaredProject is a project smith.toml declares: a folder with no manifest.",
|
|
995
|
+
"type": "object",
|
|
996
|
+
"properties": {
|
|
997
|
+
"name": {
|
|
998
|
+
"type": "string",
|
|
999
|
+
"description": "Name is the project's name, the key of its [projects.<name>] table."
|
|
1000
|
+
},
|
|
1001
|
+
"root": {
|
|
1002
|
+
"type": "string",
|
|
1003
|
+
"description": "Root is the workspace-relative folder."
|
|
1004
|
+
},
|
|
1005
|
+
"kind": {
|
|
1006
|
+
"$ref": "#/$defs/ProjectKind",
|
|
1007
|
+
"description": "Kind is \"app\", \"lib\" or \"package\", or empty for the plugin's choice."
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
"required": [
|
|
1011
|
+
"name",
|
|
1012
|
+
"root"
|
|
1013
|
+
]
|
|
1014
|
+
},
|
|
944
1015
|
"DeclaredResult": {
|
|
945
1016
|
"description": "DeclaredResult is every declaration, and the version installed of each name where the plugin can tell.",
|
|
946
1017
|
"type": "object",
|
|
@@ -1116,6 +1187,20 @@ export const protocolSchema = {
|
|
|
1116
1187
|
"items": {
|
|
1117
1188
|
"type": "string"
|
|
1118
1189
|
}
|
|
1190
|
+
},
|
|
1191
|
+
"declared": {
|
|
1192
|
+
"type": "array",
|
|
1193
|
+
"items": {
|
|
1194
|
+
"$ref": "#/$defs/DeclaredProject"
|
|
1195
|
+
},
|
|
1196
|
+
"description": "Declared are the projects smith.toml declares for this plugin's language ([projects.<name>] with a root and a language): folders with no manifest of their own, such as a program that is a package of the Go module above it. The plugin describes each one in its result, or answers with an error saying why it cannot."
|
|
1197
|
+
},
|
|
1198
|
+
"settings": {
|
|
1199
|
+
"type": "object",
|
|
1200
|
+
"additionalProperties": {
|
|
1201
|
+
"type": "object"
|
|
1202
|
+
},
|
|
1203
|
+
"description": "Settings are this plugin's settings for projects, by project name, from smith.toml [projects.<project>.settings.<plugin>]. They reach the plugin here because the tasks it describes may depend on them (the Go plugin's build tags). A project with no settings is absent."
|
|
1119
1204
|
}
|
|
1120
1205
|
},
|
|
1121
1206
|
"required": [
|
|
@@ -1549,6 +1634,13 @@ export const protocolSchema = {
|
|
|
1549
1634
|
"$ref": "#/$defs/Choice"
|
|
1550
1635
|
},
|
|
1551
1636
|
"description": "Choices are the options on an axis (framework, test, style) the plugin owns. The host lists them (smith choices) and checks a selection of them (smith add --with). Absent means the plugin owns none."
|
|
1637
|
+
},
|
|
1638
|
+
"tools": {
|
|
1639
|
+
"type": "array",
|
|
1640
|
+
"items": {
|
|
1641
|
+
"$ref": "#/$defs/ToolNeed"
|
|
1642
|
+
},
|
|
1643
|
+
"description": "Tools are the programs the plugin needs on the person's machine. The host detects them and, when one is missing, presents the ways to get it (smith tools). Absent means the plugin declares none."
|
|
1552
1644
|
}
|
|
1553
1645
|
},
|
|
1554
1646
|
"required": [
|
|
@@ -1645,6 +1737,94 @@ export const protocolSchema = {
|
|
|
1645
1737
|
}
|
|
1646
1738
|
}
|
|
1647
1739
|
},
|
|
1740
|
+
"LinkOption": {
|
|
1741
|
+
"description": "LinkOption is one way to write the dependency, with its consequence in words a person who read no manual can follow.",
|
|
1742
|
+
"type": "object",
|
|
1743
|
+
"properties": {
|
|
1744
|
+
"spec": {
|
|
1745
|
+
"type": "string",
|
|
1746
|
+
"description": "Spec is the value passed back in LinkParams.Spec."
|
|
1747
|
+
},
|
|
1748
|
+
"label": {
|
|
1749
|
+
"type": "string",
|
|
1750
|
+
"description": "Label is the option in a few words."
|
|
1751
|
+
},
|
|
1752
|
+
"meaning": {
|
|
1753
|
+
"type": "string",
|
|
1754
|
+
"description": "Meaning says what happens with this option."
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
"required": [
|
|
1758
|
+
"spec",
|
|
1759
|
+
"label",
|
|
1760
|
+
"meaning"
|
|
1761
|
+
]
|
|
1762
|
+
},
|
|
1763
|
+
"LinkParams": {
|
|
1764
|
+
"description": "LinkParams asks a plugin to make Project depend on Library, a lib or package of the same workspace and language, in the ecosystem's own form, and to install or lock as that needs. The host has checked that both exist, that the languages match, that Library is not an app, and that the link makes no cycle; the plugin answers with an error that names the file when it cannot write the dependency.",
|
|
1765
|
+
"type": "object",
|
|
1766
|
+
"properties": {
|
|
1767
|
+
"project": {
|
|
1768
|
+
"$ref": "#/$defs/Project",
|
|
1769
|
+
"description": "Project is the project that gains the dependency."
|
|
1770
|
+
},
|
|
1771
|
+
"library": {
|
|
1772
|
+
"$ref": "#/$defs/Project",
|
|
1773
|
+
"description": "Library is the project it depends on."
|
|
1774
|
+
},
|
|
1775
|
+
"quiet": {
|
|
1776
|
+
"type": "boolean",
|
|
1777
|
+
"description": "Quiet keeps the package manager's output unless it fails."
|
|
1778
|
+
},
|
|
1779
|
+
"plan": {
|
|
1780
|
+
"type": "boolean",
|
|
1781
|
+
"description": "Plan asks for the plan only: the plugin writes nothing and answers with the manifest, the line it would write and the choices the user has."
|
|
1782
|
+
},
|
|
1783
|
+
"spec": {
|
|
1784
|
+
"type": "string",
|
|
1785
|
+
"description": "Spec is the version range the user chose from LinkResult.Options; empty means the plugin's default, or the form the workspace already uses."
|
|
1786
|
+
}
|
|
1787
|
+
},
|
|
1788
|
+
"required": [
|
|
1789
|
+
"project",
|
|
1790
|
+
"library"
|
|
1791
|
+
]
|
|
1792
|
+
},
|
|
1793
|
+
"LinkResult": {
|
|
1794
|
+
"description": "LinkResult is what a link wrote, or with LinkParams.Plan would write.",
|
|
1795
|
+
"type": "object",
|
|
1796
|
+
"properties": {
|
|
1797
|
+
"files": {
|
|
1798
|
+
"type": "array",
|
|
1799
|
+
"items": {
|
|
1800
|
+
"type": "string"
|
|
1801
|
+
},
|
|
1802
|
+
"description": "Files are the workspace-relative files changed (or to be changed)."
|
|
1803
|
+
},
|
|
1804
|
+
"notes": {
|
|
1805
|
+
"type": "array",
|
|
1806
|
+
"items": {
|
|
1807
|
+
"type": "string"
|
|
1808
|
+
},
|
|
1809
|
+
"description": "Notes are for the user."
|
|
1810
|
+
},
|
|
1811
|
+
"manifest": {
|
|
1812
|
+
"type": "string",
|
|
1813
|
+
"description": "Manifest is the file the dependency goes into, workspace-relative."
|
|
1814
|
+
},
|
|
1815
|
+
"line": {
|
|
1816
|
+
"type": "string",
|
|
1817
|
+
"description": "Line is the dependency as it is written there, for the plan shown before anything is written (\"@acme/core\": \"*\")."
|
|
1818
|
+
},
|
|
1819
|
+
"options": {
|
|
1820
|
+
"type": "array",
|
|
1821
|
+
"items": {
|
|
1822
|
+
"$ref": "#/$defs/LinkOption"
|
|
1823
|
+
},
|
|
1824
|
+
"description": "Options are the real choices of the range written, with the default first. Empty when the ecosystem has none, or the workspace already follows a convention (then Line shows it)."
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1648
1828
|
"PackageStore": {
|
|
1649
1829
|
"description": "PackageStore is where a package manager keeps what it downloaded (npm's ~/.npm, Go's module cache). A generated pipeline restores it before setup and saves it after a run, keyed on Files, so `npm ci` or `go mod download` fetches only what changed. A pull request from a fork restores it and never writes the base repository's cache.",
|
|
1650
1830
|
"type": "object",
|
|
@@ -1864,6 +2044,17 @@ export const protocolSchema = {
|
|
|
1864
2044
|
"tag": {
|
|
1865
2045
|
"type": "string",
|
|
1866
2046
|
"description": "Tag is the name of the release channel the version belongs to (npm's dist-tag \"beta\"). When set, the plugin publishes under it and leaves the registry's stable pointer where it is, or ignores it when its registry has no such pointer. Only sent to a plugin with the channels capability."
|
|
2047
|
+
},
|
|
2048
|
+
"propagationWait": {
|
|
2049
|
+
"type": "string",
|
|
2050
|
+
"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."
|
|
2051
|
+
},
|
|
2052
|
+
"finalize": {
|
|
2053
|
+
"type": "array",
|
|
2054
|
+
"items": {
|
|
2055
|
+
"$ref": "#/$defs/TagMove"
|
|
2056
|
+
},
|
|
2057
|
+
"description": "Finalize turns the call into the last phase of a release: nothing is published; for each move the plugin waits until its packages are fetchable, then moves the dist-tag. The host sends it after every project has published, so a wait never blocks another publish."
|
|
1867
2058
|
}
|
|
1868
2059
|
},
|
|
1869
2060
|
"required": [
|
|
@@ -1884,6 +2075,27 @@ export const protocolSchema = {
|
|
|
1884
2075
|
"registry": {
|
|
1885
2076
|
"type": "string"
|
|
1886
2077
|
},
|
|
2078
|
+
"notes": {
|
|
2079
|
+
"type": "array",
|
|
2080
|
+
"items": {
|
|
2081
|
+
"type": "string"
|
|
2082
|
+
},
|
|
2083
|
+
"description": "Notes are things the person must know about a publish that succeeded, such as a dist-tag that was not moved; the host prints them and the report keeps them."
|
|
2084
|
+
},
|
|
2085
|
+
"pendingMoves": {
|
|
2086
|
+
"type": "array",
|
|
2087
|
+
"items": {
|
|
2088
|
+
"$ref": "#/$defs/TagMove"
|
|
2089
|
+
},
|
|
2090
|
+
"description": "PendingMoves are the dist-tags the call did not move, because the packages the release needs were not fetchable yet. A publish returns them for the host to move at the end of the release; a Finalize call returns the ones still waiting when its time ran out. The release then ends with a warning, never silently."
|
|
2091
|
+
},
|
|
2092
|
+
"moved": {
|
|
2093
|
+
"type": "array",
|
|
2094
|
+
"items": {
|
|
2095
|
+
"type": "string"
|
|
2096
|
+
},
|
|
2097
|
+
"description": "Moved names the dist-tags a Finalize call moved (\"name@version tag\")."
|
|
2098
|
+
},
|
|
1887
2099
|
"assets": {
|
|
1888
2100
|
"type": "array",
|
|
1889
2101
|
"items": {
|
|
@@ -2292,6 +2504,36 @@ export const protocolSchema = {
|
|
|
2292
2504
|
"blocking"
|
|
2293
2505
|
]
|
|
2294
2506
|
},
|
|
2507
|
+
"TagMove": {
|
|
2508
|
+
"description": "TagMove is a dist-tag a publish left where it was, because the packages the release needs were not fetchable yet.",
|
|
2509
|
+
"type": "object",
|
|
2510
|
+
"properties": {
|
|
2511
|
+
"package": {
|
|
2512
|
+
"type": "string",
|
|
2513
|
+
"description": "Package and Version name the package that carries the tag."
|
|
2514
|
+
},
|
|
2515
|
+
"version": {
|
|
2516
|
+
"type": "string"
|
|
2517
|
+
},
|
|
2518
|
+
"tag": {
|
|
2519
|
+
"type": "string",
|
|
2520
|
+
"description": "Tag is the dist-tag to move to Version."
|
|
2521
|
+
},
|
|
2522
|
+
"awaits": {
|
|
2523
|
+
"type": "array",
|
|
2524
|
+
"items": {
|
|
2525
|
+
"type": "string"
|
|
2526
|
+
},
|
|
2527
|
+
"description": "Awaits are the packages that must be fetchable first."
|
|
2528
|
+
}
|
|
2529
|
+
},
|
|
2530
|
+
"required": [
|
|
2531
|
+
"package",
|
|
2532
|
+
"version",
|
|
2533
|
+
"tag",
|
|
2534
|
+
"awaits"
|
|
2535
|
+
]
|
|
2536
|
+
},
|
|
2295
2537
|
"Task": {
|
|
2296
2538
|
"description": "Task is a command the host can run, hash and cache.",
|
|
2297
2539
|
"type": "object",
|
|
@@ -2362,6 +2604,128 @@ export const protocolSchema = {
|
|
|
2362
2604
|
"command"
|
|
2363
2605
|
]
|
|
2364
2606
|
},
|
|
2607
|
+
"ToolInstall": {
|
|
2608
|
+
"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\" and \"cargo\". The host builds the exact command from the manager and Package; Package may hold {major} and {major.minor}, 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.",
|
|
2609
|
+
"type": "object",
|
|
2610
|
+
"properties": {
|
|
2611
|
+
"manager": {
|
|
2612
|
+
"type": "string"
|
|
2613
|
+
},
|
|
2614
|
+
"package": {
|
|
2615
|
+
"type": "string"
|
|
2616
|
+
},
|
|
2617
|
+
"note": {
|
|
2618
|
+
"type": "string",
|
|
2619
|
+
"description": "Note adds a sentence the person needs before choosing (\"a new terminal is needed\")."
|
|
2620
|
+
}
|
|
2621
|
+
},
|
|
2622
|
+
"required": [
|
|
2623
|
+
"manager",
|
|
2624
|
+
"package"
|
|
2625
|
+
]
|
|
2626
|
+
},
|
|
2627
|
+
"ToolNeed": {
|
|
2628
|
+
"description": "ToolNeed is a program on the person's machine that a plugin needs to build, test or run its projects (Python, the .NET SDK, Docker). A plugin publishes the tools it needs in InitializeResult.Tools. The host detects them, and when one is missing it presents the ways to get it (ADR 0077): it never installs in silence. The plugin writes facts only (what the tool is, how to detect it, how each system gets it); the host decides how to ask.",
|
|
2629
|
+
"type": "object",
|
|
2630
|
+
"properties": {
|
|
2631
|
+
"name": {
|
|
2632
|
+
"type": "string",
|
|
2633
|
+
"description": "Name identifies the tool across plugins and in commands (smith tools install python). Two plugins that need the same tool use the same Name."
|
|
2634
|
+
},
|
|
2635
|
+
"title": {
|
|
2636
|
+
"type": "string",
|
|
2637
|
+
"description": "Title is what the tool is called in text: \"Python\", \"the .NET SDK\". Doctor words the check \"<Title> is installed\"."
|
|
2638
|
+
},
|
|
2639
|
+
"why": {
|
|
2640
|
+
"type": "string",
|
|
2641
|
+
"description": "Why says in plain words what smith needs the tool for."
|
|
2642
|
+
},
|
|
2643
|
+
"consequence": {
|
|
2644
|
+
"type": "string",
|
|
2645
|
+
"description": "Consequence says what stops working while the tool is missing, as the end of a sentence that starts \"If you skip it, \": \"smith test and smith build fail for the python projects\"."
|
|
2646
|
+
},
|
|
2647
|
+
"program": {
|
|
2648
|
+
"type": "string",
|
|
2649
|
+
"description": "Program is the program that carries the tool on PATH (\"python3\")."
|
|
2650
|
+
},
|
|
2651
|
+
"alternatives": {
|
|
2652
|
+
"type": "array",
|
|
2653
|
+
"items": {
|
|
2654
|
+
"type": "string"
|
|
2655
|
+
},
|
|
2656
|
+
"description": "Alternatives are other programs that also count (\"python\", \"py\")."
|
|
2657
|
+
},
|
|
2658
|
+
"versionArgs": {
|
|
2659
|
+
"type": "array",
|
|
2660
|
+
"items": {
|
|
2661
|
+
"type": "string"
|
|
2662
|
+
},
|
|
2663
|
+
"description": "VersionArgs are the arguments that make Program print its version. Absent means --version."
|
|
2664
|
+
},
|
|
2665
|
+
"pins": {
|
|
2666
|
+
"type": "array",
|
|
2667
|
+
"items": {
|
|
2668
|
+
"$ref": "#/$defs/ToolVersionPin"
|
|
2669
|
+
},
|
|
2670
|
+
"description": "Pins are the files where a workspace pins the version it wants. The first pin the host finds gives the version range. Absent means any version counts."
|
|
2671
|
+
},
|
|
2672
|
+
"choice": {
|
|
2673
|
+
"type": "string",
|
|
2674
|
+
"description": "Choice limits the tool to stacks that have this choice (\"azure-functions\"): the tool is not needed by a project built without it. Absent means every project of the plugin needs it."
|
|
2675
|
+
},
|
|
2676
|
+
"files": {
|
|
2677
|
+
"type": "array",
|
|
2678
|
+
"items": {
|
|
2679
|
+
"type": "string"
|
|
2680
|
+
},
|
|
2681
|
+
"description": "Files limit the tool to projects that hold one of these files in their folder (\"build.gradle.kts\"): a Gradle build needs gradle, a Maven build does not. A tool that the tasks of a project run (gradle, mvn) is declared this way. Absent means every project of the plugin needs it."
|
|
2682
|
+
},
|
|
2683
|
+
"systems": {
|
|
2684
|
+
"type": "array",
|
|
2685
|
+
"items": {
|
|
2686
|
+
"type": "string"
|
|
2687
|
+
},
|
|
2688
|
+
"description": "Systems limits the tool to these systems, named as Go names them (\"windows\", \"darwin\", \"linux\"): the Xcode Command Line Tools exist only on \"darwin\". Absent means every system."
|
|
2689
|
+
},
|
|
2690
|
+
"suggested": {
|
|
2691
|
+
"type": "string",
|
|
2692
|
+
"description": "Suggested is the version smith installs when no pin says one: \"3.13\". It fills {major} and {major.minor} in the install entries."
|
|
2693
|
+
},
|
|
2694
|
+
"optional": {
|
|
2695
|
+
"type": "boolean",
|
|
2696
|
+
"description": "Optional marks a tool whose absence only costs a feature (running a function app locally). Doctor reports it as a warning, not a failure."
|
|
2697
|
+
},
|
|
2698
|
+
"install": {
|
|
2699
|
+
"type": "array",
|
|
2700
|
+
"items": {
|
|
2701
|
+
"$ref": "#/$defs/ToolInstall"
|
|
2702
|
+
},
|
|
2703
|
+
"description": "Install are the ways to get the tool, per package manager and system."
|
|
2704
|
+
},
|
|
2705
|
+
"download": {
|
|
2706
|
+
"type": "string",
|
|
2707
|
+
"description": "Download is the official page of the tool, for the person who installs it by hand or has no package manager."
|
|
2708
|
+
},
|
|
2709
|
+
"source": {
|
|
2710
|
+
"type": "string",
|
|
2711
|
+
"description": "Source is the address of the page the Install entries were checked against."
|
|
2712
|
+
},
|
|
2713
|
+
"checked": {
|
|
2714
|
+
"type": "string",
|
|
2715
|
+
"description": "Checked is the date (YYYY-MM-DD) the entries were last checked."
|
|
2716
|
+
}
|
|
2717
|
+
},
|
|
2718
|
+
"required": [
|
|
2719
|
+
"name",
|
|
2720
|
+
"title",
|
|
2721
|
+
"why",
|
|
2722
|
+
"consequence",
|
|
2723
|
+
"program",
|
|
2724
|
+
"download",
|
|
2725
|
+
"source",
|
|
2726
|
+
"checked"
|
|
2727
|
+
]
|
|
2728
|
+
},
|
|
2365
2729
|
"ToolPin": {
|
|
2366
2730
|
"description": "ToolPin is a tool the plugin installs at a pinned version (in CI, the dev container, the venv) against the newest release; informational.",
|
|
2367
2731
|
"type": "object",
|
|
@@ -2386,6 +2750,23 @@ export const protocolSchema = {
|
|
|
2386
2750
|
"pinned"
|
|
2387
2751
|
]
|
|
2388
2752
|
},
|
|
2753
|
+
"ToolVersionPin": {
|
|
2754
|
+
"description": "ToolVersionPin names a file that pins the version of a tool and how to read it. Format is one of: \"text\" (the first word of the file, as in .nvmrc and .python-version), \"go-mod\" (the toolchain line, else the go line), \"pyproject\" (requires-python), \"global-json\" (sdk.version) and \"rust-toolchain\" (the channel).",
|
|
2755
|
+
"type": "object",
|
|
2756
|
+
"properties": {
|
|
2757
|
+
"file": {
|
|
2758
|
+
"type": "string",
|
|
2759
|
+
"description": "File is the base name of the file, looked up at the workspace root and in the folders of the projects that use the tool."
|
|
2760
|
+
},
|
|
2761
|
+
"format": {
|
|
2762
|
+
"type": "string"
|
|
2763
|
+
}
|
|
2764
|
+
},
|
|
2765
|
+
"required": [
|
|
2766
|
+
"file",
|
|
2767
|
+
"format"
|
|
2768
|
+
]
|
|
2769
|
+
},
|
|
2389
2770
|
"Toolchain": {
|
|
2390
2771
|
"description": "Toolchain is a runtime the pipeline must install, and how. Plugins asking for the same name share one setup step (the first plugin's).",
|
|
2391
2772
|
"type": "object",
|
|
@@ -2437,6 +2818,22 @@ export const protocolSchema = {
|
|
|
2437
2818
|
"packages"
|
|
2438
2819
|
]
|
|
2439
2820
|
},
|
|
2821
|
+
"UnlinkParams": {
|
|
2822
|
+
"description": "UnlinkParams asks a plugin to remove the dependency of Project on Library. Notes of the result say so when the manifest held no such dependency.",
|
|
2823
|
+
"type": "object",
|
|
2824
|
+
"properties": {
|
|
2825
|
+
"project": {
|
|
2826
|
+
"$ref": "#/$defs/Project"
|
|
2827
|
+
},
|
|
2828
|
+
"library": {
|
|
2829
|
+
"$ref": "#/$defs/Project"
|
|
2830
|
+
}
|
|
2831
|
+
},
|
|
2832
|
+
"required": [
|
|
2833
|
+
"project",
|
|
2834
|
+
"library"
|
|
2835
|
+
]
|
|
2836
|
+
},
|
|
2440
2837
|
"VersionParams": {
|
|
2441
2838
|
"description": "VersionParams asks a plugin to record a new version in a project manifest.",
|
|
2442
2839
|
"type": "object",
|
|
@@ -177,6 +177,13 @@ export interface Capabilities {
|
|
|
177
177
|
published?: boolean;
|
|
178
178
|
/** Dependencies installs and uninstalls packages in its projects. */
|
|
179
179
|
dependencies?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Link makes a project depend on a library of the same workspace in the ecosystem's own form (a
|
|
182
|
+
* workspace dependency, a path dependency, a project reference), and takes it out again. A plugin
|
|
183
|
+
* without it is refused by the host with one sentence that tells the user to add the dependency
|
|
184
|
+
* by hand.
|
|
185
|
+
*/
|
|
186
|
+
link?: boolean;
|
|
180
187
|
/** Declarations lists and rewrites declared dependency specs (sync, up). */
|
|
181
188
|
declarations?: boolean;
|
|
182
189
|
/** Latest reports the newest releases of dependencies and pinned tools. */
|
|
@@ -204,6 +211,13 @@ export interface Capabilities {
|
|
|
204
211
|
* plugin that lacks it.
|
|
205
212
|
*/
|
|
206
213
|
channels?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Declared says the plugin describes the projects smith.toml declares for its language
|
|
216
|
+
* (DiscoverParams.declared): folders with no manifest of their own. A plugin without it finds a
|
|
217
|
+
* project by its manifest only, and the host refuses a declaration for its language with a
|
|
218
|
+
* message that says so.
|
|
219
|
+
*/
|
|
220
|
+
declared?: boolean;
|
|
207
221
|
}
|
|
208
222
|
/**
|
|
209
223
|
* ChangeKindParams asks a plugin what changing a project's kind edits. The plugin writes nothing:
|
|
@@ -265,6 +279,19 @@ export interface Choice {
|
|
|
265
279
|
*/
|
|
266
280
|
name: string;
|
|
267
281
|
description?: string;
|
|
282
|
+
/** Title is the name shown to a person ("Electron" for electron). Without it the name is shown. */
|
|
283
|
+
title?: string;
|
|
284
|
+
/**
|
|
285
|
+
* Aliases are words that find the choice when a person searches the catalogue (smith compose):
|
|
286
|
+
* "desktop", "serverless", "web".
|
|
287
|
+
*/
|
|
288
|
+
aliases?: string[];
|
|
289
|
+
/**
|
|
290
|
+
* Layer is where the choice sits in the stack of a project: "framework", "shell" (a desktop
|
|
291
|
+
* shell), "host" (where cloud code runs), "test", "lint", "style" or a layer of the plugin's own.
|
|
292
|
+
* Without it the layer is the axis. It is for display and grouping: the axis decides conflicts.
|
|
293
|
+
*/
|
|
294
|
+
layer?: string;
|
|
268
295
|
/** Language is the language plugin the choice applies to ("node"). */
|
|
269
296
|
language: string;
|
|
270
297
|
/**
|
|
@@ -280,6 +307,12 @@ export interface Choice {
|
|
|
280
307
|
needs?: string[];
|
|
281
308
|
/** Default marks the choice the host adds when a selection needs its axis and has no choice on it. */
|
|
282
309
|
default?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Suggested marks the choice an asker pre-selects on its axis. The solver never adds it by
|
|
312
|
+
* itself: an axis that a choice needs and that has no Default is asked, and the person answers
|
|
313
|
+
* (ADR 0072).
|
|
314
|
+
*/
|
|
315
|
+
suggested?: boolean;
|
|
283
316
|
/**
|
|
284
317
|
* Many allows the choice next to other choices of its axis that are Many too. By default a
|
|
285
318
|
* selection has one choice per axis.
|
|
@@ -406,6 +439,15 @@ export interface Declaration {
|
|
|
406
439
|
export interface DeclaredParams {
|
|
407
440
|
projects: Project[];
|
|
408
441
|
}
|
|
442
|
+
/** DeclaredProject is a project smith.toml declares: a folder with no manifest. */
|
|
443
|
+
export interface DeclaredProject {
|
|
444
|
+
/** Name is the project's name, the key of its [projects.<name>] table. */
|
|
445
|
+
name: string;
|
|
446
|
+
/** Root is the workspace-relative folder. */
|
|
447
|
+
root: string;
|
|
448
|
+
/** Kind is "app", "lib" or "package", or empty for the plugin's choice. */
|
|
449
|
+
kind?: ProjectKind;
|
|
450
|
+
}
|
|
409
451
|
/**
|
|
410
452
|
* DeclaredResult is every declaration, and the version installed of each name where the plugin can
|
|
411
453
|
* tell.
|
|
@@ -502,6 +544,20 @@ export interface DevcontainerFeature {
|
|
|
502
544
|
*/
|
|
503
545
|
export interface DiscoverParams {
|
|
504
546
|
manifests: string[];
|
|
547
|
+
/**
|
|
548
|
+
* Declared are the projects smith.toml declares for this plugin's language ([projects.<name>]
|
|
549
|
+
* with a root and a language): folders with no manifest of their own, such as a program that is a
|
|
550
|
+
* package of the Go module above it. The plugin describes each one in its result, or answers with
|
|
551
|
+
* an error saying why it cannot.
|
|
552
|
+
*/
|
|
553
|
+
declared?: DeclaredProject[];
|
|
554
|
+
/**
|
|
555
|
+
* Settings are this plugin's settings for projects, by project name, from smith.toml
|
|
556
|
+
* [projects.<project>.settings.<plugin>]. They reach the plugin here because the tasks it
|
|
557
|
+
* describes may depend on them (the Go plugin's build tags). A project with no settings is
|
|
558
|
+
* absent.
|
|
559
|
+
*/
|
|
560
|
+
settings?: Record<string, Record<string, unknown>>;
|
|
505
561
|
}
|
|
506
562
|
/**
|
|
507
563
|
* DiscoverResult describes every manifest that is a project of this plugin. A manifest the plugin
|
|
@@ -743,6 +799,12 @@ export interface InitializeResult {
|
|
|
743
799
|
* owns none.
|
|
744
800
|
*/
|
|
745
801
|
choices?: Choice[];
|
|
802
|
+
/**
|
|
803
|
+
* Tools are the programs the plugin needs on the person's machine. The host detects them and,
|
|
804
|
+
* when one is missing, presents the ways to get it (smith tools). Absent means the plugin
|
|
805
|
+
* declares none.
|
|
806
|
+
*/
|
|
807
|
+
tools?: ToolNeed[];
|
|
746
808
|
}
|
|
747
809
|
/**
|
|
748
810
|
* Input is one input of an ActionStep. Values are written as quoted YAML strings, except true and
|
|
@@ -795,6 +857,62 @@ export interface LatestResult {
|
|
|
795
857
|
unreachable?: Record<string, string>;
|
|
796
858
|
tools?: ToolPin[];
|
|
797
859
|
}
|
|
860
|
+
/**
|
|
861
|
+
* LinkOption is one way to write the dependency, with its consequence in words a person who read no
|
|
862
|
+
* manual can follow.
|
|
863
|
+
*/
|
|
864
|
+
export interface LinkOption {
|
|
865
|
+
/** Spec is the value passed back in LinkParams.Spec. */
|
|
866
|
+
spec: string;
|
|
867
|
+
/** Label is the option in a few words. */
|
|
868
|
+
label: string;
|
|
869
|
+
/** Meaning says what happens with this option. */
|
|
870
|
+
meaning: string;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* LinkParams asks a plugin to make Project depend on Library, a lib or package of the same
|
|
874
|
+
* workspace and language, in the ecosystem's own form, and to install or lock as that needs. The
|
|
875
|
+
* host has checked that both exist, that the languages match, that Library is not an app, and that
|
|
876
|
+
* the link makes no cycle; the plugin answers with an error that names the file when it cannot
|
|
877
|
+
* write the dependency.
|
|
878
|
+
*/
|
|
879
|
+
export interface LinkParams {
|
|
880
|
+
/** Project is the project that gains the dependency. */
|
|
881
|
+
project: Project;
|
|
882
|
+
/** Library is the project it depends on. */
|
|
883
|
+
library: Project;
|
|
884
|
+
/** Quiet keeps the package manager's output unless it fails. */
|
|
885
|
+
quiet?: boolean;
|
|
886
|
+
/**
|
|
887
|
+
* Plan asks for the plan only: the plugin writes nothing and answers with the manifest, the line
|
|
888
|
+
* it would write and the choices the user has.
|
|
889
|
+
*/
|
|
890
|
+
plan?: boolean;
|
|
891
|
+
/**
|
|
892
|
+
* Spec is the version range the user chose from LinkResult.Options; empty means the plugin's
|
|
893
|
+
* default, or the form the workspace already uses.
|
|
894
|
+
*/
|
|
895
|
+
spec?: string;
|
|
896
|
+
}
|
|
897
|
+
/** LinkResult is what a link wrote, or with LinkParams.Plan would write. */
|
|
898
|
+
export interface LinkResult {
|
|
899
|
+
/** Files are the workspace-relative files changed (or to be changed). */
|
|
900
|
+
files?: string[];
|
|
901
|
+
/** Notes are for the user. */
|
|
902
|
+
notes?: string[];
|
|
903
|
+
/** Manifest is the file the dependency goes into, workspace-relative. */
|
|
904
|
+
manifest?: string;
|
|
905
|
+
/**
|
|
906
|
+
* Line is the dependency as it is written there, for the plan shown before anything is written
|
|
907
|
+
* ("@acme/core": "*").
|
|
908
|
+
*/
|
|
909
|
+
line?: string;
|
|
910
|
+
/**
|
|
911
|
+
* Options are the real choices of the range written, with the default first. Empty when the
|
|
912
|
+
* ecosystem has none, or the workspace already follows a convention (then Line shows it).
|
|
913
|
+
*/
|
|
914
|
+
options?: LinkOption[];
|
|
915
|
+
}
|
|
798
916
|
/**
|
|
799
917
|
* PackageStore is where a package manager keeps what it downloaded (npm's ~/.npm, Go's module
|
|
800
918
|
* cache). A generated pipeline restores it before setup and saves it after a run, keyed on Files,
|
|
@@ -973,6 +1091,18 @@ export interface PublishParams {
|
|
|
973
1091
|
* capability.
|
|
974
1092
|
*/
|
|
975
1093
|
tag?: string;
|
|
1094
|
+
/**
|
|
1095
|
+
* PropagationWait is the longest time a plugin waits, in a Finalize call, for the packages of the
|
|
1096
|
+
* release to be fetchable from the registry: a duration such as "15m", "0" to not wait. Empty
|
|
1097
|
+
* means the default. Only npm has such a wait. A publish never waits.
|
|
1098
|
+
*/
|
|
1099
|
+
propagationWait?: string;
|
|
1100
|
+
/**
|
|
1101
|
+
* Finalize turns the call into the last phase of a release: nothing is published; for each move
|
|
1102
|
+
* the plugin waits until its packages are fetchable, then moves the dist-tag. The host sends it
|
|
1103
|
+
* after every project has published, so a wait never blocks another publish.
|
|
1104
|
+
*/
|
|
1105
|
+
finalize?: TagMove[];
|
|
976
1106
|
}
|
|
977
1107
|
/**
|
|
978
1108
|
* PublishResult reports what happened. Skipped with a reason is a success: an already-published
|
|
@@ -982,6 +1112,20 @@ export interface PublishResult {
|
|
|
982
1112
|
published: boolean;
|
|
983
1113
|
skipped?: string;
|
|
984
1114
|
registry?: string;
|
|
1115
|
+
/**
|
|
1116
|
+
* Notes are things the person must know about a publish that succeeded, such as a dist-tag that
|
|
1117
|
+
* was not moved; the host prints them and the report keeps them.
|
|
1118
|
+
*/
|
|
1119
|
+
notes?: string[];
|
|
1120
|
+
/**
|
|
1121
|
+
* PendingMoves are the dist-tags the call did not move, because the packages the release needs
|
|
1122
|
+
* were not fetchable yet. A publish returns them for the host to move at the end of the release;
|
|
1123
|
+
* a Finalize call returns the ones still waiting when its time ran out. The release then ends
|
|
1124
|
+
* with a warning, never silently.
|
|
1125
|
+
*/
|
|
1126
|
+
pendingMoves?: TagMove[];
|
|
1127
|
+
/** Moved names the dist-tags a Finalize call moved ("name@version tag"). */
|
|
1128
|
+
moved?: string[];
|
|
985
1129
|
/**
|
|
986
1130
|
* Assets are the workspace-relative files built for the release, in upload order; in a dry run,
|
|
987
1131
|
* the files that would be built.
|
|
@@ -1185,6 +1329,19 @@ export interface Step {
|
|
|
1185
1329
|
*/
|
|
1186
1330
|
cacheFiles?: string[];
|
|
1187
1331
|
}
|
|
1332
|
+
/**
|
|
1333
|
+
* TagMove is a dist-tag a publish left where it was, because the packages the release needs were
|
|
1334
|
+
* not fetchable yet.
|
|
1335
|
+
*/
|
|
1336
|
+
export interface TagMove {
|
|
1337
|
+
/** Package and Version name the package that carries the tag. */
|
|
1338
|
+
package: string;
|
|
1339
|
+
version: string;
|
|
1340
|
+
/** Tag is the dist-tag to move to Version. */
|
|
1341
|
+
tag: string;
|
|
1342
|
+
/** Awaits are the packages that must be fetchable first. */
|
|
1343
|
+
awaits: string[];
|
|
1344
|
+
}
|
|
1188
1345
|
/** Task is a command the host can run, hash and cache. */
|
|
1189
1346
|
export interface Task {
|
|
1190
1347
|
/** Command is an argv array; it is never passed through a shell. */
|
|
@@ -1228,6 +1385,94 @@ export interface Task {
|
|
|
1228
1385
|
/** ServeTimeout is how long to wait for ServeURL, as a Go duration ("60s"); empty means 60s. */
|
|
1229
1386
|
serveTimeout?: string;
|
|
1230
1387
|
}
|
|
1388
|
+
/**
|
|
1389
|
+
* ToolInstall is one way to get a tool with a package manager. Manager is one of: "winget", "brew",
|
|
1390
|
+
* "brew-cask", "apt", "dnf", "pacman", "npm", "uv", "fnm", "rustup" and "cargo". The host builds
|
|
1391
|
+
* the exact command from the manager and Package; Package may hold {major} and {major.minor}, which
|
|
1392
|
+
* the pinned or suggested version fills. The language's own installers (uv, fnm, rustup, cargo) are
|
|
1393
|
+
* offered only when they are already on the machine.
|
|
1394
|
+
*/
|
|
1395
|
+
export interface ToolInstall {
|
|
1396
|
+
manager: string;
|
|
1397
|
+
package: string;
|
|
1398
|
+
/** Note adds a sentence the person needs before choosing ("a new terminal is needed"). */
|
|
1399
|
+
note?: string;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* ToolNeed is a program on the person's machine that a plugin needs to build, test or run its
|
|
1403
|
+
* projects (Python, the .NET SDK, Docker). A plugin publishes the tools it needs in
|
|
1404
|
+
* InitializeResult.Tools. The host detects them, and when one is missing it presents the ways to
|
|
1405
|
+
* get it (ADR 0077): it never installs in silence. The plugin writes facts only (what the tool is,
|
|
1406
|
+
* how to detect it, how each system gets it); the host decides how to ask.
|
|
1407
|
+
*/
|
|
1408
|
+
export interface ToolNeed {
|
|
1409
|
+
/**
|
|
1410
|
+
* Name identifies the tool across plugins and in commands (smith tools install python). Two
|
|
1411
|
+
* plugins that need the same tool use the same Name.
|
|
1412
|
+
*/
|
|
1413
|
+
name: string;
|
|
1414
|
+
/**
|
|
1415
|
+
* Title is what the tool is called in text: "Python", "the .NET SDK". Doctor words the check
|
|
1416
|
+
* "<Title> is installed".
|
|
1417
|
+
*/
|
|
1418
|
+
title: string;
|
|
1419
|
+
/** Why says in plain words what smith needs the tool for. */
|
|
1420
|
+
why: string;
|
|
1421
|
+
/**
|
|
1422
|
+
* Consequence says what stops working while the tool is missing, as the end of a sentence that
|
|
1423
|
+
* starts "If you skip it, ": "smith test and smith build fail for the python projects".
|
|
1424
|
+
*/
|
|
1425
|
+
consequence: string;
|
|
1426
|
+
/** Program is the program that carries the tool on PATH ("python3"). */
|
|
1427
|
+
program: string;
|
|
1428
|
+
/** Alternatives are other programs that also count ("python", "py"). */
|
|
1429
|
+
alternatives?: string[];
|
|
1430
|
+
/** VersionArgs are the arguments that make Program print its version. Absent means --version. */
|
|
1431
|
+
versionArgs?: string[];
|
|
1432
|
+
/**
|
|
1433
|
+
* Pins are the files where a workspace pins the version it wants. The first pin the host finds
|
|
1434
|
+
* gives the version range. Absent means any version counts.
|
|
1435
|
+
*/
|
|
1436
|
+
pins?: ToolVersionPin[];
|
|
1437
|
+
/**
|
|
1438
|
+
* Choice limits the tool to stacks that have this choice ("azure-functions"): the tool is not
|
|
1439
|
+
* needed by a project built without it. Absent means every project of the plugin needs it.
|
|
1440
|
+
*/
|
|
1441
|
+
choice?: string;
|
|
1442
|
+
/**
|
|
1443
|
+
* Files limit the tool to projects that hold one of these files in their folder
|
|
1444
|
+
* ("build.gradle.kts"): a Gradle build needs gradle, a Maven build does not. A tool that the
|
|
1445
|
+
* tasks of a project run (gradle, mvn) is declared this way. Absent means every project of the
|
|
1446
|
+
* plugin needs it.
|
|
1447
|
+
*/
|
|
1448
|
+
files?: string[];
|
|
1449
|
+
/**
|
|
1450
|
+
* Systems limits the tool to these systems, named as Go names them ("windows", "darwin",
|
|
1451
|
+
* "linux"): the Xcode Command Line Tools exist only on "darwin". Absent means every system.
|
|
1452
|
+
*/
|
|
1453
|
+
systems?: string[];
|
|
1454
|
+
/**
|
|
1455
|
+
* Suggested is the version smith installs when no pin says one: "3.13". It fills {major} and
|
|
1456
|
+
* {major.minor} in the install entries.
|
|
1457
|
+
*/
|
|
1458
|
+
suggested?: string;
|
|
1459
|
+
/**
|
|
1460
|
+
* Optional marks a tool whose absence only costs a feature (running a function app locally).
|
|
1461
|
+
* Doctor reports it as a warning, not a failure.
|
|
1462
|
+
*/
|
|
1463
|
+
optional?: boolean;
|
|
1464
|
+
/** Install are the ways to get the tool, per package manager and system. */
|
|
1465
|
+
install?: ToolInstall[];
|
|
1466
|
+
/**
|
|
1467
|
+
* Download is the official page of the tool, for the person who installs it by hand or has no
|
|
1468
|
+
* package manager.
|
|
1469
|
+
*/
|
|
1470
|
+
download: string;
|
|
1471
|
+
/** Source is the address of the page the Install entries were checked against. */
|
|
1472
|
+
source: string;
|
|
1473
|
+
/** Checked is the date (YYYY-MM-DD) the entries were last checked. */
|
|
1474
|
+
checked: string;
|
|
1475
|
+
}
|
|
1231
1476
|
/**
|
|
1232
1477
|
* ToolPin is a tool the plugin installs at a pinned version (in CI, the dev container, the venv)
|
|
1233
1478
|
* against the newest release; informational.
|
|
@@ -1240,6 +1485,20 @@ export interface ToolPin {
|
|
|
1240
1485
|
/** Newer is true when Latest is a release the pin does not cover. */
|
|
1241
1486
|
newer?: boolean;
|
|
1242
1487
|
}
|
|
1488
|
+
/**
|
|
1489
|
+
* ToolVersionPin names a file that pins the version of a tool and how to read it. Format is one of:
|
|
1490
|
+
* "text" (the first word of the file, as in .nvmrc and .python-version), "go-mod" (the toolchain
|
|
1491
|
+
* line, else the go line), "pyproject" (requires-python), "global-json" (sdk.version) and
|
|
1492
|
+
* "rust-toolchain" (the channel).
|
|
1493
|
+
*/
|
|
1494
|
+
export interface ToolVersionPin {
|
|
1495
|
+
/**
|
|
1496
|
+
* File is the base name of the file, looked up at the workspace root and in the folders of the
|
|
1497
|
+
* projects that use the tool.
|
|
1498
|
+
*/
|
|
1499
|
+
file: string;
|
|
1500
|
+
format: string;
|
|
1501
|
+
}
|
|
1243
1502
|
/**
|
|
1244
1503
|
* Toolchain is a runtime the pipeline must install, and how. Plugins asking for the same name share
|
|
1245
1504
|
* one setup step (the first plugin's).
|
|
@@ -1267,6 +1526,14 @@ export interface UninstallParams {
|
|
|
1267
1526
|
project: Project;
|
|
1268
1527
|
packages: string[];
|
|
1269
1528
|
}
|
|
1529
|
+
/**
|
|
1530
|
+
* UnlinkParams asks a plugin to remove the dependency of Project on Library. Notes of the result
|
|
1531
|
+
* say so when the manifest held no such dependency.
|
|
1532
|
+
*/
|
|
1533
|
+
export interface UnlinkParams {
|
|
1534
|
+
project: Project;
|
|
1535
|
+
library: Project;
|
|
1536
|
+
}
|
|
1270
1537
|
/** VersionParams asks a plugin to record a new version in a project manifest. */
|
|
1271
1538
|
export interface VersionParams {
|
|
1272
1539
|
project: Project;
|
|
@@ -1403,6 +1670,21 @@ export interface ProtocolMethods {
|
|
|
1403
1670
|
result: DependencyResult;
|
|
1404
1671
|
capability: 'dependencies';
|
|
1405
1672
|
};
|
|
1673
|
+
/**
|
|
1674
|
+
* Makes a project depend on a library of the same workspace and language, in the ecosystem's own
|
|
1675
|
+
* form, then installs or locks as that needs.
|
|
1676
|
+
*/
|
|
1677
|
+
'dependencies/link': {
|
|
1678
|
+
params: LinkParams;
|
|
1679
|
+
result: LinkResult;
|
|
1680
|
+
capability: 'link';
|
|
1681
|
+
};
|
|
1682
|
+
/** Removes the dependency of a project on a library of the same workspace. */
|
|
1683
|
+
'dependencies/unlink': {
|
|
1684
|
+
params: UnlinkParams;
|
|
1685
|
+
result: DependencyResult;
|
|
1686
|
+
capability: 'link';
|
|
1687
|
+
};
|
|
1406
1688
|
/** Lists the dependencies the manifests of the plugin's projects declare. */
|
|
1407
1689
|
'dependencies/declared': {
|
|
1408
1690
|
params: DeclaredParams;
|
package/serve/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { serve, serveStreams } from './serve.use-case.ts';
|
|
2
2
|
export { capabilitiesOf, implementsMethod } from './capabilities-of.algorithm.ts';
|
|
3
|
-
export type { APISurfaceReader, Awaitable, Cancellable, CIContributor, ComponentLister, Contributor, DeclarationEditor, DependencyManager, Deriver, Discoverer, DoctorContributor, Generator, KindChanger, LatestReader, Plugin, PluginDescription, Publisher, RegistryReader, Remover, SmithPlugin, Versioner, } from './plugin.contract.ts';
|
|
3
|
+
export type { APISurfaceReader, Awaitable, Cancellable, CIContributor, ComponentLister, Contributor, DeclarationEditor, DependencyManager, Deriver, Discoverer, DoctorContributor, Generator, KindChanger, LatestReader, Linker, Plugin, PluginDescription, Publisher, RegistryReader, Remover, SmithPlugin, Versioner, } from './plugin.contract.ts';
|
|
4
4
|
export type { FrameSink, ServeStreams } from './protocol-streams.contract.ts';
|
|
@@ -20,6 +20,8 @@ export const PLUGIN_MEMBERS = {
|
|
|
20
20
|
'published': { member: 'published', requires: ['published'] },
|
|
21
21
|
'dependencies/install': { member: 'install', requires: ['install', 'uninstall'] },
|
|
22
22
|
'dependencies/uninstall': { member: 'uninstall', requires: ['install', 'uninstall'] },
|
|
23
|
+
'dependencies/link': { member: 'link', requires: ['link', 'unlink'] },
|
|
24
|
+
'dependencies/unlink': { member: 'unlink', requires: ['link', 'unlink'] },
|
|
23
25
|
'dependencies/declared': { member: 'declared', requires: ['declared', 'rewrite'] },
|
|
24
26
|
'dependencies/rewrite': { member: 'rewrite', requires: ['declared', 'rewrite'] },
|
|
25
27
|
'dependencies/latest': { member: 'latest', requires: ['latest'] },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeriveParams, DeriveResult, APISurfaceParams, APISurfaceResult, ChangeKindParams, ChangeKindResult, CIParams, CIResult, ComponentsParams, ComponentsResult, ContributeParams, ContributeResult, DeclaredParams, DeclaredResult, DependencyResult, DiscoverParams, DiscoverResult, DoctorParams, DoctorResult, GenerateParams, GenerateResult, InitializeParams, InitializeResult, InstallParams, LatestParams, LatestResult, PublishedParams, PublishedResult, PublishParams, PublishResult, RemoveParams, RemoveResult, RewriteParams, UninstallParams, VersionParams, VersionResult } from '../protocol/index.ts';
|
|
1
|
+
import type { DeriveParams, DeriveResult, APISurfaceParams, APISurfaceResult, ChangeKindParams, ChangeKindResult, CIParams, CIResult, ComponentsParams, ComponentsResult, ContributeParams, ContributeResult, DeclaredParams, DeclaredResult, DependencyResult, DiscoverParams, DiscoverResult, DoctorParams, DoctorResult, GenerateParams, GenerateResult, InitializeParams, InitializeResult, InstallParams, LatestParams, LatestResult, LinkParams, LinkResult, PublishedParams, PublishedResult, PublishParams, PublishResult, RemoveParams, RemoveResult, RewriteParams, UninstallParams, UnlinkParams, VersionParams, VersionResult } from '../protocol/index.ts';
|
|
2
2
|
/** A result now or later: every method of a plugin may be `async`. */
|
|
3
3
|
export type Awaitable<T> = T | Promise<T>;
|
|
4
4
|
/** What a plugin says about itself. The serve loop fills in `protocolVersion` and `capabilities`. */
|
|
@@ -61,6 +61,11 @@ export interface DependencyManager {
|
|
|
61
61
|
install: (params: InstallParams, signal: AbortSignal) => Awaitable<DependencyResult>;
|
|
62
62
|
uninstall: (params: UninstallParams, signal: AbortSignal) => Awaitable<DependencyResult>;
|
|
63
63
|
}
|
|
64
|
+
/** `dependencies/link` and `dependencies/unlink`: both, or the capability is not advertised. */
|
|
65
|
+
export interface Linker {
|
|
66
|
+
link: (params: LinkParams, signal: AbortSignal) => Awaitable<LinkResult>;
|
|
67
|
+
unlink: (params: UnlinkParams, signal: AbortSignal) => Awaitable<DependencyResult>;
|
|
68
|
+
}
|
|
64
69
|
/** `dependencies/declared` and `dependencies/rewrite`: both, or the capability is not advertised. */
|
|
65
70
|
export interface DeclarationEditor {
|
|
66
71
|
declared: (params: DeclaredParams, signal: AbortSignal) => Awaitable<DeclaredResult>;
|
|
@@ -93,4 +98,4 @@ export interface Cancellable {
|
|
|
93
98
|
* from `cancellable`. How many requests it can work on at once is declared in
|
|
94
99
|
* `describe`'s `concurrency`: omit it for one at a time, in order.
|
|
95
100
|
*/
|
|
96
|
-
export type SmithPlugin = Plugin & Partial<Discoverer & Generator & Versioner & Publisher & RegistryReader & CIContributor & DoctorContributor & Remover & KindChanger & ComponentLister & Deriver & APISurfaceReader & DependencyManager & DeclarationEditor & LatestReader & Contributor & Cancellable>;
|
|
101
|
+
export type SmithPlugin = Plugin & Partial<Discoverer & Generator & Versioner & Publisher & RegistryReader & CIContributor & DoctorContributor & Remover & KindChanger & ComponentLister & Deriver & APISurfaceReader & DependencyManager & Linker & DeclarationEditor & LatestReader & Contributor & Cancellable>;
|