rangutopia 0.0.0-experimental-d5da43c68
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/.editorconfig +10 -0
- package/.gitattributes +4 -0
- package/.yarnrc.yml +1 -0
- package/README.md +4 -0
- package/dist/commands/library/build/action.d.ts +4 -0
- package/dist/commands/library/build/action.d.ts.map +1 -0
- package/dist/commands/library/build/action.js +30 -0
- package/dist/commands/library/build/action.js.map +1 -0
- package/dist/commands/library/build/mod.d.ts +2 -0
- package/dist/commands/library/build/mod.d.ts.map +1 -0
- package/dist/commands/library/build/mod.js +2 -0
- package/dist/commands/library/build/mod.js.map +1 -0
- package/dist/commands/library/build/options.d.ts +23 -0
- package/dist/commands/library/build/options.d.ts.map +1 -0
- package/dist/commands/library/build/options.js +98 -0
- package/dist/commands/library/build/options.js.map +1 -0
- package/dist/commands/library/check/action.d.ts +2 -0
- package/dist/commands/library/check/action.d.ts.map +1 -0
- package/dist/commands/library/check/action.js +24 -0
- package/dist/commands/library/check/action.js.map +1 -0
- package/dist/commands/library/check/mod.d.ts +2 -0
- package/dist/commands/library/check/mod.d.ts.map +1 -0
- package/dist/commands/library/check/mod.js +2 -0
- package/dist/commands/library/check/mod.js.map +1 -0
- package/dist/commands/library/mod.d.ts +4 -0
- package/dist/commands/library/mod.d.ts.map +1 -0
- package/dist/commands/library/mod.js +33 -0
- package/dist/commands/library/mod.js.map +1 -0
- 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 +3 -0
- package/dist/commands/library/publish/constants.d.ts.map +1 -0
- package/dist/commands/library/publish/constants.js +3 -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 +624 -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 +18 -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 +4 -0
- package/dist/commands/tools/husky/init/action.d.ts.map +1 -0
- package/dist/commands/tools/husky/init/action.js +82 -0
- package/dist/commands/tools/husky/init/action.js.map +1 -0
- package/dist/commands/tools/husky/init/mod.d.ts +2 -0
- package/dist/commands/tools/husky/init/mod.d.ts.map +1 -0
- package/dist/commands/tools/husky/init/mod.js +2 -0
- package/dist/commands/tools/husky/init/mod.js.map +1 -0
- package/dist/commands/tools/husky/init/options.d.ts +10 -0
- package/dist/commands/tools/husky/init/options.d.ts.map +1 -0
- package/dist/commands/tools/husky/init/options.js +10 -0
- package/dist/commands/tools/husky/init/options.js.map +1 -0
- package/dist/commands/tools/husky/mod.d.ts +4 -0
- package/dist/commands/tools/husky/mod.d.ts.map +1 -0
- package/dist/commands/tools/husky/mod.js +12 -0
- package/dist/commands/tools/husky/mod.js.map +1 -0
- package/dist/commands/tools/lint/init/action.d.ts +2 -0
- package/dist/commands/tools/lint/init/action.d.ts.map +1 -0
- package/dist/commands/tools/lint/init/action.js +19 -0
- package/dist/commands/tools/lint/init/action.js.map +1 -0
- package/dist/commands/tools/lint/init/mod.d.ts +2 -0
- package/dist/commands/tools/lint/init/mod.d.ts.map +1 -0
- package/dist/commands/tools/lint/init/mod.js +2 -0
- package/dist/commands/tools/lint/init/mod.js.map +1 -0
- package/dist/commands/tools/lint/mod.d.ts +4 -0
- package/dist/commands/tools/lint/mod.d.ts.map +1 -0
- package/dist/commands/tools/lint/mod.js +11 -0
- package/dist/commands/tools/lint/mod.js.map +1 -0
- package/dist/commands/tools/mod.d.ts +4 -0
- package/dist/commands/tools/mod.d.ts.map +1 -0
- package/dist/commands/tools/mod.js +10 -0
- package/dist/commands/tools/mod.js.map +1 -0
- 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/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +12 -0
- package/dist/main.js.map +1 -0
- 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 +4 -0
- package/dist/modules/mod.d.ts.map +1 -0
- package/dist/modules/mod.js +4 -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/modules/packageManager/helpers.d.ts +3 -0
- package/dist/modules/packageManager/helpers.d.ts.map +1 -0
- package/dist/modules/packageManager/helpers.js +22 -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 +16 -0
- package/dist/modules/packageManager/packageManager.d.ts.map +1 -0
- package/dist/modules/packageManager/packageManager.js +19 -0
- package/dist/modules/packageManager/packageManager.js.map +1 -0
- package/dist/modules/packageManager/types.d.ts +7 -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 +49 -0
- package/dist/modules/packageManager/yarnBerryAdapter.js.map +1 -0
- package/dist/modules/packageManager/yarnClassicAdapter.d.ts +8 -0
- package/dist/modules/packageManager/yarnClassicAdapter.d.ts.map +1 -0
- package/dist/modules/packageManager/yarnClassicAdapter.js +38 -0
- package/dist/modules/packageManager/yarnClassicAdapter.js.map +1 -0
- package/dist/setup.d.ts +3 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +17 -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/cli.d.ts +2 -0
- package/dist/utils/cli.d.ts.map +1 -0
- package/dist/utils/cli.js +18 -0
- package/dist/utils/cli.js.map +1 -0
- package/dist/utils/fs.d.ts +6 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +36 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/log.d.ts +7 -0
- package/dist/utils/log.d.ts.map +1 -0
- package/dist/utils/log.js +9 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/packageJson.d.ts +45 -0
- package/dist/utils/packageJson.d.ts.map +1 -0
- package/dist/utils/packageJson.js +135 -0
- package/dist/utils/packageJson.js.map +1 -0
- package/dist/utils/parse.d.ts +3 -0
- package/dist/utils/parse.d.ts.map +1 -0
- package/dist/utils/parse.js +15 -0
- package/dist/utils/parse.js.map +1 -0
- package/dist/utils/yarn.d.ts +16 -0
- package/dist/utils/yarn.d.ts.map +1 -0
- package/dist/utils/yarn.js +60 -0
- package/dist/utils/yarn.js.map +1 -0
- package/package.json +38 -0
- package/templates/format/.prettierrc.json +6 -0
- package/templates/husky/commit-msg +4 -0
- package/templates/husky/post-commit +9 -0
- package/templates/husky/pre-commit +4 -0
- package/templates/lint/.lintstagedrc.mjs +14 -0
- package/templates/lint/commitlint.config.js +5 -0
- package/templates/lint/eslint.config.mjs +3 -0
- package/tsconfig.json +14 -0
- package/vitest.config.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../src/modules/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAC,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAqB,MAAM,0BAA0B,CAAA;AAC5H,OAAO,EAAC,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MonorepoManager } from "./monorepoManager.js";
|
|
2
|
+
export declare const setupMonorepoManager: () => void;
|
|
3
|
+
export declare const getMonorepoManager: () => MonorepoManager;
|
|
4
|
+
export declare const removeMonorepoManager: () => void;
|
|
5
|
+
export type { MonorepoGraph } from "./types.js";
|
|
6
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/modules/monorepoManager/mod.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAIrD,eAAO,MAAM,oBAAoB,YAWhC,CAAA;AAED,eAAO,MAAM,kBAAkB,uBAK9B,CAAA;AAED,eAAO,MAAM,qBAAqB,YAEjC,CAAA;AAED,YAAY,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { TurborepoAdapter } from "./turborepoAdapter.js";
|
|
3
|
+
import { NxAdapter } from "./nxAdapter.js";
|
|
4
|
+
import { MonorepoManager } from "./monorepoManager.js";
|
|
5
|
+
let monorepoManager;
|
|
6
|
+
export const setupMonorepoManager = () => {
|
|
7
|
+
if (monorepoManager) {
|
|
8
|
+
throw new Error("monorepo manager already setup");
|
|
9
|
+
}
|
|
10
|
+
if (fs.existsSync("turbo.json")) {
|
|
11
|
+
monorepoManager = new MonorepoManager(new TurborepoAdapter());
|
|
12
|
+
}
|
|
13
|
+
else if (fs.existsSync("nx.json")) {
|
|
14
|
+
monorepoManager = new MonorepoManager(new NxAdapter());
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export const getMonorepoManager = () => {
|
|
18
|
+
if (!monorepoManager) {
|
|
19
|
+
throw new Error("monorepo manager does not exist");
|
|
20
|
+
}
|
|
21
|
+
return monorepoManager;
|
|
22
|
+
};
|
|
23
|
+
export const removeMonorepoManager = () => {
|
|
24
|
+
monorepoManager = null;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=mod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/modules/monorepoManager/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAC,gBAAgB,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,IAAI,eAAgC,CAAC;AAErC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,IAAI,eAAe,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC;IAClE,CAAC;SACI,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;IAC3D,CAAC;AACL,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACnC,IAAI,CAAC,eAAe,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACtC,eAAe,GAAG,IAAI,CAAC;AAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MonorepoGraph } from "./types.js";
|
|
2
|
+
export interface IMonorepoManagerAdapter {
|
|
3
|
+
graph(): Promise<MonorepoGraph>;
|
|
4
|
+
build(projects: string[]): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare class MonorepoManager implements IMonorepoManagerAdapter {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(adapter: IMonorepoManagerAdapter);
|
|
9
|
+
graph(): Promise<MonorepoGraph>;
|
|
10
|
+
build(packages: string[]): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=monorepoManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorepoManager.d.ts","sourceRoot":"","sources":["../../../src/modules/monorepoManager/monorepoManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACpC,KAAK,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,qBAAa,eAAgB,YAAW,uBAAuB;;gBAG/C,OAAO,EAAE,uBAAuB;IAItC,KAAK;IAIL,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE;CAGjC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class MonorepoManager {
|
|
2
|
+
#adapter;
|
|
3
|
+
constructor(adapter) {
|
|
4
|
+
this.#adapter = adapter;
|
|
5
|
+
}
|
|
6
|
+
async graph() {
|
|
7
|
+
return this.#adapter.graph();
|
|
8
|
+
}
|
|
9
|
+
async build(packages) {
|
|
10
|
+
return this.#adapter.build(packages);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=monorepoManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorepoManager.js","sourceRoot":"","sources":["../../../src/modules/monorepoManager/monorepoManager.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,eAAe;IACxB,QAAQ,CAA0B;IAElC,YAAY,OAAgC;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,KAAK;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,QAAkB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IMonorepoManagerAdapter } from "./monorepoManager.js";
|
|
2
|
+
export declare class NxAdapter implements IMonorepoManagerAdapter {
|
|
3
|
+
graph(): Promise<{
|
|
4
|
+
nodes: string[];
|
|
5
|
+
dependencies: Map<string, string[]>;
|
|
6
|
+
}>;
|
|
7
|
+
build(projects: string[]): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=nxAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nxAdapter.d.ts","sourceRoot":"","sources":["../../../src/modules/monorepoManager/nxAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AAclE,qBAAa,SAAU,YAAW,uBAAuB;IAC/C,KAAK;;;;IAsBL,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMjD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { join } from "path";
|
|
2
|
+
import { ROOT_PATH } from "../../constants.js";
|
|
3
|
+
import spawn from "nano-spawn";
|
|
4
|
+
import { importJson } from "../../utils/fs.js";
|
|
5
|
+
import { rmSync } from "node:fs";
|
|
6
|
+
export class NxAdapter {
|
|
7
|
+
async graph() {
|
|
8
|
+
const filename = '__output__.json';
|
|
9
|
+
const filepath = join(ROOT_PATH, filename);
|
|
10
|
+
await spawn('yarn', ['nx', 'graph', '--file', filename]).catch(async (error) => {
|
|
11
|
+
throw new Error(`Creating graph file failed. \n ${error.stderr}`);
|
|
12
|
+
});
|
|
13
|
+
const nxGraph = await importJson(filepath);
|
|
14
|
+
rmSync(filename, { force: true });
|
|
15
|
+
return {
|
|
16
|
+
nodes: Object.keys(nxGraph.graph.nodes),
|
|
17
|
+
dependencies: new Map(Object.keys(nxGraph.graph.dependencies).map(dep => ([dep, nxGraph.graph.dependencies[dep].map(depNode => depNode.target)]))),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async build(projects) {
|
|
21
|
+
await spawn("yarn", ["nx",
|
|
22
|
+
"run-many", "--target=build",
|
|
23
|
+
`--projects=${projects.join(",")}`,
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=nxAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nxAdapter.js","sourceRoot":"","sources":["../../../src/modules/monorepoManager/nxAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAS/B,MAAM,OAAO,SAAS;IAClB,KAAK,CAAC,KAAK;QACP,MAAM,QAAQ,GAAG,iBAAiB,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAE3C,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC3E,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,MAAM,UAAU,CAAU,QAAQ,CAAC,CAAC;QAEpD,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAElC,OAAO;YACH,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;YACvC,YAAY,EAAE,IAAI,GAAG,CACjB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CACvC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CACjF,CACJ;SACJ,CAAC;IACN,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,QAAkB;QAC1B,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI;YACrB,UAAU,EAAE,gBAAgB;YAC5B,cAAc,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;SACrC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IMonorepoManagerAdapter } from "./monorepoManager.js";
|
|
2
|
+
export declare class TurborepoAdapter implements IMonorepoManagerAdapter {
|
|
3
|
+
graph(): Promise<{
|
|
4
|
+
nodes: string[];
|
|
5
|
+
dependencies: Map<string, string[]>;
|
|
6
|
+
}>;
|
|
7
|
+
build(projects: string[]): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=turborepoAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turborepoAdapter.d.ts","sourceRoot":"","sources":["../../../src/modules/monorepoManager/turborepoAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,sBAAsB,CAAC;AAyBlE,qBAAa,gBAAiB,YAAW,uBAAuB;IACtD,KAAK;;;;IAwBL,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAKjD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import spawn from "nano-spawn";
|
|
2
|
+
const findAndParseJsonFromOutput = (output) => {
|
|
3
|
+
const start = output.indexOf('{');
|
|
4
|
+
const end = output.lastIndexOf('}');
|
|
5
|
+
if (start === -1 || end === -1)
|
|
6
|
+
throw new Error(`No JSON found in output:\n${output}`);
|
|
7
|
+
return JSON.parse(output.slice(start, end + 1));
|
|
8
|
+
};
|
|
9
|
+
export class TurborepoAdapter {
|
|
10
|
+
async graph() {
|
|
11
|
+
const lsResult = await spawn('yarn', ['turbo', 'ls', '--output=json']).catch((error) => {
|
|
12
|
+
throw new Error(`Listing packages failed.\n ${error.stderr}`);
|
|
13
|
+
});
|
|
14
|
+
const turboLs = findAndParseJsonFromOutput(lsResult.stdout);
|
|
15
|
+
const dryResult = await spawn('yarn', ['turbo', 'run', 'build', '--dry=json']).catch((error) => {
|
|
16
|
+
throw new Error(`Creating dry-run failed.\n ${error.stderr}`);
|
|
17
|
+
});
|
|
18
|
+
const turboDry = findAndParseJsonFromOutput(dryResult.stdout);
|
|
19
|
+
return {
|
|
20
|
+
nodes: turboLs.packages.items.map(pkg => pkg.name),
|
|
21
|
+
dependencies: new Map(turboDry.tasks.map(task => [
|
|
22
|
+
task.package,
|
|
23
|
+
task.dependencies.map(dep => dep.split('#')[0])
|
|
24
|
+
])),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async build(projects) {
|
|
28
|
+
await spawn('yarn', ['turbo', 'run', 'build',
|
|
29
|
+
...projects.map(p => `--filter=${p}`),
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=turborepoAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turborepoAdapter.js","sourceRoot":"","sources":["../../../src/modules/monorepoManager/turborepoAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAiB/B,MAAM,0BAA0B,GAAG,CAAC,MAAc,EAAW,EAAE;IAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;IACvF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,OAAO,gBAAgB;IACzB,KAAK,CAAC,KAAK;QACP,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACnF,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAsB,CAAC;QAEjF,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3F,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,0BAA0B,CAAC,SAAS,CAAC,MAAM,CAAoB,CAAC;QAEjF,OAAO;YACH,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;YAClD,YAAY,EAAE,IAAI,GAAG,CACjB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAClD,CAAC,CACL;SACJ,CAAC;IACN,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,QAAkB;QAC1B,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO;YACxC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;SACxC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/monorepoManager/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/monorepoManager/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/modules/packageManager/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAKhD,eAAO,MAAM,oBAAoB,QAAO,eAgBvC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { readPackageJson } from "../../utils/packageJson.js";
|
|
2
|
+
import { ROOT_PATH } from "../../constants.js";
|
|
3
|
+
import { isFileExists } from "../../utils/fs.js";
|
|
4
|
+
export const detectPackageManager = () => {
|
|
5
|
+
const rootPackageJson = readPackageJson(ROOT_PATH);
|
|
6
|
+
const pm = rootPackageJson.packageManager;
|
|
7
|
+
if (typeof pm === 'string') {
|
|
8
|
+
if (pm.startsWith("yarn@1"))
|
|
9
|
+
return "yarn-classic";
|
|
10
|
+
if (pm.startsWith("yarn"))
|
|
11
|
+
return "yarn-berry";
|
|
12
|
+
}
|
|
13
|
+
if (isFileExists("yarn.lock")) {
|
|
14
|
+
if (isFileExists(".yarnrc.yml"))
|
|
15
|
+
return "yarn-berry";
|
|
16
|
+
if (isFileExists(".pnp.cjs") || isFileExists(".pnp.js"))
|
|
17
|
+
return "yarn-berry";
|
|
18
|
+
return "yarn-classic";
|
|
19
|
+
}
|
|
20
|
+
throw new Error("Could not detect the package manager");
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/modules/packageManager/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAoB,EAAE;IACtD,MAAM,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,EAAE,GAAG,eAAe,CAAC,cAAc,CAAC;IAE1C,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QACzB,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,cAAc,CAAC;QACnD,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,YAAY,CAAC;IACnD,CAAC;IAED,IAAI,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,IAAI,YAAY,CAAC,aAAa,CAAC;YAAE,OAAO,YAAY,CAAC;QACrD,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,YAAY,CAAC,SAAS,CAAC;YAAE,OAAO,YAAY,CAAC;QAC7E,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/modules/packageManager/mod.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,eAAO,MAAM,mBAAmB,YAc/B,CAAC;AAEF,eAAO,MAAM,iBAAiB,sBAK7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAEhC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { YarnClassicAdapter } from "./yarnClassicAdapter.js";
|
|
2
|
+
import { YarnBerryAdapter } from "./yarnBerryAdapter.js";
|
|
3
|
+
import { PackageManager } from "./packageManager.js";
|
|
4
|
+
import { detectPackageManager } from "./helpers.js";
|
|
5
|
+
let packageManager;
|
|
6
|
+
export const setupPackageManager = () => {
|
|
7
|
+
if (packageManager) {
|
|
8
|
+
throw new Error("package manager already setup");
|
|
9
|
+
}
|
|
10
|
+
const detected = detectPackageManager();
|
|
11
|
+
if (detected === 'yarn-berry') {
|
|
12
|
+
packageManager = new PackageManager(new YarnBerryAdapter());
|
|
13
|
+
}
|
|
14
|
+
else if (detected === 'yarn-classic') {
|
|
15
|
+
packageManager = new PackageManager(new YarnClassicAdapter());
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
throw new Error(`Package manager "${detected}" is not supported yet`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const getPackageManager = () => {
|
|
22
|
+
if (!packageManager) {
|
|
23
|
+
throw new Error("package manager does not exist");
|
|
24
|
+
}
|
|
25
|
+
return packageManager;
|
|
26
|
+
};
|
|
27
|
+
export const removePackageManager = () => {
|
|
28
|
+
packageManager = null;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=mod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../src/modules/packageManager/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAElD,IAAI,cAA8B,CAAC;AAEnC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACpC,IAAI,cAAc,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,QAAQ,GAAG,oBAAoB,EAAE,CAAC;IAExC,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC5B,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAC;IAChE,CAAC;SAAM,IAAI,QAAQ,KAAK,cAAc,EAAE,CAAC;QACrC,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,wBAAwB,CAAC,CAAC;IAC1E,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,cAAc,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,cAAc,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { YarnWorkspaceInfo } from "./types.js";
|
|
2
|
+
export interface IPackageManagerAdapter {
|
|
3
|
+
add(packages: string[], type?: 'dev'): Promise<void>;
|
|
4
|
+
getWorkspaces(): Promise<YarnWorkspaceInfo>;
|
|
5
|
+
setVersion(packageName: string, newVersion: string): Promise<void>;
|
|
6
|
+
publish(pkgLocation: string, tag: string): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare class PackageManager implements IPackageManagerAdapter {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(adapter: IPackageManagerAdapter);
|
|
11
|
+
add(packages: string[], type?: 'dev'): Promise<void>;
|
|
12
|
+
getWorkspaces(): Promise<YarnWorkspaceInfo>;
|
|
13
|
+
setVersion(packageName: string, newVersion: string): Promise<void>;
|
|
14
|
+
publish(packageName: string, tag: string): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=packageManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageManager.d.ts","sourceRoot":"","sources":["../../../src/modules/packageManager/packageManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACnC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5C,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,qBAAa,cAAe,YAAW,sBAAsB;;gBAG7C,OAAO,EAAE,sBAAsB;IAI3C,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,KAAK;IAIpC,aAAa;IAIb,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAIlD,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAG3C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class PackageManager {
|
|
2
|
+
#adapter;
|
|
3
|
+
constructor(adapter) {
|
|
4
|
+
this.#adapter = adapter;
|
|
5
|
+
}
|
|
6
|
+
add(packages, type) {
|
|
7
|
+
return this.#adapter.add(packages, type);
|
|
8
|
+
}
|
|
9
|
+
getWorkspaces() {
|
|
10
|
+
return this.#adapter.getWorkspaces();
|
|
11
|
+
}
|
|
12
|
+
setVersion(packageName, newVersion) {
|
|
13
|
+
return this.#adapter.setVersion(packageName, newVersion);
|
|
14
|
+
}
|
|
15
|
+
publish(packageName, tag) {
|
|
16
|
+
return this.#adapter.publish(packageName, tag);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=packageManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../../src/modules/packageManager/packageManager.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,cAAc;IACvB,QAAQ,CAAyB;IAEjC,YAAY,OAA+B;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAED,GAAG,CAAC,QAAkB,EAAE,IAAY;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,aAAa;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED,UAAU,CAAC,WAAmB,EAAE,UAAkB;QAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,CAAC,WAAmB,EAAE,GAAW;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/packageManager/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,YAAY,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EACzC;IACI,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,+BAA+B,EAAE,MAAM,EAAE,CAAC;CAC7C,CACJ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/packageManager/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IPackageManagerAdapter } from "./packageManager.js";
|
|
2
|
+
import type { YarnWorkspaceInfo } from "./types.js";
|
|
3
|
+
export declare class YarnBerryAdapter implements IPackageManagerAdapter {
|
|
4
|
+
add(packages: string[], type?: 'dev'): Promise<void>;
|
|
5
|
+
getWorkspaces(): Promise<YarnWorkspaceInfo>;
|
|
6
|
+
setVersion(packageName: string, newVersion: string): Promise<void>;
|
|
7
|
+
publish(packageName: string, tag: string): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=yarnBerryAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yarnBerryAdapter.d.ts","sourceRoot":"","sources":["../../../src/modules/packageManager/yarnBerryAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElD,qBAAa,gBAAiB,YAAW,sBAAsB;IACrD,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,KAAK;IAMpC,aAAa;IAkCb,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IASlD,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CAUjD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import spawn from "nano-spawn";
|
|
2
|
+
export class YarnBerryAdapter {
|
|
3
|
+
async add(packages, type) {
|
|
4
|
+
const args = ['add'];
|
|
5
|
+
if (type === 'dev')
|
|
6
|
+
args.push('-D');
|
|
7
|
+
await spawn('yarn', args.concat(packages));
|
|
8
|
+
}
|
|
9
|
+
async getWorkspaces() {
|
|
10
|
+
const result = await spawn('yarn', ['workspaces', 'list', '--json', '--verbose']);
|
|
11
|
+
const workspaces = result.stdout.toString()
|
|
12
|
+
.trim()
|
|
13
|
+
.split('\n')
|
|
14
|
+
.map(line => JSON.parse(line));
|
|
15
|
+
const withoutRootWorkspace = workspaces.filter(w => w.location !== '.');
|
|
16
|
+
const workspacesObj = {};
|
|
17
|
+
const locationToName = Object.fromEntries(workspaces.map(ws => [ws.location, ws.name]));
|
|
18
|
+
withoutRootWorkspace.forEach((workspace) => {
|
|
19
|
+
workspacesObj[workspace.name] = {
|
|
20
|
+
location: workspace.location,
|
|
21
|
+
workspaceDependencies: workspace.workspaceDependencies.map(loc => locationToName[loc]),
|
|
22
|
+
mismatchedWorkspaceDependencies: workspace.mismatchedWorkspaceDependencies.map(depWithVersion => {
|
|
23
|
+
const i = depWithVersion.indexOf('@', depWithVersion.indexOf('@') + 1);
|
|
24
|
+
return depWithVersion.slice(0, i === -1 ? undefined : i);
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return workspacesObj;
|
|
29
|
+
}
|
|
30
|
+
async setVersion(packageName, newVersion) {
|
|
31
|
+
await spawn('yarn', [
|
|
32
|
+
'workspace',
|
|
33
|
+
packageName,
|
|
34
|
+
'version',
|
|
35
|
+
newVersion,
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
async publish(packageName, tag) {
|
|
39
|
+
await spawn('yarn', [
|
|
40
|
+
'workspace',
|
|
41
|
+
packageName,
|
|
42
|
+
'npm',
|
|
43
|
+
'publish',
|
|
44
|
+
'--tag',
|
|
45
|
+
tag,
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=yarnBerryAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yarnBerryAdapter.js","sourceRoot":"","sources":["../../../src/modules/packageManager/yarnBerryAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAI/B,MAAM,OAAO,gBAAgB;IACzB,KAAK,CAAC,GAAG,CAAC,QAAkB,EAAE,IAAY;QACtC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,IAAI,KAAK,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,aAAa;QACf,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;QAClF,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;aACtC,IAAI,EAAE;aACN,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAK3B,CAAC,CAAC;QAEP,MAAM,oBAAoB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAA;QAEvE,MAAM,aAAa,GAAsB,EAAE,CAAC;QAC5C,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CACrC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAC/C,CAAC;QAEF,oBAAoB,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YACvC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG;gBAC5B,QAAQ,EAAE,SAAS,CAAC,QAAQ;gBAC5B,qBAAqB,EAAE,SAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;gBACtF,+BAA+B,EAAE,SAAS,CAAC,+BAA+B,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;oBAC5F,MAAM,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;oBACvE,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7D,CAAC,CAAC;aACL,CAAA;QACL,CAAC,CAAC,CAAA;QAGF,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,UAAkB;QACpD,MAAM,KAAK,CAAC,MAAM,EAAE;YAChB,WAAW;YACX,WAAW;YACX,SAAS;YACT,UAAU;SACb,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,GAAW;QAC1C,MAAM,KAAK,CAAC,MAAM,EAAE;YAChB,WAAW;YACX,WAAW;YACX,KAAK;YACL,SAAS;YACT,OAAO;YACP,GAAG;SACN,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IPackageManagerAdapter } from "./packageManager.js";
|
|
2
|
+
export declare class YarnClassicAdapter implements IPackageManagerAdapter {
|
|
3
|
+
add(packages: string[], type?: 'dev'): Promise<void>;
|
|
4
|
+
getWorkspaces(): Promise<any>;
|
|
5
|
+
setVersion(packageName: string, newVersion: string): Promise<void>;
|
|
6
|
+
publish(packageName: string, tag: string): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=yarnClassicAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yarnClassicAdapter.d.ts","sourceRoot":"","sources":["../../../src/modules/packageManager/yarnClassicAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIlE,qBAAa,kBAAmB,YAAW,sBAAsB;IACvD,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,KAAK;IAOpC,aAAa;IAMb,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAalD,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;CASjD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import spawn from "nano-spawn";
|
|
2
|
+
import { stripVTControlCharacters } from "node:util";
|
|
3
|
+
export class YarnClassicAdapter {
|
|
4
|
+
async add(packages, type) {
|
|
5
|
+
let args = ["add"];
|
|
6
|
+
if (type === "dev")
|
|
7
|
+
args.push("-D");
|
|
8
|
+
args = args.concat(packages);
|
|
9
|
+
await spawn("yarn", args);
|
|
10
|
+
}
|
|
11
|
+
async getWorkspaces() {
|
|
12
|
+
// --json flag guarantees that whether it is run with yarn or node, the output always has a consistent result.
|
|
13
|
+
const result = await spawn("yarn", ['--silent', 'workspaces', 'info', '--json']);
|
|
14
|
+
return JSON.parse(stripVTControlCharacters(result.stdout));
|
|
15
|
+
}
|
|
16
|
+
async setVersion(packageName, newVersion) {
|
|
17
|
+
await spawn('yarn', [
|
|
18
|
+
'--silent',
|
|
19
|
+
'workspace',
|
|
20
|
+
packageName,
|
|
21
|
+
'version',
|
|
22
|
+
'--new-version',
|
|
23
|
+
newVersion,
|
|
24
|
+
'--no-git-tag-version',
|
|
25
|
+
'--json',
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
async publish(packageName, tag) {
|
|
29
|
+
await spawn('yarn', [
|
|
30
|
+
'workspace',
|
|
31
|
+
packageName,
|
|
32
|
+
'publish',
|
|
33
|
+
'--tag',
|
|
34
|
+
tag,
|
|
35
|
+
]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=yarnClassicAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yarnClassicAdapter.js","sourceRoot":"","sources":["../../../src/modules/packageManager/yarnClassicAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AAEnD,MAAM,OAAO,kBAAkB;IAC3B,KAAK,CAAC,GAAG,CAAC,QAAkB,EAAE,IAAY;QACtC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;QAClB,IAAI,IAAI,KAAK,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAC5B,MAAM,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC7B,CAAC;IAED,KAAK,CAAC,aAAa;QACf,8GAA8G;QAC9G,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAA;QAChF,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,UAAkB;QACpD,MAAM,KAAK,CAAC,MAAM,EAAE;YAChB,UAAU;YACV,WAAW;YACX,WAAW;YACX,SAAS;YACT,eAAe;YACf,UAAU;YACV,sBAAsB;YACtB,QAAQ;SACX,CAAC,CAAA;IACN,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,GAAW;QAC1C,MAAM,KAAK,CAAC,MAAM,EAAE;YAChB,WAAW;YACX,WAAW;YACX,SAAS;YACT,OAAO;YACP,GAAG;SACN,CAAC,CAAA;IACN,CAAC;CACJ"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAGvC,eAAO,MAAM,KAAK,GAAI,SAAS,OAAO,SASrC,CAAA"}
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { setupLogger, setupMonorepoManager, setupPackageManager } from "./modules/mod.js";
|
|
2
|
+
export const setup = (program) => {
|
|
3
|
+
setupGeneralInfoAndOptions(program);
|
|
4
|
+
program.hook("preAction", (thisCommand) => {
|
|
5
|
+
const options = thisCommand.opts();
|
|
6
|
+
setupLogger({ verbose: options.verbose ?? false });
|
|
7
|
+
setupMonorepoManager();
|
|
8
|
+
setupPackageManager();
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
const setupGeneralInfoAndOptions = (program) => {
|
|
12
|
+
program
|
|
13
|
+
.name("Rangutopia")
|
|
14
|
+
.description("Scripts across rango organization.")
|
|
15
|
+
.option("-v, --verbose", "Verbose", false);
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,oBAAoB,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAExF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAgB,EAAE,EAAE;IACtC,0BAA0B,CAAC,OAAO,CAAC,CAAA;IAEnC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE;QACtC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;QACnC,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QACnD,oBAAoB,EAAE,CAAA;QACtB,mBAAmB,EAAE,CAAA;IACzB,CAAC,CAAC,CAAC;AACP,CAAC,CAAA;AAED,MAAM,0BAA0B,GAAG,CAAC,OAAgB,EAAE,EAAE;IACpD,OAAO;SACF,IAAI,CAAC,YAAY,CAAC;SAClB,WAAW,CAAC,oCAAoC,CAAC;SACjD,MAAM,CAAC,eAAe,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Package } from "../commands/library/publish/types.js";
|
|
2
|
+
export declare const TAG_PACKAGE_PREFIX: (pkg: {
|
|
3
|
+
name: string;
|
|
4
|
+
}) => string;
|
|
5
|
+
export declare function generateChangelogAndSave(pkg: Package): Promise<unknown>;
|
|
6
|
+
export declare function memoizeGenerateChangelog(pkg: Package): import("stream").Readable;
|
|
7
|
+
export declare function generateChangelog(pkg: Package): import("stream").Readable;
|
|
8
|
+
//# sourceMappingURL=changelog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/utils/changelog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,sCAAsC,CAAC;AAYlE,eAAO,MAAM,kBAAkB,GAAI,KAAK;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,WACX,CAAC;AAM5C,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,OAAO,oBAS1D;AAGD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,6BAcpD;AAiDD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,6BAc7C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ConventionalChangelog } from 'conventional-changelog';
|
|
2
|
+
import path, { join } from "node:path";
|
|
3
|
+
import { ROOT_PATH } from "../constants.js";
|
|
4
|
+
import { packageJsonPath, packagePath } from "./packageJson.js";
|
|
5
|
+
import { createReadStream, createWriteStream, existsSync, mkdirSync } from "node:fs";
|
|
6
|
+
import { Writable } from "stream";
|
|
7
|
+
import { access, rename, unlink } from "node:fs/promises";
|
|
8
|
+
import { pipeline } from "node:stream/promises";
|
|
9
|
+
import { logger } from "../modules/mod.js";
|
|
10
|
+
import { tmpdir } from "node:os";
|
|
11
|
+
export const TAG_PACKAGE_PREFIX = (pkg) => `${packageNameWithoutScope(pkg.name)}@`;
|
|
12
|
+
function packageNameWithoutScope(name) {
|
|
13
|
+
return name.replace(/@.+\//, '');
|
|
14
|
+
}
|
|
15
|
+
export async function generateChangelogAndSave(pkg) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const changelog = memoizeGenerateChangelog(pkg);
|
|
18
|
+
const writeStream = changelog.pipe(changelogFileStream(pkg));
|
|
19
|
+
writeStream.on('finish', resolve);
|
|
20
|
+
writeStream.on('error', reject);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export function memoizeGenerateChangelog(pkg) {
|
|
24
|
+
const memoizeFolder = join(tmpdir(), "CHANGELOGS");
|
|
25
|
+
// escaped pkg.name slashes since scoped packages (e.g. @scope/name) contain a slash
|
|
26
|
+
// which would be interpreted as a folder path
|
|
27
|
+
const escapedName = pkg.name.replace(/\//g, '_');
|
|
28
|
+
const changelogMemoizePath = join(memoizeFolder, `${escapedName}@${pkg.version}.tmp`);
|
|
29
|
+
if (existsSync(changelogMemoizePath)) {
|
|
30
|
+
return createReadStream(changelogMemoizePath);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
mkdirSync(join(tmpdir(), "CHANGELOGS"), { recursive: true });
|
|
34
|
+
const source = generateChangelog(pkg);
|
|
35
|
+
source.pipe(createWriteStream(changelogMemoizePath));
|
|
36
|
+
return source;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function changelogFileStream(pkg) {
|
|
40
|
+
const changelogPath = packageChangelogPath(pkg.location);
|
|
41
|
+
const changelogPathTmp = changelogPath + '.tmp';
|
|
42
|
+
// Creating a temp writer to don't load the whole file in memory at once, at the end will append the old changelog to the temp, then rename it.
|
|
43
|
+
const tempWriteStream = createWriteStream(changelogPathTmp);
|
|
44
|
+
const proxyStream = new Writable({
|
|
45
|
+
write(chunk, encoding, cb) {
|
|
46
|
+
tempWriteStream.write(chunk, encoding, cb);
|
|
47
|
+
},
|
|
48
|
+
final(cb) {
|
|
49
|
+
tempWriteStream.end(async () => {
|
|
50
|
+
try {
|
|
51
|
+
// if a changelog already exists, we append the old one top the temp.
|
|
52
|
+
await access(changelogPath)
|
|
53
|
+
.then(() => pipeline(createReadStream(changelogPath), createWriteStream(changelogPathTmp, { flags: 'a' })))
|
|
54
|
+
.catch(() => {
|
|
55
|
+
// ignore.
|
|
56
|
+
});
|
|
57
|
+
// replace temp as the main changelog.
|
|
58
|
+
await rename(changelogPathTmp, changelogPath);
|
|
59
|
+
cb();
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
logger.error(`Failed to prepend changelog: ${{ err }}`);
|
|
63
|
+
void unlink(changelogPathTmp);
|
|
64
|
+
cb(err);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return proxyStream;
|
|
70
|
+
}
|
|
71
|
+
function packageChangelogPath(packageLocation = '') {
|
|
72
|
+
return path.join(packagePath(packageLocation), 'CHANGELOG.md');
|
|
73
|
+
}
|
|
74
|
+
export function generateChangelog(pkg) {
|
|
75
|
+
const generator = new ConventionalChangelog(ROOT_PATH);
|
|
76
|
+
generator.loadPreset('angular');
|
|
77
|
+
generator.readPackage(packageJsonPath(pkg.location));
|
|
78
|
+
generator.commits({
|
|
79
|
+
path: pkg.location,
|
|
80
|
+
});
|
|
81
|
+
generator.tags({
|
|
82
|
+
prefix: TAG_PACKAGE_PREFIX(pkg),
|
|
83
|
+
});
|
|
84
|
+
return generator.writeStream();
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=changelog.js.map
|