rangutopia 0.0.6 → 0.0.7
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/dist/commands/changelog/generate/action.d.ts +3 -0
- package/dist/commands/changelog/generate/action.d.ts.map +1 -0
- package/dist/commands/changelog/generate/action.js +22 -0
- package/dist/commands/changelog/generate/action.js.map +1 -0
- package/dist/commands/changelog/generate/helpers.d.ts +5 -0
- package/dist/commands/changelog/generate/helpers.d.ts.map +1 -0
- package/dist/commands/changelog/generate/helpers.js +67 -0
- package/dist/commands/changelog/generate/helpers.js.map +1 -0
- package/dist/commands/changelog/generate/mod.d.ts +2 -0
- package/dist/commands/changelog/generate/mod.d.ts.map +1 -0
- package/dist/commands/changelog/generate/mod.js +2 -0
- package/dist/commands/changelog/generate/mod.js.map +1 -0
- package/dist/commands/changelog/generate/options.d.ts +9 -0
- package/dist/commands/changelog/generate/options.d.ts.map +1 -0
- package/dist/commands/changelog/generate/options.js +13 -0
- package/dist/commands/changelog/generate/options.js.map +1 -0
- package/dist/commands/changelog/mod.d.ts +4 -0
- package/dist/commands/changelog/mod.d.ts.map +1 -0
- package/dist/commands/changelog/mod.js +14 -0
- package/dist/commands/changelog/mod.js.map +1 -0
- package/dist/commands/library/build/options.js +2 -2
- package/dist/commands/library/publish/action.d.ts.map +1 -1
- package/dist/commands/library/publish/action.js +32 -33
- package/dist/commands/library/publish/action.js.map +1 -1
- package/dist/commands/library/publish/helpers.d.ts +22 -4
- package/dist/commands/library/publish/helpers.d.ts.map +1 -1
- package/dist/commands/library/publish/helpers.js +86 -125
- package/dist/commands/library/publish/helpers.js.map +1 -1
- package/dist/commands/library/publish/state.d.ts +1 -1
- package/dist/commands/library/publish/state.d.ts.map +1 -1
- package/dist/commands/library/publish/state.js.map +1 -1
- package/dist/commands/library/publish/types.d.ts +0 -9
- package/dist/commands/library/publish/types.d.ts.map +1 -1
- package/dist/commands/tools/husky/init/action.d.ts.map +1 -1
- package/dist/commands/tools/husky/init/action.js +2 -2
- package/dist/commands/tools/husky/init/action.js.map +1 -1
- package/dist/commands/tools/lint/init/action.js +2 -2
- package/dist/commands/tools/lint/init/action.js.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modules/mod.d.ts +1 -0
- package/dist/modules/mod.d.ts.map +1 -1
- package/dist/modules/mod.js +1 -0
- package/dist/modules/mod.js.map +1 -1
- package/dist/modules/packageManager/constants.d.ts +2 -0
- package/dist/modules/packageManager/constants.d.ts.map +1 -0
- package/dist/modules/packageManager/constants.js +2 -0
- package/dist/modules/packageManager/constants.js.map +1 -0
- package/dist/modules/packageManager/errors.d.ts +5 -0
- package/dist/modules/packageManager/errors.d.ts.map +1 -0
- package/dist/modules/packageManager/errors.js +7 -0
- package/dist/modules/packageManager/errors.js.map +1 -0
- package/dist/modules/packageManager/helpers.d.ts +6 -0
- package/dist/modules/packageManager/helpers.d.ts.map +1 -0
- package/dist/modules/packageManager/helpers.js +38 -0
- package/dist/modules/packageManager/helpers.js.map +1 -0
- package/dist/modules/packageManager/mod.d.ts +5 -0
- package/dist/modules/packageManager/mod.d.ts.map +1 -0
- package/dist/modules/packageManager/mod.js +30 -0
- package/dist/modules/packageManager/mod.js.map +1 -0
- package/dist/modules/packageManager/packageManager.d.ts +18 -0
- package/dist/modules/packageManager/packageManager.d.ts.map +1 -0
- package/dist/modules/packageManager/packageManager.js +22 -0
- package/dist/modules/packageManager/packageManager.js.map +1 -0
- package/dist/modules/packageManager/types.d.ts +12 -0
- package/dist/modules/packageManager/types.d.ts.map +1 -0
- package/dist/modules/packageManager/types.js +2 -0
- package/dist/modules/packageManager/types.js.map +1 -0
- package/dist/modules/packageManager/yarnBerryAdapter.d.ts +9 -0
- package/dist/modules/packageManager/yarnBerryAdapter.d.ts.map +1 -0
- package/dist/modules/packageManager/yarnBerryAdapter.js +40 -0
- package/dist/modules/packageManager/yarnBerryAdapter.js.map +1 -0
- package/dist/modules/packageManager/yarnClassicAdapter.d.ts +9 -0
- package/dist/modules/packageManager/yarnClassicAdapter.d.ts.map +1 -0
- package/dist/modules/packageManager/yarnClassicAdapter.js +43 -0
- package/dist/modules/packageManager/yarnClassicAdapter.js.map +1 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +3 -2
- package/dist/setup.js.map +1 -1
- package/dist/utils/changelog.d.ts +6 -3
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +17 -11
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +1 -0
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/packageJson.d.ts +12 -1
- package/dist/utils/packageJson.d.ts.map +1 -1
- package/dist/utils/packageJson.js +4 -1
- package/dist/utils/packageJson.js.map +1 -1
- package/package.json +4 -1
- package/vitest.config.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/action.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,WAAW,EAAwB,MAAM,cAAc,CAAC;AAGrE,wBAAsB,MAAM,CAAC,cAAc,EAAE,WAAW,iBAiBvD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getPackageManager, logger } from "../../../modules/mod.js";
|
|
2
|
+
import { throwIfOptionsInvalid } from "./options.js";
|
|
3
|
+
import { generateChangelogForRoot, throwIfRootNotClient } from "./helpers.js";
|
|
4
|
+
export async function action(commandOptions) {
|
|
5
|
+
logger.info('🔍 Checking options...');
|
|
6
|
+
logger.info(commandOptions);
|
|
7
|
+
throwIfOptionsInvalid(commandOptions);
|
|
8
|
+
// TODO: currently only single-repo client packages are supported;
|
|
9
|
+
// monorepo and library package support will be added in the future,
|
|
10
|
+
// at which point this condition should be revisited.
|
|
11
|
+
if (commandOptions.client && !getPackageManager().isMonorepo()) {
|
|
12
|
+
logger.info("generating changelog for a single-repo client");
|
|
13
|
+
throwIfRootNotClient();
|
|
14
|
+
await generateChangelogForRoot({
|
|
15
|
+
save: commandOptions.save,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
throw new Error("not implemented.");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAmB,qBAAqB,EAAC,MAAM,cAAc,CAAC;AACrE,OAAO,EAAC,wBAAwB,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAE5E,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,cAA2B;IACpD,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC3B,qBAAqB,CAAC,cAAc,CAAC,CAAC;IAEtC,kEAAkE;IAClE,oEAAoE;IACpE,qDAAqD;IACrD,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC;QAC7D,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAA;QAC5D,oBAAoB,EAAE,CAAC;QACvB,MAAM,wBAAwB,CAAC;YAC3B,IAAI,EAAE,cAAc,CAAC,IAAI;SAC5B,CAAC,CAAC;IACP,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/helpers.ts"],"names":[],"mappings":"AAUA,wBAAsB,wBAAwB,CAAC,OAAO,EAAE;IAAC,IAAI,EAAE,OAAO,CAAA;CAAC,iBAetE;AAkDD,eAAO,MAAM,oBAAoB,YAIhC,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ROOT_PATH } from "../../../constants.js";
|
|
2
|
+
import { ConventionalGitClient } from '@conventional-changelog/git-client';
|
|
3
|
+
import { generateChangelog, generateChangelogAndSave, TAG_ROOT_PREFIX } from "../../../utils/changelog.js";
|
|
4
|
+
import { packageJsonPath, readAndValidatePackageJson } from "../../../utils/packageJson.js";
|
|
5
|
+
import { logger } from "../../../modules/mod.js";
|
|
6
|
+
export async function generateChangelogForRoot(options) {
|
|
7
|
+
const { from, commitsCount } = await getInfoBeforeGeneratingChangelog();
|
|
8
|
+
if (commitsCount > 0) {
|
|
9
|
+
logger.info(`from: ${from || 'start (first release)'}`);
|
|
10
|
+
logger.info(`commits: ${commitsCount}`);
|
|
11
|
+
if (options.save) {
|
|
12
|
+
await generateChangelogAndSave();
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
await generateChangelogAndPrint();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
logger.info(`No commits found, skipping changelog generation.`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function getInfoBeforeGeneratingChangelog() {
|
|
23
|
+
const gitClient = new ConventionalGitClient(ROOT_PATH);
|
|
24
|
+
let commitsParams = {
|
|
25
|
+
merges: false,
|
|
26
|
+
};
|
|
27
|
+
const semverTag = await gitClient.getLastSemverTag({
|
|
28
|
+
// HEADS UP:
|
|
29
|
+
// The following regex pattern supports the `package@1.1.1` format, which meets our needs for now.
|
|
30
|
+
// scoped tags like `@a/b@1.1.1` are not currently supported.
|
|
31
|
+
prefix: TAG_ROOT_PREFIX,
|
|
32
|
+
});
|
|
33
|
+
// If there are no semver tags, null is returned. In that case, we change it undefined to match the `string | undefined` signature.
|
|
34
|
+
const startFromTag = semverTag || undefined;
|
|
35
|
+
if (startFromTag) {
|
|
36
|
+
commitsParams = {
|
|
37
|
+
...commitsParams,
|
|
38
|
+
from: startFromTag,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const commitsStream = gitClient.getCommits(commitsParams);
|
|
42
|
+
const commits = [];
|
|
43
|
+
for await (const commit of commitsStream) {
|
|
44
|
+
commits.push(commit);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
/** Where is considering as starting point, it is genrally a tag. undefined means it's the first release.'*/
|
|
48
|
+
from: startFromTag,
|
|
49
|
+
/** How many commits this release has. */
|
|
50
|
+
commitsCount: commits.length,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function generateChangelogAndPrint() {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
logger.info("Generated log:");
|
|
56
|
+
const changelog = generateChangelog();
|
|
57
|
+
changelog.pipe(process.stdout);
|
|
58
|
+
changelog.on('end', resolve);
|
|
59
|
+
changelog.on('error', reject);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export const throwIfRootNotClient = () => {
|
|
63
|
+
const rootPackageJson = readAndValidatePackageJson(packageJsonPath());
|
|
64
|
+
if (!rootPackageJson.private)
|
|
65
|
+
throw new Error("Root package.json should be private");
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EACH,iBAAiB,EACjB,wBAAwB,EACxB,eAAe,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,eAAe,EAAE,0BAA0B,EAAC,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAE/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ED,OAAO;QACH,4GAA4G;QAC5G,IAAI,EAAE,YAAY;QAClB,yCAAyC;QACzC,YAAY,EAAE,OAAO,CAAC,MAAM;KAC/B,CAAC;AACN,CAAC;AAED,SAAS,yBAAyB;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC7B,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QACtC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/B,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC7B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,MAAM,eAAe,GAAG,0BAA0B,CAAC,eAAe,EAAE,CAAC,CAAC;IACtE,IAAI,CAAC,eAAe,CAAC,OAAO;QACxB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;AAC9D,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
export declare const CommandOptionsSchema: z.ZodObject<{
|
|
3
|
+
library: z.ZodBoolean;
|
|
4
|
+
client: z.ZodBoolean;
|
|
5
|
+
save: z.ZodBoolean;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type OptionsType = z.infer<typeof CommandOptionsSchema>;
|
|
8
|
+
export declare const throwIfOptionsInvalid: (options: OptionsType) => void;
|
|
9
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE/D,eAAO,MAAM,qBAAqB,GAAI,SAAS,WAAW,SAMzD,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
export const CommandOptionsSchema = z.object({
|
|
3
|
+
library: z.boolean(),
|
|
4
|
+
client: z.boolean(),
|
|
5
|
+
save: z.boolean(),
|
|
6
|
+
});
|
|
7
|
+
export const throwIfOptionsInvalid = (options) => {
|
|
8
|
+
if (options.library && options.client)
|
|
9
|
+
throw new Error("You must only set one flag between '--client' and '--library'");
|
|
10
|
+
if (!options.library && !options.client)
|
|
11
|
+
throw new Error("You must at least set one flag between '--client' and '--library'");
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/commands/changelog/generate/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAoB,EAAE,EAAE;IAC1D,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM;QACjC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IAErF,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;QACnC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;AAC7F,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/commands/changelog/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,iBAAS,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAWzC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
function changelogCommand(program) {
|
|
3
|
+
const changelog = program.command("changelog").description("Actions related to changelogs");
|
|
4
|
+
changelog.command("generate").description("generate a changelog")
|
|
5
|
+
.option("--client", "Only consider client packages")
|
|
6
|
+
.option("--library", "Only consider library packages")
|
|
7
|
+
.option("--save", "Update the CHANGELOG.md file in the project", false)
|
|
8
|
+
.action(async (options) => {
|
|
9
|
+
const { action } = await import("./generate/mod.js");
|
|
10
|
+
action(options);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { changelogCommand };
|
|
14
|
+
//# sourceMappingURL=mod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/commands/changelog/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,SAAS,gBAAgB,CAAC,OAAgB;IAClC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAEhG,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC;SAC5D,MAAM,CAAC,UAAU,EAAE,+BAA+B,CAAC;SACnD,MAAM,CAAC,WAAW,EAAE,gCAAgC,CAAC;SACrD,MAAM,CAAC,QAAQ,EAAE,6CAA6C,EAAE,KAAK,CAAC;SACtE,MAAM,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;QACpB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACrD,MAAM,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACX,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
import { validatedSchemaOrThrow } from "../../../utils/parse.js";
|
|
3
3
|
import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill';
|
|
4
|
-
import { nearestPackageJsonPath,
|
|
4
|
+
import { nearestPackageJsonPath, readAndValidatePackageJson, readPackageJson } from "../../../utils/packageJson.js";
|
|
5
5
|
import { logErrorAndExit } from "../../../utils/log.js";
|
|
6
6
|
import { accessSync, constants } from "node:fs";
|
|
7
7
|
const DEFAULT_TSCONFIG_FILENAME = "tsconfig.build.json";
|
|
@@ -19,7 +19,7 @@ export async function parseOptions(commandOptions) {
|
|
|
19
19
|
if (!packageJsonRootPath) {
|
|
20
20
|
throw new Error("We couldn't found any package.json where you are runing the command. Are you in a correct path?'");
|
|
21
21
|
}
|
|
22
|
-
const packageJsonContent =
|
|
22
|
+
const packageJsonContent = readAndValidatePackageJson(packageJsonRootPath);
|
|
23
23
|
const options = validatedSchemaOrThrow(CommandOptionsSchema, commandOptions);
|
|
24
24
|
if (!!options.external && !!options.externalAllExcept) {
|
|
25
25
|
logErrorAndExit("You should only use one of `external` or `external-all-except` at the sametime.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/action.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/action.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,cAAc,CAAC;AAiB9C,wBAAsB,MAAM,CAAC,cAAc,EAAE,WAAW,iBAkKvD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logger } from "../../../modules/mod.js";
|
|
2
2
|
import {} from "./options.js";
|
|
3
3
|
import { trySetConfigs } from "./configs.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getAffectedPackages, throwIfUnableToProceed, publishCommitAndTags, push, makeGithubRelease, publishPkg, addFileToStage, determinePkgVersions, addPkgFileChangesToStage, sequentiallyRun } from "./helpers.js";
|
|
5
5
|
import { State } from "./state.js";
|
|
6
6
|
import { should } from "./features.js";
|
|
7
7
|
export async function action(commandOptions) {
|
|
@@ -13,6 +13,7 @@ export async function action(commandOptions) {
|
|
|
13
13
|
logger.githubAction.group('🔍 Anlyzing dependencies...');
|
|
14
14
|
const affectedPkgs = await getAffectedPackages(commandOptions.sinceStart);
|
|
15
15
|
const libPkgs = affectedPkgs.filter((pkg) => !pkg.private);
|
|
16
|
+
const clientPkgs = affectedPkgs.filter((pkg) => pkg.private);
|
|
16
17
|
if (libPkgs.length === 0) {
|
|
17
18
|
logger.info('No library has changed. Skip.');
|
|
18
19
|
process.exit(0);
|
|
@@ -20,14 +21,14 @@ export async function action(commandOptions) {
|
|
|
20
21
|
logger.info('Current state:');
|
|
21
22
|
logger.table(libPkgs);
|
|
22
23
|
const state = new State(libPkgs);
|
|
23
|
-
const
|
|
24
|
-
return
|
|
24
|
+
const determinePkgsVersionsTasks = libPkgs.map(pkg => {
|
|
25
|
+
return determinePkgVersions(pkg).then(pkgState => {
|
|
25
26
|
state.setState(pkg.name, 'gitTag', pkgState.gitTag);
|
|
26
27
|
state.setState(pkg.name, 'npmVersion', pkgState.npmVersion);
|
|
27
28
|
state.setState(pkg.name, 'version', pkgState.version);
|
|
28
29
|
});
|
|
29
30
|
});
|
|
30
|
-
await Promise.all(
|
|
31
|
+
await Promise.all(determinePkgsVersionsTasks);
|
|
31
32
|
const pkgs = state.list();
|
|
32
33
|
const pkgStates = pkgs.map((pkg) => state.getState(pkg.name));
|
|
33
34
|
logger.info('Next state:');
|
|
@@ -39,38 +40,28 @@ export async function action(commandOptions) {
|
|
|
39
40
|
}));
|
|
40
41
|
throwIfUnableToProceed(pkgStates);
|
|
41
42
|
logger.githubAction.endGroup();
|
|
42
|
-
// 2.
|
|
43
|
-
/**
|
|
44
|
-
* IMPORTANT NOTE:
|
|
45
|
-
* We are all the libs in parallel, parcel has a limitation on running `parcel` instances.
|
|
46
|
-
* So if you are trying to build multiple parcel apps it goes through some erros. here, for publishing libs
|
|
47
|
-
* We are using esbuild so don't need to do anything.
|
|
48
|
-
* but if we need, the potential solution is filtering parcel apps and run them secquentially.
|
|
49
|
-
*/
|
|
50
|
-
logger.githubAction.group(`🔨 Start building...`);
|
|
51
|
-
await build(pkgs);
|
|
52
|
-
logger.githubAction.endGroup();
|
|
53
|
-
// 3. Publish
|
|
43
|
+
// 2. Publish packages
|
|
54
44
|
logger.githubAction.group(`🚀 Start publishing...`);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
onUpdateState: state.setState.bind(state)
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
logger.error(e);
|
|
62
|
-
const pkg = e.cause.pkg;
|
|
63
|
-
if (!pkg) {
|
|
64
|
-
logger.error("🚨 The error hasn't thrown `pkg`. Here is more information to debug");
|
|
65
|
-
logger.info(state.toJSON());
|
|
45
|
+
for (const pkg of pkgs) {
|
|
46
|
+
try {
|
|
47
|
+
await publishPkg(pkg, { onUpdateState: state.setState.bind(state) });
|
|
66
48
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
catch (e) {
|
|
50
|
+
logger.error(e);
|
|
51
|
+
const pkg = e.cause.pkg;
|
|
52
|
+
if (!pkg) {
|
|
53
|
+
logger.error("🚨 The error hasn't thrown `pkg`. Here is more information to debug");
|
|
54
|
+
logger.info(state.toJSON());
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// Ignoring error since it's possible to file hasn't changed yet.
|
|
58
|
+
await addPkgFileChangesToStage(pkg).catch(logger.warn);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
70
61
|
}
|
|
71
62
|
}
|
|
72
63
|
logger.githubAction.endGroup();
|
|
73
|
-
//
|
|
64
|
+
// 3. Tag and Push
|
|
74
65
|
/**
|
|
75
66
|
* Our final list will includes only packages that published on NPM.
|
|
76
67
|
* If a package failed on making changelog, github release, ...
|
|
@@ -83,6 +74,14 @@ export async function action(commandOptions) {
|
|
|
83
74
|
logger.githubAction.group(`🏷️ Tagging and commit... ${listPkgsForTag.length} packages for tagging.`);
|
|
84
75
|
if (listPkgsForTag.length > 0) {
|
|
85
76
|
performance.mark(`start-publish-tagging`);
|
|
77
|
+
// yarn berry would change the lockfile after bumping packages version in monorepo
|
|
78
|
+
await addFileToStage("yarn.lock");
|
|
79
|
+
/**
|
|
80
|
+
* We don't need to tag and mention them while publishing, they have a separate github action.
|
|
81
|
+
* But we updated their package json to use the latest version of published libs
|
|
82
|
+
* So we should includes them in our commit.
|
|
83
|
+
*/
|
|
84
|
+
await sequentiallyRun(clientPkgs.map((pkg) => () => addFileToStage(`${pkg.location}`).catch(console.warn)));
|
|
86
85
|
await publishCommitAndTags(listPkgsForTag);
|
|
87
86
|
await push();
|
|
88
87
|
performance.mark(`end-publish-tagging`);
|
|
@@ -93,7 +92,7 @@ export async function action(commandOptions) {
|
|
|
93
92
|
logger.info('Skipped.');
|
|
94
93
|
}
|
|
95
94
|
logger.githubAction.endGroup();
|
|
96
|
-
//
|
|
95
|
+
// 4. Making github release
|
|
97
96
|
// NOTE: If any error happens in this step we are don't bail out the process and will continue. A warning will be shown.
|
|
98
97
|
logger.githubAction.group('🐙 Github release');
|
|
99
98
|
if (should('generateChangelog')) {
|
|
@@ -119,7 +118,7 @@ export async function action(commandOptions) {
|
|
|
119
118
|
logger.info('Skipped as it set on environments.');
|
|
120
119
|
}
|
|
121
120
|
logger.githubAction.endGroup();
|
|
122
|
-
//
|
|
121
|
+
// 5. Report
|
|
123
122
|
logger.githubAction.group('::group::📊 Report');
|
|
124
123
|
logger.table(pkgs.map((pkg) => {
|
|
125
124
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAkB,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAkB,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,IAAI,EACJ,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,MAAM,EAAC,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aAAM,CAAC;YACJ,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IACtD,CAAC;IACD,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IAE/B,YAAY;IACZ,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CACR,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,OAAO;YACH,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;SAC9B,CAAC;IACN,CAAC,CAAC,CACL,CAAC;IACF,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;AAEnC,CAAC"}
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
import type { Package, PackageState } from "./types.js";
|
|
2
2
|
import { type MonorepoGraph } from "../../../modules/mod.js";
|
|
3
|
+
import type { State } from "./state.js";
|
|
3
4
|
export declare function getAffectedPackages(sinceStart: boolean): Promise<Package[]>;
|
|
4
5
|
export declare function detectEdges(nodesWithDependencies: MonorepoGraph["dependencies"]): Map<string, {
|
|
5
6
|
indeg: string[];
|
|
6
7
|
outdeg: string[];
|
|
7
8
|
}>;
|
|
8
|
-
export declare function
|
|
9
|
+
export declare function determinePkgVersions(pkg: Package): Promise<{
|
|
9
10
|
version: string;
|
|
10
11
|
githubRelease: string;
|
|
11
12
|
gitTag: string;
|
|
12
|
-
npmVersion:
|
|
13
|
+
npmVersion: string;
|
|
13
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Runs the full publish pipeline for a single package: updates files, builds, and publishes to npm.
|
|
17
|
+
*
|
|
18
|
+
* @param pkg - The package to publish.
|
|
19
|
+
* @param options.onUpdateState - Callback invoked after a successful npm publish to persist the new npm version in shared state.
|
|
20
|
+
*/
|
|
21
|
+
export declare function publishPkg(pkg: Package, { onUpdateState }: {
|
|
22
|
+
onUpdateState: State['setState'];
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Writes the new version to the package's `package.json` and bumps the version
|
|
26
|
+
* constraint for every workspace package that depends on it.
|
|
27
|
+
*
|
|
28
|
+
* @param pkg - The package whose version should be written and propagated.
|
|
29
|
+
* @throws {IncreaseVersionFailedError} If the package manager fails to set the version.
|
|
30
|
+
*/
|
|
31
|
+
export declare function updatePackageJsonFiles(pkg: Package): Promise<void>;
|
|
14
32
|
export declare function throwIfUnableToProceed(pkgsState: Partial<PackageState>[]): void;
|
|
15
33
|
export declare function build(pkgs: Package[]): Promise<void>;
|
|
16
|
-
export declare function
|
|
17
|
-
onUpdateState:
|
|
34
|
+
export declare function tryPublishOnNpm(pkg: Package, { onUpdateState }: {
|
|
35
|
+
onUpdateState: State['setState'];
|
|
18
36
|
}): Promise<void>;
|
|
19
37
|
export declare function addPkgFileChangesToStage(pkg: any): Promise<void>;
|
|
20
38
|
export declare function sequentiallyRun(promises: any): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGR,OAAO,EACP,YAAY,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAgD,KAAK,aAAa,EAAC,MAAM,yBAAyB,CAAC;AA2B1G,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEtC,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,OAAO,sBAQ5D;AA2KD,wBAAgB,WAAW,CAAC,qBAAqB,EAAE,aAAa,CAAC,cAAc,CAAC;WACr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