@ohos-ports/rsbuild-core 1.7.2-beta.1
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/LICENSE +21 -0
- package/README.md +27 -0
- package/bin/rsbuild.js +20 -0
- package/compiled/@jridgewell/remapping/index.d.ts +1 -0
- package/compiled/@jridgewell/remapping/index.js +1222 -0
- package/compiled/@jridgewell/remapping/license +19 -0
- package/compiled/@jridgewell/remapping/package.json +1 -0
- package/compiled/@jridgewell/trace-mapping/index.d.ts +194 -0
- package/compiled/@jridgewell/trace-mapping/index.js +1408 -0
- package/compiled/@jridgewell/trace-mapping/license +19 -0
- package/compiled/@jridgewell/trace-mapping/package.json +1 -0
- package/compiled/chokidar/index.d.ts +384 -0
- package/compiled/chokidar/index.js +1793 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/connect/index.d.ts +90 -0
- package/compiled/connect/index.js +1240 -0
- package/compiled/connect/license +25 -0
- package/compiled/connect/package.json +1 -0
- package/compiled/cors/index.d.ts +56 -0
- package/compiled/cors/index.js +371 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/api.js +85 -0
- package/compiled/css-loader/getUrl.js +26 -0
- package/compiled/css-loader/index.d.ts +1 -0
- package/compiled/css-loader/index.js +2 -0
- package/compiled/css-loader/license +20 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +16 -0
- package/compiled/html-rspack-plugin/default_index.ejs +9 -0
- package/compiled/html-rspack-plugin/index.d.ts +290 -0
- package/compiled/html-rspack-plugin/index.js +1602 -0
- package/compiled/html-rspack-plugin/license +20 -0
- package/compiled/html-rspack-plugin/loader.js +166 -0
- package/compiled/html-rspack-plugin/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +319 -0
- package/compiled/http-proxy-middleware/index.js +5284 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/launch-editor-middleware/index.d.ts +1 -0
- package/compiled/launch-editor-middleware/index.js +719 -0
- package/compiled/launch-editor-middleware/license +21 -0
- package/compiled/launch-editor-middleware/package.json +1 -0
- package/compiled/memfs/index.d.ts +1462 -0
- package/compiled/memfs/index.js +1 -0
- package/compiled/memfs/license +201 -0
- package/compiled/memfs/package.json +1 -0
- package/compiled/mrmime/index.d.ts +4 -0
- package/compiled/mrmime/index.js +456 -0
- package/compiled/mrmime/package.json +1 -0
- package/compiled/picocolors/index.d.ts +55 -0
- package/compiled/picocolors/index.js +108 -0
- package/compiled/picocolors/license +15 -0
- package/compiled/picocolors/package.json +1 -0
- package/compiled/postcss/index.js +1 -0
- package/compiled/postcss/lib/at-rule.d.ts +140 -0
- package/compiled/postcss/lib/comment.d.ts +68 -0
- package/compiled/postcss/lib/container.d.ts +483 -0
- package/compiled/postcss/lib/css-syntax-error.d.ts +248 -0
- package/compiled/postcss/lib/declaration.d.ts +151 -0
- package/compiled/postcss/lib/document.d.ts +69 -0
- package/compiled/postcss/lib/fromJSON.d.ts +9 -0
- package/compiled/postcss/lib/input.d.ts +227 -0
- package/compiled/postcss/lib/lazy-result.d.ts +190 -0
- package/compiled/postcss/lib/list.d.ts +60 -0
- package/compiled/postcss/lib/no-work-result.d.ts +46 -0
- package/compiled/postcss/lib/node.d.ts +556 -0
- package/compiled/postcss/lib/parse.d.ts +9 -0
- package/compiled/postcss/lib/postcss.d.ts +458 -0
- package/compiled/postcss/lib/previous-map.d.ts +81 -0
- package/compiled/postcss/lib/processor.d.ts +115 -0
- package/compiled/postcss/lib/result.d.ts +205 -0
- package/compiled/postcss/lib/root.d.ts +87 -0
- package/compiled/postcss/lib/rule.d.ts +126 -0
- package/compiled/postcss/lib/source-map-js.d.ts +4 -0
- package/compiled/postcss/lib/stringifier.d.ts +46 -0
- package/compiled/postcss/lib/stringify.d.ts +9 -0
- package/compiled/postcss/lib/warning.d.ts +147 -0
- package/compiled/postcss/license +20 -0
- package/compiled/postcss/package.json +1 -0
- package/compiled/postcss-loader/index.d.ts +1 -0
- package/compiled/postcss-loader/index.js +720 -0
- package/compiled/postcss-loader/license +20 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/rslog/index.d.ts +67 -0
- package/compiled/rslog/license +21 -0
- package/compiled/rslog/package.json +1 -0
- package/compiled/rspack-chain/license +22 -0
- package/compiled/rspack-chain/package.json +1 -0
- package/compiled/rspack-chain/types/index.d.ts +545 -0
- package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
- package/compiled/rspack-manifest-plugin/index.js +409 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/sirv/index.d.ts +1 -0
- package/compiled/sirv/index.js +274 -0
- package/compiled/sirv/package.json +1 -0
- package/compiled/style-loader/index.d.ts +1 -0
- package/compiled/style-loader/index.js +427 -0
- package/compiled/style-loader/license +20 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
- package/compiled/style-loader/runtime/insertBySelector.js +34 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
- package/compiled/style-loader/runtime/isOldIE.js +17 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
- package/compiled/tinyglobby/index.d.ts +46 -0
- package/compiled/tinyglobby/index.js +2664 -0
- package/compiled/tinyglobby/license +21 -0
- package/compiled/tinyglobby/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
- package/compiled/webpack-bundle-analyzer/index.js +23 -0
- package/compiled/webpack-bundle-analyzer/license +20 -0
- package/compiled/webpack-bundle-analyzer/package.json +1 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
- package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
- package/compiled/webpack-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/compiled/ws/index.d.ts +437 -0
- package/compiled/ws/index.js +3161 -0
- package/compiled/ws/license +20 -0
- package/compiled/ws/package.json +1 -0
- package/dist/0~open.js +427 -0
- package/dist/0~range-parser.js +49 -0
- package/dist/0~range-parser.js.LICENSE.txt +6 -0
- package/dist/131.js +9305 -0
- package/dist/131.js.LICENSE.txt +26 -0
- package/dist/136.mjs +42 -0
- package/dist/2~open.cjs +436 -0
- package/dist/2~range-parser.cjs +52 -0
- package/dist/2~range-parser.cjs.LICENSE.txt +6 -0
- package/dist/client/59.js +22 -0
- package/dist/client/hmr.js +206 -0
- package/dist/client/overlay.js +203 -0
- package/dist/ignoreCssLoader.mjs +3 -0
- package/dist/index.cjs +9456 -0
- package/dist/index.cjs.LICENSE.txt +26 -0
- package/dist/index.js +1 -0
- package/dist/rslib-runtime.js +44 -0
- package/dist/transformLoader.mjs +1 -0
- package/dist/transformRawLoader.mjs +4 -0
- package/dist-types/cli/commands.d.ts +28 -0
- package/dist-types/cli/index.d.ts +1 -0
- package/dist-types/cli/init.d.ts +7 -0
- package/dist-types/client/hmr.d.ts +3 -0
- package/dist-types/client/log.d.ts +13 -0
- package/dist-types/client/overlay.d.ts +1 -0
- package/dist-types/configChain.d.ts +154 -0
- package/dist-types/constants.d.ts +52 -0
- package/dist-types/createContext.d.ts +11 -0
- package/dist-types/createRsbuild.d.ts +5 -0
- package/dist-types/defaultConfig.d.ts +25 -0
- package/dist-types/helpers/compiler.d.ts +5 -0
- package/dist-types/helpers/exitHook.d.ts +3 -0
- package/dist-types/helpers/format.d.ts +2 -0
- package/dist-types/helpers/fs.d.ts +17 -0
- package/dist-types/helpers/index.d.ts +29 -0
- package/dist-types/helpers/path.d.ts +26 -0
- package/dist-types/helpers/stats.d.ts +18 -0
- package/dist-types/helpers/url.d.ts +11 -0
- package/dist-types/helpers/vendors.d.ts +29 -0
- package/dist-types/helpers/version.d.ts +7 -0
- package/dist-types/hooks.d.ts +44 -0
- package/dist-types/index.d.ts +22 -0
- package/dist-types/initPlugins.d.ts +6 -0
- package/dist-types/inspectConfig.d.ts +35 -0
- package/dist-types/loadConfig.d.ts +60 -0
- package/dist-types/loadEnv.d.ts +63 -0
- package/dist-types/loader/ignoreCssLoader.d.ts +3 -0
- package/dist-types/loader/transformLoader.d.ts +8 -0
- package/dist-types/loader/transformRawLoader.d.ts +3 -0
- package/dist-types/logger.d.ts +19 -0
- package/dist-types/mergeConfig.d.ts +2 -0
- package/dist-types/package.json +1 -0
- package/dist-types/pluginHelper.d.ts +12 -0
- package/dist-types/pluginManager.d.ts +21 -0
- package/dist-types/plugins/appIcon.d.ts +2 -0
- package/dist-types/plugins/asset.d.ts +3 -0
- package/dist-types/plugins/basic.d.ts +5 -0
- package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
- package/dist-types/plugins/cache.d.ts +2 -0
- package/dist-types/plugins/cleanOutput.d.ts +2 -0
- package/dist-types/plugins/css.d.ts +4 -0
- package/dist-types/plugins/define.d.ts +2 -0
- package/dist-types/plugins/entry.d.ts +2 -0
- package/dist-types/plugins/esm.d.ts +2 -0
- package/dist-types/plugins/externals.d.ts +2 -0
- package/dist-types/plugins/fileSize.d.ts +6 -0
- package/dist-types/plugins/html.d.ts +9 -0
- package/dist-types/plugins/inlineChunk.d.ts +6 -0
- package/dist-types/plugins/lazyCompilation.d.ts +2 -0
- package/dist-types/plugins/manifest.d.ts +2 -0
- package/dist-types/plugins/minimize.d.ts +10 -0
- package/dist-types/plugins/moduleFederation.d.ts +2 -0
- package/dist-types/plugins/moment.d.ts +2 -0
- package/dist-types/plugins/nodeAddons.d.ts +2 -0
- package/dist-types/plugins/nonce.d.ts +2 -0
- package/dist-types/plugins/output.d.ts +2 -0
- package/dist-types/plugins/performance.d.ts +5 -0
- package/dist-types/plugins/progress.d.ts +2 -0
- package/dist-types/plugins/resolve.d.ts +2 -0
- package/dist-types/plugins/resourceHints.d.ts +2 -0
- package/dist-types/plugins/rsdoctor.d.ts +2 -0
- package/dist-types/plugins/rspackProfile.d.ts +2 -0
- package/dist-types/plugins/server.d.ts +2 -0
- package/dist-types/plugins/sourceMap.d.ts +2 -0
- package/dist-types/plugins/splitChunks.d.ts +4 -0
- package/dist-types/plugins/sri.d.ts +2 -0
- package/dist-types/plugins/swc.d.ts +5 -0
- package/dist-types/plugins/target.d.ts +2 -0
- package/dist-types/plugins/wasm.d.ts +2 -0
- package/dist-types/provider/build.d.ts +4 -0
- package/dist-types/provider/createCompiler.d.ts +6 -0
- package/dist-types/provider/helpers.d.ts +12 -0
- package/dist-types/provider/initConfigs.d.ts +19 -0
- package/dist-types/provider/provider.d.ts +2 -0
- package/dist-types/provider/rspackConfig.d.ts +8 -0
- package/dist-types/restart.d.ts +18 -0
- package/dist-types/rspack-plugins/RsbuildHtmlPlugin.d.ts +38 -0
- package/dist-types/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +32 -0
- package/dist-types/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +28 -0
- package/dist-types/rspack-plugins/resource-hints/extractChunks.d.ts +23 -0
- package/dist-types/rspack-plugins/resource-hints/getResourceType.d.ts +22 -0
- package/dist-types/rspack.d.ts +2 -0
- package/dist-types/server/ansiHTML.d.ts +4 -0
- package/dist-types/server/assets-middleware/getFileFromUrl.d.ts +12 -0
- package/dist-types/server/assets-middleware/index.d.ts +37 -0
- package/dist-types/server/assets-middleware/middleware.d.ts +2 -0
- package/dist-types/server/assets-middleware/parseTokenList.d.ts +1 -0
- package/dist-types/server/assets-middleware/setupOutputFileSystem.d.ts +3 -0
- package/dist-types/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
- package/dist-types/server/browserLogs.d.ts +9 -0
- package/dist-types/server/buildManager.d.ts +33 -0
- package/dist-types/server/cliShortcuts.d.ts +10 -0
- package/dist-types/server/devMiddlewares.d.ts +21 -0
- package/dist-types/server/devServer.d.ts +79 -0
- package/dist-types/server/environment.d.ts +8 -0
- package/dist-types/server/gracefulShutdown.d.ts +10 -0
- package/dist-types/server/gzipMiddleware.d.ts +2 -0
- package/dist-types/server/helper.d.ts +91 -0
- package/dist-types/server/historyApiFallback.d.ts +2 -0
- package/dist-types/server/hmrFallback.d.ts +1 -0
- package/dist-types/server/httpServer.d.ts +7 -0
- package/dist-types/server/middlewares.d.ts +33 -0
- package/dist-types/server/open.d.ts +10 -0
- package/dist-types/server/overlay.d.ts +3 -0
- package/dist-types/server/prodServer.d.ts +24 -0
- package/dist-types/server/proxy.d.ts +6 -0
- package/dist-types/server/runner/asModule.d.ts +2 -0
- package/dist-types/server/runner/basic.d.ts +29 -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 +4 -0
- package/dist-types/server/runner/type.d.ts +42 -0
- package/dist-types/server/socketServer.d.ts +81 -0
- package/dist-types/server/watchFiles.d.ts +14 -0
- package/dist-types/types/config.d.ts +1882 -0
- package/dist-types/types/context.d.ts +110 -0
- package/dist-types/types/hooks.d.ts +275 -0
- package/dist-types/types/index.d.ts +8 -0
- package/dist-types/types/plugin.d.ts +585 -0
- package/dist-types/types/rsbuild.d.ts +286 -0
- package/dist-types/types/rspack.d.ts +16 -0
- package/dist-types/types/thirdParty.d.ts +186 -0
- package/dist-types/types/utils.d.ts +19 -0
- package/package.json +114 -0
- package/static/openChrome.applescript +95 -0
- package/types.d.ts +349 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ee-first
|
|
3
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
+
* MIT Licensed
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
* on-finished
|
|
9
|
+
* Copyright(c) 2013 Jonathan Ong
|
|
10
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Autoload Config for PostCSS
|
|
16
|
+
*
|
|
17
|
+
* @author Michael Ciniawsky @michael-ciniawsky <michael.ciniawsky@gmail.com>
|
|
18
|
+
* @license MIT
|
|
19
|
+
*
|
|
20
|
+
* @module postcss-load-config
|
|
21
|
+
* @version 2.1.0
|
|
22
|
+
*
|
|
23
|
+
* @requires comsiconfig
|
|
24
|
+
* @requires ./options
|
|
25
|
+
* @requires ./plugins
|
|
26
|
+
*/
|
package/dist/136.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
let constants_dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
process.platform, join(constants_dirname), join(constants_dirname, '../static'), join(constants_dirname, 'client');
|
|
6
|
+
let COMPILED_PATH = join(constants_dirname, '../compiled'), vendors_require = createRequire(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`);
|
|
7
|
+
requireCompiledPackage('picocolors');
|
|
8
|
+
let transformLoader = async function transform(source, map) {
|
|
9
|
+
let callback = this.async(), bypass = ()=>{
|
|
10
|
+
callback(null, source, map);
|
|
11
|
+
}, { id: transformId, getEnvironment } = this.getOptions();
|
|
12
|
+
if (!transformId) return void bypass();
|
|
13
|
+
let transform = this._compiler?.__rsbuildTransformer?.[transformId];
|
|
14
|
+
if (!transform) return void bypass();
|
|
15
|
+
try {
|
|
16
|
+
var generatedSourceMap;
|
|
17
|
+
let result = await transform({
|
|
18
|
+
code: source,
|
|
19
|
+
context: this.context,
|
|
20
|
+
resource: this.resource,
|
|
21
|
+
resourcePath: this.resourcePath,
|
|
22
|
+
resourceQuery: this.resourceQuery,
|
|
23
|
+
environment: getEnvironment(),
|
|
24
|
+
addDependency: this.addDependency.bind(this),
|
|
25
|
+
addMissingDependency: this.addMissingDependency.bind(this),
|
|
26
|
+
addContextDependency: this.addContextDependency.bind(this),
|
|
27
|
+
emitFile: this.emitFile.bind(this),
|
|
28
|
+
importModule: this.importModule.bind(this),
|
|
29
|
+
resolve: this.resolve.bind(this)
|
|
30
|
+
});
|
|
31
|
+
if (null == result) return void bypass();
|
|
32
|
+
if ('string' == typeof result || Buffer.isBuffer(result)) return void callback(null, result, map);
|
|
33
|
+
let mergedMap = (generatedSourceMap = result.map, map && generatedSourceMap ? requireCompiledPackage('@jridgewell/remapping')([
|
|
34
|
+
generatedSourceMap,
|
|
35
|
+
map
|
|
36
|
+
], ()=>null) : generatedSourceMap ?? map);
|
|
37
|
+
callback(null, result.code, mergedMap);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
error instanceof Error ? callback(error) : callback(Error(String(error)));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export default transformLoader;
|
package/dist/2~open.cjs
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
3
|
+
exports.ids = [
|
|
4
|
+
"664"
|
|
5
|
+
], exports.modules = {
|
|
6
|
+
"../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
let isDockerCached, cachedResult, canAccessPowerShellPromise, mountPoint, defaultMountPoint;
|
|
8
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
default: ()=>node_modules_open,
|
|
10
|
+
apps: ()=>open_apps
|
|
11
|
+
});
|
|
12
|
+
var external_node_process_ = __webpack_require__("node:process"), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), external_node_child_process_ = __webpack_require__("node:child_process"), promises_ = __webpack_require__("node:fs/promises"), external_node_os_ = __webpack_require__("node:os"), external_node_fs_ = __webpack_require__("node:fs");
|
|
13
|
+
function hasDockerEnv() {
|
|
14
|
+
try {
|
|
15
|
+
return external_node_fs_.statSync('/.dockerenv'), !0;
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function hasDockerCGroup() {
|
|
21
|
+
try {
|
|
22
|
+
return external_node_fs_.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
|
23
|
+
} catch {
|
|
24
|
+
return !1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function isDocker() {
|
|
28
|
+
return void 0 === isDockerCached && (isDockerCached = hasDockerEnv() || hasDockerCGroup()), isDockerCached;
|
|
29
|
+
}
|
|
30
|
+
function isInsideContainer() {
|
|
31
|
+
return void 0 === cachedResult && (cachedResult = (()=>{
|
|
32
|
+
try {
|
|
33
|
+
return external_node_fs_.statSync('/run/.containerenv'), !0;
|
|
34
|
+
} catch {
|
|
35
|
+
return !1;
|
|
36
|
+
}
|
|
37
|
+
})() || isDocker()), cachedResult;
|
|
38
|
+
}
|
|
39
|
+
let isWsl = ()=>{
|
|
40
|
+
if ('linux' !== external_node_process_.platform) return !1;
|
|
41
|
+
if (external_node_os_.release().toLowerCase().includes('microsoft')) return !isInsideContainer();
|
|
42
|
+
try {
|
|
43
|
+
return !!external_node_fs_.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') && !isInsideContainer();
|
|
44
|
+
} catch {
|
|
45
|
+
return !1;
|
|
46
|
+
}
|
|
47
|
+
}, is_wsl = external_node_process_.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
48
|
+
var external_node_util_ = __webpack_require__("node:util"), external_node_buffer_ = __webpack_require__("node:buffer");
|
|
49
|
+
let execFile = (0, external_node_util_.promisify)(external_node_child_process_.execFile), powerShellPath = ()=>`${external_node_process_.env.SYSTEMROOT || external_node_process_.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell = async (command, options = {})=>{
|
|
50
|
+
let { powerShellPath: psPath, ...execFileOptions } = options, encodedCommand = executePowerShell.encodeCommand(command);
|
|
51
|
+
return execFile(psPath ?? powerShellPath(), [
|
|
52
|
+
...executePowerShell.argumentsPrefix,
|
|
53
|
+
encodedCommand
|
|
54
|
+
], {
|
|
55
|
+
encoding: 'utf8',
|
|
56
|
+
...execFileOptions
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
executePowerShell.argumentsPrefix = [
|
|
60
|
+
'-NoProfile',
|
|
61
|
+
'-NonInteractive',
|
|
62
|
+
'-ExecutionPolicy',
|
|
63
|
+
'Bypass',
|
|
64
|
+
'-EncodedCommand'
|
|
65
|
+
], executePowerShell.encodeCommand = (command)=>external_node_buffer_.Buffer.from(command, 'utf16le').toString('base64'), executePowerShell.escapeArgument = (value)=>`'${String(value).replaceAll('\'', '\'\'')}'`;
|
|
66
|
+
let wsl_utils_execFile = (0, external_node_util_.promisify)(external_node_child_process_.execFile), wslDrivesMountPoint = (defaultMountPoint = '/mnt/', async function() {
|
|
67
|
+
if (mountPoint) return mountPoint;
|
|
68
|
+
let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
|
|
69
|
+
try {
|
|
70
|
+
await promises_.access(configFilePath, promises_.constants.F_OK), isConfigFileExists = !0;
|
|
71
|
+
} catch {}
|
|
72
|
+
if (!isConfigFileExists) return defaultMountPoint;
|
|
73
|
+
let configContent = await promises_.readFile(configFilePath, {
|
|
74
|
+
encoding: 'utf8'
|
|
75
|
+
}), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
76
|
+
return configMountPoint ? mountPoint = (mountPoint = configMountPoint.groups.mountPoint.trim()).endsWith('/') ? mountPoint : `${mountPoint}/` : defaultMountPoint;
|
|
77
|
+
}), powerShellPathFromWsl = async ()=>{
|
|
78
|
+
let mountPoint = await wslDrivesMountPoint();
|
|
79
|
+
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
80
|
+
}, wsl_utils_powerShellPath = is_wsl ? powerShellPathFromWsl : powerShellPath, wsl_utils_canAccessPowerShell = async ()=>canAccessPowerShellPromise ??= (async ()=>{
|
|
81
|
+
try {
|
|
82
|
+
let psPath = await wsl_utils_powerShellPath();
|
|
83
|
+
return await promises_.access(psPath, promises_.constants.X_OK), !0;
|
|
84
|
+
} catch {
|
|
85
|
+
return !1;
|
|
86
|
+
}
|
|
87
|
+
})(), wslDefaultBrowser = async ()=>{
|
|
88
|
+
let psPath = await wsl_utils_powerShellPath(), command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { stdout } = await executePowerShell(command, {
|
|
89
|
+
powerShellPath: psPath
|
|
90
|
+
});
|
|
91
|
+
return stdout.trim();
|
|
92
|
+
}, convertWslPathToWindows = async (path)=>{
|
|
93
|
+
if (/^[a-z]+:\/\//i.test(path)) return path;
|
|
94
|
+
try {
|
|
95
|
+
let { stdout } = await wsl_utils_execFile('wslpath', [
|
|
96
|
+
'-aw',
|
|
97
|
+
path
|
|
98
|
+
], {
|
|
99
|
+
encoding: 'utf8'
|
|
100
|
+
});
|
|
101
|
+
return stdout.trim();
|
|
102
|
+
} catch {
|
|
103
|
+
return path;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
107
|
+
let define = (value)=>Object.defineProperty(object, propertyName, {
|
|
108
|
+
value,
|
|
109
|
+
enumerable: !0,
|
|
110
|
+
writable: !0
|
|
111
|
+
});
|
|
112
|
+
return Object.defineProperty(object, propertyName, {
|
|
113
|
+
configurable: !0,
|
|
114
|
+
enumerable: !0,
|
|
115
|
+
get () {
|
|
116
|
+
let result = valueGetter();
|
|
117
|
+
return define(result), result;
|
|
118
|
+
},
|
|
119
|
+
set (value) {
|
|
120
|
+
define(value);
|
|
121
|
+
}
|
|
122
|
+
}), object;
|
|
123
|
+
}
|
|
124
|
+
let execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile), windowsBrowserProgIds = {
|
|
125
|
+
MSEdgeHTM: {
|
|
126
|
+
name: 'Edge',
|
|
127
|
+
id: 'com.microsoft.edge'
|
|
128
|
+
},
|
|
129
|
+
MSEdgeBHTML: {
|
|
130
|
+
name: 'Edge Beta',
|
|
131
|
+
id: 'com.microsoft.edge.beta'
|
|
132
|
+
},
|
|
133
|
+
MSEdgeDHTML: {
|
|
134
|
+
name: 'Edge Dev',
|
|
135
|
+
id: 'com.microsoft.edge.dev'
|
|
136
|
+
},
|
|
137
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
|
|
138
|
+
name: 'Edge',
|
|
139
|
+
id: 'com.microsoft.edge.old'
|
|
140
|
+
},
|
|
141
|
+
ChromeHTML: {
|
|
142
|
+
name: 'Chrome',
|
|
143
|
+
id: 'com.google.chrome'
|
|
144
|
+
},
|
|
145
|
+
ChromeBHTML: {
|
|
146
|
+
name: 'Chrome Beta',
|
|
147
|
+
id: 'com.google.chrome.beta'
|
|
148
|
+
},
|
|
149
|
+
ChromeDHTML: {
|
|
150
|
+
name: 'Chrome Dev',
|
|
151
|
+
id: 'com.google.chrome.dev'
|
|
152
|
+
},
|
|
153
|
+
ChromiumHTM: {
|
|
154
|
+
name: 'Chromium',
|
|
155
|
+
id: 'org.chromium.Chromium'
|
|
156
|
+
},
|
|
157
|
+
BraveHTML: {
|
|
158
|
+
name: 'Brave',
|
|
159
|
+
id: 'com.brave.Browser'
|
|
160
|
+
},
|
|
161
|
+
BraveBHTML: {
|
|
162
|
+
name: 'Brave Beta',
|
|
163
|
+
id: 'com.brave.Browser.beta'
|
|
164
|
+
},
|
|
165
|
+
BraveDHTML: {
|
|
166
|
+
name: 'Brave Dev',
|
|
167
|
+
id: 'com.brave.Browser.dev'
|
|
168
|
+
},
|
|
169
|
+
BraveSSHTM: {
|
|
170
|
+
name: 'Brave Nightly',
|
|
171
|
+
id: 'com.brave.Browser.nightly'
|
|
172
|
+
},
|
|
173
|
+
FirefoxURL: {
|
|
174
|
+
name: 'Firefox',
|
|
175
|
+
id: 'org.mozilla.firefox'
|
|
176
|
+
},
|
|
177
|
+
OperaStable: {
|
|
178
|
+
name: 'Opera',
|
|
179
|
+
id: 'com.operasoftware.Opera'
|
|
180
|
+
},
|
|
181
|
+
VivaldiHTM: {
|
|
182
|
+
name: 'Vivaldi',
|
|
183
|
+
id: 'com.vivaldi.Vivaldi'
|
|
184
|
+
},
|
|
185
|
+
'IE.HTTP': {
|
|
186
|
+
name: 'Internet Explorer',
|
|
187
|
+
id: 'com.microsoft.ie'
|
|
188
|
+
}
|
|
189
|
+
}, _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
190
|
+
class UnknownBrowserError extends Error {
|
|
191
|
+
}
|
|
192
|
+
async function defaultBrowser(_execFileAsync = execFileAsync) {
|
|
193
|
+
let { stdout } = await _execFileAsync('reg', [
|
|
194
|
+
'QUERY',
|
|
195
|
+
' HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice',
|
|
196
|
+
'/v',
|
|
197
|
+
'ProgId'
|
|
198
|
+
]), match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
199
|
+
if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
200
|
+
let { id } = match.groups, browser = windowsBrowserProgIds[id];
|
|
201
|
+
if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
202
|
+
return browser;
|
|
203
|
+
}
|
|
204
|
+
let default_browser_id_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
|
|
205
|
+
async function defaultBrowserId() {
|
|
206
|
+
if ('darwin' !== external_node_process_.platform) throw Error('macOS only');
|
|
207
|
+
let { stdout } = await default_browser_id_execFileAsync('defaults', [
|
|
208
|
+
'read',
|
|
209
|
+
'com.apple.LaunchServices/com.apple.launchservices.secure',
|
|
210
|
+
'LSHandlers'
|
|
211
|
+
]), match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
212
|
+
return match?.groups.id ?? 'com.apple.Safari';
|
|
213
|
+
}
|
|
214
|
+
let run_applescript_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
|
|
215
|
+
async function runAppleScript(script, { humanReadableOutput = !0, signal } = {}) {
|
|
216
|
+
if ('darwin' !== external_node_process_.platform) throw Error('macOS only');
|
|
217
|
+
let execOptions = {};
|
|
218
|
+
signal && (execOptions.signal = signal);
|
|
219
|
+
let { stdout } = await run_applescript_execFileAsync("osascript", [
|
|
220
|
+
'-e',
|
|
221
|
+
script,
|
|
222
|
+
humanReadableOutput ? [] : [
|
|
223
|
+
'-ss'
|
|
224
|
+
]
|
|
225
|
+
], execOptions);
|
|
226
|
+
return stdout.trim();
|
|
227
|
+
}
|
|
228
|
+
async function bundleName(bundleId) {
|
|
229
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
230
|
+
}
|
|
231
|
+
let default_browser_execFileAsync = (0, external_node_util_.promisify)(external_node_child_process_.execFile);
|
|
232
|
+
async function default_browser_defaultBrowser() {
|
|
233
|
+
if ('darwin' === external_node_process_.platform) {
|
|
234
|
+
let id = await defaultBrowserId();
|
|
235
|
+
return {
|
|
236
|
+
name: await bundleName(id),
|
|
237
|
+
id
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
if ('linux' === external_node_process_.platform) {
|
|
241
|
+
let { stdout } = await default_browser_execFileAsync('xdg-mime', [
|
|
242
|
+
'query',
|
|
243
|
+
'default',
|
|
244
|
+
'x-scheme-handler/http'
|
|
245
|
+
]), id = stdout.trim();
|
|
246
|
+
return {
|
|
247
|
+
name: id.replace(/.desktop$/, '').replace('-', ' ').toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x)=>x.toUpperCase()),
|
|
248
|
+
id
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
if ('win32' === external_node_process_.platform) return defaultBrowser();
|
|
252
|
+
throw Error('Only macOS, Linux, and Windows are supported');
|
|
253
|
+
}
|
|
254
|
+
let isInSsh = !!(external_node_process_.env.SSH_CONNECTION || external_node_process_.env.SSH_CLIENT || external_node_process_.env.SSH_TTY), fallbackAttemptSymbol = Symbol('fallbackAttempt'), open_dirname = __rslib_import_meta_url__ ? external_node_path_.dirname((0, external_node_url_.fileURLToPath)(__rslib_import_meta_url__)) : '', localXdgOpenPath = external_node_path_.join(open_dirname, 'xdg-open'), { platform, arch } = external_node_process_, tryEachApp = async (apps, opener)=>{
|
|
255
|
+
if (0 === apps.length) return;
|
|
256
|
+
let errors = [];
|
|
257
|
+
for (let app of apps)try {
|
|
258
|
+
return await opener(app);
|
|
259
|
+
} catch (error) {
|
|
260
|
+
errors.push(error);
|
|
261
|
+
}
|
|
262
|
+
throw AggregateError(errors, 'Failed to open in all supported apps');
|
|
263
|
+
}, baseOpen = async (options)=>{
|
|
264
|
+
let command, isFallbackAttempt = !0 === (options = {
|
|
265
|
+
wait: !1,
|
|
266
|
+
background: !1,
|
|
267
|
+
newInstance: !1,
|
|
268
|
+
allowNonzeroExitCode: !1,
|
|
269
|
+
...options
|
|
270
|
+
})[fallbackAttemptSymbol];
|
|
271
|
+
if (delete options[fallbackAttemptSymbol], Array.isArray(options.app)) return tryEachApp(options.app, (singleApp)=>baseOpen({
|
|
272
|
+
...options,
|
|
273
|
+
app: singleApp,
|
|
274
|
+
[fallbackAttemptSymbol]: !0
|
|
275
|
+
}));
|
|
276
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
277
|
+
if (appArguments = [
|
|
278
|
+
...appArguments
|
|
279
|
+
], Array.isArray(app)) return tryEachApp(app, (appName)=>baseOpen({
|
|
280
|
+
...options,
|
|
281
|
+
app: {
|
|
282
|
+
name: appName,
|
|
283
|
+
arguments: appArguments
|
|
284
|
+
},
|
|
285
|
+
[fallbackAttemptSymbol]: !0
|
|
286
|
+
}));
|
|
287
|
+
if ('browser' === app || 'browserPrivate' === app) {
|
|
288
|
+
let browser, ids = {
|
|
289
|
+
'com.google.chrome': 'chrome',
|
|
290
|
+
'google-chrome.desktop': 'chrome',
|
|
291
|
+
'com.brave.browser': 'brave',
|
|
292
|
+
'org.mozilla.firefox': 'firefox',
|
|
293
|
+
'firefox.desktop': 'firefox',
|
|
294
|
+
'com.microsoft.msedge': 'edge',
|
|
295
|
+
'com.microsoft.edge': 'edge',
|
|
296
|
+
'com.microsoft.edgemac': 'edge',
|
|
297
|
+
'microsoft-edge.desktop': 'edge',
|
|
298
|
+
'com.apple.safari': 'safari'
|
|
299
|
+
};
|
|
300
|
+
if (is_wsl) {
|
|
301
|
+
let progId = await wslDefaultBrowser();
|
|
302
|
+
browser = _windowsBrowserProgIdMap.get(progId) ?? {};
|
|
303
|
+
} else browser = await default_browser_defaultBrowser();
|
|
304
|
+
if (browser.id in ids) {
|
|
305
|
+
let browserName = ids[browser.id.toLowerCase()];
|
|
306
|
+
if ('browserPrivate' === app) {
|
|
307
|
+
if ('safari' === browserName) throw Error('Safari doesn\'t support opening in private mode via command line');
|
|
308
|
+
appArguments.push({
|
|
309
|
+
chrome: '--incognito',
|
|
310
|
+
brave: '--incognito',
|
|
311
|
+
firefox: '--private-window',
|
|
312
|
+
edge: '--inPrivate'
|
|
313
|
+
}[browserName]);
|
|
314
|
+
}
|
|
315
|
+
return baseOpen({
|
|
316
|
+
...options,
|
|
317
|
+
app: {
|
|
318
|
+
name: open_apps[browserName],
|
|
319
|
+
arguments: appArguments
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
throw Error(`${browser.name} is not supported as a default browser`);
|
|
324
|
+
}
|
|
325
|
+
let cliArguments = [], childProcessOptions = {}, shouldUseWindowsInWsl = !1;
|
|
326
|
+
if (!is_wsl || isInsideContainer() || isInSsh || app || (shouldUseWindowsInWsl = await wsl_utils_canAccessPowerShell()), 'darwin' === platform) command = 'open', options.wait && cliArguments.push('--wait-apps'), options.background && cliArguments.push('--background'), options.newInstance && cliArguments.push('--new'), app && cliArguments.push('-a', app);
|
|
327
|
+
else if ('win32' === platform || shouldUseWindowsInWsl) {
|
|
328
|
+
command = await wsl_utils_powerShellPath(), cliArguments.push(...executePowerShell.argumentsPrefix), is_wsl || (childProcessOptions.windowsVerbatimArguments = !0), is_wsl && options.target && (options.target = await convertWslPathToWindows(options.target));
|
|
329
|
+
let encodedArguments = [
|
|
330
|
+
'$ProgressPreference = \'SilentlyContinue\';',
|
|
331
|
+
'Start'
|
|
332
|
+
];
|
|
333
|
+
options.wait && encodedArguments.push('-Wait'), app ? (encodedArguments.push(executePowerShell.escapeArgument(app)), options.target && appArguments.push(options.target)) : options.target && encodedArguments.push(executePowerShell.escapeArgument(options.target)), appArguments.length > 0 && encodedArguments.push('-ArgumentList', (appArguments = appArguments.map((argument)=>executePowerShell.escapeArgument(argument))).join(',')), options.target = executePowerShell.encodeCommand(encodedArguments.join(' ')), options.wait || (childProcessOptions.stdio = 'ignore');
|
|
334
|
+
} else {
|
|
335
|
+
if (app) command = app;
|
|
336
|
+
else {
|
|
337
|
+
let exeLocalXdgOpen = !1;
|
|
338
|
+
try {
|
|
339
|
+
await promises_.access(localXdgOpenPath, promises_.constants.X_OK), exeLocalXdgOpen = !0;
|
|
340
|
+
} catch {}
|
|
341
|
+
command = external_node_process_.versions.electron ?? ('android' === platform || !open_dirname || '/' === open_dirname || !exeLocalXdgOpen) ? 'xdg-open' : localXdgOpenPath;
|
|
342
|
+
}
|
|
343
|
+
appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = 'ignore', childProcessOptions.detached = !0);
|
|
344
|
+
}
|
|
345
|
+
'darwin' === platform && appArguments.length > 0 && cliArguments.push('--args', ...appArguments), options.target && cliArguments.push(options.target);
|
|
346
|
+
let subprocess = external_node_child_process_.spawn(command, cliArguments, childProcessOptions);
|
|
347
|
+
return options.wait ? new Promise((resolve, reject)=>{
|
|
348
|
+
subprocess.once('error', reject), subprocess.once('close', (exitCode)=>{
|
|
349
|
+
options.allowNonzeroExitCode || 0 === exitCode ? resolve(subprocess) : reject(Error(`Exited with code ${exitCode}`));
|
|
350
|
+
});
|
|
351
|
+
}) : isFallbackAttempt ? new Promise((resolve, reject)=>{
|
|
352
|
+
subprocess.once('error', reject), subprocess.once('spawn', ()=>{
|
|
353
|
+
subprocess.once('close', (exitCode)=>{
|
|
354
|
+
(subprocess.off('error', reject), 0 !== exitCode) ? reject(Error(`Exited with code ${exitCode}`)) : (subprocess.unref(), resolve(subprocess));
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
}) : (subprocess.unref(), new Promise((resolve, reject)=>{
|
|
358
|
+
subprocess.once('error', reject), subprocess.once('spawn', ()=>{
|
|
359
|
+
subprocess.off('error', reject), resolve(subprocess);
|
|
360
|
+
});
|
|
361
|
+
}));
|
|
362
|
+
};
|
|
363
|
+
function detectArchBinary(binary) {
|
|
364
|
+
if ('string' == typeof binary || Array.isArray(binary)) return binary;
|
|
365
|
+
let { [arch]: archBinary } = binary;
|
|
366
|
+
if (!archBinary) throw Error(`${arch} is not supported`);
|
|
367
|
+
return archBinary;
|
|
368
|
+
}
|
|
369
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
|
|
370
|
+
if (wsl && is_wsl) return detectArchBinary(wsl);
|
|
371
|
+
if (!platformBinary) throw Error(`${platform} is not supported`);
|
|
372
|
+
return detectArchBinary(platformBinary);
|
|
373
|
+
}
|
|
374
|
+
let open_apps = {
|
|
375
|
+
browser: 'browser',
|
|
376
|
+
browserPrivate: 'browserPrivate'
|
|
377
|
+
};
|
|
378
|
+
defineLazyProperty(open_apps, 'chrome', ()=>detectPlatformBinary({
|
|
379
|
+
darwin: 'google chrome',
|
|
380
|
+
win32: 'chrome',
|
|
381
|
+
linux: [
|
|
382
|
+
'google-chrome',
|
|
383
|
+
'google-chrome-stable',
|
|
384
|
+
'chromium',
|
|
385
|
+
'chromium-browser'
|
|
386
|
+
]
|
|
387
|
+
}, {
|
|
388
|
+
wsl: {
|
|
389
|
+
ia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',
|
|
390
|
+
x64: [
|
|
391
|
+
'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe',
|
|
392
|
+
'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
})), defineLazyProperty(open_apps, 'brave', ()=>detectPlatformBinary({
|
|
396
|
+
darwin: 'brave browser',
|
|
397
|
+
win32: 'brave',
|
|
398
|
+
linux: [
|
|
399
|
+
'brave-browser',
|
|
400
|
+
'brave'
|
|
401
|
+
]
|
|
402
|
+
}, {
|
|
403
|
+
wsl: {
|
|
404
|
+
ia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',
|
|
405
|
+
x64: [
|
|
406
|
+
'/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe',
|
|
407
|
+
'/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
})), defineLazyProperty(open_apps, 'firefox', ()=>detectPlatformBinary({
|
|
411
|
+
darwin: 'firefox',
|
|
412
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
413
|
+
linux: 'firefox'
|
|
414
|
+
}, {
|
|
415
|
+
wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'
|
|
416
|
+
})), defineLazyProperty(open_apps, 'edge', ()=>detectPlatformBinary({
|
|
417
|
+
darwin: 'microsoft edge',
|
|
418
|
+
win32: 'msedge',
|
|
419
|
+
linux: [
|
|
420
|
+
'microsoft-edge',
|
|
421
|
+
'microsoft-edge-dev'
|
|
422
|
+
]
|
|
423
|
+
}, {
|
|
424
|
+
wsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
|
|
425
|
+
})), defineLazyProperty(open_apps, 'safari', ()=>detectPlatformBinary({
|
|
426
|
+
darwin: 'Safari'
|
|
427
|
+
}));
|
|
428
|
+
let node_modules_open = (target, options)=>{
|
|
429
|
+
if ('string' != typeof target) throw TypeError('Expected a `target`');
|
|
430
|
+
return baseOpen({
|
|
431
|
+
...options,
|
|
432
|
+
target
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*! For license information please see 2~range-parser.cjs.LICENSE.txt */
|
|
2
|
+
"use strict";
|
|
3
|
+
const __rslib_import_meta_url__ = "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
|
+
exports.ids = [
|
|
5
|
+
"603"
|
|
6
|
+
], exports.modules = {
|
|
7
|
+
"../../node_modules/.pnpm/range-parser@1.2.1/node_modules/range-parser/index.js" (module) {
|
|
8
|
+
function combineRanges(ranges) {
|
|
9
|
+
for(var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart), j = 0, i = 1; i < ordered.length; i++){
|
|
10
|
+
var range = ordered[i], current = ordered[j];
|
|
11
|
+
range.start > current.end + 1 ? ordered[++j] = range : range.end > current.end && (current.end = range.end, current.index = Math.min(current.index, range.index));
|
|
12
|
+
}
|
|
13
|
+
ordered.length = j + 1;
|
|
14
|
+
var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex);
|
|
15
|
+
return combined.type = ranges.type, combined;
|
|
16
|
+
}
|
|
17
|
+
function mapWithIndex(range, index) {
|
|
18
|
+
return {
|
|
19
|
+
start: range.start,
|
|
20
|
+
end: range.end,
|
|
21
|
+
index: index
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function mapWithoutIndex(range) {
|
|
25
|
+
return {
|
|
26
|
+
start: range.start,
|
|
27
|
+
end: range.end
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function sortByRangeIndex(a, b) {
|
|
31
|
+
return a.index - b.index;
|
|
32
|
+
}
|
|
33
|
+
function sortByRangeStart(a, b) {
|
|
34
|
+
return a.start - b.start;
|
|
35
|
+
}
|
|
36
|
+
module.exports = function rangeParser(size, str, options) {
|
|
37
|
+
if ('string' != typeof str) throw TypeError('argument str must be a string');
|
|
38
|
+
var index = str.indexOf('=');
|
|
39
|
+
if (-1 === index) return -2;
|
|
40
|
+
var arr = str.slice(index + 1).split(','), ranges = [];
|
|
41
|
+
ranges.type = str.slice(0, index);
|
|
42
|
+
for(var i = 0; i < arr.length; i++){
|
|
43
|
+
var range = arr[i].split('-'), start = parseInt(range[0], 10), end = parseInt(range[1], 10);
|
|
44
|
+
isNaN(start) ? (start = size - end, end = size - 1) : isNaN(end) && (end = size - 1), end > size - 1 && (end = size - 1), isNaN(start) || isNaN(end) || start > end || start < 0 || ranges.push({
|
|
45
|
+
start: start,
|
|
46
|
+
end: end
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return ranges.length < 1 ? -1 : options && options.combine ? combineRanges(ranges) : ranges;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const LOG_LEVEL = {
|
|
2
|
+
silent: -1,
|
|
3
|
+
error: 0,
|
|
4
|
+
warn: 1,
|
|
5
|
+
info: 2
|
|
6
|
+
};
|
|
7
|
+
const logger = {
|
|
8
|
+
level: 'info',
|
|
9
|
+
info (...messages) {
|
|
10
|
+
if (LOG_LEVEL.info > LOG_LEVEL[logger.level]) return;
|
|
11
|
+
console.info(...messages);
|
|
12
|
+
},
|
|
13
|
+
warn (...messages) {
|
|
14
|
+
if (LOG_LEVEL.warn > LOG_LEVEL[logger.level]) return;
|
|
15
|
+
console.warn(...messages);
|
|
16
|
+
},
|
|
17
|
+
error (...messages) {
|
|
18
|
+
if (LOG_LEVEL.error > LOG_LEVEL[logger.level]) return;
|
|
19
|
+
console.error(...messages);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export { logger };
|