pubm 0.0.2-5 → 0.0.2-9
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/bin/cli.js +29 -14
- package/dist/index.cjs +10 -1
- package/dist/index.js +10 -1
- package/package.json +7 -3
package/bin/cli.js
CHANGED
|
@@ -5630,7 +5630,16 @@ var npmPublishTasks = {
|
|
|
5630
5630
|
"NODE_AUTH_TOKEN not found in the environment variables. Please set the token and try again."
|
|
5631
5631
|
);
|
|
5632
5632
|
}
|
|
5633
|
-
|
|
5633
|
+
try {
|
|
5634
|
+
await npm.publishProvenance();
|
|
5635
|
+
} catch (error) {
|
|
5636
|
+
if (`${error}`.includes("EOTP")) {
|
|
5637
|
+
throw new NpmAvailableError(
|
|
5638
|
+
`In CI environment, publishing with 2FA is not allowed. Please disable 2FA when accessing with a token from ${link2("npm", `https://www.npmjs.com/package/${npm.packageName}/access`)}.`
|
|
5639
|
+
);
|
|
5640
|
+
}
|
|
5641
|
+
throw error;
|
|
5642
|
+
}
|
|
5634
5643
|
}
|
|
5635
5644
|
}
|
|
5636
5645
|
};
|
|
@@ -6378,22 +6387,28 @@ cli.command("[version]").action(async (nextVersion, options2) => {
|
|
|
6378
6387
|
tag: options2.tag
|
|
6379
6388
|
};
|
|
6380
6389
|
try {
|
|
6381
|
-
if (
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6390
|
+
if (isCI3) {
|
|
6391
|
+
if (options2.publishOnly) {
|
|
6392
|
+
const git = new Git();
|
|
6393
|
+
const latestVersion = (await git.latestTag())?.slice(1);
|
|
6394
|
+
if (!latestVersion) {
|
|
6395
|
+
throw new Error(
|
|
6396
|
+
"Cannot find the latest tag. Please ensure tags exist in the repository."
|
|
6397
|
+
);
|
|
6398
|
+
}
|
|
6399
|
+
if (!valid(latestVersion)) {
|
|
6400
|
+
throw new Error(
|
|
6401
|
+
"Cannot parse the latest tag to a valid SemVer version. Please check the tag format."
|
|
6402
|
+
);
|
|
6403
|
+
}
|
|
6404
|
+
context.version = latestVersion;
|
|
6405
|
+
} else {
|
|
6392
6406
|
throw new Error(
|
|
6393
|
-
"
|
|
6407
|
+
"Version must be set in the CI environment. Please define the version before proceeding."
|
|
6394
6408
|
);
|
|
6395
6409
|
}
|
|
6396
|
-
|
|
6410
|
+
} else {
|
|
6411
|
+
await requiredMissingInformationTasks().run(context);
|
|
6397
6412
|
}
|
|
6398
6413
|
await pubm(
|
|
6399
6414
|
resolveCliOptions({
|
package/dist/index.cjs
CHANGED
|
@@ -5637,7 +5637,16 @@ var npmPublishTasks = {
|
|
|
5637
5637
|
"NODE_AUTH_TOKEN not found in the environment variables. Please set the token and try again."
|
|
5638
5638
|
);
|
|
5639
5639
|
}
|
|
5640
|
-
|
|
5640
|
+
try {
|
|
5641
|
+
await npm.publishProvenance();
|
|
5642
|
+
} catch (error) {
|
|
5643
|
+
if (`${error}`.includes("EOTP")) {
|
|
5644
|
+
throw new NpmAvailableError(
|
|
5645
|
+
`In CI environment, publishing with 2FA is not allowed. Please disable 2FA when accessing with a token from ${link2("npm", `https://www.npmjs.com/package/${npm.packageName}/access`)}.`
|
|
5646
|
+
);
|
|
5647
|
+
}
|
|
5648
|
+
throw error;
|
|
5649
|
+
}
|
|
5641
5650
|
}
|
|
5642
5651
|
}
|
|
5643
5652
|
};
|
package/dist/index.js
CHANGED
|
@@ -5626,7 +5626,16 @@ var npmPublishTasks = {
|
|
|
5626
5626
|
"NODE_AUTH_TOKEN not found in the environment variables. Please set the token and try again."
|
|
5627
5627
|
);
|
|
5628
5628
|
}
|
|
5629
|
-
|
|
5629
|
+
try {
|
|
5630
|
+
await npm.publishProvenance();
|
|
5631
|
+
} catch (error) {
|
|
5632
|
+
if (`${error}`.includes("EOTP")) {
|
|
5633
|
+
throw new NpmAvailableError(
|
|
5634
|
+
`In CI environment, publishing with 2FA is not allowed. Please disable 2FA when accessing with a token from ${link2("npm", `https://www.npmjs.com/package/${npm.packageName}/access`)}.`
|
|
5635
|
+
);
|
|
5636
|
+
}
|
|
5637
|
+
throw error;
|
|
5638
|
+
}
|
|
5630
5639
|
}
|
|
5631
5640
|
}
|
|
5632
5641
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pubm",
|
|
3
|
-
"version": "0.0.2-
|
|
3
|
+
"version": "0.0.2-9",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=18",
|
|
6
6
|
"git": ">=2.11.0"
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"pubm": "bin/cli.js"
|
|
16
16
|
},
|
|
17
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"bin"
|
|
20
|
+
],
|
|
18
21
|
"exports": {
|
|
19
22
|
".": {
|
|
20
23
|
"types": "./dist/index.d.ts",
|
|
@@ -50,7 +53,8 @@
|
|
|
50
53
|
"@types/npmcli__promise-spawn": "^6.0.3",
|
|
51
54
|
"@types/semver": "^7.5.8",
|
|
52
55
|
"@vitest/coverage-v8": "^2.1.1",
|
|
53
|
-
"
|
|
56
|
+
"jsr": "^0.13.2",
|
|
57
|
+
"pubm": "^0.0.2-6",
|
|
54
58
|
"tsup": "^8.3.0",
|
|
55
59
|
"typescript": "^5.6.2",
|
|
56
60
|
"vitest": "^2.1.1"
|