@r_masseater/msch 0.93.0 → 0.95.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 +1 -1
- package/dist/{base-revision-C9RxuIMK.mjs → base-revision-uiUwYlbc.mjs} +2 -2
- package/dist/{base-revision-C9RxuIMK.mjs.map → base-revision-uiUwYlbc.mjs.map} +1 -1
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/changed.mjs +5 -5
- package/dist/cli.mjs +496 -382
- package/dist/cli.mjs.map +1 -1
- package/dist/collections-CdEHfcEj.mjs +6 -0
- package/dist/collections-CdEHfcEj.mjs.map +1 -0
- package/dist/config-BBdsNPSO.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-GWsBHDRn.mjs → define-lint-preset-BjHY5WNt.mjs} +57 -38
- package/dist/define-lint-preset-BjHY5WNt.mjs.map +1 -0
- package/dist/exits.mjs +4 -4
- package/dist/{ignored-directories-Ce-45yzO.mjs → ignored-directories-BRRODOoG.mjs} +2 -2
- package/dist/{ignored-directories-Ce-45yzO.mjs.map → ignored-directories-BRRODOoG.mjs.map} +1 -1
- package/dist/index-skill-Bf5Ish11.mjs +19 -0
- package/dist/index-skill-Bf5Ish11.mjs.map +1 -0
- package/dist/judge.mjs +4 -4
- package/dist/lint.mjs +1 -1
- package/dist/{lookup-report-DVJg0K4Z.mjs → lookup-report-BWiDFlSS.mjs} +3 -3
- package/dist/{lookup-report-DVJg0K4Z.mjs.map → lookup-report-BWiDFlSS.mjs.map} +1 -1
- package/dist/{manifest-texts-B69vIp7o.mjs → manifest-texts-Bhlz2Z2_.mjs} +2 -2
- package/dist/{manifest-texts-B69vIp7o.mjs.map → manifest-texts-Bhlz2Z2_.mjs.map} +1 -1
- package/dist/{output-B_YPmKad.mjs → output-B4GNchqH.mjs} +3 -3
- package/dist/{output-B_YPmKad.mjs.map → output-B4GNchqH.mjs.map} +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/package-routes-BdYpOLTv.mjs +73 -0
- package/dist/package-routes-BdYpOLTv.mjs.map +1 -0
- package/dist/{package-versions-PMKDR-bJ.mjs → package-versions-BLtKon6D.mjs} +4 -4
- package/dist/{package-versions-PMKDR-bJ.mjs.map → package-versions-BLtKon6D.mjs.map} +1 -1
- package/dist/{pass-records-CBvMwfN3.mjs → pass-records-ljpQ--tm.mjs} +4 -4
- package/dist/{pass-records-CBvMwfN3.mjs.map → pass-records-ljpQ--tm.mjs.map} +1 -1
- package/dist/{problem-CUIz4TEI.mjs → problem-Bi4Kgg9b.mjs} +2 -2
- package/dist/{problem-CUIz4TEI.mjs.map → problem-Bi4Kgg9b.mjs.map} +1 -1
- package/dist/publish.mjs +56 -100
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-B5LA4ZlS.mjs → published-BGur-Htr.mjs} +9 -5
- package/dist/{published-B5LA4ZlS.mjs.map → published-BGur-Htr.mjs.map} +1 -1
- package/dist/published.mjs +15 -18
- package/dist/published.mjs.map +1 -1
- package/dist/refs.mjs +7 -7
- package/dist/refs.mjs.map +1 -1
- package/dist/registries-DePiYd3D.mjs +11 -0
- package/dist/registries-DePiYd3D.mjs.map +1 -0
- package/dist/{registry-releases-Dj6jH8Yt.mjs → registry-releases-CaO-8xAO.mjs} +3 -3
- package/dist/registry-releases-CaO-8xAO.mjs.map +1 -0
- package/dist/{repository-files-B6PEvKWe.mjs → repository-files-hbJpQ1i0.mjs} +9 -5
- package/dist/repository-files-hbJpQ1i0.mjs.map +1 -0
- package/dist/{runtime-C8OGDSk9.mjs → runtime-BdEuIL6Z.mjs} +2 -2
- package/dist/{runtime-C8OGDSk9.mjs.map → runtime-BdEuIL6Z.mjs.map} +1 -1
- package/dist/unbumped.mjs +5 -5
- package/dist/{upstream-exits-nTTh2qcD.mjs → upstream-exits-BC8ofnVa.mjs} +7 -7
- package/dist/{upstream-exits-nTTh2qcD.mjs.map → upstream-exits-BC8ofnVa.mjs.map} +1 -1
- package/dist/{upstream-record-DlluH3fY.mjs → upstream-record-I5ZgAwk-.mjs} +3 -2
- package/dist/{upstream-record-DlluH3fY.mjs.map → upstream-record-I5ZgAwk-.mjs.map} +1 -1
- package/dist/upstream.mjs +7 -8
- package/dist/upstream.mjs.map +1 -1
- package/dist/{workspace-projects-B-vCr6bx.mjs → workspace-projects-DnWDM8G1.mjs} +2 -2
- package/dist/{workspace-projects-B-vCr6bx.mjs.map → workspace-projects-DnWDM8G1.mjs.map} +1 -1
- package/dist/workspace-settings.mjs +4 -4
- package/package.json +4 -5
- package/skills/msch-checks/SKILL.md +3 -3
- package/skills/msch-publishing/SKILL.md +5 -5
- package/skills/msch-repository-config/SKILL.md +20 -33
- package/skills/msch-workspace-settings/SKILL.md +1 -0
- package/src/app/vite.d.ts +1 -34
- package/dist/credential-broker-PkIpsaMh.mjs +0 -29
- package/dist/credential-broker-PkIpsaMh.mjs.map +0 -1
- package/dist/define-lint-preset-GWsBHDRn.mjs.map +0 -1
- package/dist/owner-settings-BAh-fFKg.mjs +0 -122
- package/dist/owner-settings-BAh-fFKg.mjs.map +0 -1
- package/dist/package-routes-DQmhjX07.mjs +0 -82
- package/dist/package-routes-DQmhjX07.mjs.map +0 -1
- package/dist/registry-releases-Dj6jH8Yt.mjs.map +0 -1
- package/dist/repository-files-B6PEvKWe.mjs.map +0 -1
- package/dist/wake.d.mts +0 -1
- package/dist/wake.mjs +0 -34
- package/dist/wake.mjs.map +0 -1
package/dist/publish.mjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as runCli } from "./runtime-
|
|
3
|
-
import {
|
|
4
|
-
import { n as repositoryBroker, t as actionsOidcToken } from "./credential-broker-PkIpsaMh.mjs";
|
|
2
|
+
import { t as runCli } from "./runtime-BdEuIL6Z.mjs";
|
|
3
|
+
import { n as PUBLIC_REGISTRY } from "./registries-DePiYd3D.mjs";
|
|
5
4
|
import { Array, Config, Console, Effect, FileSystem, Option, Order, Path, Predicate, Record, Schedule, Schema, Stdio, String as String$1, pipe } from "effect";
|
|
6
5
|
import { PACKAGE_JSON_FILE, ROOT_SUBPATH, exportEntriesOf, importSpecifierOf, runtimeDependencyNames, unscopedNameOf } from "@r_masseater/masseater-utils/kestrion";
|
|
7
6
|
import { decodePackageJson, readPackageJson, readRawPackageJson, readVersionedPackageJson, updatePackageJson, writePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
|
|
8
7
|
import semver from "semver";
|
|
9
|
-
import { HttpClient,
|
|
8
|
+
import { HttpClient, HttpClientResponse } from "effect/http";
|
|
10
9
|
import { dual } from "effect/Function";
|
|
11
|
-
import { finished,
|
|
10
|
+
import { finished, mustSucceed, outputOf, succeeds, writeOutputs } from "@r_masseater/masseater-utils/github-workflow";
|
|
12
11
|
import { arch, platform } from "node:os";
|
|
13
12
|
import { Base64 } from "effect/encoding";
|
|
14
13
|
// src/features/publish-workspace/model/export-targets.ts
|
|
@@ -154,7 +153,8 @@ const loadsCleanly = ({ runtime, consumer, failure, args }) => mustSucceed({
|
|
|
154
153
|
const PLUGIN_FILE = ".claude-plugin/plugin.json";
|
|
155
154
|
const PACKED_ROOT = "package";
|
|
156
155
|
const NPM_LOCK$1 = "package-lock.json";
|
|
157
|
-
const
|
|
156
|
+
const MINIMUM_RELEASE_AGE_DAYS = 1;
|
|
157
|
+
const SCOPE = /^@[^/]+\//u;
|
|
158
158
|
/** @internal */
|
|
159
159
|
const PLUGIN_LOCK = "npm-shrinkwrap.json";
|
|
160
160
|
/** @internal */
|
|
@@ -191,22 +191,40 @@ const installsDependencies = Effect.fn("publish.installsDependencies")(function*
|
|
|
191
191
|
return pipe(Option.fromUndefinedOr(dependencies), Option.exists((held) => !Record.isEmptyRecord(held)));
|
|
192
192
|
});
|
|
193
193
|
/** @internal */
|
|
194
|
+
const agedFlags = ({ name, direct }) => pipe(Option.fromNullishOr(SCOPE.exec(name)), Option.map(([scope]) => `${scope}*`), Option.toArray, Array.appendAll(direct), Array.map((excluded) => `--min-release-age-exclude=${excluded}`), Array.prepend(`--min-release-age=${String(MINIMUM_RELEASE_AGE_DAYS)}`));
|
|
195
|
+
const npmLock = (root, flags) => mustSucceed({
|
|
196
|
+
command: "npm",
|
|
197
|
+
args: [
|
|
198
|
+
"install",
|
|
199
|
+
"--package-lock-only",
|
|
200
|
+
`--registry=${PUBLIC_REGISTRY}`,
|
|
201
|
+
...flags,
|
|
202
|
+
...NPM_QUIET
|
|
203
|
+
],
|
|
204
|
+
cwd: root
|
|
205
|
+
});
|
|
206
|
+
const lockedOf = Effect.fn("publish.lockedOf")(function* lockedOf(root) {
|
|
207
|
+
const { name, dependencies } = yield* readVersionedPackageJson(root);
|
|
208
|
+
const direct = Record.keys(dependencies ?? {});
|
|
209
|
+
if (Array.isReadonlyArrayEmpty(direct)) return Option.none();
|
|
210
|
+
return Option.some({
|
|
211
|
+
name,
|
|
212
|
+
direct
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
const writeLock = (root, locked) => npmLock(root, agedFlags(locked)).pipe(Effect.matchEffect({
|
|
216
|
+
onFailure: () => Console.warn(`${locked.name}: no dependency set is a day old, so the lock takes newer versions`).pipe(Effect.andThen(npmLock(root, []))),
|
|
217
|
+
onSuccess: () => Effect.void
|
|
218
|
+
}));
|
|
219
|
+
/** @internal */
|
|
194
220
|
const lockPlugin = Effect.fn("publish.lockPlugin")(function* lockPlugin(tarball, temporary) {
|
|
195
221
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
196
222
|
const path = yield* Path.Path;
|
|
197
|
-
const
|
|
198
|
-
const root = yield* unpacked(tarball,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
args: [
|
|
203
|
-
"install",
|
|
204
|
-
"--package-lock-only",
|
|
205
|
-
`--registry=${NPM_REGISTRY}`,
|
|
206
|
-
...NPM_QUIET
|
|
207
|
-
],
|
|
208
|
-
cwd: root
|
|
209
|
-
});
|
|
223
|
+
const unpackedTo = path.join(temporary, "locked");
|
|
224
|
+
const root = yield* unpacked(tarball, unpackedTo);
|
|
225
|
+
const locked = yield* lockedOf(root);
|
|
226
|
+
if (Option.isNone(locked)) return;
|
|
227
|
+
yield* writeLock(root, locked.value);
|
|
210
228
|
yield* fileSystem.rename(path.join(root, NPM_LOCK$1), path.join(root, PLUGIN_LOCK));
|
|
211
229
|
yield* mustSucceed({
|
|
212
230
|
command: "tar",
|
|
@@ -214,7 +232,7 @@ const lockPlugin = Effect.fn("publish.lockPlugin")(function* lockPlugin(tarball,
|
|
|
214
232
|
"-czf",
|
|
215
233
|
tarball,
|
|
216
234
|
"-C",
|
|
217
|
-
|
|
235
|
+
unpackedTo,
|
|
218
236
|
PACKED_ROOT
|
|
219
237
|
]
|
|
220
238
|
});
|
|
@@ -625,33 +643,6 @@ const checkCompat = Effect.fn("publish.compat")(function* checkCompat(directory)
|
|
|
625
643
|
});
|
|
626
644
|
return yield* checkPluginInstall(directory, manifest, tarballsFor({})(local));
|
|
627
645
|
}, Effect.scoped);
|
|
628
|
-
// src/features/publish-workspace/model/broker.ts
|
|
629
|
-
const Issued = Schema.Record(Schema.String, Schema.Unknown);
|
|
630
|
-
const issued = Effect.fn("publish.issued")(function* issued(broker, oidc, { kind, field }) {
|
|
631
|
-
const client = yield* HttpClient.HttpClient;
|
|
632
|
-
const request = HttpClientRequest.post(`${broker.url}?only=${kind}`).pipe(HttpClientRequest.bearerToken(oidc));
|
|
633
|
-
const response = yield* HttpClient.filterStatusOk(client).execute(request);
|
|
634
|
-
const body = yield* HttpClientResponse.schemaBodyJson(Issued)(response);
|
|
635
|
-
const token = Option.filter(Option.fromNullishOr(body[field]), (value) => typeof value === "string" && value !== "");
|
|
636
|
-
yield* Effect.forEach(Option.toArray(token), mask, {
|
|
637
|
-
concurrency: 1,
|
|
638
|
-
discard: true
|
|
639
|
-
});
|
|
640
|
-
return token;
|
|
641
|
-
});
|
|
642
|
-
/** @internal */
|
|
643
|
-
const credentialFrom = Effect.fn("publish.credentialFrom")(function* credentialFrom(broker, credential) {
|
|
644
|
-
if (Option.isNone(broker)) return Option.none();
|
|
645
|
-
return yield* actionsOidcToken(broker.value).pipe(Effect.flatMap(Option.match({
|
|
646
|
-
onNone: () => Effect.succeedNone,
|
|
647
|
-
onSome: (oidc) => issued(broker.value, oidc, credential)
|
|
648
|
-
})), Effect.tapError(() => Console.log(`The credential broker gave no ${credential.field}`)), Effect.orElseSucceed(() => Option.none()));
|
|
649
|
-
});
|
|
650
|
-
/** @internal */
|
|
651
|
-
const brokerCredential = Effect.fn("publish.brokerCredential")(function* brokerCredential(credential) {
|
|
652
|
-
const broker = yield* repositoryBroker;
|
|
653
|
-
return yield* credentialFrom(broker, credential);
|
|
654
|
-
});
|
|
655
646
|
// src/features/publish-workspace/model/consumer-build.ts
|
|
656
647
|
const PNPMFILE = ".pnpmfile.cjs";
|
|
657
648
|
const TASK = "msch";
|
|
@@ -884,14 +875,7 @@ const dependentsOf = (known) => (names) => {
|
|
|
884
875
|
if (Array.isReadonlyArrayEmpty(added)) return names;
|
|
885
876
|
return dependentsOf(known)([...names, ...added]);
|
|
886
877
|
};
|
|
887
|
-
const tokenOf =
|
|
888
|
-
const given = yield* Config.option(Config.String("GITHUB_APP_TOKEN"));
|
|
889
|
-
if (Option.isSome(given)) return given;
|
|
890
|
-
return yield* brokerCredential({
|
|
891
|
-
kind: "github",
|
|
892
|
-
field: "githubToken"
|
|
893
|
-
});
|
|
894
|
-
});
|
|
878
|
+
const tokenOf = Config.option(Config.String("GITHUB_APP_TOKEN"));
|
|
895
879
|
const selfOf = Effect.fn("consumers.self")(function* selfOf() {
|
|
896
880
|
const given = yield* Config.option(Config.String("GITHUB_REPOSITORY"));
|
|
897
881
|
if (Option.isSome(given)) return given.value;
|
|
@@ -954,7 +938,7 @@ const verified = Effect.fn("consumers.verified")(function* verified(directories,
|
|
|
954
938
|
/** @internal */
|
|
955
939
|
const checkConsumers = Effect.fn("publish.consumers")(function* checkConsumers(directories) {
|
|
956
940
|
if (Array.isReadonlyArrayEmpty(directories)) return yield* Effect.void;
|
|
957
|
-
const token = yield* tokenOf
|
|
941
|
+
const token = yield* tokenOf;
|
|
958
942
|
const found = yield* consumersAffected(directories, token);
|
|
959
943
|
if (Option.isNone(found)) return yield* unlisted();
|
|
960
944
|
return yield* verified(directories, found.value, token);
|
|
@@ -982,31 +966,24 @@ const WORKSPACE_PROTOCOL = "workspace:";
|
|
|
982
966
|
const READ_CONCURRENCY = 8;
|
|
983
967
|
const WAIT_INTERVAL = "30 seconds";
|
|
984
968
|
const WAIT_ATTEMPTS = 120;
|
|
985
|
-
|
|
986
|
-
const
|
|
969
|
+
/** @internal */
|
|
970
|
+
const REGISTRY_FLAGS = ["--registry", PUBLIC_REGISTRY];
|
|
971
|
+
/** @internal */
|
|
972
|
+
const PUBLISH_FLAGS = [
|
|
987
973
|
"--provenance",
|
|
988
974
|
"--access",
|
|
989
|
-
"public"
|
|
975
|
+
"public",
|
|
976
|
+
...REGISTRY_FLAGS
|
|
990
977
|
];
|
|
991
978
|
/** @internal */
|
|
992
|
-
const publishRegistry = Effect.map(ownerSettings(REPOSITORY_ROOT), ({ publishRegistry: registry }) => registry);
|
|
993
|
-
/** @internal */
|
|
994
|
-
const registryFlags = (registry) => ["--registry", registry];
|
|
995
|
-
/** @internal */
|
|
996
|
-
const publishFlags = (registry) => {
|
|
997
|
-
if (isPublicRegistry(registry)) return [...PUBLIC_FLAGS, ...registryFlags(registry)];
|
|
998
|
-
return registryFlags(registry);
|
|
999
|
-
};
|
|
1000
|
-
/** @internal */
|
|
1001
979
|
const onNpm = Effect.fn("publish.onNpm")(function* onNpm({ directory, name, version }) {
|
|
1002
|
-
const registry = yield* publishRegistry;
|
|
1003
980
|
return yield* succeeds({
|
|
1004
981
|
command: "npm",
|
|
1005
982
|
args: [
|
|
1006
983
|
"view",
|
|
1007
984
|
`${name}@${version}`,
|
|
1008
985
|
"version",
|
|
1009
|
-
...
|
|
986
|
+
...REGISTRY_FLAGS
|
|
1010
987
|
],
|
|
1011
988
|
cwd: directory
|
|
1012
989
|
});
|
|
@@ -1058,8 +1035,6 @@ const Attestations = Schema.Struct({ attestations: Schema.Array(Attestation) });
|
|
|
1058
1035
|
const commitOf = (repository) => (payload) => pipe(Base64.decodeString(payload), Effect.fromResult, Effect.flatMap(Schema.decodeEffect(Statement)), Effect.map(({ predicate }) => pipe(Array.head(predicate.buildDefinition.resolvedDependencies), Option.filter(({ uri }) => String$1.includes(`github.com/${repository}@`)(uri)), Option.map(({ digest }) => digest.gitCommit))), Effect.orElseSucceed(() => Option.none()));
|
|
1059
1036
|
/** @internal */
|
|
1060
1037
|
const provenanceCommit = Effect.fn("publish.provenanceCommit")(function* provenanceCommit({ name, version }) {
|
|
1061
|
-
const registry = yield* publishRegistry;
|
|
1062
|
-
if (!isPublicRegistry(registry)) return Option.none();
|
|
1063
1038
|
const client = yield* HttpClient.HttpClient;
|
|
1064
1039
|
const repository = yield* Config.String("GITHUB_REPOSITORY");
|
|
1065
1040
|
const url = `${ATTESTATIONS}${String$1.replace("/", "%2f")(name)}@${version}`;
|
|
@@ -1079,10 +1054,7 @@ const tagged = Effect.fn("publish.tagged")(function* tagged(tag) {
|
|
|
1079
1054
|
args: ["api", `repos/${repository}/git/ref/tags/${tag}`]
|
|
1080
1055
|
});
|
|
1081
1056
|
});
|
|
1082
|
-
const tokenEnv =
|
|
1083
|
-
kind: "github",
|
|
1084
|
-
field: "githubToken"
|
|
1085
|
-
}).pipe(Effect.map(Option.match({
|
|
1057
|
+
const tokenEnv = Config.option(Config.String("GITHUB_APP_TOKEN")).pipe(Effect.map(Option.match({
|
|
1086
1058
|
onNone: () => ({}),
|
|
1087
1059
|
onSome: (value) => ({ GH_TOKEN: value })
|
|
1088
1060
|
})));
|
|
@@ -1108,8 +1080,7 @@ const createTag = Effect.fn("publish.createTag")(function* createTag({ tag, sha
|
|
|
1108
1080
|
});
|
|
1109
1081
|
const isRelease = (version) => version !== UNVERSIONED && semver.valid(version) !== null && semver.prerelease(version) === null;
|
|
1110
1082
|
const publishedVersions = Effect.fn("publish.publishedVersions")(function* publishedVersions({ directory, manifest }) {
|
|
1111
|
-
|
|
1112
|
-
if (!goesToNpm(manifest) || !isPublicRegistry(registry)) return [];
|
|
1083
|
+
if (!goesToNpm(manifest)) return [];
|
|
1113
1084
|
const text = yield* outputOf({
|
|
1114
1085
|
command: "npm",
|
|
1115
1086
|
args: [
|
|
@@ -1117,7 +1088,7 @@ const publishedVersions = Effect.fn("publish.publishedVersions")(function* publi
|
|
|
1117
1088
|
manifest.name,
|
|
1118
1089
|
"versions",
|
|
1119
1090
|
"--json",
|
|
1120
|
-
...
|
|
1091
|
+
...REGISTRY_FLAGS
|
|
1121
1092
|
],
|
|
1122
1093
|
cwd: directory
|
|
1123
1094
|
}).pipe(Effect.orElseSucceed(() => "[]"));
|
|
@@ -1392,16 +1363,6 @@ const checkChangedCompat = Effect.fn("publish.compatChanged")(function* checkCha
|
|
|
1392
1363
|
return yield* checkConsumers(checked);
|
|
1393
1364
|
});
|
|
1394
1365
|
// src/features/publish-workspace/model/npm.ts
|
|
1395
|
-
const authEnv = Effect.fn("publish.authEnv")(function* authEnv() {
|
|
1396
|
-
const token = yield* brokerCredential({
|
|
1397
|
-
kind: "npm",
|
|
1398
|
-
field: "npmToken"
|
|
1399
|
-
});
|
|
1400
|
-
return Option.match(token, {
|
|
1401
|
-
onNone: () => ({}),
|
|
1402
|
-
onSome: (value) => ({ NODE_AUTH_TOKEN: value })
|
|
1403
|
-
});
|
|
1404
|
-
});
|
|
1405
1366
|
const verifyPackage = Effect.fn("publish.verify")(function* verifyPackage(directory, manifest) {
|
|
1406
1367
|
const tasks = [
|
|
1407
1368
|
"build",
|
|
@@ -1419,8 +1380,7 @@ const verifyPackage = Effect.fn("publish.verify")(function* verifyPackage(direct
|
|
|
1419
1380
|
yield* checkExportTargets(directory);
|
|
1420
1381
|
yield* checkCompat(directory);
|
|
1421
1382
|
});
|
|
1422
|
-
const publishNative = Effect.fn("publish.publishNative")(function* publishNative(target
|
|
1423
|
-
const registry = yield* publishRegistry;
|
|
1383
|
+
const publishNative = Effect.fn("publish.publishNative")(function* publishNative(target) {
|
|
1424
1384
|
const { name, version } = yield* readVersionedPackageJson(target);
|
|
1425
1385
|
if (yield* onNpm({
|
|
1426
1386
|
directory: target,
|
|
@@ -1435,15 +1395,14 @@ const publishNative = Effect.fn("publish.publishNative")(function* publishNative
|
|
|
1435
1395
|
args: [
|
|
1436
1396
|
"publish",
|
|
1437
1397
|
".",
|
|
1438
|
-
...
|
|
1398
|
+
...PUBLISH_FLAGS
|
|
1439
1399
|
],
|
|
1440
|
-
env,
|
|
1441
1400
|
cwd: target
|
|
1442
1401
|
});
|
|
1443
1402
|
return name;
|
|
1444
1403
|
});
|
|
1445
1404
|
const addOptionalDependencies = (directory, names, version) => updatePackageJson(directory, { optionalDependencies: pipe(names, Array.map((name) => [name, version]), Record.fromEntries) }).pipe(Effect.withSpan("publish.optionalDependencies"));
|
|
1446
|
-
const publishNatives = Effect.fn("publish.publishNatives")(function* publishNatives(directory, manifest
|
|
1405
|
+
const publishNatives = Effect.fn("publish.publishNatives")(function* publishNatives(directory, manifest) {
|
|
1447
1406
|
if (Predicate.isUndefined(manifest.native)) return;
|
|
1448
1407
|
const { binary, targets } = manifest.native;
|
|
1449
1408
|
const written = yield* Effect.forEach(targets, (target) => writeNative(directory, {
|
|
@@ -1452,7 +1411,7 @@ const publishNatives = Effect.fn("publish.publishNatives")(function* publishNati
|
|
|
1452
1411
|
binary,
|
|
1453
1412
|
target
|
|
1454
1413
|
}), { concurrency: 1 });
|
|
1455
|
-
const names = yield* Effect.forEach(written,
|
|
1414
|
+
const names = yield* Effect.forEach(written, publishNative, { concurrency: 1 });
|
|
1456
1415
|
yield* addOptionalDependencies(directory, names, manifest.version);
|
|
1457
1416
|
});
|
|
1458
1417
|
/** @internal */
|
|
@@ -1463,18 +1422,15 @@ const publishToNpm = Effect.fn("publish.npm")(function* publishToNpm(directory)
|
|
|
1463
1422
|
...manifest
|
|
1464
1423
|
})) return yield* Console.log(`${manifest.name}@${manifest.version} is already published`);
|
|
1465
1424
|
yield* verifyPackage(directory, manifest);
|
|
1466
|
-
|
|
1467
|
-
yield* publishNatives(directory, manifest, env);
|
|
1425
|
+
yield* publishNatives(directory, manifest);
|
|
1468
1426
|
const tarball = yield* pack(directory);
|
|
1469
|
-
const registry = yield* publishRegistry;
|
|
1470
1427
|
return yield* mustSucceed({
|
|
1471
1428
|
command: "npm",
|
|
1472
1429
|
args: [
|
|
1473
1430
|
"publish",
|
|
1474
1431
|
tarball,
|
|
1475
|
-
...
|
|
1432
|
+
...PUBLISH_FLAGS
|
|
1476
1433
|
],
|
|
1477
|
-
env,
|
|
1478
1434
|
cwd: directory
|
|
1479
1435
|
});
|
|
1480
1436
|
}, Effect.scoped);
|