rangutopia 0.0.1 → 0.0.3
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/.yarnrc.yml +1 -0
- package/dist/commands/library/build/action.d.ts.map +1 -1
- package/dist/commands/library/build/action.js +5 -4
- package/dist/commands/library/build/action.js.map +1 -1
- package/dist/commands/library/mod.d.ts.map +1 -1
- package/dist/commands/library/mod.js +10 -2
- package/dist/commands/library/mod.js.map +1 -1
- package/dist/commands/library/publish/action.d.ts +3 -0
- package/dist/commands/library/publish/action.d.ts.map +1 -0
- package/dist/commands/library/publish/action.js +132 -0
- package/dist/commands/library/publish/action.js.map +1 -0
- package/dist/commands/library/publish/configs.d.ts +6 -0
- package/dist/commands/library/publish/configs.d.ts.map +1 -0
- package/dist/commands/library/publish/configs.js +23 -0
- package/dist/commands/library/publish/configs.js.map +1 -0
- package/dist/commands/library/publish/constants.d.ts +2 -0
- package/dist/commands/library/publish/constants.d.ts.map +1 -0
- package/dist/commands/library/publish/constants.js +2 -0
- package/dist/commands/library/publish/constants.js.map +1 -0
- package/dist/commands/library/publish/errors.d.ts +41 -0
- package/dist/commands/library/publish/errors.d.ts.map +1 -0
- package/dist/commands/library/publish/errors.js +61 -0
- package/dist/commands/library/publish/errors.js.map +1 -0
- package/dist/commands/library/publish/features.d.ts +7 -0
- package/dist/commands/library/publish/features.d.ts.map +1 -0
- package/dist/commands/library/publish/features.js +29 -0
- package/dist/commands/library/publish/features.js.map +1 -0
- package/dist/commands/library/publish/graph.d.ts +15 -0
- package/dist/commands/library/publish/graph.d.ts.map +1 -0
- package/dist/commands/library/publish/graph.js +82 -0
- package/dist/commands/library/publish/graph.js.map +1 -0
- package/dist/commands/library/publish/helpers.d.ts +29 -0
- package/dist/commands/library/publish/helpers.d.ts.map +1 -0
- package/dist/commands/library/publish/helpers.js +676 -0
- package/dist/commands/library/publish/helpers.js.map +1 -0
- package/dist/commands/library/publish/mod.d.ts +2 -0
- package/dist/commands/library/publish/mod.d.ts.map +1 -0
- package/dist/commands/library/publish/mod.js +2 -0
- package/dist/commands/library/publish/mod.js.map +1 -0
- package/dist/commands/library/publish/options.d.ts +9 -0
- package/dist/commands/library/publish/options.d.ts.map +1 -0
- package/dist/commands/library/publish/options.js +8 -0
- package/dist/commands/library/publish/options.js.map +1 -0
- package/dist/commands/library/publish/state.d.ts +22 -0
- package/dist/commands/library/publish/state.d.ts.map +1 -0
- package/dist/commands/library/publish/state.js +44 -0
- package/dist/commands/library/publish/state.js.map +1 -0
- package/dist/commands/library/publish/types.d.ts +27 -0
- package/dist/commands/library/publish/types.d.ts.map +1 -0
- package/dist/commands/library/publish/types.js +2 -0
- package/dist/commands/library/publish/types.js.map +1 -0
- package/dist/commands/tools/husky/init/action.d.ts.map +1 -1
- package/dist/commands/tools/husky/init/action.js +4 -4
- 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/configs.d.ts +8 -0
- package/dist/configs.d.ts.map +1 -0
- package/dist/configs.js +13 -0
- package/dist/configs.js.map +1 -0
- package/dist/main.js +2 -1
- package/dist/main.js.map +1 -1
- package/dist/modules/logger/logger.d.ts +19 -0
- package/dist/modules/logger/logger.d.ts.map +1 -0
- package/dist/modules/logger/logger.js +47 -0
- package/dist/modules/logger/logger.js.map +1 -0
- package/dist/modules/logger/mod.d.ts +2 -0
- package/dist/modules/logger/mod.d.ts.map +1 -0
- package/dist/modules/logger/mod.js +2 -0
- package/dist/modules/logger/mod.js.map +1 -0
- package/dist/modules/mod.d.ts +3 -0
- package/dist/modules/mod.d.ts.map +1 -0
- package/dist/modules/mod.js +3 -0
- package/dist/modules/mod.js.map +1 -0
- package/dist/modules/monorepoManager/mod.d.ts +6 -0
- package/dist/modules/monorepoManager/mod.d.ts.map +1 -0
- package/dist/modules/monorepoManager/mod.js +26 -0
- package/dist/modules/monorepoManager/mod.js.map +1 -0
- package/dist/modules/monorepoManager/monorepoManager.d.ts +12 -0
- package/dist/modules/monorepoManager/monorepoManager.d.ts.map +1 -0
- package/dist/modules/monorepoManager/monorepoManager.js +13 -0
- package/dist/modules/monorepoManager/monorepoManager.js.map +1 -0
- package/dist/modules/monorepoManager/nxAdapter.d.ts +9 -0
- package/dist/modules/monorepoManager/nxAdapter.d.ts.map +1 -0
- package/dist/modules/monorepoManager/nxAdapter.js +27 -0
- package/dist/modules/monorepoManager/nxAdapter.js.map +1 -0
- package/dist/modules/monorepoManager/turborepoAdapter.d.ts +9 -0
- package/dist/modules/monorepoManager/turborepoAdapter.d.ts.map +1 -0
- package/dist/modules/monorepoManager/turborepoAdapter.js +33 -0
- package/dist/modules/monorepoManager/turborepoAdapter.js.map +1 -0
- package/dist/modules/monorepoManager/types.d.ts +5 -0
- package/dist/modules/monorepoManager/types.d.ts.map +1 -0
- package/dist/modules/monorepoManager/types.js +2 -0
- package/dist/modules/monorepoManager/types.js.map +1 -0
- package/dist/setup.d.ts +3 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +16 -0
- package/dist/setup.js.map +1 -0
- package/dist/utils/changelog.d.ts +8 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +86 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/fs.d.ts +1 -0
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +5 -0
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/log.d.ts +0 -8
- package/dist/utils/log.d.ts.map +1 -1
- package/dist/utils/log.js +2 -31
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/packageJson.d.ts +22 -0
- package/dist/utils/packageJson.d.ts.map +1 -1
- package/dist/utils/packageJson.js +30 -4
- package/dist/utils/packageJson.js.map +1 -1
- package/dist/utils/yarn.d.ts +15 -1
- package/dist/utils/yarn.d.ts.map +1 -1
- package/dist/utils/yarn.js +59 -10
- package/dist/utils/yarn.js.map +1 -1
- package/package.json +15 -5
- package/tsconfig.json +3 -1
- package/vitest.config.ts +11 -0
- package/.npmrc +0 -2
- package/dist/utils/ps.d.ts +0 -4
- package/dist/utils/ps.d.ts.map +0 -1
- package/dist/utils/ps.js +0 -21
- package/dist/utils/ps.js.map +0 -1
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/build/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAK1B,OAAO,EAAE,oBAAoB,EAAgB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/build/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAK1B,OAAO,EAAE,oBAAoB,EAAgB,MAAM,cAAc,CAAC;AAMlE,wBAAsB,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,iBAyBhF"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
import ora from "ora";
|
|
3
|
-
import {
|
|
3
|
+
import { logErrorAndExit, message } from "../../../utils/log.js";
|
|
4
4
|
import { action as checkAction } from "../check/mod.js";
|
|
5
5
|
import { build } from "esbuild";
|
|
6
6
|
import { CommandOptionsSchema, parseOptions } from "./options.js";
|
|
7
7
|
import { objectToCliParams } from "../../../utils/cli.js";
|
|
8
8
|
import { findBinaryPath } from "../../../utils/fs.js";
|
|
9
|
-
import {
|
|
9
|
+
import { logger } from "../../../modules/mod.js";
|
|
10
|
+
import spawn from "nano-spawn";
|
|
10
11
|
export async function action(commandOptions) {
|
|
11
12
|
await checkAction(commandOptions);
|
|
12
13
|
const options = await parseOptions(commandOptions).catch(logErrorAndExit);
|
|
13
14
|
const spinner = ora(`Running Typescript and ESBuild on ${options.package.name}\n`).start();
|
|
14
15
|
const tscParams = objectToCliParams(options.typescript);
|
|
15
16
|
const localTsc = await findBinaryPath("tsc");
|
|
16
|
-
const taskTsc =
|
|
17
|
+
const taskTsc = spawn(localTsc || "tsc", tscParams);
|
|
17
18
|
const taskEsbuild = build(options.esbuild).catch((reason) => {
|
|
18
19
|
throw new Error(message({ task: "esbuild" }, reason.errors.map(error => error.text).join("\n")), {
|
|
19
20
|
cause: reason
|
|
@@ -21,7 +22,7 @@ export async function action(commandOptions) {
|
|
|
21
22
|
});
|
|
22
23
|
await Promise.all([taskTsc, taskEsbuild]).catch((reason) => {
|
|
23
24
|
spinner.stop();
|
|
24
|
-
|
|
25
|
+
logger.error(reason.message);
|
|
25
26
|
logErrorAndExit(`Building '${options.package.name}' failed.`);
|
|
26
27
|
});
|
|
27
28
|
spinner.succeed(`'${options.package.name}' built.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../src/commands/library/build/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../../src/commands/library/build/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,EAAoB,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,M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AAO,CAAC,CAAC;QAC7B,eAAe,CAAC,aAAa,OAAO,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,CAAA;IACrE,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,CAAA;AAC3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/commands/library/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,iBAAS,cAAc,CAAC,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/commands/library/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,iBAAS,cAAc,CAAC,OAAO,EAAE,OAAO,QAgDvC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -17,8 +17,16 @@ function libraryCommand(program) {
|
|
|
17
17
|
const { action } = await import("./build/mod.js");
|
|
18
18
|
action(options);
|
|
19
19
|
});
|
|
20
|
-
library
|
|
21
|
-
|
|
20
|
+
library
|
|
21
|
+
.command("publish")
|
|
22
|
+
.description("Update your public packages' versions and changelogs, publish them on NPM, commit changes, and tag the commit")
|
|
23
|
+
.option("--prod", "Enables production flow, compares changes in the current branch with the last tagged commit", false)
|
|
24
|
+
.option("--next", "Enables next flow, uses regex pattern to match the last published commit title; changes since that commit will be considered for publishing", false)
|
|
25
|
+
.option("--experimental", "Enables experimental flow, compares changes since the current branch diverged from the main branch", false)
|
|
26
|
+
.option("--since-start", "consider all packages in the current branch for publishing", false)
|
|
27
|
+
.action(async (options) => {
|
|
28
|
+
const { action } = await import("./publish/mod.js");
|
|
29
|
+
action(options);
|
|
22
30
|
});
|
|
23
31
|
}
|
|
24
32
|
export { libraryCommand };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/commands/library/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,SAAS,cAAc,CAAC,OAAgB;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,4CAA4C,CAAC,CAAC;IAErG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,KAAK,EAAC,QAAQ,EAAC,EAAE;QACrE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,gDAAgD,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxG,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC;SACjD,MAAM,CAAC,mBAAmB,EAAE,yDAAyD,CAAC;SACtF,MAAM,CAAC,uBAAuB,EAAE,+DAA+D,CAAC;SAChG,MAAM,CAAC,wCAAwC,EAAE,wJAAwJ,CAAC;SAC1M,MAAM,CAAC,aAAa,EAAE,uBAAuB,EAAE,KAAK,CAAC;SACrD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QAClB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/commands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K,CACR;SACA,MAAM,CACH,QAAQ,EACR,6IAA6I,EAC7I,KAAK,CACR;SACA,MAAM,CACH,gBAAgB,EAChB,oGAAoG,EACpG,KAAK,CACR;SACA,MAAM,CACH,eAAe,EACf,4DAA4D,EAC5D,KAAK,CACR;SACA,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACtB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACpD,MAAM,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACX,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +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;AAgB9C,wBAAsB,MAAM,CAAC,cAAc,EAAE,WAAW,iBA8JvD"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { logger } from "../../../modules/mod.js";
|
|
2
|
+
import {} from "./options.js";
|
|
3
|
+
import { trySetConfigs } from "./configs.js";
|
|
4
|
+
import { tryPublish, build, getAffectedPackages, throwIfUnableToProceed, update, addPkgFileChangesToStage, publishCommitAndTags, push, makeGithubRelease, } from "./helpers.js";
|
|
5
|
+
import { State } from "./state.js";
|
|
6
|
+
import { should } from "./features.js";
|
|
7
|
+
export async function action(commandOptions) {
|
|
8
|
+
logger.githubAction.group('🔍 Checking environments...');
|
|
9
|
+
logger.info(commandOptions);
|
|
10
|
+
trySetConfigs(commandOptions);
|
|
11
|
+
logger.githubAction.endGroup();
|
|
12
|
+
// 1. Detect affected packages and increase version
|
|
13
|
+
logger.githubAction.group('🔍 Anlyzing dependencies...');
|
|
14
|
+
const affectedPkgs = await getAffectedPackages(commandOptions.sinceStart);
|
|
15
|
+
const libPkgs = affectedPkgs.filter((pkg) => !pkg.private);
|
|
16
|
+
if (libPkgs.length === 0) {
|
|
17
|
+
logger.info('No library has changed. Skip.');
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
logger.info('Current state:');
|
|
21
|
+
logger.table(libPkgs);
|
|
22
|
+
const state = new State(libPkgs);
|
|
23
|
+
const updateTasks = libPkgs.map((pkg) => {
|
|
24
|
+
return update(pkg).then((pkgState) => {
|
|
25
|
+
state.setState(pkg.name, 'gitTag', pkgState.gitTag);
|
|
26
|
+
state.setState(pkg.name, 'npmVersion', pkgState.npmVersion);
|
|
27
|
+
state.setState(pkg.name, 'version', pkgState.version);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
await Promise.all(updateTasks);
|
|
31
|
+
const pkgs = state.list();
|
|
32
|
+
const pkgStates = pkgs.map((pkg) => state.getState(pkg.name));
|
|
33
|
+
logger.info('Next state:');
|
|
34
|
+
logger.table(pkgs.map((pkg) => {
|
|
35
|
+
return {
|
|
36
|
+
name: pkg.name,
|
|
37
|
+
...state.getState(pkg.name),
|
|
38
|
+
};
|
|
39
|
+
}));
|
|
40
|
+
throwIfUnableToProceed(pkgStates);
|
|
41
|
+
logger.githubAction.endGroup();
|
|
42
|
+
// 2. Build all packacges
|
|
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
|
|
54
|
+
logger.githubAction.group(`🚀 Start publishing...`);
|
|
55
|
+
try {
|
|
56
|
+
await tryPublish(pkgs, {
|
|
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());
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// Ignoring error since it's possible to file hasn't changed yet.
|
|
69
|
+
await addPkgFileChangesToStage(pkg).catch(logger.warn);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
logger.githubAction.endGroup();
|
|
73
|
+
// 4. Tag and Push
|
|
74
|
+
/**
|
|
75
|
+
* Our final list will includes only packages that published on NPM.
|
|
76
|
+
* If a package failed on making changelog, github release, ...
|
|
77
|
+
* We are considering it's published and should handle those cases manually.
|
|
78
|
+
*/
|
|
79
|
+
const listPkgsForTag = state.list().filter((pkg) => {
|
|
80
|
+
const isPublishedOnNpm = !!state.getState(pkg.name, 'npmVersion');
|
|
81
|
+
return isPublishedOnNpm;
|
|
82
|
+
});
|
|
83
|
+
logger.githubAction.group(`🏷️ Tagging and commit... ${listPkgsForTag.length} packages for tagging.`);
|
|
84
|
+
if (listPkgsForTag.length > 0) {
|
|
85
|
+
performance.mark(`start-publish-tagging`);
|
|
86
|
+
await publishCommitAndTags(listPkgsForTag);
|
|
87
|
+
await push();
|
|
88
|
+
performance.mark(`end-publish-tagging`);
|
|
89
|
+
const duration_build = performance.measure(`publish-tagging`, `start-publish-tagging`, `end-publish-tagging`).duration;
|
|
90
|
+
logger.info(`Tagged. ${duration_build}ms`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
logger.info('Skipped.');
|
|
94
|
+
}
|
|
95
|
+
logger.githubAction.endGroup();
|
|
96
|
+
// 5. Making github release
|
|
97
|
+
// 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
|
+
logger.githubAction.group('🐙 Github release');
|
|
99
|
+
if (should('generateChangelog')) {
|
|
100
|
+
if (listPkgsForTag.length > 0) {
|
|
101
|
+
performance.mark(`start-publish-gh-release`);
|
|
102
|
+
const tasks = listPkgsForTag.map((pkg) => {
|
|
103
|
+
return makeGithubRelease(pkg)
|
|
104
|
+
.then(() => {
|
|
105
|
+
state.setState(pkg.name, 'githubRelease', pkg.version);
|
|
106
|
+
})
|
|
107
|
+
.catch(logger.warn);
|
|
108
|
+
});
|
|
109
|
+
await Promise.all(tasks);
|
|
110
|
+
performance.mark(`end-publish-gh-release`);
|
|
111
|
+
const duration_build = performance.measure(`publish-gh-release`, `start-publish-gh-release`, `end-publish-gh-release`).duration;
|
|
112
|
+
logger.info(`Finished. ${duration_build}ms`);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
logger.info('Skipped.');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
logger.info('Skipped as it set on environments.');
|
|
120
|
+
}
|
|
121
|
+
logger.githubAction.endGroup();
|
|
122
|
+
// 6. Report
|
|
123
|
+
logger.githubAction.group('::group::📊 Report');
|
|
124
|
+
logger.table(pkgs.map((pkg) => {
|
|
125
|
+
return {
|
|
126
|
+
name: pkg.name,
|
|
127
|
+
...state.getState(pkg.name),
|
|
128
|
+
};
|
|
129
|
+
}));
|
|
130
|
+
logger.githubAction.endGroup();
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +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,UAAU,EACV,KAAK,EACL,mBAAmB,EACnB,sBAAsB,EACtB,MAAM,EACN,wBAAwB,EACxB,oBA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AAC;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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Channels } from "./types.js";
|
|
2
|
+
import type { OptionsType } from "./options.js";
|
|
3
|
+
export declare const trySetConfigs: (_options: OptionsType) => void;
|
|
4
|
+
/** @deprecated Use {@link getConfig}(`"channel"`) directly */
|
|
5
|
+
export declare const detectChannel: () => Channels;
|
|
6
|
+
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/configs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,aAAa,GAAI,UAAU,WAAW,SAoBlD,CAAA;AAGD,8DAA8D;AAC9D,eAAO,MAAM,aAAa,QAAQ,QAEjC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getConfig, setConfigs } from "../../../configs.js";
|
|
2
|
+
export const trySetConfigs = (_options) => {
|
|
3
|
+
const chosenFlowsCount = [
|
|
4
|
+
_options.prod,
|
|
5
|
+
_options.next,
|
|
6
|
+
_options.experimental,
|
|
7
|
+
].filter(Boolean).length;
|
|
8
|
+
if (chosenFlowsCount === 0)
|
|
9
|
+
throw new Error("You should at least choose one flow between '--prod', '--next' and '--experimental'");
|
|
10
|
+
if (chosenFlowsCount !== 1)
|
|
11
|
+
throw new Error("You should choose only one flow between '--prod', '--next' and '--experimental'");
|
|
12
|
+
let channel = "experimental";
|
|
13
|
+
if (_options.prod)
|
|
14
|
+
channel = "prod";
|
|
15
|
+
if (_options.next)
|
|
16
|
+
channel = "next";
|
|
17
|
+
setConfigs("channel", channel);
|
|
18
|
+
};
|
|
19
|
+
/** @deprecated Use {@link getConfig}(`"channel"`) directly */
|
|
20
|
+
export const detectChannel = () => {
|
|
21
|
+
return getConfig("channel");
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=configs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configs.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/configs.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAG1D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAqB,EAAE,EAAE;IACnD,MAAM,gBAAgB,GAAG;QACrB,QAAQ,CAAC,IAAI;QACb,QAAQ,CAAC,IAAI;QACb,QAAQ,CAAC,YAAY;KACxB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IACzB,IAAI,gBAAgB,KAAK,CAAC;QACtB,MAAM,IAAI,KAAK,CACX,qFAAqF,CACxF,CAAC;IACN,IAAI,gBAAgB,KAAK,CAAC;QACtB,MAAM,IAAI,KAAK,CACX,iFAAiF,CACpF,CAAC;IAEN,IAAI,OAAO,GAAa,cAAc,CAAC;IACvC,IAAI,QAAQ,CAAC,IAAI;QAAE,OAAO,GAAG,MAAM,CAAC;IACpC,IAAI,QAAQ,CAAC,IAAI;QAAE,OAAO,GAAG,MAAM,CAAC;IAEpC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAClC,CAAC,CAAA;AAGD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAc,EAAE;IACzC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAA;AAC/B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare class GithubGetReleaseError extends Error {
|
|
2
|
+
name: string;
|
|
3
|
+
constructor(msg: any);
|
|
4
|
+
}
|
|
5
|
+
export declare class GithubReleaseNotFoundError extends Error {
|
|
6
|
+
name: string;
|
|
7
|
+
constructor(tag: any);
|
|
8
|
+
}
|
|
9
|
+
export declare class GitError extends Error {
|
|
10
|
+
name: string;
|
|
11
|
+
constructor(msg: any);
|
|
12
|
+
}
|
|
13
|
+
export declare class NpmPackageNotFoundError extends Error {
|
|
14
|
+
name: string;
|
|
15
|
+
constructor(packageName: any);
|
|
16
|
+
}
|
|
17
|
+
export declare class NpmGetPackageError extends Error {
|
|
18
|
+
name: string;
|
|
19
|
+
constructor(msg: any);
|
|
20
|
+
}
|
|
21
|
+
export declare class IncreaseVersionFailedError extends Error {
|
|
22
|
+
name: string;
|
|
23
|
+
constructor(msg: any);
|
|
24
|
+
}
|
|
25
|
+
export declare class UnableToProceedPublishError extends Error {
|
|
26
|
+
name: string;
|
|
27
|
+
constructor(msg: any);
|
|
28
|
+
}
|
|
29
|
+
export declare class NpmPublishError extends Error {
|
|
30
|
+
name: string;
|
|
31
|
+
constructor(msg: any);
|
|
32
|
+
}
|
|
33
|
+
export declare class CustomScriptError extends Error {
|
|
34
|
+
name: string;
|
|
35
|
+
constructor(msg: any);
|
|
36
|
+
}
|
|
37
|
+
export declare class GithubCreateReleaseFailedError extends Error {
|
|
38
|
+
name: string;
|
|
39
|
+
constructor(msg: any);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;IAC5C,IAAI,SAA2B;gBACnB,GAAG,KAAA;CAGlB;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IACjD,IAAI,SAAgC;gBACxB,GAAG,KAAA;CAGlB;AAED,qBAAa,QAAS,SAAQ,KAAK;IAC/B,IAAI,SAAc;gBAEN,GAAG,KAAA;CAGlB;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAC9C,IAAI,SAA6B;gBACrB,WAAW,KAAA;CAG1B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IACzC,IAAI,SAAwB;gBAChB,GAAG,KAAA;CAGlB;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IACjD,IAAI,SAAgC;gBACxB,GAAG,KAAA;CAGlB;AAED,qBAAa,2BAA4B,SAAQ,KAAK;IAClD,IAAI,SAAiC;gBACzB,GAAG,KAAA;CAGlB;AAED,qBAAa,eAAgB,SAAQ,KAAK;IACtC,IAAI,SAAqB;gBACb,GAAG,KAAA;CAGlB;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,IAAI,SAAuB;gBAEf,GAAG,KAAA;CAGlB;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IACrD,IAAI,SAAoC;gBAC5B,GAAG,KAAA;CAGlB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export class GithubGetReleaseError extends Error {
|
|
2
|
+
name = 'GithubGetReleaseError';
|
|
3
|
+
constructor(msg) {
|
|
4
|
+
super(msg);
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class GithubReleaseNotFoundError extends Error {
|
|
8
|
+
name = 'GithubReleaseNotFoundError';
|
|
9
|
+
constructor(tag) {
|
|
10
|
+
super(`Couldn't find any github release for ${tag}`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class GitError extends Error {
|
|
14
|
+
name = 'GitError';
|
|
15
|
+
constructor(msg) {
|
|
16
|
+
super(msg);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class NpmPackageNotFoundError extends Error {
|
|
20
|
+
name = 'NpmPackageNotFoundError';
|
|
21
|
+
constructor(packageName) {
|
|
22
|
+
super(`Couldn't find ${packageName} on NPM.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class NpmGetPackageError extends Error {
|
|
26
|
+
name = 'NpmGetPackageError';
|
|
27
|
+
constructor(msg) {
|
|
28
|
+
super(msg);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export class IncreaseVersionFailedError extends Error {
|
|
32
|
+
name = 'IncreaseVersionFailedError';
|
|
33
|
+
constructor(msg) {
|
|
34
|
+
super(msg);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class UnableToProceedPublishError extends Error {
|
|
38
|
+
name = 'UnableToProceedPublishError';
|
|
39
|
+
constructor(msg) {
|
|
40
|
+
super(msg);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export class NpmPublishError extends Error {
|
|
44
|
+
name = 'NpmPublishError';
|
|
45
|
+
constructor(msg) {
|
|
46
|
+
super(msg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export class CustomScriptError extends Error {
|
|
50
|
+
name = 'CustomScriptError';
|
|
51
|
+
constructor(msg) {
|
|
52
|
+
super(msg);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export class GithubCreateReleaseFailedError extends Error {
|
|
56
|
+
name = 'GithubCreateReleaseFailedError';
|
|
57
|
+
constructor(msg) {
|
|
58
|
+
super(msg);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5C,IAAI,GAAG,uBAAuB,CAAC;IAC/B,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACjD,IAAI,GAAG,4BAA4B,CAAC;IACpC,YAAY,GAAG;QACX,KAAK,CAAC,wCAAwC,GAAG,EAAE,CAAC,CAAC;IACzD,CAAC;CACJ;AAED,MAAM,OAAO,QAAS,SAAQ,KAAK;IAC/B,IAAI,GAAG,UAAU,CAAC;IAElB,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC9C,IAAI,GAAG,yBAAyB,CAAC;IACjC,YAAY,WAAW;QACnB,KAAK,CAAC,iBAAiB,WAAW,UAAU,CAAC,CAAC;IAClD,CAAC;CACJ;AAED,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACzC,IAAI,GAAG,oBAAoB,CAAC;IAC5B,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACjD,IAAI,GAAG,4BAA4B,CAAC;IACpC,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAClD,IAAI,GAAG,6BAA6B,CAAC;IACrC,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC,IAAI,GAAG,iBAAiB,CAAC;IACzB,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxC,IAAI,GAAG,mBAAmB,CAAC;IAE3B,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ;AAED,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACrD,IAAI,GAAG,gCAAgC,CAAC;IACxC,YAAY,GAAG;QACX,KAAK,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/features.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,WAOjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { detectChannel } from "./configs.js";
|
|
2
|
+
/**
|
|
3
|
+
* Features configurations
|
|
4
|
+
*
|
|
5
|
+
* Note 1: Please add to `checkEnvironments` proper values when you add something to this object.
|
|
6
|
+
* Note 2: Pass distribution channel as value.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
const config = {
|
|
10
|
+
generateChangelog: ['prod'],
|
|
11
|
+
checkGithubRelease: ['prod'],
|
|
12
|
+
checkGitTags: ['prod'],
|
|
13
|
+
checkNpm: ['prod', 'next'],
|
|
14
|
+
createPublishCommit: ['prod', 'next'],
|
|
15
|
+
createPublishTag: ['prod'],
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Check a config and returns `true` if should do anything.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export function should(key) {
|
|
23
|
+
const channel = detectChannel();
|
|
24
|
+
if (config[key].includes(channel)) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,GAAG;IACX,iBAAiB,EAAE,CAAC,MAAM,CAAC;IAC3B,kBAAkB,EAAE,CAAC,MAAM,CAAC;IAC5B,YAAY,EAAE,CAAC,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,CAAC,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW;IAC9B,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ROOT_KEY = "__ROOT__";
|
|
2
|
+
export declare class Graph {
|
|
3
|
+
nodes: Map<string, string[]>;
|
|
4
|
+
constructor();
|
|
5
|
+
addNode(node: any): void;
|
|
6
|
+
addEdge(source: any, destination: any): void;
|
|
7
|
+
onlyAffected(list: string[]): void;
|
|
8
|
+
sort(): Set<string>;
|
|
9
|
+
kindaDFS(startNode: string, sortedList: Set<string>, graph: Map<string, string[]>): void;
|
|
10
|
+
dfs(node: string, visitedNodes: Map<string, {
|
|
11
|
+
outdeg: number;
|
|
12
|
+
}>, graph: Map<string, string[]>): void;
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/graph.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,qBAAa,KAAK;IACd,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;;IAO5B,OAAO,CAAC,IAAI,KAAA;IAIZ,OAAO,CAAC,MAAM,KAAA,EAAE,WAAW,KAAA;IAI3B,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE;IAwB3B,IAAI;IAWJ,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAajF,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAY3F,QAAQ;CASX"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { detectEdges } from './helpers.js';
|
|
2
|
+
export const ROOT_KEY = '__ROOT__';
|
|
3
|
+
export class Graph {
|
|
4
|
+
nodes;
|
|
5
|
+
constructor() {
|
|
6
|
+
this.nodes = new Map();
|
|
7
|
+
this.addNode(ROOT_KEY);
|
|
8
|
+
}
|
|
9
|
+
addNode(node) {
|
|
10
|
+
this.nodes.set(node, []);
|
|
11
|
+
}
|
|
12
|
+
addEdge(source, destination) {
|
|
13
|
+
this.nodes.get(source).push(destination);
|
|
14
|
+
}
|
|
15
|
+
onlyAffected(list) {
|
|
16
|
+
const finalNodes = new Set();
|
|
17
|
+
const edges = detectEdges(this.nodes);
|
|
18
|
+
list.forEach((affectedNode) => {
|
|
19
|
+
finalNodes.add(affectedNode);
|
|
20
|
+
bubbleUp(finalNodes, edges, affectedNode);
|
|
21
|
+
});
|
|
22
|
+
const nextNodes = new Map();
|
|
23
|
+
this.nodes.forEach((edges, node) => {
|
|
24
|
+
if (finalNodes.has(node)) {
|
|
25
|
+
nextNodes.set(node, edges.filter((dependentOnNode) => {
|
|
26
|
+
return finalNodes.has(dependentOnNode);
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
this.nodes = nextNodes;
|
|
31
|
+
}
|
|
32
|
+
sort() {
|
|
33
|
+
const sortedList = new Set();
|
|
34
|
+
const tempGraph = structuredClone(this.nodes);
|
|
35
|
+
while (tempGraph.size > 1) {
|
|
36
|
+
this.kindaDFS(ROOT_KEY, sortedList, tempGraph);
|
|
37
|
+
}
|
|
38
|
+
return sortedList;
|
|
39
|
+
}
|
|
40
|
+
kindaDFS(startNode, sortedList, graph) {
|
|
41
|
+
const visitedNodes = new Map();
|
|
42
|
+
this.dfs(startNode, visitedNodes, graph);
|
|
43
|
+
visitedNodes.forEach((value, node) => {
|
|
44
|
+
if (value.outdeg === 0) {
|
|
45
|
+
sortedList.add(node);
|
|
46
|
+
graph.delete(node);
|
|
47
|
+
removeEdgeTo(node, graph);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
dfs(node, visitedNodes, graph) {
|
|
52
|
+
const neighbors = graph.get(node);
|
|
53
|
+
visitedNodes.set(node, {
|
|
54
|
+
outdeg: neighbors.length,
|
|
55
|
+
});
|
|
56
|
+
for (const neighbor of neighbors) {
|
|
57
|
+
if (!visitedNodes.has(neighbor)) {
|
|
58
|
+
this.dfs(neighbor, visitedNodes, graph);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
toString() {
|
|
63
|
+
let output = '';
|
|
64
|
+
for (const [node, neighbors] of this.nodes) {
|
|
65
|
+
let neighborsStr = neighbors.length > 0 ? neighbors.join(', ') : 'None';
|
|
66
|
+
output += `${node} -> ${neighborsStr}\n`;
|
|
67
|
+
}
|
|
68
|
+
return output;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function removeEdgeTo(targetNode, graph) {
|
|
72
|
+
for (const node of graph.keys()) {
|
|
73
|
+
graph.set(node, graph.get(node).filter((edge) => edge !== targetNode));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function bubbleUp(result, nodesWithEdges, targetNode) {
|
|
77
|
+
nodesWithEdges.get(targetNode).indeg.forEach((parentNode) => {
|
|
78
|
+
result.add(parentNode);
|
|
79
|
+
bubbleUp(result, nodesWithEdges, parentNode);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../../src/commands/library/publish/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAEnC,MAAM,OAAO,KAAK;IACd,KAAK,CAAuB;IAE5B;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,CAAC,IAAI;QACR,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,WAAW;QACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAED,YAAY,CAAC,IAAc;QACvB,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC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C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC,CACxD,CAAC;IACN,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU;IAChD,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACxD,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Package, PackageState } from "./types.js";
|
|
2
|
+
import { type MonorepoGraph } from "../../../modules/mod.js";
|
|
3
|
+
export declare function getAffectedPackages(sinceStart: boolean): Promise<Package[]>;
|
|
4
|
+
export declare function detectEdges(nodesWithDependencies: MonorepoGraph["dependencies"]): Map<string, {
|
|
5
|
+
indeg: string[];
|
|
6
|
+
outdeg: string[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function update(pkg: Package): Promise<{
|
|
9
|
+
version: string;
|
|
10
|
+
githubRelease: string;
|
|
11
|
+
gitTag: string;
|
|
12
|
+
npmVersion: any;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function throwIfUnableToProceed(pkgsState: Partial<PackageState>[]): void;
|
|
15
|
+
export declare function build(pkgs: Package[]): Promise<void>;
|
|
16
|
+
export declare function tryPublish(pkgs: Package[], { onUpdateState }: {
|
|
17
|
+
onUpdateState: (pkgName: string, name: "gitTag" | "githubRelease" | "npmVersion" | "version", value: string) => void;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
export declare function addPkgFileChangesToStage(pkg: any): Promise<void>;
|
|
20
|
+
export declare function sequentiallyRun(promises: any): Promise<any>;
|
|
21
|
+
export declare function addFileToStage(path: any): Promise<void>;
|
|
22
|
+
export declare function publishCommitAndTags(pkgs: Package[]): Promise<string[]>;
|
|
23
|
+
export declare function push(options?: {
|
|
24
|
+
setupRemote: boolean;
|
|
25
|
+
branch: string;
|
|
26
|
+
remote: string;
|
|
27
|
+
}): Promise<string>;
|
|
28
|
+
export declare function makeGithubRelease(pkg: Package): Promise<string>;
|
|
29
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/commands/library/publish/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIR,OAAO,EACP,YAAY,EAEf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAA6B,KAAK,aAAa,EAAC,MAAM,yBAAyB,CAAC;AA2BvF,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,OAAO,sBAQ5D;AA2KD,wBAAgB,WAAW,CAAC,qBAAqB,EAAE,aAAa,CAAC,cAAc,CAAC;WACrC,MAAM,EAAE;YAAU,MAAM,EAAE;GAmBpE;AAuBD,wBAAsB,MAAM,CAAC,GAAG,EAAE,OAAO;;;;;GAsBxC;AAkQD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,QAqCxE;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,iBAY1C;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE;IAAC,aAAa,EAAE,CAC7E,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,QAAQ,GAAG,eAAe,GAAG,YAAY,GAAG,SAAS,EAC3D,KAAK,EAAE,MAAM,KACZ,IAAI,CAAA;CAAC,iBAab;AAkHD,wBAAsB,wBAAwB,CAAC,GAAG,KAAA,iBAKjD;AAED,wBAAsB,eAAe,CAAC,QAAQ,KAAA,gBAM7C;AAED,wBAAsB,cAAc,CAAC,IAAI,KAAA,iBAIxC;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,OAAO,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