1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | var __importStar = (this && this.__importStar) || function (mod) {
|
7 | if (mod && mod.__esModule) return mod;
|
8 | var result = {};
|
9 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
10 | result["default"] = mod;
|
11 | return result;
|
12 | };
|
13 | Object.defineProperty(exports, "__esModule", { value: true });
|
14 | const fs = __importStar(require("fs-extra"));
|
15 | const glob = __importStar(require("glob"));
|
16 | const path = __importStar(require("path"));
|
17 | const utils = __importStar(require("./utils"));
|
18 | utils.run('npm run clean:slate');
|
19 | utils.run('lerna run prepublishOnly');
|
20 | utils.getLernaPaths().forEach(pkgPath => {
|
21 | const pkgData = utils.readJSONFile(path.join(pkgPath, 'package.json'));
|
22 | const name = pkgData.name;
|
23 |
|
24 | if (!pkgData.public) {
|
25 | return;
|
26 | }
|
27 | console.log(`Checking ${name}...`);
|
28 |
|
29 | pkgData.files.forEach((fGlob) => {
|
30 | const result = glob.sync(fGlob);
|
31 | if (result.length === 0) {
|
32 | throw new Error(`${name} has missing file(s) "${fGlob}"`);
|
33 | }
|
34 | });
|
35 |
|
36 | const main = pkgData.main;
|
37 | if (!main) {
|
38 | throw new Error(`No "main" entry for ${name}`);
|
39 | }
|
40 | const mainPath = path.join(pkgPath, main);
|
41 | if (!fs.existsSync(mainPath)) {
|
42 | throw new Error(`"main" entry "${main}" not found for ${name}`);
|
43 | }
|
44 | });
|
45 |
|
\ | No newline at end of file |