@rsbuild/core 0.7.9 → 1.0.0-alpha.0
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/compiled/css-loader/index.js +46 -46
- package/compiled/launch-editor-middleware/index.js +58 -22
- package/compiled/launch-editor-middleware/package.json +1 -1
- package/compiled/postcss-load-config/index.js +10 -10
- package/compiled/postcss-loader/index.js +43 -43
- package/compiled/rspack-manifest-plugin/index.js +4 -4
- package/compiled/style-loader/index.js +10 -10
- package/compiled/webpack-dev-middleware/index.js +31 -31
- package/dist/client/hmr.js +1 -3
- package/dist/index.cjs +1911 -1015
- package/dist/index.js +1809 -974
- package/dist-types/cli/init.d.ts +2 -1
- package/dist-types/client/hmr.d.ts +0 -4
- package/dist-types/config.d.ts +25 -6
- package/dist-types/configChain.d.ts +1 -1
- package/dist-types/constants.d.ts +6 -4
- package/dist-types/createContext.d.ts +6 -3
- package/dist-types/createRsbuild.d.ts +1 -5
- package/dist-types/helpers/path.d.ts +9 -0
- package/dist-types/helpers.d.ts +21 -19
- package/dist-types/index.d.ts +4 -3
- package/dist-types/initHooks.d.ts +2 -1
- package/dist-types/initPlugins.d.ts +3 -3
- package/dist-types/internal.d.ts +2 -3
- package/dist-types/mergeConfig.d.ts +1 -1
- package/dist-types/plugins/css.d.ts +3 -4
- package/dist-types/plugins/entry.d.ts +1 -3
- package/dist-types/plugins/html.d.ts +2 -11
- package/dist-types/plugins/minimize.d.ts +4 -4
- package/dist-types/plugins/rspackProfile.d.ts +0 -3
- package/dist-types/plugins/swc.d.ts +2 -2
- package/dist-types/provider/inspectConfig.d.ts +1 -1
- package/dist-types/provider/rspackConfig.d.ts +4 -3
- package/dist-types/reduceConfigs.d.ts +65 -0
- package/dist-types/rspack/HtmlBasicPlugin.d.ts +3 -6
- package/dist-types/rspack/InlineChunkHtmlPlugin.d.ts +7 -24
- package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +1 -1
- package/dist-types/rspack/preload/helpers/extractChunks.d.ts +4 -1
- package/dist-types/server/compilerDevMiddleware.d.ts +0 -2
- package/dist-types/server/devMiddleware.d.ts +5 -11
- package/dist-types/server/devServer.d.ts +3 -1
- package/dist-types/server/environment.d.ts +7 -0
- package/dist-types/server/getDevMiddlewares.d.ts +2 -1
- package/dist-types/server/helper.d.ts +4 -13
- package/dist-types/server/httpServer.d.ts +3 -4
- package/dist-types/server/prodServer.d.ts +1 -3
- package/dist-types/server/proxy.d.ts +1 -2
- package/dist-types/server/restart.d.ts +1 -1
- package/dist-types/server/runner/asModule.d.ts +2 -0
- package/dist-types/server/runner/basic.d.ts +25 -0
- package/dist-types/server/runner/cjs.d.ts +10 -0
- package/dist-types/server/runner/esm.d.ts +6 -0
- package/dist-types/server/runner/index.d.ts +8 -0
- package/dist-types/server/runner/type.d.ts +36 -0
- package/dist-types/server/socketServer.d.ts +1 -4
- package/dist-types/types.d.ts +4 -2
- package/package.json +10 -10
- package/types.d.ts +0 -4
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 8034:
|
|
5
5
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
const loader = __nccwpck_require__(
|
|
10
|
+
const loader = __nccwpck_require__(8394);
|
|
11
11
|
module.exports = loader.default;
|
|
12
|
-
module.exports.defaultGetLocalIdent = __nccwpck_require__(
|
|
12
|
+
module.exports.defaultGetLocalIdent = __nccwpck_require__(3091).defaultGetLocalIdent;
|
|
13
13
|
|
|
14
14
|
/***/ }),
|
|
15
15
|
|
|
16
|
-
/***/
|
|
16
|
+
/***/ 8394:
|
|
17
17
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
18
18
|
|
|
19
19
|
"use strict";
|
|
@@ -24,11 +24,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
24
24
|
}));
|
|
25
25
|
exports["default"] = loader;
|
|
26
26
|
var _postcss = _interopRequireDefault(__nccwpck_require__(977));
|
|
27
|
-
var _package = _interopRequireDefault(__nccwpck_require__(
|
|
27
|
+
var _package = _interopRequireDefault(__nccwpck_require__(7972));
|
|
28
28
|
var _semver = __nccwpck_require__(5204);
|
|
29
|
-
var _options = _interopRequireDefault(__nccwpck_require__(
|
|
30
|
-
var _plugins = __nccwpck_require__(
|
|
31
|
-
var _utils = __nccwpck_require__(
|
|
29
|
+
var _options = _interopRequireDefault(__nccwpck_require__(614));
|
|
30
|
+
var _plugins = __nccwpck_require__(1186);
|
|
31
|
+
var _utils = __nccwpck_require__(3091);
|
|
32
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
33
|
/*
|
|
34
34
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
@@ -198,7 +198,7 @@ async function loader(content, map, meta) {
|
|
|
198
198
|
|
|
199
199
|
/***/ }),
|
|
200
200
|
|
|
201
|
-
/***/
|
|
201
|
+
/***/ 1186:
|
|
202
202
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
203
203
|
|
|
204
204
|
"use strict";
|
|
@@ -225,14 +225,14 @@ Object.defineProperty(exports, "urlParser", ({
|
|
|
225
225
|
return _postcssUrlParser.default;
|
|
226
226
|
}
|
|
227
227
|
}));
|
|
228
|
-
var _postcssImportParser = _interopRequireDefault(__nccwpck_require__(
|
|
229
|
-
var _postcssIcssParser = _interopRequireDefault(__nccwpck_require__(
|
|
230
|
-
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(
|
|
228
|
+
var _postcssImportParser = _interopRequireDefault(__nccwpck_require__(3843));
|
|
229
|
+
var _postcssIcssParser = _interopRequireDefault(__nccwpck_require__(2632));
|
|
230
|
+
var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(2631));
|
|
231
231
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
232
232
|
|
|
233
233
|
/***/ }),
|
|
234
234
|
|
|
235
|
-
/***/
|
|
235
|
+
/***/ 2632:
|
|
236
236
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
237
237
|
|
|
238
238
|
"use strict";
|
|
@@ -242,8 +242,8 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
242
242
|
value: true
|
|
243
243
|
}));
|
|
244
244
|
exports["default"] = void 0;
|
|
245
|
-
var _icssUtils = __nccwpck_require__(
|
|
246
|
-
var _utils = __nccwpck_require__(
|
|
245
|
+
var _icssUtils = __nccwpck_require__(2304);
|
|
246
|
+
var _utils = __nccwpck_require__(3091);
|
|
247
247
|
const plugin = (options = {}) => {
|
|
248
248
|
return {
|
|
249
249
|
postcssPlugin: "postcss-icss-parser",
|
|
@@ -352,7 +352,7 @@ var _default = exports["default"] = plugin;
|
|
|
352
352
|
|
|
353
353
|
/***/ }),
|
|
354
354
|
|
|
355
|
-
/***/
|
|
355
|
+
/***/ 3843:
|
|
356
356
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
357
357
|
|
|
358
358
|
"use strict";
|
|
@@ -363,7 +363,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
363
363
|
}));
|
|
364
364
|
exports["default"] = void 0;
|
|
365
365
|
var _postcssValueParser = _interopRequireDefault(__nccwpck_require__(1036));
|
|
366
|
-
var _utils = __nccwpck_require__(
|
|
366
|
+
var _utils = __nccwpck_require__(3091);
|
|
367
367
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
368
368
|
function isIgnoredAfterName(atRule) {
|
|
369
369
|
if (atRule.raws && atRule.raws.afterName && atRule.raws.afterName.trim().length > 0) {
|
|
@@ -652,7 +652,7 @@ var _default = exports["default"] = plugin;
|
|
|
652
652
|
|
|
653
653
|
/***/ }),
|
|
654
654
|
|
|
655
|
-
/***/
|
|
655
|
+
/***/ 2631:
|
|
656
656
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
657
657
|
|
|
658
658
|
"use strict";
|
|
@@ -663,7 +663,7 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
663
663
|
}));
|
|
664
664
|
exports["default"] = void 0;
|
|
665
665
|
var _postcssValueParser = _interopRequireDefault(__nccwpck_require__(1036));
|
|
666
|
-
var _utils = __nccwpck_require__(
|
|
666
|
+
var _utils = __nccwpck_require__(3091);
|
|
667
667
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
668
668
|
const isUrlFunc = /url/i;
|
|
669
669
|
const isImageSetFunc = /^(?:-webkit-)?image-set$/i;
|
|
@@ -1015,7 +1015,7 @@ var _default = exports["default"] = plugin;
|
|
|
1015
1015
|
|
|
1016
1016
|
/***/ }),
|
|
1017
1017
|
|
|
1018
|
-
/***/
|
|
1018
|
+
/***/ 3091:
|
|
1019
1019
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
1020
1020
|
|
|
1021
1021
|
"use strict";
|
|
@@ -1053,10 +1053,10 @@ exports.syntaxErrorFactory = syntaxErrorFactory;
|
|
|
1053
1053
|
exports.warningFactory = warningFactory;
|
|
1054
1054
|
var _url = __nccwpck_require__(7310);
|
|
1055
1055
|
var _path = _interopRequireDefault(__nccwpck_require__(1017));
|
|
1056
|
-
var _postcssModulesValues = _interopRequireDefault(__nccwpck_require__(
|
|
1057
|
-
var _postcssModulesLocalByDefault = _interopRequireDefault(__nccwpck_require__(
|
|
1058
|
-
var _postcssModulesExtractImports = _interopRequireDefault(__nccwpck_require__(
|
|
1059
|
-
var _postcssModulesScope = _interopRequireDefault(__nccwpck_require__(
|
|
1056
|
+
var _postcssModulesValues = _interopRequireDefault(__nccwpck_require__(3378));
|
|
1057
|
+
var _postcssModulesLocalByDefault = _interopRequireDefault(__nccwpck_require__(5172));
|
|
1058
|
+
var _postcssModulesExtractImports = _interopRequireDefault(__nccwpck_require__(6486));
|
|
1059
|
+
var _postcssModulesScope = _interopRequireDefault(__nccwpck_require__(7652));
|
|
1060
1060
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1061
1061
|
/*
|
|
1062
1062
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
@@ -2198,7 +2198,7 @@ module.exports = cssesc;
|
|
|
2198
2198
|
|
|
2199
2199
|
/***/ }),
|
|
2200
2200
|
|
|
2201
|
-
/***/
|
|
2201
|
+
/***/ 8886:
|
|
2202
2202
|
/***/ ((module) => {
|
|
2203
2203
|
|
|
2204
2204
|
const createImports = (imports, postcss, mode = "rule") => {
|
|
@@ -2272,7 +2272,7 @@ module.exports = createICSSRules;
|
|
|
2272
2272
|
|
|
2273
2273
|
/***/ }),
|
|
2274
2274
|
|
|
2275
|
-
/***/
|
|
2275
|
+
/***/ 4191:
|
|
2276
2276
|
/***/ ((module) => {
|
|
2277
2277
|
|
|
2278
2278
|
const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
|
|
@@ -2355,13 +2355,13 @@ module.exports = extractICSS;
|
|
|
2355
2355
|
|
|
2356
2356
|
/***/ }),
|
|
2357
2357
|
|
|
2358
|
-
/***/
|
|
2358
|
+
/***/ 2304:
|
|
2359
2359
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2360
2360
|
|
|
2361
|
-
const replaceValueSymbols = __nccwpck_require__(
|
|
2362
|
-
const replaceSymbols = __nccwpck_require__(
|
|
2363
|
-
const extractICSS = __nccwpck_require__(
|
|
2364
|
-
const createICSSRules = __nccwpck_require__(
|
|
2361
|
+
const replaceValueSymbols = __nccwpck_require__(7694);
|
|
2362
|
+
const replaceSymbols = __nccwpck_require__(6284);
|
|
2363
|
+
const extractICSS = __nccwpck_require__(4191);
|
|
2364
|
+
const createICSSRules = __nccwpck_require__(8886);
|
|
2365
2365
|
|
|
2366
2366
|
module.exports = {
|
|
2367
2367
|
replaceValueSymbols,
|
|
@@ -2373,10 +2373,10 @@ module.exports = {
|
|
|
2373
2373
|
|
|
2374
2374
|
/***/ }),
|
|
2375
2375
|
|
|
2376
|
-
/***/
|
|
2376
|
+
/***/ 6284:
|
|
2377
2377
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2378
2378
|
|
|
2379
|
-
const replaceValueSymbols = __nccwpck_require__(
|
|
2379
|
+
const replaceValueSymbols = __nccwpck_require__(7694);
|
|
2380
2380
|
|
|
2381
2381
|
const replaceSymbols = (css, replacements) => {
|
|
2382
2382
|
css.walk((node) => {
|
|
@@ -2398,7 +2398,7 @@ module.exports = replaceSymbols;
|
|
|
2398
2398
|
|
|
2399
2399
|
/***/ }),
|
|
2400
2400
|
|
|
2401
|
-
/***/
|
|
2401
|
+
/***/ 7694:
|
|
2402
2402
|
/***/ ((module) => {
|
|
2403
2403
|
|
|
2404
2404
|
const matchValueName = /[$]?[\w-]+/g;
|
|
@@ -2427,10 +2427,10 @@ module.exports = replaceValueSymbols;
|
|
|
2427
2427
|
|
|
2428
2428
|
/***/ }),
|
|
2429
2429
|
|
|
2430
|
-
/***/
|
|
2430
|
+
/***/ 6486:
|
|
2431
2431
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2432
2432
|
|
|
2433
|
-
const topologicalSort = __nccwpck_require__(
|
|
2433
|
+
const topologicalSort = __nccwpck_require__(763);
|
|
2434
2434
|
|
|
2435
2435
|
const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
|
|
2436
2436
|
const icssImport = /^:import\((?:"([^"]+)"|'([^']+)')\)/;
|
|
@@ -2643,7 +2643,7 @@ module.exports.postcss = true;
|
|
|
2643
2643
|
|
|
2644
2644
|
/***/ }),
|
|
2645
2645
|
|
|
2646
|
-
/***/
|
|
2646
|
+
/***/ 763:
|
|
2647
2647
|
/***/ ((module) => {
|
|
2648
2648
|
|
|
2649
2649
|
const PERMANENT_MARKER = 2;
|
|
@@ -2716,7 +2716,7 @@ module.exports = topologicalSort;
|
|
|
2716
2716
|
|
|
2717
2717
|
/***/ }),
|
|
2718
2718
|
|
|
2719
|
-
/***/
|
|
2719
|
+
/***/ 5172:
|
|
2720
2720
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
2721
2721
|
|
|
2722
2722
|
"use strict";
|
|
@@ -2724,7 +2724,7 @@ module.exports = topologicalSort;
|
|
|
2724
2724
|
|
|
2725
2725
|
const selectorParser = __nccwpck_require__(3008);
|
|
2726
2726
|
const valueParser = __nccwpck_require__(1036);
|
|
2727
|
-
const { extractICSS } = __nccwpck_require__(
|
|
2727
|
+
const { extractICSS } = __nccwpck_require__(2304);
|
|
2728
2728
|
|
|
2729
2729
|
const isSpacing = (node) => node.type === "combinator" && node.value === " ";
|
|
2730
2730
|
|
|
@@ -3355,7 +3355,7 @@ module.exports.postcss = true;
|
|
|
3355
3355
|
|
|
3356
3356
|
/***/ }),
|
|
3357
3357
|
|
|
3358
|
-
/***/
|
|
3358
|
+
/***/ 7652:
|
|
3359
3359
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
3360
3360
|
|
|
3361
3361
|
"use strict";
|
|
@@ -3739,13 +3739,13 @@ module.exports = plugin;
|
|
|
3739
3739
|
|
|
3740
3740
|
/***/ }),
|
|
3741
3741
|
|
|
3742
|
-
/***/
|
|
3742
|
+
/***/ 3378:
|
|
3743
3743
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
3744
3744
|
|
|
3745
3745
|
"use strict";
|
|
3746
3746
|
|
|
3747
3747
|
|
|
3748
|
-
const ICSSUtils = __nccwpck_require__(
|
|
3748
|
+
const ICSSUtils = __nccwpck_require__(2304);
|
|
3749
3749
|
|
|
3750
3750
|
const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
|
|
3751
3751
|
const matchValueDefinition = /(?:\s+|^)([\w-]+):?(.*?)$/;
|
|
@@ -7318,7 +7318,7 @@ module.exports = require("util");
|
|
|
7318
7318
|
|
|
7319
7319
|
/***/ }),
|
|
7320
7320
|
|
|
7321
|
-
/***/
|
|
7321
|
+
/***/ 614:
|
|
7322
7322
|
/***/ ((module) => {
|
|
7323
7323
|
|
|
7324
7324
|
"use strict";
|
|
@@ -7326,11 +7326,11 @@ module.exports = JSON.parse('{"title":"CSS Loader options","additionalProperties
|
|
|
7326
7326
|
|
|
7327
7327
|
/***/ }),
|
|
7328
7328
|
|
|
7329
|
-
/***/
|
|
7329
|
+
/***/ 7972:
|
|
7330
7330
|
/***/ ((module) => {
|
|
7331
7331
|
|
|
7332
7332
|
"use strict";
|
|
7333
|
-
module.exports = JSON.parse('{"name":"postcss","version":"8.4.
|
|
7333
|
+
module.exports = JSON.parse('{"name":"postcss","version":"8.4.39","description":"Tool for transforming styles with JS plugins","engines":{"node":"^10 || ^12 || >=14"},"exports":{".":{"require":"./lib/postcss.js","import":"./lib/postcss.mjs"},"./lib/at-rule":"./lib/at-rule.js","./lib/comment":"./lib/comment.js","./lib/container":"./lib/container.js","./lib/css-syntax-error":"./lib/css-syntax-error.js","./lib/declaration":"./lib/declaration.js","./lib/fromJSON":"./lib/fromJSON.js","./lib/input":"./lib/input.js","./lib/lazy-result":"./lib/lazy-result.js","./lib/no-work-result":"./lib/no-work-result.js","./lib/list":"./lib/list.js","./lib/map-generator":"./lib/map-generator.js","./lib/node":"./lib/node.js","./lib/parse":"./lib/parse.js","./lib/parser":"./lib/parser.js","./lib/postcss":"./lib/postcss.js","./lib/previous-map":"./lib/previous-map.js","./lib/processor":"./lib/processor.js","./lib/result":"./lib/result.js","./lib/root":"./lib/root.js","./lib/rule":"./lib/rule.js","./lib/stringifier":"./lib/stringifier.js","./lib/stringify":"./lib/stringify.js","./lib/symbols":"./lib/symbols.js","./lib/terminal-highlight":"./lib/terminal-highlight.js","./lib/tokenize":"./lib/tokenize.js","./lib/warn-once":"./lib/warn-once.js","./lib/warning":"./lib/warning.js","./package.json":"./package.json"},"main":"./lib/postcss.js","types":"./lib/postcss.d.ts","keywords":["css","postcss","rework","preprocessor","parser","source map","transform","manipulation","transpiler"],"funding":[{"type":"opencollective","url":"https://opencollective.com/postcss/"},{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/postcss"},{"type":"github","url":"https://github.com/sponsors/ai"}],"author":"Andrey Sitnik <andrey@sitnik.ru>","license":"MIT","homepage":"https://postcss.org/","repository":"postcss/postcss","bugs":{"url":"https://github.com/postcss/postcss/issues"},"dependencies":{"nanoid":"^3.3.7","picocolors":"^1.0.1","source-map-js":"^1.2.0"},"browser":{"./lib/terminal-highlight":false,"source-map-js":false,"path":false,"url":false,"fs":false}}');
|
|
7334
7334
|
|
|
7335
7335
|
/***/ })
|
|
7336
7336
|
|
|
@@ -7376,7 +7376,7 @@ module.exports = JSON.parse('{"name":"postcss","version":"8.4.38","description":
|
|
|
7376
7376
|
/******/ // startup
|
|
7377
7377
|
/******/ // Load entry module and return exports
|
|
7378
7378
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
7379
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
7379
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(8034);
|
|
7380
7380
|
/******/ module.exports = __webpack_exports__;
|
|
7381
7381
|
/******/
|
|
7382
7382
|
/******/ })()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 258:
|
|
5
5
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6
6
|
|
|
7
7
|
const url = __nccwpck_require__(310)
|
|
8
8
|
const path = __nccwpck_require__(17)
|
|
9
|
-
const launch = __nccwpck_require__(
|
|
9
|
+
const launch = __nccwpck_require__(469)
|
|
10
10
|
|
|
11
11
|
module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
|
|
12
12
|
if (typeof specifiedEditor === 'function') {
|
|
@@ -21,7 +21,7 @@ module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
|
|
|
21
21
|
|
|
22
22
|
srcRoot = srcRoot || process.cwd()
|
|
23
23
|
|
|
24
|
-
return function launchEditorMiddleware (req, res
|
|
24
|
+
return function launchEditorMiddleware (req, res) {
|
|
25
25
|
const { file } = url.parse(req.url, true).query || {}
|
|
26
26
|
if (!file) {
|
|
27
27
|
res.statusCode = 500
|
|
@@ -36,7 +36,7 @@ module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
|
|
|
36
36
|
|
|
37
37
|
/***/ }),
|
|
38
38
|
|
|
39
|
-
/***/
|
|
39
|
+
/***/ 578:
|
|
40
40
|
/***/ ((module) => {
|
|
41
41
|
|
|
42
42
|
module.exports = {
|
|
@@ -62,7 +62,7 @@ module.exports = {
|
|
|
62
62
|
|
|
63
63
|
/***/ }),
|
|
64
64
|
|
|
65
|
-
/***/
|
|
65
|
+
/***/ 692:
|
|
66
66
|
/***/ ((module) => {
|
|
67
67
|
|
|
68
68
|
module.exports = {
|
|
@@ -107,13 +107,14 @@ module.exports = {
|
|
|
107
107
|
'/Applications/GoLand.app/Contents/MacOS/goland':
|
|
108
108
|
'/Applications/GoLand.app/Contents/MacOS/goland',
|
|
109
109
|
'/Applications/Rider.app/Contents/MacOS/rider':
|
|
110
|
-
'/Applications/Rider.app/Contents/MacOS/rider'
|
|
110
|
+
'/Applications/Rider.app/Contents/MacOS/rider',
|
|
111
|
+
'/Applications/Zed.app/Contents/MacOS/zed': 'zed'
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
/***/ }),
|
|
115
116
|
|
|
116
|
-
/***/
|
|
117
|
+
/***/ 119:
|
|
117
118
|
/***/ ((module) => {
|
|
118
119
|
|
|
119
120
|
module.exports = [
|
|
@@ -145,7 +146,7 @@ module.exports = [
|
|
|
145
146
|
|
|
146
147
|
/***/ }),
|
|
147
148
|
|
|
148
|
-
/***/
|
|
149
|
+
/***/ 961:
|
|
149
150
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
150
151
|
|
|
151
152
|
const path = __nccwpck_require__(17)
|
|
@@ -167,6 +168,7 @@ module.exports = function getArgumentsForPosition (
|
|
|
167
168
|
case 'sublime_text':
|
|
168
169
|
case 'wstorm':
|
|
169
170
|
case 'charm':
|
|
171
|
+
case 'zed':
|
|
170
172
|
return [`${fileName}:${lineNumber}:${columnNumber}`]
|
|
171
173
|
case 'notepad++':
|
|
172
174
|
return ['-n' + lineNumber, '-c' + columnNumber, fileName]
|
|
@@ -225,7 +227,7 @@ module.exports = function getArgumentsForPosition (
|
|
|
225
227
|
|
|
226
228
|
/***/ }),
|
|
227
229
|
|
|
228
|
-
/***/
|
|
230
|
+
/***/ 641:
|
|
229
231
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
230
232
|
|
|
231
233
|
const path = __nccwpck_require__(17)
|
|
@@ -235,9 +237,9 @@ const childProcess = __nccwpck_require__(81)
|
|
|
235
237
|
// Map from full process name to binary that starts the process
|
|
236
238
|
// We can't just re-use full process name, because it will spawn a new instance
|
|
237
239
|
// of the app every time
|
|
238
|
-
const
|
|
239
|
-
const COMMON_EDITORS_LINUX = __nccwpck_require__(
|
|
240
|
-
const COMMON_EDITORS_WIN = __nccwpck_require__(
|
|
240
|
+
const COMMON_EDITORS_MACOS = __nccwpck_require__(692)
|
|
241
|
+
const COMMON_EDITORS_LINUX = __nccwpck_require__(578)
|
|
242
|
+
const COMMON_EDITORS_WIN = __nccwpck_require__(119)
|
|
241
243
|
|
|
242
244
|
module.exports = function guessEditor (specifiedEditor) {
|
|
243
245
|
if (specifiedEditor) {
|
|
@@ -262,20 +264,20 @@ module.exports = function guessEditor (specifiedEditor) {
|
|
|
262
264
|
stdio: ['pipe', 'pipe', 'ignore']
|
|
263
265
|
})
|
|
264
266
|
.toString()
|
|
265
|
-
const processNames = Object.keys(
|
|
267
|
+
const processNames = Object.keys(COMMON_EDITORS_MACOS)
|
|
266
268
|
const processList = output.split('\n')
|
|
267
269
|
for (let i = 0; i < processNames.length; i++) {
|
|
268
270
|
const processName = processNames[i]
|
|
269
271
|
// Find editor by exact match.
|
|
270
272
|
if (processList.includes(processName)) {
|
|
271
|
-
return [
|
|
273
|
+
return [COMMON_EDITORS_MACOS[processName]]
|
|
272
274
|
}
|
|
273
275
|
const processNameWithoutApplications = processName.replace('/Applications', '')
|
|
274
276
|
// Find editor installation not in /Applications.
|
|
275
277
|
if (output.indexOf(processNameWithoutApplications) !== -1) {
|
|
276
278
|
// Use the CLI command if one is specified
|
|
277
|
-
if (processName !==
|
|
278
|
-
return [
|
|
279
|
+
if (processName !== COMMON_EDITORS_MACOS[processName]) {
|
|
280
|
+
return [COMMON_EDITORS_MACOS[processName]]
|
|
279
281
|
}
|
|
280
282
|
// Use a partial match to find the running process path. If one is found, use the
|
|
281
283
|
// existing path since it can be running from anywhere.
|
|
@@ -320,7 +322,7 @@ module.exports = function guessEditor (specifiedEditor) {
|
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
324
|
}
|
|
323
|
-
} catch (
|
|
325
|
+
} catch (ignoreError) {
|
|
324
326
|
// Ignore...
|
|
325
327
|
}
|
|
326
328
|
|
|
@@ -337,7 +339,7 @@ module.exports = function guessEditor (specifiedEditor) {
|
|
|
337
339
|
|
|
338
340
|
/***/ }),
|
|
339
341
|
|
|
340
|
-
/***/
|
|
342
|
+
/***/ 469:
|
|
341
343
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
342
344
|
|
|
343
345
|
/**
|
|
@@ -356,8 +358,8 @@ const path = __nccwpck_require__(17)
|
|
|
356
358
|
const colors = __nccwpck_require__(802)
|
|
357
359
|
const childProcess = __nccwpck_require__(81)
|
|
358
360
|
|
|
359
|
-
const guessEditor = __nccwpck_require__(
|
|
360
|
-
const getArgumentsForPosition = __nccwpck_require__(
|
|
361
|
+
const guessEditor = __nccwpck_require__(641)
|
|
362
|
+
const getArgumentsForPosition = __nccwpck_require__(961)
|
|
361
363
|
|
|
362
364
|
function wrapErrorCallback (cb) {
|
|
363
365
|
return (fileName, errorMessage) => {
|
|
@@ -439,6 +441,36 @@ function launchEditor (file, specifiedEditor, onErrorCallback) {
|
|
|
439
441
|
fileName = path.relative('', fileName)
|
|
440
442
|
}
|
|
441
443
|
|
|
444
|
+
// cmd.exe on Windows is vulnerable to RCE attacks given a file name of the
|
|
445
|
+
// form "C:\Users\myusername\Downloads\& curl 172.21.93.52". Use a safe file
|
|
446
|
+
// name pattern to validate user-provided file names. This doesn't cover the
|
|
447
|
+
// entire range of valid file names but should cover almost all of them in practice.
|
|
448
|
+
// (Backport of
|
|
449
|
+
// https://github.com/facebook/create-react-app/pull/4866
|
|
450
|
+
// and
|
|
451
|
+
// https://github.com/facebook/create-react-app/pull/5431)
|
|
452
|
+
|
|
453
|
+
// Allows alphanumeric characters, periods, dashes, slashes, and underscores.
|
|
454
|
+
const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u
|
|
455
|
+
if (
|
|
456
|
+
process.platform === 'win32' &&
|
|
457
|
+
!WINDOWS_CMD_SAFE_FILE_NAME_PATTERN.test(fileName.trim())
|
|
458
|
+
) {
|
|
459
|
+
console.log()
|
|
460
|
+
console.log(
|
|
461
|
+
colors.red('Could not open ' + path.basename(fileName) + ' in the editor.')
|
|
462
|
+
)
|
|
463
|
+
console.log()
|
|
464
|
+
console.log(
|
|
465
|
+
'When running on Windows, file names are checked against a safe file name ' +
|
|
466
|
+
'pattern to protect against remote code execution attacks. File names ' +
|
|
467
|
+
'may consist only of alphanumeric characters (all languages), periods, ' +
|
|
468
|
+
'dashes, slashes, and underscores.'
|
|
469
|
+
);
|
|
470
|
+
console.log()
|
|
471
|
+
return
|
|
472
|
+
}
|
|
473
|
+
|
|
442
474
|
if (lineNumber) {
|
|
443
475
|
const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber)
|
|
444
476
|
args.push.apply(args, extraArgs)
|
|
@@ -473,7 +505,11 @@ function launchEditor (file, specifiedEditor, onErrorCallback) {
|
|
|
473
505
|
})
|
|
474
506
|
|
|
475
507
|
_childProcess.on('error', function (error) {
|
|
476
|
-
|
|
508
|
+
let { code, message } = error
|
|
509
|
+
if ('ENOENT' === code) {
|
|
510
|
+
message = `${message} ('${editor}' command does not exist in 'PATH')`
|
|
511
|
+
}
|
|
512
|
+
onErrorCallback(fileName, message);
|
|
477
513
|
})
|
|
478
514
|
}
|
|
479
515
|
|
|
@@ -842,7 +878,7 @@ module.exports = require("url");
|
|
|
842
878
|
/******/ // startup
|
|
843
879
|
/******/ // Load entry module and return exports
|
|
844
880
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
845
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
881
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(258);
|
|
846
882
|
/******/ module.exports = __webpack_exports__;
|
|
847
883
|
/******/
|
|
848
884
|
/******/ })()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"launch-editor-middleware","author":"Evan You","version":"2.
|
|
1
|
+
{"name":"launch-editor-middleware","author":"Evan You","version":"2.8.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -463,7 +463,7 @@ module.exports.lilconfigSync = function lilconfigSync(name, options) {
|
|
|
463
463
|
|
|
464
464
|
/***/ }),
|
|
465
465
|
|
|
466
|
-
/***/
|
|
466
|
+
/***/ 510:
|
|
467
467
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
468
468
|
|
|
469
469
|
// @ts-check
|
|
@@ -471,9 +471,9 @@ const { resolve } = __nccwpck_require__(411)
|
|
|
471
471
|
|
|
472
472
|
const config = __nccwpck_require__(882)
|
|
473
473
|
|
|
474
|
-
const loadOptions = __nccwpck_require__(
|
|
475
|
-
const loadPlugins = __nccwpck_require__(
|
|
476
|
-
const req = __nccwpck_require__(
|
|
474
|
+
const loadOptions = __nccwpck_require__(703)
|
|
475
|
+
const loadPlugins = __nccwpck_require__(547)
|
|
476
|
+
const req = __nccwpck_require__(915)
|
|
477
477
|
|
|
478
478
|
const interopRequireDefault = obj =>
|
|
479
479
|
obj && obj.__esModule ? obj : { default: obj }
|
|
@@ -648,11 +648,11 @@ module.exports = rc
|
|
|
648
648
|
|
|
649
649
|
/***/ }),
|
|
650
650
|
|
|
651
|
-
/***/
|
|
651
|
+
/***/ 703:
|
|
652
652
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
653
653
|
|
|
654
654
|
// @ts-check
|
|
655
|
-
const req = __nccwpck_require__(
|
|
655
|
+
const req = __nccwpck_require__(915)
|
|
656
656
|
|
|
657
657
|
/**
|
|
658
658
|
* Load Options
|
|
@@ -703,11 +703,11 @@ module.exports = options
|
|
|
703
703
|
|
|
704
704
|
/***/ }),
|
|
705
705
|
|
|
706
|
-
/***/
|
|
706
|
+
/***/ 547:
|
|
707
707
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
708
708
|
|
|
709
709
|
// @ts-check
|
|
710
|
-
const req = __nccwpck_require__(
|
|
710
|
+
const req = __nccwpck_require__(915)
|
|
711
711
|
|
|
712
712
|
/**
|
|
713
713
|
* Plugin Loader
|
|
@@ -799,7 +799,7 @@ module.exports = plugins
|
|
|
799
799
|
|
|
800
800
|
/***/ }),
|
|
801
801
|
|
|
802
|
-
/***/
|
|
802
|
+
/***/ 915:
|
|
803
803
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
804
804
|
|
|
805
805
|
// @ts-check
|
|
@@ -1043,7 +1043,7 @@ module.exports = require("yaml");
|
|
|
1043
1043
|
/******/ // startup
|
|
1044
1044
|
/******/ // Load entry module and return exports
|
|
1045
1045
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1046
|
-
/******/ var __webpack_exports__ = __nccwpck_require__(
|
|
1046
|
+
/******/ var __webpack_exports__ = __nccwpck_require__(510);
|
|
1047
1047
|
/******/ module.exports = __webpack_exports__;
|
|
1048
1048
|
/******/
|
|
1049
1049
|
/******/ })()
|