@modern-js/plugin-changeset 2.22.1-beta.4 → 2.22.1-beta.6

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.
@@ -19,7 +19,7 @@ async function release(options) {
19
19
  const params = [
20
20
  "publish"
21
21
  ];
22
- const { tag, otp, ignoreScripts, gitChecks } = options;
22
+ const { tag, otp, ignoreScripts, gitChecks, provenance } = options;
23
23
  if (tag) {
24
24
  params.push("--tag");
25
25
  params.push(tag);
@@ -50,6 +50,14 @@ async function release(options) {
50
50
  if (!gitChecks) {
51
51
  params.push("--no-git-checks");
52
52
  }
53
+ if (provenance) {
54
+ if (_utils.semver.lt(pnpmVersion, "8.4.0")) {
55
+ console.warn("current pnpm version not support --provenance, please upgrade pnpm version first.");
56
+ } else {
57
+ params.push("--provenance");
58
+ }
59
+ }
60
+ console.info("==release params", params);
53
61
  await (0, _utils1.execaWithStreamLog)(packageManager, params);
54
62
  const pnpmPublishSummaryFile = _path.default.join(appDir, "pnpm-publish-summary.json");
55
63
  const publishInfo = await _utils.fs.readJSON(pnpmPublishSummaryFile, "utf-8");
package/dist/cjs/index.js CHANGED
@@ -26,7 +26,7 @@ const _default = () => ({
26
26
  return memo;
27
27
  }, []).option("--preid <tag>", _locale.i18n.t(_locale.localeKeys.command.bump.preid), "next").option("--snapshot [snapshot]", _locale.i18n.t(_locale.localeKeys.command.bump.snapshot), false).action((options) => (0, _commands.bump)(options));
28
28
  program.command("pre <enter|exit> [tag]").description(_locale.i18n.t(_locale.localeKeys.command.pre.describe)).action((type, tag) => (0, _commands.pre)(type, tag));
29
- program.command("release").description(_locale.i18n.t(_locale.localeKeys.command.release.describe)).option("--tag <tag>", _locale.i18n.t(_locale.localeKeys.command.release.tag), "").option("--otp <token>", _locale.i18n.t(_locale.localeKeys.command.release.otp), "").option("--ignore-scripts", _locale.i18n.t(_locale.localeKeys.command.release.ignore_scripts), "").option("--no-git-checks", _locale.i18n.t(_locale.localeKeys.command.release.no_git_checks), "").action((options) => (0, _commands.release)(options));
29
+ program.command("release").description(_locale.i18n.t(_locale.localeKeys.command.release.describe)).option("--tag <tag>", _locale.i18n.t(_locale.localeKeys.command.release.tag), "").option("--otp <token>", _locale.i18n.t(_locale.localeKeys.command.release.otp), "").option("--ignore-scripts", _locale.i18n.t(_locale.localeKeys.command.release.ignore_scripts), "").option("--no-git-checks", _locale.i18n.t(_locale.localeKeys.command.release.no_git_checks), "").option("--provenance", _locale.i18n.t(_locale.localeKeys.command.release.provenance)).action((options) => (0, _commands.release)(options));
30
30
  program.command("change-status").description(_locale.i18n.t(_locale.localeKeys.command.status.describe)).option("--verbose", _locale.i18n.t(_locale.localeKeys.command.status.verbose)).option("--output <file>", _locale.i18n.t(_locale.localeKeys.command.status.output)).option("--since <ref>", _locale.i18n.t(_locale.localeKeys.command.status.since)).action((options) => (0, _commands.status)(options));
31
31
  program.command("gen-release-note").description(_locale.i18n.t(_locale.localeKeys.command.gen_release_note.describe)).option("--repo <repo>", _locale.i18n.t(_locale.localeKeys.command.gen_release_note.repo)).option("--custom <custom>", _locale.i18n.t(_locale.localeKeys.command.gen_release_note.custom)).action(async (options) => {
32
32
  await (0, _commands.genReleaseNote)(options);
@@ -31,7 +31,8 @@ const EN_LOCALE = {
31
31
  tag: "publish use special tag",
32
32
  otp: "publish package use one-time password, if you have auth and writes enabled on npm ",
33
33
  ignore_scripts: "publish command ignore npm scripts, only can use in pnpm monorepo",
34
- no_git_checks: "publish command ignore checking if current branch is your publish branch, clean, and up-to-date, only can use in pnpm monorepo"
34
+ no_git_checks: "publish command ignore checking if current branch is your publish branch, clean, and up-to-date, only can use in pnpm monorepo",
35
+ provenance: "when publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from"
35
36
  },
36
37
  status: {
37
38
  describe: "provides information about the changesets that currently exist",
@@ -31,7 +31,8 @@ const ZH_LOCALE = {
31
31
  tag: "发布 npm 包使用特定的 tag",
32
32
  otp: "发布 npm 包的一次性 token,该 token 需要写权限",
33
33
  ignore_scripts: "发布时忽略 package.json 中的 scripts 命令,仅支持在 pnpm monorepo 中使用",
34
- no_git_checks: "发布命令忽略检查当前分支是否是发布分支,干净且最新,仅支持在 pnpm monorepo 中使用"
34
+ no_git_checks: "发布命令忽略检查当前分支是否是发布分支,干净且最新,仅支持在 pnpm monorepo 中使用",
35
+ provenance: "当从支持的云 CI/CD 系统发布时,软件包将公开链接到其构建和发布来源"
35
36
  },
36
37
  status: {
37
38
  describe: "展示当前存在的变更集的状态信息",
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { getPackageManager, isMonorepo, fs, getPnpmVersion } from "@modern-js/utils";
2
+ import { getPackageManager, isMonorepo, fs, getPnpmVersion, semver } from "@modern-js/utils";
3
3
  import { tag as gitTag } from "@changesets/git";
4
4
  import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
5
5
  export async function release(options) {
@@ -8,7 +8,7 @@ export async function release(options) {
8
8
  const params = [
9
9
  "publish"
10
10
  ];
11
- const { tag, otp, ignoreScripts, gitChecks } = options;
11
+ const { tag, otp, ignoreScripts, gitChecks, provenance } = options;
12
12
  if (tag) {
13
13
  params.push("--tag");
14
14
  params.push(tag);
@@ -39,6 +39,14 @@ export async function release(options) {
39
39
  if (!gitChecks) {
40
40
  params.push("--no-git-checks");
41
41
  }
42
+ if (provenance) {
43
+ if (semver.lt(pnpmVersion, "8.4.0")) {
44
+ console.warn("current pnpm version not support --provenance, please upgrade pnpm version first.");
45
+ } else {
46
+ params.push("--provenance");
47
+ }
48
+ }
49
+ console.info("==release params", params);
42
50
  await execaWithStreamLog(packageManager, params);
43
51
  const pnpmPublishSummaryFile = path.join(appDir, "pnpm-publish-summary.json");
44
52
  const publishInfo = await fs.readJSON(pnpmPublishSummaryFile, "utf-8");
package/dist/esm/index.js CHANGED
@@ -16,7 +16,7 @@ export default () => ({
16
16
  return memo;
17
17
  }, []).option("--preid <tag>", i18n.t(localeKeys.command.bump.preid), "next").option("--snapshot [snapshot]", i18n.t(localeKeys.command.bump.snapshot), false).action((options) => bump(options));
18
18
  program.command("pre <enter|exit> [tag]").description(i18n.t(localeKeys.command.pre.describe)).action((type, tag) => pre(type, tag));
19
- program.command("release").description(i18n.t(localeKeys.command.release.describe)).option("--tag <tag>", i18n.t(localeKeys.command.release.tag), "").option("--otp <token>", i18n.t(localeKeys.command.release.otp), "").option("--ignore-scripts", i18n.t(localeKeys.command.release.ignore_scripts), "").option("--no-git-checks", i18n.t(localeKeys.command.release.no_git_checks), "").action((options) => release(options));
19
+ program.command("release").description(i18n.t(localeKeys.command.release.describe)).option("--tag <tag>", i18n.t(localeKeys.command.release.tag), "").option("--otp <token>", i18n.t(localeKeys.command.release.otp), "").option("--ignore-scripts", i18n.t(localeKeys.command.release.ignore_scripts), "").option("--no-git-checks", i18n.t(localeKeys.command.release.no_git_checks), "").option("--provenance", i18n.t(localeKeys.command.release.provenance)).action((options) => release(options));
20
20
  program.command("change-status").description(i18n.t(localeKeys.command.status.describe)).option("--verbose", i18n.t(localeKeys.command.status.verbose)).option("--output <file>", i18n.t(localeKeys.command.status.output)).option("--since <ref>", i18n.t(localeKeys.command.status.since)).action((options) => status(options));
21
21
  program.command("gen-release-note").description(i18n.t(localeKeys.command.gen_release_note.describe)).option("--repo <repo>", i18n.t(localeKeys.command.gen_release_note.repo)).option("--custom <custom>", i18n.t(localeKeys.command.gen_release_note.custom)).action(async (options) => {
22
22
  await genReleaseNote(options);
@@ -21,7 +21,8 @@ export const EN_LOCALE = {
21
21
  tag: "publish use special tag",
22
22
  otp: "publish package use one-time password, if you have auth and writes enabled on npm ",
23
23
  ignore_scripts: "publish command ignore npm scripts, only can use in pnpm monorepo",
24
- no_git_checks: "publish command ignore checking if current branch is your publish branch, clean, and up-to-date, only can use in pnpm monorepo"
24
+ no_git_checks: "publish command ignore checking if current branch is your publish branch, clean, and up-to-date, only can use in pnpm monorepo",
25
+ provenance: "when publishing from a supported cloud CI/CD system, the package will be publicly linked to where it was built and published from"
25
26
  },
26
27
  status: {
27
28
  describe: "provides information about the changesets that currently exist",
@@ -21,7 +21,8 @@ export const ZH_LOCALE = {
21
21
  tag: "发布 npm 包使用特定的 tag",
22
22
  otp: "发布 npm 包的一次性 token,该 token 需要写权限",
23
23
  ignore_scripts: "发布时忽略 package.json 中的 scripts 命令,仅支持在 pnpm monorepo 中使用",
24
- no_git_checks: "发布命令忽略检查当前分支是否是发布分支,干净且最新,仅支持在 pnpm monorepo 中使用"
24
+ no_git_checks: "发布命令忽略检查当前分支是否是发布分支,干净且最新,仅支持在 pnpm monorepo 中使用",
25
+ provenance: "当从支持的云 CI/CD 系统发布时,软件包将公开链接到其构建和发布来源"
25
26
  },
26
27
  status: {
27
28
  describe: "展示当前存在的变更集的状态信息",
@@ -3,6 +3,7 @@ interface ReleaseOptions {
3
3
  ignoreScripts: boolean;
4
4
  gitChecks: boolean;
5
5
  otp: string;
6
+ provenance: boolean;
6
7
  }
7
8
  export declare function release(options: ReleaseOptions): Promise<void>;
8
9
  export {};
@@ -22,6 +22,7 @@ export declare const EN_LOCALE: {
22
22
  otp: string;
23
23
  ignore_scripts: string;
24
24
  no_git_checks: string;
25
+ provenance: string;
25
26
  };
26
27
  status: {
27
28
  describe: string;
@@ -24,6 +24,7 @@ declare const localeKeys: {
24
24
  otp: string;
25
25
  ignore_scripts: string;
26
26
  no_git_checks: string;
27
+ provenance: string;
27
28
  };
28
29
  status: {
29
30
  describe: string;
@@ -61,6 +62,7 @@ declare const localeKeys: {
61
62
  otp: string;
62
63
  ignore_scripts: string;
63
64
  no_git_checks: string;
65
+ provenance: string;
64
66
  };
65
67
  status: {
66
68
  describe: string;
@@ -22,6 +22,7 @@ export declare const ZH_LOCALE: {
22
22
  otp: string;
23
23
  ignore_scripts: string;
24
24
  no_git_checks: string;
25
+ provenance: string;
25
26
  };
26
27
  status: {
27
28
  describe: string;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.22.1-beta.4",
18
+ "version": "2.22.1-beta.6",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -49,20 +49,20 @@
49
49
  "@changesets/cli": "^2.26.0",
50
50
  "@changesets/git": "^1.3.2",
51
51
  "@changesets/read": "^0.5.5",
52
- "@modern-js/plugin-i18n": "2.22.0",
53
- "@modern-js/utils": "2.22.0",
54
52
  "resolve-from": "^5.0.0",
55
53
  "axios": "^1.2.1",
56
- "@swc/helpers": "0.5.1"
54
+ "@swc/helpers": "0.5.1",
55
+ "@modern-js/plugin-i18n": "2.22.0",
56
+ "@modern-js/utils": "2.22.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@modern-js/core": "2.22.0",
60
- "@scripts/build": "2.22.0",
61
59
  "@types/jest": "^29",
62
60
  "@types/node": "^14",
63
61
  "typescript": "^5",
64
62
  "jest": "^29",
65
- "@scripts/jest-config": "2.22.0"
63
+ "@modern-js/core": "2.22.0",
64
+ "@scripts/jest-config": "2.22.0",
65
+ "@scripts/build": "2.22.0"
66
66
  },
67
67
  "sideEffects": false,
68
68
  "publishConfig": {