1 | #!/usr/bin/env node
|
2 | "use strict";
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | var __importStar = (this && this.__importStar) || function (mod) {
|
8 | if (mod && mod.__esModule) return mod;
|
9 | var result = {};
|
10 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
11 | result["default"] = mod;
|
12 | return result;
|
13 | };
|
14 | Object.defineProperty(exports, "__esModule", { value: true });
|
15 | const path = __importStar(require("path"));
|
16 | const utils = __importStar(require("./utils"));
|
17 |
|
18 | if (process.argv.length !== 3) {
|
19 | const msg = '** Must supply a library name\n';
|
20 | process.stderr.write(msg);
|
21 | process.exit(1);
|
22 | }
|
23 | const name = process.argv[2];
|
24 |
|
25 | utils.getLernaPaths().forEach(pkgPath => {
|
26 | handlePackage(pkgPath);
|
27 | });
|
28 | handlePackage(path.resolve('.'));
|
29 |
|
30 |
|
31 |
|
32 | function handlePackage(packagePath) {
|
33 |
|
34 | packagePath = path.join(packagePath, 'package.json');
|
35 | let data;
|
36 | try {
|
37 | data = utils.readJSONFile(packagePath);
|
38 | }
|
39 | catch (e) {
|
40 | console.debug('Skipping package ' + packagePath);
|
41 | return;
|
42 | }
|
43 |
|
44 | for (const dtype of ['dependencies', 'devDependencies']) {
|
45 | const deps = data[dtype] || {};
|
46 | delete deps[name];
|
47 | }
|
48 |
|
49 | utils.writePackageData(packagePath, data);
|
50 | }
|
51 |
|
52 | utils.run('jlpm run integrity');
|
53 |
|
\ | No newline at end of file |