@intentius/chant 0.124.100 → 0.124.102
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/dist/action-pins.d.ts +2 -0
- package/dist/action-pins.js +3 -0
- package/dist/ci-detect.d.ts +13 -0
- package/dist/ci-detect.js +12 -0
- package/dist/ci-evidence-claims.d.ts +12 -0
- package/dist/ci-evidence-claims.js +12 -0
- package/dist/ci-system.d.ts +66 -0
- package/dist/ci-system.js +61 -0
- package/dist/cli/handlers/build.js +27 -0
- package/dist/cli/handlers/release-doctor.d.ts +12 -0
- package/dist/cli/handlers/release-doctor.js +118 -0
- package/dist/cli/handlers/release-init.d.ts +10 -0
- package/dist/cli/handlers/release-init.js +374 -0
- package/dist/cli/handlers/release.d.ts +43 -2
- package/dist/cli/handlers/release.js +667 -39
- package/dist/cli/handlers/run-generate.js +11 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +44 -101
- package/dist/cli/parse-args.js +48 -0
- package/dist/cli/registry.d.ts +16 -0
- package/dist/cli/release-commands/artifacts.d.ts +3 -0
- package/dist/cli/release-commands/artifacts.js +14 -0
- package/dist/cli/release-commands/candidates.d.ts +3 -0
- package/dist/cli/release-commands/candidates.js +16 -0
- package/dist/cli/release-commands/changed.d.ts +3 -0
- package/dist/cli/release-commands/changed.js +14 -0
- package/dist/cli/release-commands/compose.d.ts +3 -0
- package/dist/cli/release-commands/compose.js +16 -0
- package/dist/cli/release-commands/cut.d.ts +3 -0
- package/dist/cli/release-commands/cut.js +50 -0
- package/dist/cli/release-commands/doctor.d.ts +3 -0
- package/dist/cli/release-commands/doctor.js +14 -0
- package/dist/cli/release-commands/export.d.ts +3 -0
- package/dist/cli/release-commands/export.js +12 -0
- package/dist/cli/release-commands/images.d.ts +3 -0
- package/dist/cli/release-commands/images.js +13 -0
- package/dist/cli/release-commands/index.d.ts +8 -0
- package/dist/cli/release-commands/index.js +52 -0
- package/dist/cli/release-commands/init.d.ts +3 -0
- package/dist/cli/release-commands/init.js +19 -0
- package/dist/cli/release-commands/list.d.ts +3 -0
- package/dist/cli/release-commands/list.js +10 -0
- package/dist/cli/release-commands/next.d.ts +3 -0
- package/dist/cli/release-commands/next.js +13 -0
- package/dist/cli/release-commands/publish.d.ts +3 -0
- package/dist/cli/release-commands/publish.js +22 -0
- package/dist/cli/release-commands/stamp.d.ts +3 -0
- package/dist/cli/release-commands/stamp.js +15 -0
- package/dist/cli/release-commands/status.d.ts +3 -0
- package/dist/cli/release-commands/status.js +17 -0
- package/dist/cli/release-commands/tag.d.ts +3 -0
- package/dist/cli/release-commands/tag.js +12 -0
- package/dist/cli/release-commands/types.d.ts +20 -0
- package/dist/cli/release-commands/types.js +1 -0
- package/dist/cli/release-commands/verify.d.ts +3 -0
- package/dist/cli/release-commands/verify.js +15 -0
- package/dist/cli/release-commands/workflow.d.ts +3 -0
- package/dist/cli/release-commands/workflow.js +15 -0
- package/dist/cloud-lister/index.d.ts +4 -1
- package/dist/cloud-lister/index.js +2 -1
- package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
- package/dist/cloud-lister/kubernetes-components.js +642 -0
- package/dist/cloud-lister/kubernetes.d.ts +18 -0
- package/dist/cloud-lister/kubernetes.js +26 -1
- package/dist/cloud-lister/mask.d.ts +5 -1
- package/dist/cloud-lister/mask.js +14 -5
- package/dist/components/cli-support.d.ts +1 -1
- package/dist/components/cli-support.js +1 -1
- package/dist/config-environments.d.ts +8 -1
- package/dist/config-environments.js +2 -0
- package/dist/config-import.d.ts +1 -1
- package/dist/config-import.js +6 -2
- package/dist/config-sandbox.d.ts +1 -1
- package/dist/config-sandbox.js +3 -3
- package/dist/config.d.ts +369 -10
- package/dist/config.js +127 -7
- package/dist/deep-observation.js +9 -3
- package/dist/floor-table.data.js +21 -1
- package/dist/forge-remote.d.ts +13 -0
- package/dist/forge-remote.js +15 -0
- package/dist/lexicon.d.ts +45 -4
- package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
- package/dist/lifecycle/__fixtures__/package-files.js +72 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +275 -3
- package/dist/lifecycle/publish-attachments.d.ts +2 -1
- package/dist/lifecycle/publish-attachments.js +19 -2
- package/dist/lifecycle/publish-cargo.d.ts +99 -0
- package/dist/lifecycle/publish-cargo.js +412 -0
- package/dist/lifecycle/publish-credentials.d.ts +1 -1
- package/dist/lifecycle/publish-credentials.js +13 -0
- package/dist/lifecycle/publish-declaration.d.ts +322 -4
- package/dist/lifecycle/publish-declaration.js +340 -9
- package/dist/lifecycle/publish-forge.d.ts +45 -2
- package/dist/lifecycle/publish-forge.js +434 -34
- package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
- package/dist/lifecycle/publish-git-ssh.js +30 -4
- package/dist/lifecycle/publish-github.d.ts +40 -2
- package/dist/lifecycle/publish-github.js +100 -3
- package/dist/lifecycle/publish-helm.d.ts +83 -0
- package/dist/lifecycle/publish-helm.js +452 -0
- package/dist/lifecycle/publish-homebrew.d.ts +7 -9
- package/dist/lifecycle/publish-homebrew.js +34 -197
- package/dist/lifecycle/publish-index.d.ts +141 -0
- package/dist/lifecycle/publish-index.js +719 -0
- package/dist/lifecycle/publish-marketplace.js +77 -0
- package/dist/lifecycle/publish-maven.d.ts +79 -0
- package/dist/lifecycle/publish-maven.js +364 -0
- package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
- package/dist/lifecycle/publish-mcp-registry.js +305 -0
- package/dist/lifecycle/publish-npm.d.ts +27 -1
- package/dist/lifecycle/publish-npm.js +216 -3
- package/dist/lifecycle/publish-nuget.d.ts +93 -0
- package/dist/lifecycle/publish-nuget.js +377 -0
- package/dist/lifecycle/publish-oci.d.ts +91 -2
- package/dist/lifecycle/publish-oci.js +247 -8
- package/dist/lifecycle/publish-package-files.d.ts +16 -0
- package/dist/lifecycle/publish-package-files.js +39 -0
- package/dist/lifecycle/publish-pypi.d.ts +138 -0
- package/dist/lifecycle/publish-pypi.js +657 -0
- package/dist/lifecycle/publish-record.d.ts +6 -3
- package/dist/lifecycle/publish-record.js +6 -3
- package/dist/lifecycle/publish-rubygems.d.ts +84 -0
- package/dist/lifecycle/publish-rubygems.js +366 -0
- package/dist/lifecycle/publish-signing.d.ts +147 -0
- package/dist/lifecycle/publish-signing.js +257 -0
- package/dist/lifecycle/publish-targets.d.ts +37 -1
- package/dist/lifecycle/publish-targets.js +102 -0
- package/dist/lifecycle/publish-tauri.js +43 -0
- package/dist/lifecycle/publish-train-names.d.ts +57 -0
- package/dist/lifecycle/publish-train-names.js +123 -0
- package/dist/lifecycle/publish-verify.d.ts +121 -0
- package/dist/lifecycle/publish-verify.js +130 -0
- package/dist/lifecycle/query.js +8 -0
- package/dist/lifecycle/release-artifacts.d.ts +290 -0
- package/dist/lifecycle/release-artifacts.js +808 -0
- package/dist/lifecycle/release-changelog.d.ts +13 -1
- package/dist/lifecycle/release-changelog.js +35 -2
- package/dist/lifecycle/release-cut.d.ts +64 -4
- package/dist/lifecycle/release-cut.js +147 -34
- package/dist/lifecycle/release-doctor.d.ts +113 -0
- package/dist/lifecycle/release-doctor.js +1198 -0
- package/dist/lifecycle/release-green.d.ts +86 -0
- package/dist/lifecycle/release-green.js +286 -0
- package/dist/lifecycle/release-init-registries.d.ts +48 -0
- package/dist/lifecycle/release-init-registries.js +97 -0
- package/dist/lifecycle/release-init.d.ts +275 -0
- package/dist/lifecycle/release-init.js +984 -0
- package/dist/lifecycle/release-intents.d.ts +73 -0
- package/dist/lifecycle/release-intents.js +128 -0
- package/dist/lifecycle/release-next.d.ts +111 -0
- package/dist/lifecycle/release-next.js +251 -0
- package/dist/lifecycle/release-prerelease.d.ts +19 -0
- package/dist/lifecycle/release-prerelease.js +30 -0
- package/dist/lifecycle/release-publish.d.ts +256 -10
- package/dist/lifecycle/release-publish.js +247 -35
- package/dist/lifecycle/release-status-change.d.ts +226 -0
- package/dist/lifecycle/release-status-change.js +478 -0
- package/dist/lifecycle/release-status.d.ts +11 -0
- package/dist/lifecycle/release-status.js +1 -1
- package/dist/lifecycle/release-store.d.ts +73 -2
- package/dist/lifecycle/release-store.js +32 -1
- package/dist/lifecycle/release-tag.d.ts +142 -0
- package/dist/lifecycle/release-tag.js +322 -0
- package/dist/lifecycle/release-verify.d.ts +73 -1
- package/dist/lifecycle/release-verify.js +117 -2
- package/dist/lifecycle/release-version-formats.d.ts +73 -0
- package/dist/lifecycle/release-version-formats.js +570 -0
- package/dist/lifecycle/release-version.d.ts +58 -10
- package/dist/lifecycle/release-version.js +164 -36
- package/dist/lifecycle/release-workstation.d.ts +3 -2
- package/dist/lifecycle/release-workstation.js +3 -2
- package/dist/op/generate-pipeline.js +1 -1
- package/dist/op/local-executor.d.ts +1 -1
- package/dist/op/local-executor.js +2 -2
- package/dist/op/op-waves-evidence.js +9 -2
- package/dist/pr-forge-base.js +4 -2
- package/dist/pr-forge.d.ts +20 -2
- package/dist/pr-forge.js +46 -10
- package/dist/release-floors.d.ts +8 -1
- package/dist/release-floors.js +9 -2
- package/dist/sensitive-key.d.ts +12 -0
- package/dist/sensitive-key.js +52 -0
- package/dist/tool-pins.d.ts +40 -0
- package/dist/tool-pins.js +66 -0
- package/dist/ts-loader.d.ts +8 -0
- package/dist/ts-loader.js +19 -0
- package/dist/wave-runtime.mjs +345 -342
- package/dist/workspace/ci-forge.d.ts +17 -0
- package/dist/workspace/ci-forge.js +17 -0
- package/dist/workspace/ci-init.js +1 -1
- package/dist/workspace/composites.schema.json +1 -0
- package/dist/workspace/declaration.d.ts +8 -0
- package/dist/workspace/declaration.js +12 -0
- package/dist/workspace/declaration.schema.json +8 -0
- package/dist/workspace/environments.d.ts +2 -0
- package/dist/workspace/environments.js +1 -1
- package/dist/workspace/identity-gate-rule.d.ts +61 -5
- package/dist/workspace/identity-gate-rule.js +81 -12
- package/dist/workspace/lexicon-outputs.d.ts +1 -1
- package/dist/workspace/lexicon-outputs.js +1 -1
- package/dist/workspace/member-pipeline.d.ts +2 -1
- package/dist/workspace/member-pipeline.js +5 -2
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.js +3 -1
- package/dist/workspace/release-changed.d.ts +75 -4
- package/dist/workspace/release-changed.js +205 -34
- package/dist/workspace/release-changed.schema.json +20 -2
- package/dist/workspace/release-steps/artifacts.d.ts +7 -0
- package/dist/workspace/release-steps/artifacts.js +45 -0
- package/dist/workspace/release-steps/builds.d.ts +12 -0
- package/dist/workspace/release-steps/builds.js +38 -0
- package/dist/workspace/release-steps/doctor.d.ts +8 -0
- package/dist/workspace/release-steps/doctor.js +14 -0
- package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
- package/dist/workspace/release-steps/goreleaser.js +36 -0
- package/dist/workspace/release-steps/green.d.ts +3 -0
- package/dist/workspace/release-steps/green.js +6 -0
- package/dist/workspace/release-steps/images.d.ts +22 -0
- package/dist/workspace/release-steps/images.js +59 -0
- package/dist/workspace/release-steps/index.d.ts +9 -0
- package/dist/workspace/release-steps/index.js +50 -0
- package/dist/workspace/release-steps/nfpm.d.ts +13 -0
- package/dist/workspace/release-steps/nfpm.js +29 -0
- package/dist/workspace/release-steps/nuget.d.ts +14 -0
- package/dist/workspace/release-steps/nuget.js +16 -0
- package/dist/workspace/release-steps/pypi.d.ts +15 -0
- package/dist/workspace/release-steps/pypi.js +21 -0
- package/dist/workspace/release-steps/qemu.d.ts +21 -0
- package/dist/workspace/release-steps/qemu.js +35 -0
- package/dist/workspace/release-steps/signing.d.ts +18 -0
- package/dist/workspace/release-steps/signing.js +30 -0
- package/dist/workspace/release-steps/stamp.d.ts +3 -0
- package/dist/workspace/release-steps/stamp.js +4 -0
- package/dist/workspace/release-steps/targets.d.ts +31 -0
- package/dist/workspace/release-steps/targets.js +40 -0
- package/dist/workspace/release-steps/types.d.ts +104 -0
- package/dist/workspace/release-steps/types.js +2 -0
- package/dist/workspace/release-steps/verify.d.ts +3 -0
- package/dist/workspace/release-steps/verify.js +4 -0
- package/dist/workspace/release-toolchains.d.ts +59 -0
- package/dist/workspace/release-toolchains.js +133 -0
- package/dist/workspace/release-train-workflow.d.ts +36 -0
- package/dist/workspace/release-train-workflow.js +121 -0
- package/dist/workspace/release-train.d.ts +3 -1
- package/dist/workspace/release-train.js +20 -3
- package/dist/workspace/release-workflow.d.ts +183 -59
- package/dist/workspace/release-workflow.js +570 -201
- package/dist/workspace/releases.schema.json +70 -1
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/security.js +9 -2
- package/dist/workspace/train-cut.d.ts +182 -0
- package/dist/workspace/train-cut.js +504 -0
- package/dist/workspace/train-prepare.d.ts +64 -0
- package/dist/workspace/train-prepare.js +313 -0
- package/dist/workspace/train-publish.d.ts +177 -0
- package/dist/workspace/train-publish.js +574 -0
- package/dist/workspace/train-range-labels.d.ts +33 -0
- package/dist/workspace/train-range-labels.js +109 -0
- package/dist/workspace/train-shell.d.ts +5 -0
- package/dist/workspace/train-shell.js +17 -0
- package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
- package/dist/workspace/trust/check-evidence-report.js +3 -7
- package/dist/workspace/trust/seal.d.ts +13 -3
- package/dist/workspace/trust/seal.js +14 -4
- package/dist/workspace/work-cli.d.ts +3 -2
- package/dist/workspace/work-cli.js +3 -2
- package/dist/workspace/workspace-ledger.d.ts +14 -1
- package/dist/workspace/workspace-ledger.js +33 -7
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant release init` (#5160): the first setup of `chant release` in a
|
|
3
|
+
* project that has never used chant.
|
|
4
|
+
*
|
|
5
|
+
* It reads the project ({@link detectProject}): the package.json and its
|
|
6
|
+
* npm, pnpm or yarn workspaces, go.mod, Cargo.toml, pyproject.toml,
|
|
7
|
+
* Dockerfiles, a goreleaser config, Helm charts and an nfpm config (#5233),
|
|
8
|
+
* the forge `origin` names, and the tags
|
|
9
|
+
* releases were made under so far. From that it plans a `release` block
|
|
10
|
+
* ({@link planRelease}): the tag template, `legacyTags`, the green gate, the
|
|
11
|
+
* version stamping, the publish targets it can infer, and a dispatched
|
|
12
|
+
* release workflow. Then it writes that block into `chant.config.ts`
|
|
13
|
+
* ({@link insertReleaseBlock}), making a config of the block alone when
|
|
14
|
+
* there is none.
|
|
15
|
+
*
|
|
16
|
+
* Detection reads files and local git only; it never reaches a registry or
|
|
17
|
+
* the forge. Everything it can't set up from the repository, such as an npm
|
|
18
|
+
* trusted publisher, is a step printed for a person ({@link ReleaseInitPlan.registry}).
|
|
19
|
+
*/
|
|
20
|
+
import { type RegistryProjectFacts } from "./release-init-registries.js";
|
|
21
|
+
export type ReleaseInitCode = "release-init-release-exists" | "release-init-config-unreadable" | "release-init-workflow-exists" | "release-init-not-a-project" | "release-init-member-exists" | "release-init-tsx-missing";
|
|
22
|
+
/** A refusal of `chant release init`, with its code. */
|
|
23
|
+
export declare class ReleaseInitError extends Error {
|
|
24
|
+
readonly code: ReleaseInitCode;
|
|
25
|
+
readonly fix?: string | undefined;
|
|
26
|
+
constructor(code: ReleaseInitCode, message: string, fix?: string | undefined);
|
|
27
|
+
}
|
|
28
|
+
/** One package.json found in the project. */
|
|
29
|
+
export interface InitPackage {
|
|
30
|
+
/** Directory from the project root, `.` for the root. */
|
|
31
|
+
dir: string;
|
|
32
|
+
name: string | null;
|
|
33
|
+
private: boolean;
|
|
34
|
+
/** `publishConfig.access`, when set. */
|
|
35
|
+
access: string | null;
|
|
36
|
+
/** A VS Code extension: `engines.vscode` is set. */
|
|
37
|
+
vscode: boolean;
|
|
38
|
+
/** The extension's publisher, for a VS Code extension. */
|
|
39
|
+
publisher: string | null;
|
|
40
|
+
/** Names in `dependencies`, `peerDependencies` and `optionalDependencies`. */
|
|
41
|
+
deps: string[];
|
|
42
|
+
scripts: string[];
|
|
43
|
+
/** `files` in package.json or an `.npmignore`, so npm packs only what they name. */
|
|
44
|
+
packList?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export type NodeManager = "npm" | "pnpm" | "yarn";
|
|
47
|
+
/** What {@link detectProject} found. */
|
|
48
|
+
export interface ProjectFacts {
|
|
49
|
+
/** The project's directory from the repository root, or null at the root. */
|
|
50
|
+
path: string | null;
|
|
51
|
+
/** The forge `origin` names, or null. */
|
|
52
|
+
origin: {
|
|
53
|
+
kind: "github" | "gitlab" | "forgejo";
|
|
54
|
+
host: string;
|
|
55
|
+
repo: string;
|
|
56
|
+
} | null;
|
|
57
|
+
/** The forge whose workflow directory the repository has, else the origin's, else github. */
|
|
58
|
+
workflowForge: "github" | "gitlab" | "forgejo";
|
|
59
|
+
/** Other CI files at the repository root, which give a commit checks: workflow files other than chant's release, or `.gitlab-ci.yml`. */
|
|
60
|
+
ciFiles: string[];
|
|
61
|
+
/**
|
|
62
|
+
* Workflow files under `.github/workflows` that chant did not write and that
|
|
63
|
+
* run `npm publish` (or pnpm's or yarn's), for this project: an npm trusted
|
|
64
|
+
* publisher names one such file, so the release workflow takes its place.
|
|
65
|
+
*/
|
|
66
|
+
publishWorkflows?: string[];
|
|
67
|
+
node: {
|
|
68
|
+
manager: NodeManager;
|
|
69
|
+
lockfile: string | null;
|
|
70
|
+
/** `.yarnrc.yml` is there: yarn 2 or later. */
|
|
71
|
+
yarnBerry: boolean;
|
|
72
|
+
root: InitPackage;
|
|
73
|
+
/** Workspace packages, when the root declares workspaces. */
|
|
74
|
+
workspaces: InitPackage[] | null;
|
|
75
|
+
/** `@intentius/chant` is a dependency of the root package. */
|
|
76
|
+
hasChant: boolean;
|
|
77
|
+
} | null;
|
|
78
|
+
go: {
|
|
79
|
+
module: string | null;
|
|
80
|
+
} | null;
|
|
81
|
+
rust: {
|
|
82
|
+
name: string | null;
|
|
83
|
+
workspace: boolean;
|
|
84
|
+
/** `Cargo.toml` has a `version` string in `[package]` or `[workspace.package]`, which `release.version.files` can stamp. */
|
|
85
|
+
version: boolean;
|
|
86
|
+
/** `[package]` sets `publish = false`. */
|
|
87
|
+
unpublishable: boolean;
|
|
88
|
+
} | null;
|
|
89
|
+
python: {
|
|
90
|
+
name: string | null;
|
|
91
|
+
/** There is a `pyproject.toml`, which `python -m build` reads. */
|
|
92
|
+
pyproject: boolean;
|
|
93
|
+
/** `pyproject.toml` has a static `version` in `[project]` or `[tool.poetry]`, which `release.version.files` can stamp. */
|
|
94
|
+
version: boolean;
|
|
95
|
+
} | null;
|
|
96
|
+
/** Dockerfiles, from the project root. */
|
|
97
|
+
dockerfiles: string[];
|
|
98
|
+
goreleaser: {
|
|
99
|
+
file: string;
|
|
100
|
+
/** The config sets `snapshot.version_template` to the release label. */
|
|
101
|
+
labelTemplate: boolean;
|
|
102
|
+
/** The config has a top-level `snapshot:` key. */
|
|
103
|
+
snapshot: boolean;
|
|
104
|
+
/** The config builds images (`dockers:` or `kos:`). */
|
|
105
|
+
images: boolean;
|
|
106
|
+
} | null;
|
|
107
|
+
/** Helm charts (#5233): each directory holding a `Chart.yaml`, from the project root, and the chart's name. A chart inside another's directory is its subchart and is not listed. */
|
|
108
|
+
charts?: Array<{
|
|
109
|
+
dir: string;
|
|
110
|
+
name: string | null;
|
|
111
|
+
}>;
|
|
112
|
+
/** An nfpm config (#5233), and whether its `version` follows the label chant passes. */
|
|
113
|
+
nfpm?: {
|
|
114
|
+
file: string;
|
|
115
|
+
version: boolean;
|
|
116
|
+
} | null;
|
|
117
|
+
/** The tags releases were made under. */
|
|
118
|
+
tags: TagHistory;
|
|
119
|
+
/** `ci.green` is declared or `ci/green/` tags exist. */
|
|
120
|
+
chantCi: boolean;
|
|
121
|
+
/** `.gitignore` ignores `dist/`. */
|
|
122
|
+
distIgnored: boolean;
|
|
123
|
+
/** A `pom.xml`, `*.csproj` files or a `*.gemspec` at the root (#5232). */
|
|
124
|
+
registries?: RegistryProjectFacts;
|
|
125
|
+
}
|
|
126
|
+
/** The release tags a repository holds, grouped by what comes before the version. */
|
|
127
|
+
export interface TagHistory {
|
|
128
|
+
/** The prefix most of the version tags share, such as `v` or `cli-v`; `""` for bare versions; null with no version tags. */
|
|
129
|
+
prefix: string | null;
|
|
130
|
+
/** How many tags have that prefix. */
|
|
131
|
+
count: number;
|
|
132
|
+
/** The newest tag with that prefix, by version. */
|
|
133
|
+
newest: string | null;
|
|
134
|
+
/** Other prefixes seen, with their counts. */
|
|
135
|
+
others: Array<{
|
|
136
|
+
prefix: string;
|
|
137
|
+
count: number;
|
|
138
|
+
}>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The tag history of a list of tags: version tags grouped by their prefix,
|
|
142
|
+
* the largest group first. `ci/` and `chant/` tags are chant's own and
|
|
143
|
+
* left out.
|
|
144
|
+
*/
|
|
145
|
+
export declare function readTagHistory(tags: readonly string[]): TagHistory;
|
|
146
|
+
/** The directories a workspace pattern such as `packages/*` or `apps/**` names, from `root`. */
|
|
147
|
+
export declare function expandWorkspacePattern(root: string, pattern: string): string[];
|
|
148
|
+
/** The workspace patterns of a package.json (`workspaces` as a list or `{ packages }`) or a pnpm-workspace.yaml. */
|
|
149
|
+
export declare function workspacePatterns(root: string): string[] | null;
|
|
150
|
+
/** Whether a goreleaser config sets `snapshot.version_template` to the release label. */
|
|
151
|
+
export declare function goreleaserFacts(text: string): {
|
|
152
|
+
labelTemplate: boolean;
|
|
153
|
+
snapshot: boolean;
|
|
154
|
+
images: boolean;
|
|
155
|
+
};
|
|
156
|
+
/** The lines a goreleaser config needs so its snapshot build carries the release's label. */
|
|
157
|
+
export declare const GORELEASER_SNAPSHOT = "snapshot:\n version_template: \"{{ .Env.CHANT_RELEASE_LABEL }}\"\n";
|
|
158
|
+
/** A `Cargo.toml`'s name, workspace, stampable version and `publish = false`. */
|
|
159
|
+
export declare function cargoFacts(text: string): NonNullable<ProjectFacts["rust"]>;
|
|
160
|
+
/** A `pyproject.toml`'s project name, and whether its version is a static string that `release.version.files` can stamp. */
|
|
161
|
+
export declare function pyprojectFacts(text: string): NonNullable<ProjectFacts["python"]>;
|
|
162
|
+
export declare function detectProject(root: string): ProjectFacts;
|
|
163
|
+
/** A value in the release block, as it is written to chant.config.ts. */
|
|
164
|
+
type Json = string | number | boolean | null | Json[] | {
|
|
165
|
+
[k: string]: Json;
|
|
166
|
+
};
|
|
167
|
+
/** What `chant release init` would write and say. */
|
|
168
|
+
export interface ReleaseInitPlan {
|
|
169
|
+
/** The `release` block. */
|
|
170
|
+
release: Record<string, Json>;
|
|
171
|
+
/** Why each part of the block is what it is, one line each. */
|
|
172
|
+
reasons: string[];
|
|
173
|
+
/** What the release does not publish, and why. */
|
|
174
|
+
notes: string[];
|
|
175
|
+
/** Steps a person takes on the registries and the forge. */
|
|
176
|
+
registry: string[];
|
|
177
|
+
/** The workflow file `chant release workflow` writes, from the repository root. */
|
|
178
|
+
workflowFile: string;
|
|
179
|
+
/** Lines to add to the goreleaser config, when it lacks them. */
|
|
180
|
+
goreleaserPatch: {
|
|
181
|
+
file: string;
|
|
182
|
+
append: string | null;
|
|
183
|
+
manual: string | null;
|
|
184
|
+
} | null;
|
|
185
|
+
/**
|
|
186
|
+
* True when the existing version tags are ones `release.tag` or
|
|
187
|
+
* `release.legacyTags` matches, so `chant release next` reads the newest
|
|
188
|
+
* as the previous release and the first release can take the label `auto`
|
|
189
|
+
* (#5200).
|
|
190
|
+
*/
|
|
191
|
+
readsHistory: boolean;
|
|
192
|
+
}
|
|
193
|
+
/** What the plan needs besides the facts. */
|
|
194
|
+
export interface PlanOptions {
|
|
195
|
+
/** The chant version writing the plan, for the workflow's `npx --yes @intentius/chant@<version>`. */
|
|
196
|
+
chantVersion: string;
|
|
197
|
+
}
|
|
198
|
+
/** Packages in dependency order: each after the packages of the list it depends on, ties by directory. */
|
|
199
|
+
export declare function dependencyOrder(pkgs: readonly InitPackage[]): InitPackage[];
|
|
200
|
+
/**
|
|
201
|
+
* The tag template a project's history asks for, and the prefixes to read
|
|
202
|
+
* older releases by. `packages` is how many packages one release publishes:
|
|
203
|
+
* with more than one, a prefix other than `v` names one package's tags, so
|
|
204
|
+
* the release gets `v{version}` and the older tags are only read.
|
|
205
|
+
*/
|
|
206
|
+
export declare function tagTemplateOf(facts: Pick<ProjectFacts, "tags" | "go" | "path">, packages?: number): {
|
|
207
|
+
template: string;
|
|
208
|
+
legacy: string[];
|
|
209
|
+
reason: string;
|
|
210
|
+
note: string | null;
|
|
211
|
+
};
|
|
212
|
+
/** Plan the `release` block for a project. */
|
|
213
|
+
export declare function planRelease(facts: ProjectFacts, opts: PlanOptions): ReleaseInitPlan;
|
|
214
|
+
/** One member of a planned train: a publishable package, released at its own version from its own `chant.config.ts`. */
|
|
215
|
+
export interface TrainMemberPlan {
|
|
216
|
+
/** The member's name in `chant.workspace.json`. */
|
|
217
|
+
name: string;
|
|
218
|
+
/** The package's directory from the project root. */
|
|
219
|
+
dir: string;
|
|
220
|
+
/** The npm package name. */
|
|
221
|
+
package: string;
|
|
222
|
+
/** The member's `release` block. */
|
|
223
|
+
release: Record<string, Json>;
|
|
224
|
+
}
|
|
225
|
+
/** What `chant release init` writes for a workspace released as a train (#5154). */
|
|
226
|
+
export interface ReleaseTrainPlan {
|
|
227
|
+
/** The workspace root's `release` block: `train`, the gate and the workflow. */
|
|
228
|
+
release: Record<string, Json>;
|
|
229
|
+
members: TrainMemberPlan[];
|
|
230
|
+
/** The name for a new `chant.workspace.json`. */
|
|
231
|
+
workspaceName: string;
|
|
232
|
+
reasons: string[];
|
|
233
|
+
notes: string[];
|
|
234
|
+
registry: string[];
|
|
235
|
+
workflowFile: string;
|
|
236
|
+
/** The environment the train is recorded for. */
|
|
237
|
+
env: string;
|
|
238
|
+
}
|
|
239
|
+
/** The environment a planned train is recorded for. */
|
|
240
|
+
export declare const TRAIN_ENV = "npm";
|
|
241
|
+
/**
|
|
242
|
+
* Whether the project's npm, pnpm or yarn workspaces can release as a train:
|
|
243
|
+
* one member per publishable package (#5154). `why` says why a project with
|
|
244
|
+
* several packages gets one release instead, and is null for a project with
|
|
245
|
+
* fewer than two.
|
|
246
|
+
*/
|
|
247
|
+
export declare function trainFit(facts: ProjectFacts): {
|
|
248
|
+
train: true;
|
|
249
|
+
} | {
|
|
250
|
+
train: false;
|
|
251
|
+
why: string | null;
|
|
252
|
+
};
|
|
253
|
+
/** A workspace member name (lowercase letters, digits and dashes, at most 40) for a package. */
|
|
254
|
+
export declare function memberNameOf(pkg: Pick<InitPackage, "name" | "dir">): string;
|
|
255
|
+
/**
|
|
256
|
+
* Plan a train for a project {@link trainFit} accepts: a member per
|
|
257
|
+
* publishable workspace package, each stamping and publishing its own
|
|
258
|
+
* package, and the root's `release.train` with a dispatched workflow.
|
|
259
|
+
*/
|
|
260
|
+
export declare function planTrain(facts: ProjectFacts, opts: PlanOptions): ReleaseTrainPlan;
|
|
261
|
+
/** A value as TypeScript source, objects and arrays on one line when short. */
|
|
262
|
+
export declare function toSource(value: Json, indent: string, step?: string): string;
|
|
263
|
+
/** The `release:` property as source, at `indent`, expanded one level so each field is on its own line. */
|
|
264
|
+
export declare function releaseBlockSource(release: Record<string, Json>, indent: string, step?: string): string;
|
|
265
|
+
/** A config made of the release block alone. */
|
|
266
|
+
export declare function newConfigSource(release: Record<string, Json>): string;
|
|
267
|
+
/**
|
|
268
|
+
* Write `release` into a chant.config.ts's default export: before the
|
|
269
|
+
* object's closing brace, or in place of an existing `release` property
|
|
270
|
+
* when `force`. Throws {@link ReleaseInitError}: `release-init-release-exists`
|
|
271
|
+
* for a `release` property without `force`, `release-init-config-unreadable`
|
|
272
|
+
* when the default export is not an object literal this can find.
|
|
273
|
+
*/
|
|
274
|
+
export declare function insertReleaseBlock(src: string, release: Record<string, Json>, force: boolean): string;
|
|
275
|
+
export {};
|