@monoweave/publish 1.21.0 → 2.1.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/lib/commitPublishChanges.js +16 -24
- package/lib/createReleaseGitTags.js +7 -12
- package/lib/determineGitTags.js +1 -3
- package/lib/getPublishConfig.js +7 -44
- package/lib/getWorkspacesToPublish.js +3 -5
- package/lib/index.d.ts +3 -3
- package/lib/index.js +11 -21
- package/lib/lifecycleExecutor.js +3 -6
- package/lib/pack.js +20 -57
- package/package.json +24 -23
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.pushPublishCommit = exports.createPublishCommit = void 0;
|
|
7
|
-
const git_1 = require("@monoweave/git");
|
|
8
|
-
const logging_1 = __importDefault(require("@monoweave/logging"));
|
|
9
|
-
const createReleaseGitTags_1 = __importDefault(require("./createReleaseGitTags"));
|
|
10
|
-
const createPublishCommit = async ({ config, context, gitTags, }) => {
|
|
1
|
+
import { gitAdd, gitCommit, gitGlob, gitPull, gitPush, gitPushTags, gitResolveSha, } from '@monoweave/git';
|
|
2
|
+
import logging from '@monoweave/logging';
|
|
3
|
+
import createReleaseGitTags from './createReleaseGitTags.js';
|
|
4
|
+
export const createPublishCommit = async ({ config, context, gitTags, }) => {
|
|
11
5
|
if (config.dryRun) {
|
|
12
|
-
|
|
6
|
+
logging.info('[Publish] Creating publish commit', {
|
|
13
7
|
report: context?.report,
|
|
14
8
|
});
|
|
15
9
|
return undefined;
|
|
@@ -19,7 +13,7 @@ const createPublishCommit = async ({ config, context, gitTags, }) => {
|
|
|
19
13
|
// that we're running monoweave against since this marks the commit as the
|
|
20
14
|
// "last one published". This informs later monoweave runs so that they don't republish
|
|
21
15
|
// the changes.
|
|
22
|
-
await (
|
|
16
|
+
await createReleaseGitTags({
|
|
23
17
|
config,
|
|
24
18
|
context,
|
|
25
19
|
gitTags,
|
|
@@ -38,14 +32,14 @@ const createPublishCommit = async ({ config, context, gitTags, }) => {
|
|
|
38
32
|
if (config.conventionalChangelogConfig === false && config.versionStrategy?.versionFolder) {
|
|
39
33
|
globs.push(`${config.versionStrategy?.versionFolder}/*.md`);
|
|
40
34
|
}
|
|
41
|
-
const files = globs.length ? await
|
|
35
|
+
const files = globs.length ? await gitGlob(globs, { cwd: config.cwd, context }) : [];
|
|
42
36
|
if (files.length) {
|
|
43
|
-
await
|
|
44
|
-
await
|
|
37
|
+
await gitAdd(files, { cwd: config.cwd, context });
|
|
38
|
+
await gitCommit(config.autoCommitMessage, { cwd: config.cwd, context });
|
|
45
39
|
}
|
|
46
40
|
}
|
|
47
41
|
if (config.git.push && config.autoCommit) {
|
|
48
|
-
await
|
|
42
|
+
await gitPull({
|
|
49
43
|
cwd: config.cwd,
|
|
50
44
|
remote: config.git.remote,
|
|
51
45
|
context,
|
|
@@ -59,28 +53,27 @@ const createPublishCommit = async ({ config, context, gitTags, }) => {
|
|
|
59
53
|
// subject to a race condition where 2 changes going out at the same time might
|
|
60
54
|
// result in the latter change missing commits. This is an inherent flaw with using
|
|
61
55
|
// git tags to determine the last publish checkpoint.
|
|
62
|
-
await (
|
|
56
|
+
await createReleaseGitTags({
|
|
63
57
|
config,
|
|
64
58
|
context,
|
|
65
59
|
gitTags,
|
|
66
60
|
});
|
|
67
61
|
}
|
|
68
|
-
return { headSha: await
|
|
62
|
+
return { headSha: await gitResolveSha('HEAD', { cwd: config.cwd, context }) };
|
|
69
63
|
};
|
|
70
|
-
|
|
71
|
-
const pushPublishCommit = async ({ config, context, gitTags, dryRun = config.dryRun, }) => {
|
|
64
|
+
export const pushPublishCommit = async ({ config, context, gitTags, dryRun = config.dryRun, }) => {
|
|
72
65
|
if (!config.git.push) {
|
|
73
66
|
return;
|
|
74
67
|
}
|
|
75
68
|
if (config.autoCommit) {
|
|
76
|
-
await
|
|
69
|
+
await gitPush({
|
|
77
70
|
cwd: config.cwd,
|
|
78
71
|
remote: config.git.remote,
|
|
79
72
|
context,
|
|
80
73
|
dryRun,
|
|
81
74
|
});
|
|
82
75
|
if (config.git.tag && gitTags?.size) {
|
|
83
|
-
await
|
|
76
|
+
await gitPushTags({
|
|
84
77
|
cwd: config.cwd,
|
|
85
78
|
remote: config.git.remote,
|
|
86
79
|
context,
|
|
@@ -92,7 +85,7 @@ const pushPublishCommit = async ({ config, context, gitTags, dryRun = config.dry
|
|
|
92
85
|
if (config.git.tag && gitTags?.size) {
|
|
93
86
|
// Push tags only outside of auto-commit mode, otherwise
|
|
94
87
|
// we'll push them after we push the commit
|
|
95
|
-
await
|
|
88
|
+
await gitPushTags({
|
|
96
89
|
cwd: config.cwd,
|
|
97
90
|
remote: config.git.remote,
|
|
98
91
|
context,
|
|
@@ -101,4 +94,3 @@ const pushPublishCommit = async ({ config, context, gitTags, dryRun = config.dry
|
|
|
101
94
|
}
|
|
102
95
|
}
|
|
103
96
|
};
|
|
104
|
-
exports.pushPublishCommit = pushPublishCommit;
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const git_1 = require("@monoweave/git");
|
|
7
|
-
const logging_1 = __importDefault(require("@monoweave/logging"));
|
|
1
|
+
import { gitTag } from '@monoweave/git';
|
|
2
|
+
import logging from '@monoweave/logging';
|
|
8
3
|
async function createReleaseGitTags({ config, context, gitTags, }) {
|
|
9
4
|
// packages in a group share the same tag
|
|
10
5
|
const tags = new Set(gitTags.values());
|
|
11
6
|
for (const tag of tags) {
|
|
12
7
|
try {
|
|
13
8
|
if (!config.dryRun) {
|
|
14
|
-
await
|
|
9
|
+
await gitTag(tag, { cwd: config.cwd, context });
|
|
15
10
|
}
|
|
16
|
-
|
|
11
|
+
logging.info(`[Tag] ${tag}`, { report: context.report });
|
|
17
12
|
}
|
|
18
13
|
catch (err) {
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
logging.error(`[Tag] Failed ${tag}`, { report: context.report });
|
|
15
|
+
logging.error(err, { report: context.report });
|
|
21
16
|
}
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
|
-
|
|
19
|
+
export default createReleaseGitTags;
|
package/lib/determineGitTags.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
async function determineGitTags({ versions, workspaceGroups, }) {
|
|
4
2
|
const groupByPackageName = new Map();
|
|
5
3
|
for (const [groupKey, group] of workspaceGroups.entries()) {
|
|
@@ -21,4 +19,4 @@ async function determineGitTags({ versions, workspaceGroups, }) {
|
|
|
21
19
|
}
|
|
22
20
|
return packageTags;
|
|
23
21
|
}
|
|
24
|
-
|
|
22
|
+
export default determineGitTags;
|
package/lib/getPublishConfig.js
CHANGED
|
@@ -1,55 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getPublishRegistryUrl = void 0;
|
|
37
|
-
const io_1 = require("@monoweave/io");
|
|
38
|
-
const types_1 = require("@monoweave/types");
|
|
39
|
-
const pluginNPM = __importStar(require("@yarnpkg/plugin-npm"));
|
|
40
|
-
const getPublishRegistryUrl = async ({ config, context, workspace, }) => {
|
|
41
|
-
const groupName = (0, io_1.resolveGroupName)({
|
|
1
|
+
import { resolveGroupName } from '@monoweave/io';
|
|
2
|
+
import { RegistryMode } from '@monoweave/types';
|
|
3
|
+
import * as pluginNPM from '@yarnpkg/plugin-npm';
|
|
4
|
+
export const getPublishRegistryUrl = async ({ config, context, workspace, }) => {
|
|
5
|
+
const groupName = resolveGroupName({
|
|
42
6
|
context,
|
|
43
7
|
workspace,
|
|
44
8
|
packageGroupManifestField: config.packageGroupManifestField,
|
|
45
9
|
});
|
|
46
10
|
if (groupName) {
|
|
47
11
|
const registryMode = config.packageGroups?.[groupName]?.registryMode ?? config.registryMode;
|
|
48
|
-
if (registryMode ===
|
|
12
|
+
if (registryMode === RegistryMode.Manifest) {
|
|
49
13
|
return null;
|
|
50
14
|
}
|
|
51
15
|
}
|
|
52
|
-
if (!groupName && config.registryMode ===
|
|
16
|
+
if (!groupName && config.registryMode === RegistryMode.Manifest) {
|
|
53
17
|
return null;
|
|
54
18
|
}
|
|
55
19
|
const configRegistryUrl = config.registryUrl;
|
|
@@ -60,4 +24,3 @@ const getPublishRegistryUrl = async ({ config, context, workspace, }) => {
|
|
|
60
24
|
configuration: context.configuration,
|
|
61
25
|
});
|
|
62
26
|
};
|
|
63
|
-
exports.getPublishRegistryUrl = getPublishRegistryUrl;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@yarnpkg/core");
|
|
1
|
+
import { structUtils } from '@yarnpkg/core';
|
|
4
2
|
const getWorkspacesToPublish = async ({ context, changeset, }) => {
|
|
5
3
|
const workspacesByIdent = context.project.workspaces.reduce((workspacesMap, current) => {
|
|
6
4
|
const manifestName = current.manifest.name;
|
|
7
5
|
if (manifestName) {
|
|
8
|
-
const ident =
|
|
6
|
+
const ident = structUtils.stringifyIdent(manifestName);
|
|
9
7
|
workspacesMap.set(ident, current);
|
|
10
8
|
}
|
|
11
9
|
return workspacesMap;
|
|
@@ -19,4 +17,4 @@ const getWorkspacesToPublish = async ({ context, changeset, }) => {
|
|
|
19
17
|
}
|
|
20
18
|
return workspacesToRelease;
|
|
21
19
|
};
|
|
22
|
-
|
|
20
|
+
export default getWorkspacesToPublish;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MonoweaveConfiguration, YarnContext } from '@monoweave/types';
|
|
2
2
|
import { type Workspace } from '@yarnpkg/core';
|
|
3
|
-
import determineGitTags from './determineGitTags';
|
|
4
|
-
import getWorkspacesToPublish from './getWorkspacesToPublish';
|
|
5
|
-
export { pushPublishCommit, createPublishCommit } from './commitPublishChanges';
|
|
3
|
+
import determineGitTags from './determineGitTags.js';
|
|
4
|
+
import getWorkspacesToPublish from './getWorkspacesToPublish.js';
|
|
5
|
+
export { pushPublishCommit, createPublishCommit } from './commitPublishChanges.js';
|
|
6
6
|
export { determineGitTags, getWorkspacesToPublish };
|
|
7
7
|
export declare const publishPackages: ({ config, context, workspaces, publishCommitSha, }: {
|
|
8
8
|
config: MonoweaveConfiguration;
|
package/lib/index.js
CHANGED
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
exports.determineGitTags = determineGitTags_1.default;
|
|
10
|
-
const getWorkspacesToPublish_1 = __importDefault(require("./getWorkspacesToPublish"));
|
|
11
|
-
exports.getWorkspacesToPublish = getWorkspacesToPublish_1.default;
|
|
12
|
-
const lifecycleExecutor_1 = require("./lifecycleExecutor");
|
|
13
|
-
const pack_1 = require("./pack");
|
|
14
|
-
var commitPublishChanges_1 = require("./commitPublishChanges");
|
|
15
|
-
Object.defineProperty(exports, "pushPublishCommit", { enumerable: true, get: function () { return commitPublishChanges_1.pushPublishCommit; } });
|
|
16
|
-
Object.defineProperty(exports, "createPublishCommit", { enumerable: true, get: function () { return commitPublishChanges_1.createPublishCommit; } });
|
|
17
|
-
const publishPackages = async ({ config, context, workspaces, publishCommitSha, }) => {
|
|
1
|
+
import { getTopologicalSort } from '@monoweave/dependencies';
|
|
2
|
+
import determineGitTags from './determineGitTags.js';
|
|
3
|
+
import getWorkspacesToPublish from './getWorkspacesToPublish.js';
|
|
4
|
+
import { createWorkspaceLifecycleExecutor } from './lifecycleExecutor.js';
|
|
5
|
+
import { pack } from './pack.js';
|
|
6
|
+
export { pushPublishCommit, createPublishCommit } from './commitPublishChanges.js';
|
|
7
|
+
export { determineGitTags, getWorkspacesToPublish };
|
|
8
|
+
export const publishPackages = async ({ config, context, workspaces, publishCommitSha, }) => {
|
|
18
9
|
const { default: pLimit } = await import('p-limit');
|
|
19
10
|
const limitPublish = pLimit(config.maxConcurrentWrites || 1);
|
|
20
11
|
const publishTag = config.prerelease ? config.prereleaseNPMTag : 'latest';
|
|
21
12
|
const limit = pLimit(config.jobs || Infinity);
|
|
22
13
|
const groups = config.topological || config.topologicalDev
|
|
23
|
-
? await
|
|
14
|
+
? await getTopologicalSort(workspaces, {
|
|
24
15
|
dev: config.topologicalDev,
|
|
25
16
|
})
|
|
26
17
|
: [[...workspaces]];
|
|
27
|
-
const executeLifecycle =
|
|
18
|
+
const executeLifecycle = createWorkspaceLifecycleExecutor({ limit, groups, config, context });
|
|
28
19
|
/**
|
|
29
20
|
* Lifecycle: Prepublish
|
|
30
21
|
*
|
|
@@ -60,7 +51,7 @@ const publishPackages = async ({ config, context, workspaces, publishCommitSha,
|
|
|
60
51
|
/**
|
|
61
52
|
* In "pack", we create the package archives and publish to the registry.
|
|
62
53
|
*/
|
|
63
|
-
await executeLifecycle((workspace) =>
|
|
54
|
+
await executeLifecycle((workspace) => pack({ workspace, limitPublish, config, context, publishTag, publishCommitSha }));
|
|
64
55
|
}
|
|
65
56
|
finally {
|
|
66
57
|
try {
|
|
@@ -81,4 +72,3 @@ const publishPackages = async ({ config, context, workspaces, publishCommitSha,
|
|
|
81
72
|
}
|
|
82
73
|
}
|
|
83
74
|
};
|
|
84
|
-
exports.publishPackages = publishPackages;
|
package/lib/lifecycleExecutor.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createWorkspaceLifecycleExecutor = createWorkspaceLifecycleExecutor;
|
|
4
|
-
const io_1 = require("@monoweave/io");
|
|
5
|
-
function createWorkspaceLifecycleExecutor({ limit, config, groups, context, }) {
|
|
1
|
+
import { maybeExecuteWorkspaceLifecycleScript } from '@monoweave/io';
|
|
2
|
+
export function createWorkspaceLifecycleExecutor({ limit, config, groups, context, }) {
|
|
6
3
|
async function executeInGroups(callback) {
|
|
7
4
|
await groups.reduce((chain, group) => chain.then(async () => {
|
|
8
5
|
// We'll wait for all promises to settle so we don't have runaway 'processes'
|
|
@@ -20,7 +17,7 @@ function createWorkspaceLifecycleExecutor({ limit, config, groups, context, }) {
|
|
|
20
17
|
if (typeof script === 'function') {
|
|
21
18
|
return script(workspace);
|
|
22
19
|
}
|
|
23
|
-
return
|
|
20
|
+
return maybeExecuteWorkspaceLifecycleScript(context, workspace, script, {
|
|
24
21
|
cwd: workspace.cwd,
|
|
25
22
|
dryRun: config.dryRun,
|
|
26
23
|
});
|
package/lib/pack.js
CHANGED
|
@@ -1,90 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.pack = void 0;
|
|
37
|
-
const logging_1 = __importStar(require("@monoweave/logging"));
|
|
38
|
-
const core_1 = require("@yarnpkg/core");
|
|
39
|
-
const plugin_npm_1 = require("@yarnpkg/plugin-npm");
|
|
40
|
-
const plugin_pack_1 = require("@yarnpkg/plugin-pack");
|
|
41
|
-
const getPublishConfig_1 = require("./getPublishConfig");
|
|
42
|
-
const pack = async ({ workspace, limitPublish, config, context, publishTag, publishCommitSha, }) => {
|
|
1
|
+
import logging, { assertProductionOrTest } from '@monoweave/logging';
|
|
2
|
+
import { miscUtils, structUtils } from '@yarnpkg/core';
|
|
3
|
+
import { npmHttpUtils, npmPublishUtils } from '@yarnpkg/plugin-npm';
|
|
4
|
+
import { packUtils } from '@yarnpkg/plugin-pack';
|
|
5
|
+
import { getPublishRegistryUrl } from './getPublishConfig.js';
|
|
6
|
+
export const pack = async ({ workspace, limitPublish, config, context, publishTag, publishCommitSha, }) => {
|
|
43
7
|
const ident = workspace.manifest.name;
|
|
44
8
|
if (!ident)
|
|
45
9
|
return;
|
|
46
|
-
const pkgName =
|
|
47
|
-
const registryUrl = await
|
|
10
|
+
const pkgName = structUtils.stringifyIdent(ident);
|
|
11
|
+
const registryUrl = await getPublishRegistryUrl({
|
|
48
12
|
config,
|
|
49
13
|
context,
|
|
50
14
|
workspace,
|
|
51
15
|
});
|
|
52
16
|
if (!registryUrl) {
|
|
53
|
-
|
|
17
|
+
logging.info(`[Publish] '${pkgName}' (${publishTag}: ${workspace.manifest.version}, skipping registry)`, { report: context.report });
|
|
54
18
|
return;
|
|
55
19
|
}
|
|
56
20
|
const globalAccess = config.access;
|
|
57
21
|
const access = globalAccess === 'infer' ? undefined : globalAccess;
|
|
58
|
-
|
|
59
|
-
const filesToPack = await
|
|
60
|
-
const pack = await
|
|
61
|
-
const buffer = await
|
|
62
|
-
const body = await
|
|
22
|
+
logging.info(`[Publish] ${pkgName} (${publishTag}: ${workspace.manifest.version}, ${registryUrl}; ${access})`, { report: context.report });
|
|
23
|
+
const filesToPack = await packUtils.genPackList(workspace);
|
|
24
|
+
const pack = await packUtils.genPackStream(workspace, filesToPack);
|
|
25
|
+
const buffer = await miscUtils.bufferStream(pack);
|
|
26
|
+
const body = await npmPublishUtils.makePublishBody(workspace, buffer, {
|
|
63
27
|
access,
|
|
64
28
|
tag: publishTag,
|
|
65
29
|
registry: registryUrl,
|
|
66
30
|
gitHead: publishCommitSha,
|
|
67
31
|
});
|
|
68
|
-
const identUrl =
|
|
32
|
+
const identUrl = npmHttpUtils.getIdentUrl(ident);
|
|
69
33
|
try {
|
|
70
34
|
if (!config.dryRun) {
|
|
71
|
-
|
|
72
|
-
await limitPublish(() =>
|
|
73
|
-
authType:
|
|
35
|
+
assertProductionOrTest();
|
|
36
|
+
await limitPublish(() => npmHttpUtils.put(identUrl, body, {
|
|
37
|
+
authType: npmHttpUtils.AuthType.ALWAYS_AUTH,
|
|
74
38
|
configuration: context.project.configuration,
|
|
75
39
|
ident,
|
|
76
40
|
registry: registryUrl,
|
|
77
41
|
allowOidc: Boolean(process.env.CI && (process.env.GITHUB_ACTIONS || process.env.GITLAB)),
|
|
78
42
|
}));
|
|
79
43
|
}
|
|
80
|
-
|
|
44
|
+
logging.info(`[Publish] '${pkgName}' published.`, { report: context.report });
|
|
81
45
|
}
|
|
82
46
|
catch (err) {
|
|
83
|
-
|
|
47
|
+
logging.error(err, {
|
|
84
48
|
report: context.report,
|
|
85
49
|
extras: `[Publish] Failed to publish '${pkgName}' to ${identUrl} (${publishTag}: ${body['dist-tags']?.[publishTag]}, ${registryUrl}; ${body.access})`,
|
|
86
50
|
});
|
|
87
51
|
throw err;
|
|
88
52
|
}
|
|
89
53
|
};
|
|
90
|
-
exports.pack = pack;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monoweave/publish",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "git",
|
|
6
7
|
"url": "https://github.com/monoweave/monoweave.git",
|
|
@@ -30,33 +31,33 @@
|
|
|
30
31
|
"prepack": "run workspace:build \"$(pwd)\""
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"p-limit": "^
|
|
34
|
+
"p-limit": "^7.2.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@monoweave/
|
|
38
|
-
"@monoweave/
|
|
39
|
-
"@monoweave/
|
|
40
|
-
"@monoweave/
|
|
41
|
-
"@monoweave/
|
|
42
|
-
"@
|
|
43
|
-
"@yarnpkg/
|
|
44
|
-
"@yarnpkg/
|
|
45
|
-
"@yarnpkg/
|
|
46
|
-
"@yarnpkg/plugin-npm": "^3.3.2",
|
|
37
|
+
"@monoweave/dependencies": "2.1.0",
|
|
38
|
+
"@monoweave/git": "2.1.0",
|
|
39
|
+
"@monoweave/io": "2.1.0",
|
|
40
|
+
"@monoweave/logging": "2.1.0",
|
|
41
|
+
"@monoweave/test-utils": "0.0.0",
|
|
42
|
+
"@monoweave/types": "2.1.0",
|
|
43
|
+
"@yarnpkg/cli": "^4.11.0",
|
|
44
|
+
"@yarnpkg/core": "^4.5.0",
|
|
45
|
+
"@yarnpkg/fslib": "^3.1.4",
|
|
46
|
+
"@yarnpkg/plugin-npm": "^3.4.0",
|
|
47
47
|
"@yarnpkg/plugin-pack": "^4.0.4",
|
|
48
|
-
"@yarnpkg/shell": "^4.1.3"
|
|
48
|
+
"@yarnpkg/shell": "^4.1.3",
|
|
49
|
+
"vitest": "^3.2.4"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
|
-
"@monoweave/dependencies": "^1.
|
|
52
|
-
"@monoweave/git": "^1.
|
|
53
|
-
"@monoweave/io": "^1.
|
|
54
|
-
"@monoweave/logging": "^1.
|
|
55
|
-
"@monoweave/types": "^1.
|
|
56
|
-
"@yarnpkg/cli": "^4.
|
|
57
|
-
"@yarnpkg/core": "^4.
|
|
58
|
-
"@yarnpkg/fslib": "^3.1.
|
|
59
|
-
"@yarnpkg/plugin-npm": "^3.
|
|
52
|
+
"@monoweave/dependencies": "^2.1.0",
|
|
53
|
+
"@monoweave/git": "^2.1.0",
|
|
54
|
+
"@monoweave/io": "^2.1.0",
|
|
55
|
+
"@monoweave/logging": "^2.1.0",
|
|
56
|
+
"@monoweave/types": "^2.1.0",
|
|
57
|
+
"@yarnpkg/cli": "^4.11.0",
|
|
58
|
+
"@yarnpkg/core": "^4.5.0",
|
|
59
|
+
"@yarnpkg/fslib": "^3.1.4",
|
|
60
|
+
"@yarnpkg/plugin-npm": "^3.4.0",
|
|
60
61
|
"@yarnpkg/plugin-pack": "^4.0.4",
|
|
61
62
|
"@yarnpkg/shell": "^4.1.3"
|
|
62
63
|
},
|