@goldstack/utils-typescript-references 0.1.1 → 0.1.5
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/README.md +5 -5
- package/dist/src/sharedUtils.d.ts +5 -5
- package/dist/src/sharedUtils.js +28 -28
- package/dist/src/updatePackageProjectReferences.d.ts +1 -1
- package/dist/src/updatePackageProjectReferences.d.ts.map +1 -1
- package/dist/src/updatePackageProjectReferences.js +55 -57
- package/dist/src/updatePackageProjectReferences.js.map +1 -1
- package/dist/src/updateRootProjectReferences.d.ts +1 -1
- package/dist/src/updateRootProjectReferences.js +18 -18
- package/dist/src/utilsTypeScriptReferences.d.ts +1 -1
- package/dist/src/utilsTypeScriptReferences.js +26 -26
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# TypeScript References Utility
|
|
1
|
+
# TypeScript References Yarn Workspaces Sync Utility
|
|
2
2
|
|
|
3
3
|
This library ensures that [project references](https://www.typescriptlang.org/docs/handbook/project-references.html) in TypeScript `tsconfig.js` files are automatically kept up to date in a project using **Yarn 2 workspaces**.
|
|
4
4
|
|
|
5
5
|
Running this script will:
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. Add a list of all packages in the workspaces to the root `tsconfig.json` for the `"references"` attribute:
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
"references": [
|
|
@@ -23,7 +23,7 @@ Running this script will:
|
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
2. Update all the `"references"` in the `tsconfig.json` for all packages in the workspace so that it includes all the packages that it declares as a dependency in `package.json`.
|
|
27
27
|
|
|
28
28
|
This package uses [@monorepo-utils/workspaces-to-typescript-project-references](https://github.com/azu/monorepo-utils/tree/master/packages/@monorepo-utils/workspaces-to-typescript-project-references#readme).
|
|
29
29
|
|
|
@@ -69,7 +69,7 @@ Will skip updating the `references` in the `tsconfig.json` file for the project
|
|
|
69
69
|
|
|
70
70
|
## Limitations
|
|
71
71
|
|
|
72
|
-
- The root of the project and each workspace must contain a `tsconfig.json`. It is currently not able to specify an alternative file name for `tsconfig.json`.
|
|
72
|
+
- The root of the project and each workspace must contain a `tsconfig.json`. It is currently not able to specify an alternative file name for `tsconfig.json`.
|
|
73
73
|
- The root `tsconfig.json` file needs to be a vanilla JSON document (so no comments)
|
|
74
74
|
|
|
75
75
|
If these limitations or anything else are an issues, please [raise a ticket in GitHub for the Goldstack Monorepo](https://github.com/goldstack/goldstack/issues).
|
|
@@ -79,4 +79,4 @@ If these limitations or anything else are an issues, please [raise a ticket in G
|
|
|
79
79
|
- [The Full Stack Blog - TypeScript Monorepo with Yarn and Project References](https://maxrohde.com/2021/10/01/typescript-monorepo-with-yarn-and-project-references/)
|
|
80
80
|
- [@monorepo-utils/workspaces-to-typescript-project-references](https://github.com/azu/monorepo-utils/tree/master/packages/@monorepo-utils/workspaces-to-typescript-project-references#readme)
|
|
81
81
|
- [Optimizing multi-package apps with TypeScript Project References](https://ebaytech.berlin/optimizing-multi-package-apps-with-typescript-project-references-d5c57a3b4440)
|
|
82
|
-
- [TypeScript Monorepos with Yarn](https://semaphoreci.com/blog/typescript-monorepos-with-yarn)
|
|
82
|
+
- [TypeScript Monorepos with Yarn](https://semaphoreci.com/blog/typescript-monorepos-with-yarn)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface PackageData {
|
|
2
|
-
path: string;
|
|
3
|
-
name: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function getPackages(cmdRes: string): PackageData[];
|
|
1
|
+
export interface PackageData {
|
|
2
|
+
path: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function getPackages(cmdRes: string): PackageData[];
|
|
6
6
|
//# sourceMappingURL=sharedUtils.d.ts.map
|
package/dist/src/sharedUtils.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPackages = void 0;
|
|
4
|
-
function getPackages(cmdRes) {
|
|
5
|
-
return cmdRes
|
|
6
|
-
.split('\n')
|
|
7
|
-
.map((line) => {
|
|
8
|
-
if (line.trim() === '') {
|
|
9
|
-
return {
|
|
10
|
-
path: undefined,
|
|
11
|
-
name: undefined,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const packageData = JSON.parse(line);
|
|
15
|
-
if (packageData.location === '.') {
|
|
16
|
-
return {
|
|
17
|
-
path: undefined,
|
|
18
|
-
name: undefined,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
path: packageData.location,
|
|
23
|
-
name: packageData.name,
|
|
24
|
-
};
|
|
25
|
-
})
|
|
26
|
-
.filter((packageData) => packageData.path && packageData.name);
|
|
27
|
-
}
|
|
28
|
-
exports.getPackages = getPackages;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPackages = void 0;
|
|
4
|
+
function getPackages(cmdRes) {
|
|
5
|
+
return cmdRes
|
|
6
|
+
.split('\n')
|
|
7
|
+
.map((line) => {
|
|
8
|
+
if (line.trim() === '') {
|
|
9
|
+
return {
|
|
10
|
+
path: undefined,
|
|
11
|
+
name: undefined,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const packageData = JSON.parse(line);
|
|
15
|
+
if (packageData.location === '.') {
|
|
16
|
+
return {
|
|
17
|
+
path: undefined,
|
|
18
|
+
name: undefined,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
path: packageData.location,
|
|
23
|
+
name: packageData.name,
|
|
24
|
+
};
|
|
25
|
+
})
|
|
26
|
+
.filter((packageData) => packageData.path && packageData.name);
|
|
27
|
+
}
|
|
28
|
+
exports.getPackages = getPackages;
|
|
29
29
|
//# sourceMappingURL=sharedUtils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const updatePackageProjectReferences: () => void;
|
|
1
|
+
export declare const updatePackageProjectReferences: () => void;
|
|
2
2
|
//# sourceMappingURL=updatePackageProjectReferences.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updatePackageProjectReferences.d.ts","sourceRoot":"","sources":["../../src/updatePackageProjectReferences.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,8BAA8B,QAAO,
|
|
1
|
+
{"version":3,"file":"updatePackageProjectReferences.d.ts","sourceRoot":"","sources":["../../src/updatePackageProjectReferences.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,8BAA8B,QAAO,IAcjD,CAAC"}
|
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updatePackageProjectReferences = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const child_process_1 = require("child_process");
|
|
9
|
-
const sharedUtils_1 = require("./sharedUtils");
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const updatePackageProjectReferences = () => {
|
|
12
|
-
const cmdRes = (0, child_process_1.execSync)('yarn workspaces list --json').toString();
|
|
13
|
-
const allPackages = (0, sharedUtils_1.getPackages)(cmdRes);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
fs_1.default.writeFileSync(path_1.default.resolve(packageDir, './tsconfig.json'), JSON.stringify(tsConfigData, null, 2));
|
|
57
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.updatePackageProjectReferences = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const sharedUtils_1 = require("./sharedUtils");
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const updatePackageProjectReferences = () => {
|
|
12
|
+
const cmdRes = (0, child_process_1.execSync)('yarn workspaces list --json').toString();
|
|
13
|
+
const allPackages = (0, sharedUtils_1.getPackages)(cmdRes);
|
|
14
|
+
for (const packageData of allPackages) {
|
|
15
|
+
const packageDir = packageData.path;
|
|
16
|
+
if (fs_1.default.existsSync(path_1.default.resolve(packageDir, './tsconfig.json'))) {
|
|
17
|
+
processPackage(packageDir, allPackages, packageData);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
console.log(`Skipping package ${packageDir}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.updatePackageProjectReferences = updatePackageProjectReferences;
|
|
25
|
+
function processPackage(packageDir, allPackages, packageData) {
|
|
26
|
+
console.log(`Processing package ${packageDir}`);
|
|
27
|
+
const packageJson = fs_1.default
|
|
28
|
+
.readFileSync(path_1.default.resolve(packageDir, './package.json'))
|
|
29
|
+
.toString();
|
|
30
|
+
const packageJsonData = JSON.parse(packageJson);
|
|
31
|
+
const tsConfig = fs_1.default
|
|
32
|
+
.readFileSync(path_1.default.resolve(packageDir, './tsconfig.json'))
|
|
33
|
+
.toString();
|
|
34
|
+
const tsConfigData = JSON.parse(tsConfig);
|
|
35
|
+
tsConfigData.references = [
|
|
36
|
+
...Object.keys(packageJsonData.dependencies || {}),
|
|
37
|
+
...Object.keys(packageJsonData.devDependencies || {}),
|
|
38
|
+
]
|
|
39
|
+
// all dependencies that are workspace dependencies
|
|
40
|
+
.filter((dependencyData) => allPackages.filter((packageData) => packageData.name === dependencyData)
|
|
41
|
+
.length > 0)
|
|
42
|
+
// for each add a path
|
|
43
|
+
.map((dependencyData) => {
|
|
44
|
+
const dependencyPackageData = allPackages.find((packageData) => packageData.name === dependencyData);
|
|
45
|
+
if (!dependencyPackageData) {
|
|
46
|
+
throw new Error('Package not found');
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
path: path_1.default.posix.relative(packageData.path, dependencyPackageData.path),
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
console.log('Setting project references:\n' +
|
|
53
|
+
tsConfigData.references.map((refData) => refData.path).join('\n '));
|
|
54
|
+
fs_1.default.writeFileSync(path_1.default.resolve(packageDir, './tsconfig.json'), JSON.stringify(tsConfigData, null, 2));
|
|
55
|
+
}
|
|
58
56
|
//# sourceMappingURL=updatePackageProjectReferences.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updatePackageProjectReferences.js","sourceRoot":"","sources":["../../src/updatePackageProjectReferences.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,iDAAyC;AACzC,+CAAyD;AACzD,gDAAwB;AAEjB,MAAM,8BAA8B,GAAG,GAAS,EAAE;IACvD,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE,CAAC;IAElE,MAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,
|
|
1
|
+
{"version":3,"file":"updatePackageProjectReferences.js","sourceRoot":"","sources":["../../src/updatePackageProjectReferences.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,iDAAyC;AACzC,+CAAyD;AACzD,gDAAwB;AAEjB,MAAM,8BAA8B,GAAG,GAAS,EAAE;IACvD,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,6BAA6B,CAAC,CAAC,QAAQ,EAAE,CAAC;IAElE,MAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,KAAK,MAAM,WAAW,IAAI,WAAW,EAAE;QACrC,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC;QAEpC,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,EAAE;YAC9D,cAAc,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;SACtD;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,oBAAoB,UAAU,EAAE,CAAC,CAAC;SAC/C;KACF;AACH,CAAC,CAAC;AAdW,QAAA,8BAA8B,kCAczC;AAEF,SAAS,cAAc,CACrB,UAAkB,EAClB,WAA0B,EAC1B,WAAwB;IAExB,OAAO,CAAC,GAAG,CAAC,sBAAsB,UAAU,EAAE,CAAC,CAAC;IAChD,MAAM,WAAW,GAAG,YAAE;SACnB,YAAY,CAAC,cAAI,CAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;SACxD,QAAQ,EAAE,CAAC;IACd,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,YAAE;SAChB,YAAY,CAAC,cAAI,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;SACzD,QAAQ,EAAE,CAAC;IAEd,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAE1C,YAAY,CAAC,UAAU,GAAG;QACxB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,IAAI,EAAE,CAAC;QAClD,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,eAAe,IAAI,EAAE,CAAC;KACtD;QACC,mDAAmD;SAClD,MAAM,CACL,CAAC,cAAc,EAAE,EAAE,CACjB,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,cAAc,CAAC;SACrE,MAAM,GAAG,CAAC,CAChB;QACD,sBAAsB;SACrB,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;QACtB,MAAM,qBAAqB,GAAG,WAAW,CAAC,IAAI,CAC5C,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,cAAc,CACrD,CAAC;QACF,IAAI,CAAC,qBAAqB,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;SACtC;QACD,OAAO;YACL,IAAI,EAAE,cAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;SACxE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,GAAG,CACT,+BAA+B;QAC7B,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACrE,CAAC;IACF,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAC3C,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CACtC,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const updateRootProjectReferences: () => void;
|
|
1
|
+
export declare const updateRootProjectReferences: () => void;
|
|
2
2
|
//# sourceMappingURL=updateRootProjectReferences.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updateRootProjectReferences = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const child_process_1 = require("child_process");
|
|
9
|
-
const sharedUtils_1 = require("./sharedUtils");
|
|
10
|
-
const updateRootProjectReferences = () => {
|
|
11
|
-
const cmdRes = (0, child_process_1.execSync)('yarn workspaces list --json').toString();
|
|
12
|
-
const allPackages = (0, sharedUtils_1.getPackages)(cmdRes);
|
|
13
|
-
const tsConfig = fs_1.default.readFileSync('./tsconfig.json').toString();
|
|
14
|
-
const tsConfigData = JSON.parse(tsConfig);
|
|
15
|
-
tsConfigData.references = allPackages.filter((packageData) => packageData.path);
|
|
16
|
-
fs_1.default.writeFileSync('./tsconfig.json', JSON.stringify(tsConfigData, null, 2));
|
|
17
|
-
};
|
|
18
|
-
exports.updateRootProjectReferences = updateRootProjectReferences;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.updateRootProjectReferences = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const sharedUtils_1 = require("./sharedUtils");
|
|
10
|
+
const updateRootProjectReferences = () => {
|
|
11
|
+
const cmdRes = (0, child_process_1.execSync)('yarn workspaces list --json').toString();
|
|
12
|
+
const allPackages = (0, sharedUtils_1.getPackages)(cmdRes);
|
|
13
|
+
const tsConfig = fs_1.default.readFileSync('./tsconfig.json').toString();
|
|
14
|
+
const tsConfigData = JSON.parse(tsConfig);
|
|
15
|
+
tsConfigData.references = allPackages.filter((packageData) => packageData.path);
|
|
16
|
+
fs_1.default.writeFileSync('./tsconfig.json', JSON.stringify(tsConfigData, null, 2));
|
|
17
|
+
};
|
|
18
|
+
exports.updateRootProjectReferences = updateRootProjectReferences;
|
|
19
19
|
//# sourceMappingURL=updateRootProjectReferences.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const run: (args: string[]) => void;
|
|
1
|
+
export declare const run: (args: string[]) => void;
|
|
2
2
|
//# sourceMappingURL=utilsTypeScriptReferences.d.ts.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.run = void 0;
|
|
4
|
-
const updatePackageProjectReferences_1 = require("./updatePackageProjectReferences");
|
|
5
|
-
const updateRootProjectReferences_1 = require("./updateRootProjectReferences");
|
|
6
|
-
const run = (args) => {
|
|
7
|
-
console.log('run ' + args);
|
|
8
|
-
if (args.indexOf('--skipPackages') === -1) {
|
|
9
|
-
// const res = toProjectReferences({
|
|
10
|
-
// rootDir: path.resolve('./'),
|
|
11
|
-
// checkOnly: false,
|
|
12
|
-
// });
|
|
13
|
-
// if (!res.ok) {
|
|
14
|
-
// if (res.aggregateError) {
|
|
15
|
-
// console.error(res.aggregateError.message);
|
|
16
|
-
// }
|
|
17
|
-
// process.exit(1);
|
|
18
|
-
// }
|
|
19
|
-
console.log('packages');
|
|
20
|
-
(0, updatePackageProjectReferences_1.updatePackageProjectReferences)();
|
|
21
|
-
}
|
|
22
|
-
if (args.indexOf('--skipRoot') === -1) {
|
|
23
|
-
(0, updateRootProjectReferences_1.updateRootProjectReferences)();
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
exports.run = run;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = void 0;
|
|
4
|
+
const updatePackageProjectReferences_1 = require("./updatePackageProjectReferences");
|
|
5
|
+
const updateRootProjectReferences_1 = require("./updateRootProjectReferences");
|
|
6
|
+
const run = (args) => {
|
|
7
|
+
console.log('run ' + args);
|
|
8
|
+
if (args.indexOf('--skipPackages') === -1) {
|
|
9
|
+
// const res = toProjectReferences({
|
|
10
|
+
// rootDir: path.resolve('./'),
|
|
11
|
+
// checkOnly: false,
|
|
12
|
+
// });
|
|
13
|
+
// if (!res.ok) {
|
|
14
|
+
// if (res.aggregateError) {
|
|
15
|
+
// console.error(res.aggregateError.message);
|
|
16
|
+
// }
|
|
17
|
+
// process.exit(1);
|
|
18
|
+
// }
|
|
19
|
+
console.log('packages');
|
|
20
|
+
(0, updatePackageProjectReferences_1.updatePackageProjectReferences)();
|
|
21
|
+
}
|
|
22
|
+
if (args.indexOf('--skipRoot') === -1) {
|
|
23
|
+
(0, updateRootProjectReferences_1.updateRootProjectReferences)();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.run = run;
|
|
27
27
|
//# sourceMappingURL=utilsTypeScriptReferences.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goldstack/utils-typescript-references",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Utility for keeping TypeScript references in sync in the monorepo",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goldstack",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@monorepo-utils/workspaces-to-typescript-project-references": "^2.6.2",
|
|
39
|
-
"source-map-support": "^0.5.
|
|
39
|
+
"source-map-support": "^0.5.21"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@goldstack/utils-git": "0.1.
|
|
42
|
+
"@goldstack/utils-git": "0.1.30",
|
|
43
43
|
"@types/jest": "^27.0.2",
|
|
44
44
|
"@types/node": "^16.11.0",
|
|
45
45
|
"@types/source-map-support": "^0.5.4",
|