Cleanup bootstrap files (#58171)

* bootstrap  - first cut

* bootstrap => bootstrap-fork, bootstrap-shared => bootstrap

* bootstrap - extract uriFromPath()

* bootstrap - extract readfile/writefile

* bootstrap - share more code when loading renderers

* boostrap-electron-browser => bootstrap-window

* bootstrap - cleanup main.js

* bootstrap - handle index.js

* bootstrap 💄
This commit is contained in:
Benjamin Pasero
2018-09-07 12:23:09 +02:00
committed by GitHub
parent 27bb0131b0
commit a4bf919e59
25 changed files with 830 additions and 1282 deletions
+3 -11
View File
@@ -13,6 +13,7 @@ const minimatch = require('minimatch');
const istanbul = require('istanbul');
const i_remap = require('remap-istanbul/lib/remap');
const util = require('util');
const bootstrap = require('../../src/bootstrap');
// Disabled custom inspect. See #38847
if (util.inspect && util.inspect['defaultOptions']) {
@@ -23,15 +24,6 @@ let _tests_glob = '**/test/**/*.test.js';
let loader;
let _out;
function uriFromPath(_path) {
var pathName = path.resolve(_path).replace(/\\/g, '/');
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
pathName = '/' + pathName;
}
return encodeURI('file://' + pathName).replace(/#/g, '%23');
}
function initLoader(opts) {
let outdir = opts.build ? 'out-build' : 'out';
_out = path.join(__dirname, `../../${outdir}`);
@@ -42,11 +34,11 @@ function initLoader(opts) {
nodeRequire: require,
nodeMain: __filename,
catchError: true,
baseUrl: uriFromPath(path.join(__dirname, '../../src')),
baseUrl: bootstrap.uriFromPath(path.join(__dirname, '../../src')),
paths: {
'vs': `../${outdir}/vs`,
'lib': `../${outdir}/lib`,
'bootstrap': `../${outdir}/bootstrap`
'bootstrap-fork': `../${outdir}/bootstrap-fork`
}
};