UNPKG

2.1 kBJavaScriptView Raw
1"use strict";
2/*-----------------------------------------------------------------------------
3| Copyright (c) Jupyter Development Team.
4| Distributed under the terms of the Modified BSD License.
5|----------------------------------------------------------------------------*/
6var __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};
13Object.defineProperty(exports, "__esModule", { value: true });
14const fs = __importStar(require("fs-extra"));
15const path = __importStar(require("path"));
16const utils = __importStar(require("./utils"));
17// Run integrity to update the dev_mode package.json
18utils.run('jlpm integrity');
19// Get the dev mode package.json file.
20let data = utils.readJSONFile('./dev_mode/package.json');
21// Update the values that need to change and write to staging.
22data['jupyterlab']['buildDir'] = './build';
23data['jupyterlab']['outputDir'] = '..';
24data['jupyterlab']['staticDir'] = '../static';
25data['jupyterlab']['linkedPackages'] = {};
26let staging = './jupyterlab/staging';
27utils.writePackageData(path.join(staging, 'package.json'), data);
28// Update our staging files.
29[
30 'index.js',
31 'webpack.config.js',
32 'webpack.prod.config.js',
33 'webpack.prod.minimize.config.js',
34 'webpack.prod.release.config.js',
35 'templates'
36].forEach(name => {
37 fs.copySync(path.join('.', 'dev_mode', name), path.join('.', 'jupyterlab', 'staging', name));
38});
39// Create a new yarn.lock file to ensure it is correct.
40fs.removeSync(path.join(staging, 'yarn.lock'));
41utils.run('jlpm', { cwd: staging });
42try {
43 utils.run('jlpm yarn-deduplicate -s fewer --fail', { cwd: staging });
44}
45catch (_a) {
46 // re-run install if we deduped packages!
47 utils.run('jlpm', { cwd: staging });
48}
49// Build the core assets.
50utils.run('jlpm run build:prod:release', { cwd: staging });
51// Run integrity
52utils.run('jlpm integrity');
53//# sourceMappingURL=update-core-mode.js.map
\No newline at end of file