@seasb/metafab 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -1
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +317 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.js +70 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/check.d.ts +2 -0
- package/dist/commands/check.js +41 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/create.js +74 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/detach.d.ts +2 -0
- package/dist/commands/detach.js +24 -0
- package/dist/commands/detach.js.map +1 -0
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.js +35 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/import.d.ts +2 -0
- package/dist/commands/import.js +107 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +77 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/map.d.ts +2 -0
- package/dist/commands/map.js +43 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/not-implemented.d.ts +2 -0
- package/dist/commands/not-implemented.js +19 -0
- package/dist/commands/not-implemented.js.map +1 -0
- package/dist/commands/pipeline-add.d.ts +2 -0
- package/dist/commands/pipeline-add.js +67 -0
- package/dist/commands/pipeline-add.js.map +1 -0
- package/dist/commands/pipeline-remove.d.ts +2 -0
- package/dist/commands/pipeline-remove.js +44 -0
- package/dist/commands/pipeline-remove.js.map +1 -0
- package/dist/commands/publish.d.ts +2 -0
- package/dist/commands/publish.js +147 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/types.d.ts +45 -0
- package/dist/commands/types.js +2 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.js +97 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/core/adopt.d.ts +53 -0
- package/dist/core/adopt.js +676 -0
- package/dist/core/adopt.js.map +1 -0
- package/dist/core/build/agents.d.ts +23 -0
- package/dist/core/build/agents.js +60 -0
- package/dist/core/build/agents.js.map +1 -0
- package/dist/core/build/index.d.ts +4 -0
- package/dist/core/build/index.js +5 -0
- package/dist/core/build/index.js.map +1 -0
- package/dist/core/build/markers.d.ts +34 -0
- package/dist/core/build/markers.js +97 -0
- package/dist/core/build/markers.js.map +1 -0
- package/dist/core/build/plan.d.ts +48 -0
- package/dist/core/build/plan.js +792 -0
- package/dist/core/build/plan.js.map +1 -0
- package/dist/core/build/skill.d.ts +60 -0
- package/dist/core/build/skill.js +275 -0
- package/dist/core/build/skill.js.map +1 -0
- package/dist/core/check/drift.d.ts +13 -0
- package/dist/core/check/drift.js +205 -0
- package/dist/core/check/drift.js.map +1 -0
- package/dist/core/check/index.d.ts +12 -0
- package/dist/core/check/index.js +78 -0
- package/dist/core/check/index.js.map +1 -0
- package/dist/core/check/markers.d.ts +9 -0
- package/dist/core/check/markers.js +220 -0
- package/dist/core/check/markers.js.map +1 -0
- package/dist/core/config/destinations.d.ts +5 -0
- package/dist/core/config/destinations.js +20 -0
- package/dist/core/config/destinations.js.map +1 -0
- package/dist/core/config/load.d.ts +4 -0
- package/dist/core/config/load.js +41 -0
- package/dist/core/config/load.js.map +1 -0
- package/dist/core/config/parse.d.ts +8 -0
- package/dist/core/config/parse.js +198 -0
- package/dist/core/config/parse.js.map +1 -0
- package/dist/core/config/source.d.ts +14 -0
- package/dist/core/config/source.js +44 -0
- package/dist/core/config/source.js.map +1 -0
- package/dist/core/config/types.d.ts +48 -0
- package/dist/core/config/types.js +2 -0
- package/dist/core/config/types.js.map +1 -0
- package/dist/core/config/validate.d.ts +11 -0
- package/dist/core/config/validate.js +351 -0
- package/dist/core/config/validate.js.map +1 -0
- package/dist/core/config/writers.d.ts +14 -0
- package/dist/core/config/writers.js +261 -0
- package/dist/core/config/writers.js.map +1 -0
- package/dist/core/config.d.ts +7 -0
- package/dist/core/config.js +8 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/discovery.d.ts +34 -0
- package/dist/core/discovery.js +272 -0
- package/dist/core/discovery.js.map +1 -0
- package/dist/core/edit/create.d.ts +18 -0
- package/dist/core/edit/create.js +190 -0
- package/dist/core/edit/create.js.map +1 -0
- package/dist/core/edit/document.d.ts +4 -0
- package/dist/core/edit/document.js +16 -0
- package/dist/core/edit/document.js.map +1 -0
- package/dist/core/edit/factory-yaml.d.ts +17 -0
- package/dist/core/edit/factory-yaml.js +211 -0
- package/dist/core/edit/factory-yaml.js.map +1 -0
- package/dist/core/edit/files.d.ts +6 -0
- package/dist/core/edit/files.js +47 -0
- package/dist/core/edit/files.js.map +1 -0
- package/dist/core/edit/index.d.ts +9 -0
- package/dist/core/edit/index.js +10 -0
- package/dist/core/edit/index.js.map +1 -0
- package/dist/core/edit/map.d.ts +24 -0
- package/dist/core/edit/map.js +82 -0
- package/dist/core/edit/map.js.map +1 -0
- package/dist/core/edit/names.d.ts +2 -0
- package/dist/core/edit/names.js +17 -0
- package/dist/core/edit/names.js.map +1 -0
- package/dist/core/edit/paths.d.ts +8 -0
- package/dist/core/edit/paths.js +76 -0
- package/dist/core/edit/paths.js.map +1 -0
- package/dist/core/edit/pipeline.d.ts +19 -0
- package/dist/core/edit/pipeline.js +146 -0
- package/dist/core/edit/pipeline.js.map +1 -0
- package/dist/core/edit/skill.d.ts +1 -0
- package/dist/core/edit/skill.js +10 -0
- package/dist/core/edit/skill.js.map +1 -0
- package/dist/core/factory/discovery.d.ts +9 -0
- package/dist/core/factory/discovery.js +139 -0
- package/dist/core/factory/discovery.js.map +1 -0
- package/dist/core/factory/factory-yaml.d.ts +16 -0
- package/dist/core/factory/factory-yaml.js +375 -0
- package/dist/core/factory/factory-yaml.js.map +1 -0
- package/dist/core/factory/index.d.ts +5 -0
- package/dist/core/factory/index.js +6 -0
- package/dist/core/factory/index.js.map +1 -0
- package/dist/core/factory/lines.d.ts +8 -0
- package/dist/core/factory/lines.js +11 -0
- package/dist/core/factory/lines.js.map +1 -0
- package/dist/core/factory/load.d.ts +4 -0
- package/dist/core/factory/load.js +81 -0
- package/dist/core/factory/load.js.map +1 -0
- package/dist/core/factory/requires.d.ts +9 -0
- package/dist/core/factory/requires.js +123 -0
- package/dist/core/factory/requires.js.map +1 -0
- package/dist/core/factory/types.d.ts +45 -0
- package/dist/core/factory/types.js +2 -0
- package/dist/core/factory/types.js.map +1 -0
- package/dist/core/factory/validate.d.ts +41 -0
- package/dist/core/factory/validate.js +441 -0
- package/dist/core/factory/validate.js.map +1 -0
- package/dist/core/hooks/index.d.ts +8 -0
- package/dist/core/hooks/index.js +15 -0
- package/dist/core/hooks/index.js.map +1 -0
- package/dist/core/hooks/script.d.ts +21 -0
- package/dist/core/hooks/script.js +34 -0
- package/dist/core/hooks/script.js.map +1 -0
- package/dist/core/hooks/sync.d.ts +17 -0
- package/dist/core/hooks/sync.js +262 -0
- package/dist/core/hooks/sync.js.map +1 -0
- package/dist/core/import/conflicts.d.ts +82 -0
- package/dist/core/import/conflicts.js +256 -0
- package/dist/core/import/conflicts.js.map +1 -0
- package/dist/core/import/copy.d.ts +10 -0
- package/dist/core/import/copy.js +76 -0
- package/dist/core/import/copy.js.map +1 -0
- package/dist/core/import/file-tree.d.ts +43 -0
- package/dist/core/import/file-tree.js +107 -0
- package/dist/core/import/file-tree.js.map +1 -0
- package/dist/core/import/index.d.ts +5 -0
- package/dist/core/import/index.js +6 -0
- package/dist/core/import/index.js.map +1 -0
- package/dist/core/import/pipeline-changes.d.ts +8 -0
- package/dist/core/import/pipeline-changes.js +89 -0
- package/dist/core/import/pipeline-changes.js.map +1 -0
- package/dist/core/import/run.d.ts +76 -0
- package/dist/core/import/run.js +258 -0
- package/dist/core/import/run.js.map +1 -0
- package/dist/core/init/gitattributes.d.ts +20 -0
- package/dist/core/init/gitattributes.js +89 -0
- package/dist/core/init/gitattributes.js.map +1 -0
- package/dist/core/init/index.d.ts +4 -0
- package/dist/core/init/index.js +5 -0
- package/dist/core/init/index.js.map +1 -0
- package/dist/core/init/name.d.ts +1 -0
- package/dist/core/init/name.js +4 -0
- package/dist/core/init/name.js.map +1 -0
- package/dist/core/init/run.d.ts +51 -0
- package/dist/core/init/run.js +261 -0
- package/dist/core/init/run.js.map +1 -0
- package/dist/core/init/targets.d.ts +17 -0
- package/dist/core/init/targets.js +87 -0
- package/dist/core/init/targets.js.map +1 -0
- package/dist/core/merge.d.ts +88 -0
- package/dist/core/merge.js +239 -0
- package/dist/core/merge.js.map +1 -0
- package/dist/core/publish/exclude.d.ts +9 -0
- package/dist/core/publish/exclude.js +32 -0
- package/dist/core/publish/exclude.js.map +1 -0
- package/dist/core/publish/git-target.d.ts +32 -0
- package/dist/core/publish/git-target.js +447 -0
- package/dist/core/publish/git-target.js.map +1 -0
- package/dist/core/publish/index.d.ts +10 -0
- package/dist/core/publish/index.js +11 -0
- package/dist/core/publish/index.js.map +1 -0
- package/dist/core/publish/npm-target.d.ts +15 -0
- package/dist/core/publish/npm-target.js +170 -0
- package/dist/core/publish/npm-target.js.map +1 -0
- package/dist/core/publish/package-json.d.ts +31 -0
- package/dist/core/publish/package-json.js +74 -0
- package/dist/core/publish/package-json.js.map +1 -0
- package/dist/core/publish/prepare.d.ts +24 -0
- package/dist/core/publish/prepare.js +93 -0
- package/dist/core/publish/prepare.js.map +1 -0
- package/dist/core/publish/provenance.d.ts +1 -0
- package/dist/core/publish/provenance.js +20 -0
- package/dist/core/publish/provenance.js.map +1 -0
- package/dist/core/publish/publish.d.ts +13 -0
- package/dist/core/publish/publish.js +130 -0
- package/dist/core/publish/publish.js.map +1 -0
- package/dist/core/publish/readme.d.ts +22 -0
- package/dist/core/publish/readme.js +112 -0
- package/dist/core/publish/readme.js.map +1 -0
- package/dist/core/publish/stage.d.ts +19 -0
- package/dist/core/publish/stage.js +333 -0
- package/dist/core/publish/stage.js.map +1 -0
- package/dist/core/publish/types.d.ts +71 -0
- package/dist/core/publish/types.js +2 -0
- package/dist/core/publish/types.js.map +1 -0
- package/dist/core/requires/check.d.ts +15 -0
- package/dist/core/requires/check.js +83 -0
- package/dist/core/requires/check.js.map +1 -0
- package/dist/core/requires/index.d.ts +4 -0
- package/dist/core/requires/index.js +5 -0
- package/dist/core/requires/index.js.map +1 -0
- package/dist/core/requires/inspect.d.ts +44 -0
- package/dist/core/requires/inspect.js +114 -0
- package/dist/core/requires/inspect.js.map +1 -0
- package/dist/core/requires/paths.d.ts +29 -0
- package/dist/core/requires/paths.js +83 -0
- package/dist/core/requires/paths.js.map +1 -0
- package/dist/core/requires/setup.d.ts +37 -0
- package/dist/core/requires/setup.js +147 -0
- package/dist/core/requires/setup.js.map +1 -0
- package/dist/core/setup.d.ts +27 -0
- package/dist/core/setup.js +84 -0
- package/dist/core/setup.js.map +1 -0
- package/dist/core/sources/cache.d.ts +38 -0
- package/dist/core/sources/cache.js +200 -0
- package/dist/core/sources/cache.js.map +1 -0
- package/dist/core/sources/containment.d.ts +21 -0
- package/dist/core/sources/containment.js +50 -0
- package/dist/core/sources/containment.js.map +1 -0
- package/dist/core/sources/env.d.ts +12 -0
- package/dist/core/sources/env.js +28 -0
- package/dist/core/sources/env.js.map +1 -0
- package/dist/core/sources/extract.d.ts +25 -0
- package/dist/core/sources/extract.js +676 -0
- package/dist/core/sources/extract.js.map +1 -0
- package/dist/core/sources/git-process.d.ts +26 -0
- package/dist/core/sources/git-process.js +51 -0
- package/dist/core/sources/git-process.js.map +1 -0
- package/dist/core/sources/git.d.ts +41 -0
- package/dist/core/sources/git.js +511 -0
- package/dist/core/sources/git.js.map +1 -0
- package/dist/core/sources/https.d.ts +21 -0
- package/dist/core/sources/https.js +208 -0
- package/dist/core/sources/https.js.map +1 -0
- package/dist/core/sources/index.d.ts +13 -0
- package/dist/core/sources/index.js +14 -0
- package/dist/core/sources/index.js.map +1 -0
- package/dist/core/sources/npm-cli.d.ts +19 -0
- package/dist/core/sources/npm-cli.js +43 -0
- package/dist/core/sources/npm-cli.js.map +1 -0
- package/dist/core/sources/npm.d.ts +29 -0
- package/dist/core/sources/npm.js +386 -0
- package/dist/core/sources/npm.js.map +1 -0
- package/dist/core/sources/parse.d.ts +32 -0
- package/dist/core/sources/parse.js +389 -0
- package/dist/core/sources/parse.js.map +1 -0
- package/dist/core/sources/path.d.ts +10 -0
- package/dist/core/sources/path.js +316 -0
- package/dist/core/sources/path.js.map +1 -0
- package/dist/core/sources/redact.d.ts +2 -0
- package/dist/core/sources/redact.js +70 -0
- package/dist/core/sources/redact.js.map +1 -0
- package/dist/core/sources/resolve.d.ts +9 -0
- package/dist/core/sources/resolve.js +29 -0
- package/dist/core/sources/resolve.js.map +1 -0
- package/dist/core/sources/types.d.ts +86 -0
- package/dist/core/sources/types.js +2 -0
- package/dist/core/sources/types.js.map +1 -0
- package/dist/core/sources/validate.d.ts +9 -0
- package/dist/core/sources/validate.js +111 -0
- package/dist/core/sources/validate.js.map +1 -0
- package/dist/core/summary.d.ts +77 -0
- package/dist/core/summary.js +405 -0
- package/dist/core/summary.js.map +1 -0
- package/dist/core/update/clashes.d.ts +63 -0
- package/dist/core/update/clashes.js +192 -0
- package/dist/core/update/clashes.js.map +1 -0
- package/dist/core/update/detach.d.ts +21 -0
- package/dist/core/update/detach.js +38 -0
- package/dist/core/update/detach.js.map +1 -0
- package/dist/core/update/diff.d.ts +58 -0
- package/dist/core/update/diff.js +180 -0
- package/dist/core/update/diff.js.map +1 -0
- package/dist/core/update/fetch.d.ts +34 -0
- package/dist/core/update/fetch.js +73 -0
- package/dist/core/update/fetch.js.map +1 -0
- package/dist/core/update/index.d.ts +6 -0
- package/dist/core/update/index.js +7 -0
- package/dist/core/update/index.js.map +1 -0
- package/dist/core/update/restore.d.ts +20 -0
- package/dist/core/update/restore.js +195 -0
- package/dist/core/update/restore.js.map +1 -0
- package/dist/core/update/run.d.ts +113 -0
- package/dist/core/update/run.js +1132 -0
- package/dist/core/update/run.js.map +1 -0
- package/dist/core/update/select.d.ts +39 -0
- package/dist/core/update/select.js +157 -0
- package/dist/core/update/select.js.map +1 -0
- package/dist/core/update/spelling.d.ts +51 -0
- package/dist/core/update/spelling.js +185 -0
- package/dist/core/update/spelling.js.map +1 -0
- package/dist/core/update/trees.d.ts +24 -0
- package/dist/core/update/trees.js +72 -0
- package/dist/core/update/trees.js.map +1 -0
- package/dist/errors.d.ts +29 -0
- package/dist/errors.js +24 -0
- package/dist/errors.js.map +1 -0
- package/dist/help.d.ts +46 -0
- package/dist/help.js +103 -0
- package/dist/help.js.map +1 -0
- package/dist/input.d.ts +25 -0
- package/dist/input.js +173 -0
- package/dist/input.js.map +1 -0
- package/dist/output.d.ts +21 -0
- package/dist/output.js +37 -0
- package/dist/output.js.map +1 -0
- package/dist/util/frontmatter.d.ts +12 -0
- package/dist/util/frontmatter.js +58 -0
- package/dist/util/frontmatter.js.map +1 -0
- package/dist/util/fs.d.ts +32 -0
- package/dist/util/fs.js +126 -0
- package/dist/util/fs.js.map +1 -0
- package/dist/util/git-names.d.ts +8 -0
- package/dist/util/git-names.js +25 -0
- package/dist/util/git-names.js.map +1 -0
- package/dist/util/git.d.ts +12 -0
- package/dist/util/git.js +33 -0
- package/dist/util/git.js.map +1 -0
- package/dist/util/suggest.d.ts +6 -0
- package/dist/util/suggest.js +48 -0
- package/dist/util/suggest.js.map +1 -0
- package/dist/util/text.d.ts +8 -0
- package/dist/util/text.js +19 -0
- package/dist/util/text.js.map +1 -0
- package/dist/util/version.d.ts +7 -0
- package/dist/util/version.js +13 -0
- package/dist/util/version.js.map +1 -0
- package/dist/util/yaml.d.ts +30 -0
- package/dist/util/yaml.js +201 -0
- package/dist/util/yaml.js.map +1 -0
- package/package.json +50 -3
- package/resources/metafab-skill/SKILL.md +99 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
import { mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { ExitCode, MetafabError } from "../../errors.js";
|
|
7
|
+
import { copyTree, listFiles } from "../../util/fs.js";
|
|
8
|
+
import { disabledHooksConfig, gitEnvironment, gitMessage, VERBATIM_TEXT_ATTRIBUTES } from "../sources/git-process.js";
|
|
9
|
+
import { gitTransportUrl } from "../sources/parse.js";
|
|
10
|
+
import { redact, stripSourceCredentials } from "../sources/redact.js";
|
|
11
|
+
/** The tag message prefix that marks a tag `publish` created itself. */
|
|
12
|
+
const TAG_MESSAGE = "metafab publish";
|
|
13
|
+
/** A commit identity used only when the user has none configured. */
|
|
14
|
+
const FALLBACK_NAME = "metafab";
|
|
15
|
+
const FALLBACK_EMAIL = "metafab@example.com";
|
|
16
|
+
/** npm-only files: a Git fab repository carries no `package.json`. */
|
|
17
|
+
const NPM_ONLY_FILES = new Set(["package.json"]);
|
|
18
|
+
/**
|
|
19
|
+
* A fab must reach the fab repository byte for byte. Git would otherwise apply
|
|
20
|
+
* the fab's own `.gitattributes`, or the user's `core.autocrlf`: a `text` or
|
|
21
|
+
* `eol` rule converts line endings, `filter=lfs` replaces the content, and
|
|
22
|
+
* `ident` expands `$Id$`. Every clone publish uses turns those attributes off
|
|
23
|
+
* for every path before anything is checked out or added.
|
|
24
|
+
*/
|
|
25
|
+
// Publish never runs git archive, so it needs no export rules and no tar.umask.
|
|
26
|
+
const VERBATIM_ATTRIBUTES = `* ${VERBATIM_TEXT_ATTRIBUTES}\n`;
|
|
27
|
+
/**
|
|
28
|
+
* A fab may ship its own `.gitignore`, and the user's global exclude file is
|
|
29
|
+
* theirs, not the fab's. Both would silently keep a staged file out of the
|
|
30
|
+
* commit, so publishing stages with `git add --force`, which adds a path the
|
|
31
|
+
* ignore rules match. `core.autocrlf=false` keeps line endings as staged.
|
|
32
|
+
*/
|
|
33
|
+
function verbatimConfig() {
|
|
34
|
+
return "core.autocrlf=false";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* One helper for every Git call the publish workflows make. It disables hooks
|
|
38
|
+
* and turns off the credential prompt unless the caller allows it.
|
|
39
|
+
*/
|
|
40
|
+
function gitContext(options) {
|
|
41
|
+
return {
|
|
42
|
+
env: gitEnvironment(options.env, options.interactive),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function gitError(message, code, exitCode, cause) {
|
|
46
|
+
return new MetafabError(redact(message), { exitCode, code, cause });
|
|
47
|
+
}
|
|
48
|
+
async function tryGit(args, cwd, context, config = [], input) {
|
|
49
|
+
return new Promise((resolve) => {
|
|
50
|
+
const child = execFile("git", ["-c", disabledHooksConfig(), ...config, ...args], {
|
|
51
|
+
cwd,
|
|
52
|
+
env: context.env,
|
|
53
|
+
encoding: "utf8",
|
|
54
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
55
|
+
windowsHide: true,
|
|
56
|
+
}, (error, stdout, stderr) => {
|
|
57
|
+
if (error === null) {
|
|
58
|
+
resolve({ ok: true, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const failure = error;
|
|
62
|
+
resolve({
|
|
63
|
+
ok: false,
|
|
64
|
+
...(typeof failure.code === "number" ? { status: failure.code } : {}),
|
|
65
|
+
stdout: stdout ?? failure.stdout ?? "",
|
|
66
|
+
stderr: stderr ?? failure.stderr ?? failure.message ?? "",
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
if (input !== undefined) {
|
|
70
|
+
// A Git call that dies before it reads its input must not crash publish.
|
|
71
|
+
child.stdin?.on("error", () => undefined);
|
|
72
|
+
child.stdin?.end(input);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async function runGit(args, cwd, context, argvConfig, failure, input) {
|
|
77
|
+
const result = await tryGit(args, cwd, context, argvConfig, input);
|
|
78
|
+
if (!result.ok)
|
|
79
|
+
throw failure(gitMessage(result));
|
|
80
|
+
return result.stdout;
|
|
81
|
+
}
|
|
82
|
+
function gitFailureError(context) {
|
|
83
|
+
return (detail) => gitError(`${context}: ${detail}`, "publish-git-failed", ExitCode.FetchFailed);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Git quotes a path it prints the way C would, with an octal escape for every
|
|
87
|
+
* byte it cannot show; a rejected `.git` name with a formatting character in it
|
|
88
|
+
* arrives that way.
|
|
89
|
+
*/
|
|
90
|
+
function unquoteGitPath(quoted) {
|
|
91
|
+
if (!quoted.includes("\\"))
|
|
92
|
+
return quoted;
|
|
93
|
+
const simple = {
|
|
94
|
+
a: "\x07",
|
|
95
|
+
b: "\b",
|
|
96
|
+
f: "\f",
|
|
97
|
+
n: "\n",
|
|
98
|
+
r: "\r",
|
|
99
|
+
t: "\t",
|
|
100
|
+
v: "\v",
|
|
101
|
+
"\\": "\\",
|
|
102
|
+
'"': '"',
|
|
103
|
+
};
|
|
104
|
+
const bytes = [];
|
|
105
|
+
for (let index = 0; index < quoted.length; index += 1) {
|
|
106
|
+
const character = quoted[index];
|
|
107
|
+
if (character !== "\\") {
|
|
108
|
+
bytes.push(...Buffer.from(character, "utf8"));
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const octal = /^[0-7]{3}/.exec(quoted.slice(index + 1));
|
|
112
|
+
if (octal !== null) {
|
|
113
|
+
bytes.push(Number.parseInt(octal[0], 8));
|
|
114
|
+
index += 3;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const escaped = quoted[index + 1] ?? "";
|
|
118
|
+
bytes.push(...Buffer.from(simple[escaped] ?? escaped, "utf8"));
|
|
119
|
+
index += 1;
|
|
120
|
+
}
|
|
121
|
+
return Buffer.from(bytes).toString("utf8");
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* `git add` fails a path its `verify_path` rejects even when staging let the
|
|
125
|
+
* name through: a `.git` spelling the filesystem folds, for instance. That is a
|
|
126
|
+
* fab-rule rejection (exit 4) that names the path, not a Git failure.
|
|
127
|
+
*/
|
|
128
|
+
export function addFailure(message, context) {
|
|
129
|
+
const invalid = /(?:error|fatal): invalid path (?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")/.exec(message);
|
|
130
|
+
if (invalid === null)
|
|
131
|
+
return gitFailureError(context)(message);
|
|
132
|
+
const file = unquoteGitPath(invalid[1] ?? invalid[2] ?? "");
|
|
133
|
+
const problem = {
|
|
134
|
+
level: "error",
|
|
135
|
+
file,
|
|
136
|
+
message: `Git cannot store ${file} in a fab`,
|
|
137
|
+
fix: "Rename the path or add it to publish.exclude",
|
|
138
|
+
};
|
|
139
|
+
return new MetafabError(`Git cannot store ${file} in a fab.`, {
|
|
140
|
+
exitCode: ExitCode.InvalidFab,
|
|
141
|
+
code: "publish-git-invalid-path",
|
|
142
|
+
problems: [problem],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Stages the whole working tree with Git's ignore rules off. A fab may ship a
|
|
147
|
+
* `.gitignore` of its own, and the user's global exclude file must not decide
|
|
148
|
+
* what a published fab carries, so the tree Git commits is the staged fab.
|
|
149
|
+
*/
|
|
150
|
+
async function addFabFiles(repo, context, failure) {
|
|
151
|
+
const result = await tryGit(["add", "-A", "--force"], repo, context, ["-c", verbatimConfig()]);
|
|
152
|
+
if (!result.ok)
|
|
153
|
+
throw addFailure(gitMessage(result), failure);
|
|
154
|
+
}
|
|
155
|
+
/** `publish.git` is required for the Git target; a missing URL is a config error. */
|
|
156
|
+
function gitUrl(publish) {
|
|
157
|
+
if (publish.git === undefined) {
|
|
158
|
+
throw new MetafabError("The Git target requires publish.git.", {
|
|
159
|
+
exitCode: ExitCode.Failed,
|
|
160
|
+
code: "publish-missing-setting",
|
|
161
|
+
problems: [
|
|
162
|
+
{
|
|
163
|
+
level: "error",
|
|
164
|
+
file: ".factory/metafab.yaml",
|
|
165
|
+
message: "The Git target requires publish.git.",
|
|
166
|
+
fix: 'Add "git" to the publish section',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
// `check` accepts the import form, so `publish.git` may be written as
|
|
172
|
+
// `git+https://`, `git+ssh://` or `git+file://`. Git has no `git+` transport
|
|
173
|
+
// and would fail with `remote-git+https is not a git command`.
|
|
174
|
+
return gitTransportUrl(publish.git);
|
|
175
|
+
}
|
|
176
|
+
async function cloneFab(url, parent, context) {
|
|
177
|
+
const repo = path.join(parent, "fab");
|
|
178
|
+
await runGit(["clone", "--", url, repo], parent, context, [], gitFailureError(`Cannot clone fab repository ${stripSourceCredentials(url)}`));
|
|
179
|
+
// The clone has already checked its branch out, and the attributes apply to
|
|
180
|
+
// every checkout and add that follows, so the publish and the
|
|
181
|
+
// identical-content comparison both store the staged bytes. An `init.templateDir`
|
|
182
|
+
// without `info/` leaves the directory out, so create it first.
|
|
183
|
+
await mkdir(path.join(repo, ".git", "info"), { recursive: true });
|
|
184
|
+
writeFileSync(path.join(repo, ".git", "info", "attributes"), VERBATIM_ATTRIBUTES);
|
|
185
|
+
return repo;
|
|
186
|
+
}
|
|
187
|
+
async function tagExistsRemotely(url, tag, context) {
|
|
188
|
+
const ref = `refs/tags/${tag}`;
|
|
189
|
+
const output = await runGit(["ls-remote", "--tags", "--refs", "--", url], process.cwd(), context, [], gitFailureError(`Cannot read tags from fab repository ${stripSourceCredentials(url)}`));
|
|
190
|
+
return output.split("\n").some((line) => line.split("\t")[1]?.trim() === ref);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The tag's tree and the staged fab are compared by Git itself: the tag is
|
|
194
|
+
* checked out, the staged fab replaces the tracked files, and Git decides
|
|
195
|
+
* whether anything changed. The clone stores bytes verbatim (see
|
|
196
|
+
* `VERBATIM_ATTRIBUTES`), so line endings, filters and modes count exactly as
|
|
197
|
+
* Git stores them, and a round trip through a clone is not a difference.
|
|
198
|
+
*/
|
|
199
|
+
async function tagTreeMatches(repo, tag, root, context) {
|
|
200
|
+
await runGit(["checkout", "--quiet", "--force", "--detach", `refs/tags/${tag}`], repo, context, [], gitFailureError(`Cannot read tag ${tag}`));
|
|
201
|
+
await runGit(["rm", "-r", "-q", "-f", "--ignore-unmatch", "."], repo, context, [], gitFailureError("Cannot compare the fab repository files"));
|
|
202
|
+
await copyTree(root, repo, { ignore: (relativePath) => NPM_ONLY_FILES.has(relativePath) });
|
|
203
|
+
await addFabFiles(repo, context, "Cannot compare the fab repository files");
|
|
204
|
+
const differences = await tryGit(["diff", "--cached", "--quiet"], repo, context);
|
|
205
|
+
if (differences.ok)
|
|
206
|
+
return true;
|
|
207
|
+
// `--quiet` exits 1 only to report differences; any other failure is a Git
|
|
208
|
+
// error, not a changed fab.
|
|
209
|
+
if (differences.status === 1)
|
|
210
|
+
return false;
|
|
211
|
+
throw gitFailureError(`Cannot compare tag ${tag} with the staged fab`)(gitMessage(differences));
|
|
212
|
+
}
|
|
213
|
+
function filesLostError(missing, extra, changed = []) {
|
|
214
|
+
const problems = [
|
|
215
|
+
...missing.map((file) => ({
|
|
216
|
+
level: "error",
|
|
217
|
+
file,
|
|
218
|
+
message: `Git did not stage ${file}`,
|
|
219
|
+
fix: "Rename the path or add it to publish.exclude; Git cannot store it in a fab",
|
|
220
|
+
})),
|
|
221
|
+
...changed.map((file) => ({
|
|
222
|
+
level: "error",
|
|
223
|
+
file,
|
|
224
|
+
message: `Git stored different bytes for ${file}`,
|
|
225
|
+
fix: "Report this at https://github.com/seasb/metafab/issues",
|
|
226
|
+
})),
|
|
227
|
+
...extra.map((file) => ({
|
|
228
|
+
level: "error",
|
|
229
|
+
file,
|
|
230
|
+
message: `Git staged ${file}, which the staged fab does not carry`,
|
|
231
|
+
fix: "Report this at https://github.com/seasb/metafab/issues",
|
|
232
|
+
})),
|
|
233
|
+
];
|
|
234
|
+
const message = missing.length === 0 && extra.length === 0
|
|
235
|
+
? "The Git fab would store different bytes than the staged fab."
|
|
236
|
+
: "The Git fab would not carry every staged file.";
|
|
237
|
+
return new MetafabError(message, {
|
|
238
|
+
exitCode: ExitCode.InvalidFab,
|
|
239
|
+
code: "publish-git-files-lost",
|
|
240
|
+
problems,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/** The blob id and path of every index entry, as `git ls-files -s -z` reports them. */
|
|
244
|
+
function indexBlobs(listed) {
|
|
245
|
+
const entries = new Map();
|
|
246
|
+
for (const record of listed.split("\0")) {
|
|
247
|
+
if (record === "")
|
|
248
|
+
continue;
|
|
249
|
+
const tab = record.indexOf("\t");
|
|
250
|
+
if (tab < 0)
|
|
251
|
+
continue;
|
|
252
|
+
const [mode, blob] = record.slice(0, tab).split(" ");
|
|
253
|
+
if (mode === undefined || blob === undefined || blob === "")
|
|
254
|
+
continue;
|
|
255
|
+
entries.set(record.slice(tab + 1), blob);
|
|
256
|
+
}
|
|
257
|
+
return entries;
|
|
258
|
+
}
|
|
259
|
+
/** The blob id Git would store for each staged file, with no filter applied. */
|
|
260
|
+
async function stagedBlobs(repo, root, expected, context) {
|
|
261
|
+
const failure = gitFailureError("Cannot compare the staged fab with the Git index");
|
|
262
|
+
const batch = [];
|
|
263
|
+
const single = [];
|
|
264
|
+
for (const file of expected) {
|
|
265
|
+
const absolute = path.join(root, ...file.split("/"));
|
|
266
|
+
// `--stdin-paths` reads one path per line, so a name that contains a line
|
|
267
|
+
// break would be read as two paths. Those files are hashed one at a time,
|
|
268
|
+
// so Git still computes the id in the repository's own object format.
|
|
269
|
+
(absolute.includes("\n") || absolute.includes("\r") ? single : batch).push({ file, absolute });
|
|
270
|
+
}
|
|
271
|
+
const blobs = new Map();
|
|
272
|
+
if (batch.length > 0) {
|
|
273
|
+
const output = await runGit(["hash-object", "--no-filters", "--stdin-paths"], repo, context, [], failure, batch.map((entry) => `${entry.absolute}\n`).join(""));
|
|
274
|
+
const hashes = output.split("\n").filter((hash) => hash !== "");
|
|
275
|
+
if (hashes.length !== batch.length) {
|
|
276
|
+
throw failure("git hash-object returned a different number of ids than the staged files");
|
|
277
|
+
}
|
|
278
|
+
batch.forEach((entry, index) => blobs.set(entry.file, hashes[index]));
|
|
279
|
+
}
|
|
280
|
+
for (const entry of single) {
|
|
281
|
+
const output = await runGit(["hash-object", "--no-filters", "--", entry.absolute], repo, context, [], failure);
|
|
282
|
+
blobs.set(entry.file, output.trim());
|
|
283
|
+
}
|
|
284
|
+
return blobs;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The safety net for the Git target: `git add --force` covers the ignore rules,
|
|
288
|
+
* and the clone stores bytes verbatim, but Git can still keep a file out of the
|
|
289
|
+
* index, store different bytes for it, or add one the fab lacks. After staging,
|
|
290
|
+
* the index is compared with the staged fab by path and blob id, and a
|
|
291
|
+
* difference stops the publish before the commit names a tree that is not the
|
|
292
|
+
* fab. The problems name every path.
|
|
293
|
+
*/
|
|
294
|
+
export async function verifyGitIndex(repo, root, options = {}) {
|
|
295
|
+
const context = gitContext(options);
|
|
296
|
+
const listed = await runGit(["ls-files", "-s", "-z"], repo, context, [], gitFailureError("Cannot read the fab repository files"));
|
|
297
|
+
const tracked = indexBlobs(listed);
|
|
298
|
+
const expected = (await listFiles(root)).filter((file) => !NPM_ONLY_FILES.has(file));
|
|
299
|
+
const expectedSet = new Set(expected);
|
|
300
|
+
const blobs = await stagedBlobs(repo, root, expected, context);
|
|
301
|
+
const missing = expected.filter((file) => !tracked.has(file));
|
|
302
|
+
const changed = expected.filter((file) => tracked.has(file) && tracked.get(file) !== blobs.get(file));
|
|
303
|
+
const extra = [...tracked.keys()].filter((file) => !expectedSet.has(file)).sort();
|
|
304
|
+
if (missing.length === 0 && changed.length === 0 && extra.length === 0)
|
|
305
|
+
return;
|
|
306
|
+
throw filesLostError(missing, extra, changed);
|
|
307
|
+
}
|
|
308
|
+
/** Whether the fab repository already has `v<version>`, and with which content. */
|
|
309
|
+
export async function gitVersionState(publish, version, root, options = {}) {
|
|
310
|
+
const url = gitUrl(publish);
|
|
311
|
+
const context = gitContext(options);
|
|
312
|
+
const tag = `v${version}`;
|
|
313
|
+
if (!(await tagExistsRemotely(url, tag, context))) {
|
|
314
|
+
return { tagExists: false, identical: false };
|
|
315
|
+
}
|
|
316
|
+
const scratch = await mkdtemp(path.join(tmpdir(), "metafab-publish-check-"));
|
|
317
|
+
try {
|
|
318
|
+
const repo = await cloneFab(url, scratch, context);
|
|
319
|
+
return { tagExists: true, identical: await tagTreeMatches(repo, tag, root, context) };
|
|
320
|
+
}
|
|
321
|
+
finally {
|
|
322
|
+
await rm(scratch, { recursive: true, force: true });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
async function hasCommits(repo, context) {
|
|
326
|
+
const result = await tryGit(["rev-parse", "--verify", "--quiet", "HEAD"], repo, context);
|
|
327
|
+
return result.ok && result.stdout.trim() !== "";
|
|
328
|
+
}
|
|
329
|
+
async function defaultBranch(repo, context) {
|
|
330
|
+
const result = await tryGit(["symbolic-ref", "--quiet", "refs/remotes/origin/HEAD"], repo, context);
|
|
331
|
+
if (!result.ok)
|
|
332
|
+
return undefined;
|
|
333
|
+
const prefix = "refs/remotes/origin/";
|
|
334
|
+
const ref = result.stdout.trim();
|
|
335
|
+
return ref.startsWith(prefix) ? ref.slice(prefix.length) : undefined;
|
|
336
|
+
}
|
|
337
|
+
async function checkoutBranch(repo, branch, context) {
|
|
338
|
+
if (!(await hasCommits(repo, context))) {
|
|
339
|
+
await runGit(["checkout", "--quiet", "-B", branch], repo, context, [], gitFailureError(`Cannot start branch "${branch}"`));
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const remote = await tryGit(["rev-parse", "--verify", "--quiet", `refs/remotes/origin/${branch}`], repo, context);
|
|
343
|
+
if (!remote.ok) {
|
|
344
|
+
const problem = {
|
|
345
|
+
level: "error",
|
|
346
|
+
file: ".factory/metafab.yaml",
|
|
347
|
+
message: `The fab repository has no branch "${branch}".`,
|
|
348
|
+
fix: `Set publish.branch to an existing branch, or create "${branch}" in the fab repository`,
|
|
349
|
+
};
|
|
350
|
+
throw new MetafabError(`The fab repository has no branch "${branch}".`, {
|
|
351
|
+
exitCode: ExitCode.Failed,
|
|
352
|
+
code: "publish-git-branch-missing",
|
|
353
|
+
problems: [problem],
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
await runGit(["checkout", "--quiet", "-B", branch, `origin/${branch}`], repo, context, [], gitFailureError(`Cannot check out branch "${branch}"`));
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* The branch head must be a commit an earlier `publish` tagged, so a hand edit
|
|
360
|
+
* in the fab repository is reported instead of silently overwritten. An empty
|
|
361
|
+
* repository has no head and passes.
|
|
362
|
+
*/
|
|
363
|
+
async function publishOwnsHead(repo, branch, context) {
|
|
364
|
+
if (!(await hasCommits(repo, context)))
|
|
365
|
+
return;
|
|
366
|
+
const tags = await runGit(["tag", "--points-at", "HEAD"], repo, context, [], gitFailureError("Cannot read the branch tags"));
|
|
367
|
+
for (const tag of tags.split("\n").map((line) => line.trim()).filter((line) => line !== "")) {
|
|
368
|
+
const info = await tryGit(["for-each-ref", `refs/tags/${tag}`, "--format=%(objecttype)%00%(contents:subject)"], repo, context);
|
|
369
|
+
if (!info.ok)
|
|
370
|
+
continue;
|
|
371
|
+
const [type, subject] = info.stdout.split("\0");
|
|
372
|
+
// A lightweight tag reports the commit's own subject, not a tag message.
|
|
373
|
+
if (type === "tag" && subject !== undefined && subject.trim().startsWith(`${TAG_MESSAGE} `)) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const problem = {
|
|
378
|
+
level: "error",
|
|
379
|
+
file: ".factory/metafab.yaml",
|
|
380
|
+
message: `The head of "${branch}" is not tagged by an earlier publish.`,
|
|
381
|
+
fix: "Revert the commits made directly in the fab repository, then publish again",
|
|
382
|
+
};
|
|
383
|
+
throw new MetafabError(`The Git fab repository branch "${branch}" was changed outside metafab publish.`, { exitCode: ExitCode.NotOwned, code: "publish-git-not-ours", problems: [problem] });
|
|
384
|
+
}
|
|
385
|
+
/** The identity flags for a commit or a tag when the user has none configured. */
|
|
386
|
+
async function identityConfig(repo, context) {
|
|
387
|
+
const [name, email] = await Promise.all([
|
|
388
|
+
tryGit(["config", "--get", "user.name"], repo, context),
|
|
389
|
+
tryGit(["config", "--get", "user.email"], repo, context),
|
|
390
|
+
]);
|
|
391
|
+
if (name.ok && name.stdout.trim() !== "" && email.ok && email.stdout.trim() !== "")
|
|
392
|
+
return [];
|
|
393
|
+
return ["-c", `user.name=${FALLBACK_NAME}`, "-c", `user.email=${FALLBACK_EMAIL}`];
|
|
394
|
+
}
|
|
395
|
+
function versionExistsError(version, url) {
|
|
396
|
+
return new MetafabError(`The fab repository ${stripSourceCredentials(url)} already has tag v${version}.`, {
|
|
397
|
+
exitCode: ExitCode.Failed,
|
|
398
|
+
code: "publish-version-exists",
|
|
399
|
+
problems: [
|
|
400
|
+
{
|
|
401
|
+
level: "error",
|
|
402
|
+
file: ".factory/metafab.yaml",
|
|
403
|
+
message: `Tag v${version} already exists in the fab repository.`,
|
|
404
|
+
fix: "Bump publish.version; a published version cannot change",
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Replaces the fab repository branch with the staged fab, then pushes the
|
|
411
|
+
* commit and the annotated release tag atomically. Nothing in the project
|
|
412
|
+
* repository is read or written.
|
|
413
|
+
*/
|
|
414
|
+
export async function publishGitFab(publish, version, root, options = {}) {
|
|
415
|
+
const url = gitUrl(publish);
|
|
416
|
+
const context = gitContext(options);
|
|
417
|
+
const tag = `v${version}`;
|
|
418
|
+
const scratch = await mkdtemp(path.join(tmpdir(), "metafab-publish-push-"));
|
|
419
|
+
try {
|
|
420
|
+
const repo = await cloneFab(url, scratch, context);
|
|
421
|
+
const remoteDefault = await defaultBranch(repo, context);
|
|
422
|
+
const branch = publish.branch ?? remoteDefault ?? "main";
|
|
423
|
+
await checkoutBranch(repo, branch, context);
|
|
424
|
+
const existing = await tryGit(["rev-parse", "--verify", "--quiet", `refs/tags/${tag}`], repo, context);
|
|
425
|
+
if (existing.ok)
|
|
426
|
+
throw versionExistsError(version, url);
|
|
427
|
+
await publishOwnsHead(repo, branch, context);
|
|
428
|
+
const committed = await hasCommits(repo, context);
|
|
429
|
+
if (committed) {
|
|
430
|
+
await runGit(["rm", "-r", "-q", "."], repo, context, [], gitFailureError("Cannot replace the fab repository files"));
|
|
431
|
+
}
|
|
432
|
+
await copyTree(root, repo, { ignore: (relativePath) => NPM_ONLY_FILES.has(relativePath) });
|
|
433
|
+
await addFabFiles(repo, context, "Cannot stage the fab");
|
|
434
|
+
// Staging and the commit must name the same tree: a file Git left out would
|
|
435
|
+
// be reported as published while the tag never carried it.
|
|
436
|
+
await verifyGitIndex(repo, root, options);
|
|
437
|
+
const identity = await identityConfig(repo, context);
|
|
438
|
+
await runGit(["commit", "--allow-empty", "--quiet", "-m", `Publish ${version}`], repo, context, identity, gitFailureError("Cannot commit the fab"));
|
|
439
|
+
await runGit(["tag", "-a", tag, "-m", `${TAG_MESSAGE} ${version}`], repo, context, identity, gitFailureError(`Cannot create tag ${tag}`));
|
|
440
|
+
await runGit(["push", "--atomic", "origin", branch, tag], repo, context, [], gitFailureError(`Cannot push ${tag} to ${stripSourceCredentials(url)}`));
|
|
441
|
+
return `Published ${version} to ${branch} in ${stripSourceCredentials(url)}.`;
|
|
442
|
+
}
|
|
443
|
+
finally {
|
|
444
|
+
await rm(scratch, { recursive: true, force: true });
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
//# sourceMappingURL=git-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-target.js","sourceRoot":"","sources":["../../../src/core/publish/git-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBA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
|
+
export * from "./stage.js";
|
|
4
|
+
export * from "./readme.js";
|
|
5
|
+
export * from "./package-json.js";
|
|
6
|
+
export * from "./prepare.js";
|
|
7
|
+
export * from "./provenance.js";
|
|
8
|
+
export * from "./npm-target.js";
|
|
9
|
+
export * from "./git-target.js";
|
|
10
|
+
export * from "./publish.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./exclude.js";
|
|
3
|
+
export * from "./stage.js";
|
|
4
|
+
export * from "./readme.js";
|
|
5
|
+
export * from "./package-json.js";
|
|
6
|
+
export * from "./prepare.js";
|
|
7
|
+
export * from "./provenance.js";
|
|
8
|
+
export * from "./npm-target.js";
|
|
9
|
+
export * from "./git-target.js";
|
|
10
|
+
export * from "./publish.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/publish/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PublishConfig } from "../config/types.js";
|
|
2
|
+
import type { PublishOptions } from "./types.js";
|
|
3
|
+
export interface NpmVersionState {
|
|
4
|
+
/** The registry has this exact version. */
|
|
5
|
+
exists: boolean;
|
|
6
|
+
/** The registry's tarball has the same bytes as packing the staged fab. */
|
|
7
|
+
identical: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Whether `name@version` is on the registry, and if so whether it carries the
|
|
11
|
+
* same tarball as the staged fab would. A 404 means the version is new.
|
|
12
|
+
*/
|
|
13
|
+
export declare function npmVersionState(publish: PublishConfig, version: string, root: string, options?: PublishOptions): Promise<NpmVersionState>;
|
|
14
|
+
/** `npm publish` in the staging directory, streaming its output to the report's stderr. */
|
|
15
|
+
export declare function publishNpmFab(publish: PublishConfig, version: string, root: string, options?: PublishOptions): Promise<string>;
|