@vxrn/vite-plugin-metro 1.25.3 → 1.25.5
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/package.json +6 -4
- package/src/transformer/babel-core.ts +1 -0
- package/src/transformer/transformSync.test.ts +50 -0
- package/src/transformer/transformSync.ts +29 -4
- package/types/transformer/babel-core.d.ts +1 -1
- package/types/transformer/transformSync.test.d.ts +2 -0
- package/dist/cjs/babel-plugins/import-meta-env-plugin.cjs +0 -130
- package/dist/cjs/babel-plugins/import-meta-env-plugin.native.js +0 -138
- package/dist/cjs/babel-plugins/import-meta-env-plugin.native.js.map +0 -1
- package/dist/cjs/env/platformEnv.cjs +0 -76
- package/dist/cjs/env/platformEnv.native.js +0 -98
- package/dist/cjs/env/platformEnv.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -41
- package/dist/cjs/index.native.js +0 -44
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/cjs/metro-config/getMetroBabelConfigFromViteConfig.cjs +0 -62
- package/dist/cjs/metro-config/getMetroBabelConfigFromViteConfig.native.js +0 -109
- package/dist/cjs/metro-config/getMetroBabelConfigFromViteConfig.native.js.map +0 -1
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.cjs +0 -270
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.native.js +0 -284
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.native.js.map +0 -1
- package/dist/cjs/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.cjs +0 -55
- package/dist/cjs/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.native.js +0 -59
- package/dist/cjs/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.native.js.map +0 -1
- package/dist/cjs/metro-config/types.cjs +0 -18
- package/dist/cjs/metro-config/types.native.js +0 -21
- package/dist/cjs/metro-config/types.native.js.map +0 -1
- package/dist/cjs/plugins/expoManifestRequestHandlerPlugin.cjs +0 -71
- package/dist/cjs/plugins/expoManifestRequestHandlerPlugin.native.js +0 -82
- package/dist/cjs/plugins/expoManifestRequestHandlerPlugin.native.js.map +0 -1
- package/dist/cjs/plugins/metroPlugin.cjs +0 -272
- package/dist/cjs/plugins/metroPlugin.native.js +0 -281
- package/dist/cjs/plugins/metroPlugin.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/assetCatalogIOS.cjs +0 -90
- package/dist/cjs/rn-commands/bundle/assetCatalogIOS.native.js +0 -135
- package/dist/cjs/rn-commands/bundle/assetCatalogIOS.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/assetPathUtils.cjs +0 -74
- package/dist/cjs/rn-commands/bundle/assetPathUtils.native.js +0 -77
- package/dist/cjs/rn-commands/bundle/assetPathUtils.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/buildBundle.cjs +0 -62
- package/dist/cjs/rn-commands/bundle/buildBundle.native.js +0 -67
- package/dist/cjs/rn-commands/bundle/buildBundle.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.cjs +0 -87
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.native.js +0 -94
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/filterPlatformAssetScales.cjs +0 -51
- package/dist/cjs/rn-commands/bundle/filterPlatformAssetScales.native.js +0 -75
- package/dist/cjs/rn-commands/bundle/filterPlatformAssetScales.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/getAssetDestPathAndroid.cjs +0 -46
- package/dist/cjs/rn-commands/bundle/getAssetDestPathAndroid.native.js +0 -49
- package/dist/cjs/rn-commands/bundle/getAssetDestPathAndroid.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/getAssetDestPathIOS.cjs +0 -49
- package/dist/cjs/rn-commands/bundle/getAssetDestPathIOS.native.js +0 -52
- package/dist/cjs/rn-commands/bundle/getAssetDestPathIOS.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/getBuildBundleFn.cjs +0 -45
- package/dist/cjs/rn-commands/bundle/getBuildBundleFn.native.js +0 -48
- package/dist/cjs/rn-commands/bundle/getBuildBundleFn.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/index.cjs +0 -30
- package/dist/cjs/rn-commands/bundle/index.native.js +0 -33
- package/dist/cjs/rn-commands/bundle/index.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/saveAssets.cjs +0 -121
- package/dist/cjs/rn-commands/bundle/saveAssets.native.js +0 -143
- package/dist/cjs/rn-commands/bundle/saveAssets.native.js.map +0 -1
- package/dist/cjs/rn-commands/bundle/types.cjs +0 -18
- package/dist/cjs/rn-commands/bundle/types.native.js +0 -21
- package/dist/cjs/rn-commands/bundle/types.native.js.map +0 -1
- package/dist/cjs/rn-commands/index.cjs +0 -39
- package/dist/cjs/rn-commands/index.native.js +0 -42
- package/dist/cjs/rn-commands/index.native.js.map +0 -1
- package/dist/cjs/transformer/babel-core.cjs +0 -29
- package/dist/cjs/transformer/babel-core.native.js +0 -32
- package/dist/cjs/transformer/babel-core.native.js.map +0 -1
- package/dist/cjs/transformer/babel-transformer.cjs +0 -176
- package/dist/cjs/transformer/babel-transformer.native.js +0 -186
- package/dist/cjs/transformer/babel-transformer.native.js.map +0 -1
- package/dist/cjs/transformer/loadBabelConfig.cjs +0 -64
- package/dist/cjs/transformer/loadBabelConfig.native.js +0 -70
- package/dist/cjs/transformer/loadBabelConfig.native.js.map +0 -1
- package/dist/cjs/transformer/transformSync.cjs +0 -72
- package/dist/cjs/transformer/transformSync.native.js +0 -76
- package/dist/cjs/transformer/transformSync.native.js.map +0 -1
- package/dist/cjs/transformer/types.cjs +0 -18
- package/dist/cjs/transformer/types.native.js +0 -21
- package/dist/cjs/transformer/types.native.js.map +0 -1
- package/dist/cjs/utils/exit.cjs +0 -174
- package/dist/cjs/utils/exit.native.js +0 -281
- package/dist/cjs/utils/exit.native.js.map +0 -1
- package/dist/cjs/utils/getTerminalReporter.cjs +0 -64
- package/dist/cjs/utils/getTerminalReporter.native.js +0 -70
- package/dist/cjs/utils/getTerminalReporter.native.js.map +0 -1
- package/dist/cjs/utils/metroCacheManager.cjs +0 -125
- package/dist/cjs/utils/metroCacheManager.native.js +0 -148
- package/dist/cjs/utils/metroCacheManager.native.js.map +0 -1
- package/dist/cjs/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.cjs +0 -39
- package/dist/cjs/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.native.js +0 -42
- package/dist/cjs/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.native.js.map +0 -1
- package/dist/cjs/utils/projectImport.cjs +0 -72
- package/dist/cjs/utils/projectImport.native.js +0 -83
- package/dist/cjs/utils/projectImport.native.js.map +0 -1
- package/dist/esm/babel-plugins/import-meta-env-plugin.mjs +0 -93
- package/dist/esm/babel-plugins/import-meta-env-plugin.mjs.map +0 -1
- package/dist/esm/babel-plugins/import-meta-env-plugin.native.js +0 -98
- package/dist/esm/babel-plugins/import-meta-env-plugin.native.js.map +0 -1
- package/dist/esm/env/platformEnv.mjs +0 -49
- package/dist/esm/env/platformEnv.mjs.map +0 -1
- package/dist/esm/env/platformEnv.native.js +0 -68
- package/dist/esm/env/platformEnv.native.js.map +0 -1
- package/dist/esm/index.js +0 -8
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs +0 -8
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -8
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/metro-config/getMetroBabelConfigFromViteConfig.mjs +0 -37
- package/dist/esm/metro-config/getMetroBabelConfigFromViteConfig.mjs.map +0 -1
- package/dist/esm/metro-config/getMetroBabelConfigFromViteConfig.native.js +0 -81
- package/dist/esm/metro-config/getMetroBabelConfigFromViteConfig.native.js.map +0 -1
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.mjs +0 -233
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.mjs.map +0 -1
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.native.js +0 -244
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.native.js.map +0 -1
- package/dist/esm/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.mjs +0 -30
- package/dist/esm/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.mjs.map +0 -1
- package/dist/esm/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.native.js +0 -31
- package/dist/esm/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.native.js.map +0 -1
- package/dist/esm/metro-config/types.mjs +0 -2
- package/dist/esm/metro-config/types.mjs.map +0 -1
- package/dist/esm/metro-config/types.native.js +0 -2
- package/dist/esm/metro-config/types.native.js.map +0 -1
- package/dist/esm/plugins/expoManifestRequestHandlerPlugin.mjs +0 -46
- package/dist/esm/plugins/expoManifestRequestHandlerPlugin.mjs.map +0 -1
- package/dist/esm/plugins/expoManifestRequestHandlerPlugin.native.js +0 -54
- package/dist/esm/plugins/expoManifestRequestHandlerPlugin.native.js.map +0 -1
- package/dist/esm/plugins/metroPlugin.mjs +0 -236
- package/dist/esm/plugins/metroPlugin.mjs.map +0 -1
- package/dist/esm/plugins/metroPlugin.native.js +0 -242
- package/dist/esm/plugins/metroPlugin.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/assetCatalogIOS.mjs +0 -51
- package/dist/esm/rn-commands/bundle/assetCatalogIOS.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/assetCatalogIOS.native.js +0 -93
- package/dist/esm/rn-commands/bundle/assetCatalogIOS.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/assetPathUtils.mjs +0 -49
- package/dist/esm/rn-commands/bundle/assetPathUtils.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/assetPathUtils.native.js +0 -49
- package/dist/esm/rn-commands/bundle/assetPathUtils.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/buildBundle.mjs +0 -37
- package/dist/esm/rn-commands/bundle/buildBundle.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/buildBundle.native.js +0 -39
- package/dist/esm/rn-commands/bundle/buildBundle.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.mjs +0 -51
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.native.js +0 -55
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/filterPlatformAssetScales.mjs +0 -26
- package/dist/esm/rn-commands/bundle/filterPlatformAssetScales.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/filterPlatformAssetScales.native.js +0 -47
- package/dist/esm/rn-commands/bundle/filterPlatformAssetScales.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/getAssetDestPathAndroid.mjs +0 -10
- package/dist/esm/rn-commands/bundle/getAssetDestPathAndroid.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/getAssetDestPathAndroid.native.js +0 -10
- package/dist/esm/rn-commands/bundle/getAssetDestPathAndroid.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/getAssetDestPathIOS.mjs +0 -13
- package/dist/esm/rn-commands/bundle/getAssetDestPathIOS.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/getAssetDestPathIOS.native.js +0 -13
- package/dist/esm/rn-commands/bundle/getAssetDestPathIOS.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/getBuildBundleFn.mjs +0 -20
- package/dist/esm/rn-commands/bundle/getBuildBundleFn.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/getBuildBundleFn.native.js +0 -20
- package/dist/esm/rn-commands/bundle/getBuildBundleFn.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/index.mjs +0 -4
- package/dist/esm/rn-commands/bundle/index.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/index.native.js +0 -4
- package/dist/esm/rn-commands/bundle/index.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/saveAssets.mjs +0 -85
- package/dist/esm/rn-commands/bundle/saveAssets.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/saveAssets.native.js +0 -104
- package/dist/esm/rn-commands/bundle/saveAssets.native.js.map +0 -1
- package/dist/esm/rn-commands/bundle/types.mjs +0 -2
- package/dist/esm/rn-commands/bundle/types.mjs.map +0 -1
- package/dist/esm/rn-commands/bundle/types.native.js +0 -2
- package/dist/esm/rn-commands/bundle/types.native.js.map +0 -1
- package/dist/esm/rn-commands/index.mjs +0 -3
- package/dist/esm/rn-commands/index.mjs.map +0 -1
- package/dist/esm/rn-commands/index.native.js +0 -3
- package/dist/esm/rn-commands/index.native.js.map +0 -1
- package/dist/esm/transformer/babel-core.mjs +0 -3
- package/dist/esm/transformer/babel-core.mjs.map +0 -1
- package/dist/esm/transformer/babel-core.native.js +0 -3
- package/dist/esm/transformer/babel-core.native.js.map +0 -1
- package/dist/esm/transformer/babel-transformer.mjs +0 -148
- package/dist/esm/transformer/babel-transformer.mjs.map +0 -1
- package/dist/esm/transformer/babel-transformer.native.js +0 -160
- package/dist/esm/transformer/babel-transformer.native.js.map +0 -1
- package/dist/esm/transformer/loadBabelConfig.mjs +0 -28
- package/dist/esm/transformer/loadBabelConfig.mjs.map +0 -1
- package/dist/esm/transformer/loadBabelConfig.native.js +0 -31
- package/dist/esm/transformer/loadBabelConfig.native.js.map +0 -1
- package/dist/esm/transformer/transformSync.mjs +0 -36
- package/dist/esm/transformer/transformSync.mjs.map +0 -1
- package/dist/esm/transformer/transformSync.native.js +0 -37
- package/dist/esm/transformer/transformSync.native.js.map +0 -1
- package/dist/esm/transformer/types.mjs +0 -2
- package/dist/esm/transformer/types.mjs.map +0 -1
- package/dist/esm/transformer/types.native.js +0 -2
- package/dist/esm/transformer/types.native.js.map +0 -1
- package/dist/esm/utils/exit.mjs +0 -135
- package/dist/esm/utils/exit.mjs.map +0 -1
- package/dist/esm/utils/exit.native.js +0 -239
- package/dist/esm/utils/exit.native.js.map +0 -1
- package/dist/esm/utils/getTerminalReporter.mjs +0 -28
- package/dist/esm/utils/getTerminalReporter.mjs.map +0 -1
- package/dist/esm/utils/getTerminalReporter.native.js +0 -31
- package/dist/esm/utils/getTerminalReporter.native.js.map +0 -1
- package/dist/esm/utils/metroCacheManager.mjs +0 -100
- package/dist/esm/utils/metroCacheManager.mjs.map +0 -1
- package/dist/esm/utils/metroCacheManager.native.js +0 -120
- package/dist/esm/utils/metroCacheManager.native.js.map +0 -1
- package/dist/esm/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.mjs +0 -14
- package/dist/esm/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.mjs.map +0 -1
- package/dist/esm/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.native.js +0 -14
- package/dist/esm/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.native.js.map +0 -1
- package/dist/esm/utils/projectImport.mjs +0 -34
- package/dist/esm/utils/projectImport.mjs.map +0 -1
- package/dist/esm/utils/projectImport.native.js +0 -42
- package/dist/esm/utils/projectImport.native.js.map +0 -1
- package/types/babel-plugins/import-meta-env-plugin.d.ts.map +0 -1
- package/types/env/platformEnv.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/metro-config/getMetroBabelConfigFromViteConfig.d.ts.map +0 -1
- package/types/metro-config/getMetroConfigFromViteConfig.d.ts.map +0 -1
- package/types/metro-config/patchMetroServerWithViteConfigAndMetroPluginOptions.d.ts.map +0 -1
- package/types/metro-config/types.d.ts.map +0 -1
- package/types/plugins/expoManifestRequestHandlerPlugin.d.ts.map +0 -1
- package/types/plugins/metroPlugin.d.ts.map +0 -1
- package/types/rn-commands/bundle/assetCatalogIOS.d.ts.map +0 -1
- package/types/rn-commands/bundle/assetPathUtils.d.ts.map +0 -1
- package/types/rn-commands/bundle/buildBundle.d.ts.map +0 -1
- package/types/rn-commands/bundle/buildBundleWithConfig.d.ts.map +0 -1
- package/types/rn-commands/bundle/filterPlatformAssetScales.d.ts.map +0 -1
- package/types/rn-commands/bundle/getAssetDestPathAndroid.d.ts.map +0 -1
- package/types/rn-commands/bundle/getAssetDestPathIOS.d.ts.map +0 -1
- package/types/rn-commands/bundle/getBuildBundleFn.d.ts.map +0 -1
- package/types/rn-commands/bundle/index.d.ts.map +0 -1
- package/types/rn-commands/bundle/saveAssets.d.ts.map +0 -1
- package/types/rn-commands/bundle/types.d.ts.map +0 -1
- package/types/rn-commands/index.d.ts.map +0 -1
- package/types/transformer/babel-core.d.ts.map +0 -1
- package/types/transformer/babel-transformer.d.ts.map +0 -1
- package/types/transformer/loadBabelConfig.d.ts.map +0 -1
- package/types/transformer/transformSync.d.ts.map +0 -1
- package/types/transformer/types.d.ts.map +0 -1
- package/types/utils/exit.d.ts.map +0 -1
- package/types/utils/getTerminalReporter.d.ts.map +0 -1
- package/types/utils/metroCacheManager.d.ts.map +0 -1
- package/types/utils/patchExpoGoManifestHandlerMiddlewareWithCustomMainModuleName.d.ts.map +0 -1
- package/types/utils/projectImport.d.ts.map +0 -1
package/dist/cjs/utils/exit.cjs
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
30
|
-
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
34
|
-
var exit_exports = {};
|
|
35
|
-
__export(exit_exports, {
|
|
36
|
-
ensureProcessExitsAfterDelay: () => ensureProcessExitsAfterDelay,
|
|
37
|
-
guardAsync: () => guardAsync,
|
|
38
|
-
installExitHooks: () => installExitHooks,
|
|
39
|
-
warn: () => warn
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(exit_exports);
|
|
42
|
-
var import_node_child_process = require("node:child_process");
|
|
43
|
-
var import_node_process = __toESM(require("node:process"), 1);
|
|
44
|
-
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
45
|
-
const debug = (..._) => {};
|
|
46
|
-
const PRE_EXIT_SIGNALS = ["SIGHUP", "SIGINT", "SIGTERM", "SIGBREAK"];
|
|
47
|
-
const queue = [];
|
|
48
|
-
let unsubscribe = null;
|
|
49
|
-
function installExitHooks(asyncExitHook) {
|
|
50
|
-
if (!queue.length) {
|
|
51
|
-
unsubscribe = attachMasterListener();
|
|
52
|
-
}
|
|
53
|
-
queue.push(asyncExitHook);
|
|
54
|
-
return () => {
|
|
55
|
-
const index = queue.indexOf(asyncExitHook);
|
|
56
|
-
if (index >= 0) {
|
|
57
|
-
queue.splice(index, 1);
|
|
58
|
-
}
|
|
59
|
-
if (!queue.length) {
|
|
60
|
-
unsubscribe?.();
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function createExitHook(signal) {
|
|
65
|
-
return guardAsync(async () => {
|
|
66
|
-
debug(`pre-exit (signal: ${signal}, queue length: ${queue.length})`);
|
|
67
|
-
for (const [index, hookAsync] of Object.entries(queue)) {
|
|
68
|
-
try {
|
|
69
|
-
await hookAsync(signal);
|
|
70
|
-
} catch (error) {
|
|
71
|
-
debug(`Error in exit hook: %O (queue: ${index})`, error);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
debug(`post-exit (code: ${import_node_process.default.exitCode ?? 0})`);
|
|
75
|
-
import_node_process.default.exit();
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function attachMasterListener() {
|
|
79
|
-
const hooks = [];
|
|
80
|
-
for (const signal of PRE_EXIT_SIGNALS) {
|
|
81
|
-
const hook = createExitHook(signal);
|
|
82
|
-
hooks.push([signal, hook]);
|
|
83
|
-
import_node_process.default.on(signal, hook);
|
|
84
|
-
}
|
|
85
|
-
return () => {
|
|
86
|
-
for (const [signal, hook] of hooks) {
|
|
87
|
-
import_node_process.default.removeListener(signal, hook);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function ensureProcessExitsAfterDelay(waitUntilExitMs = 1e4, startedAtMs = Date.now()) {
|
|
92
|
-
const expectedResources = [import_node_process.default.stdout.isTTY ? "TTYWrap" : "PipeWrap", import_node_process.default.stderr.isTTY ? "TTYWrap" : "PipeWrap", import_node_process.default.stdin.isTTY ? "TTYWrap" : "PipeWrap"];
|
|
93
|
-
const activeResources = import_node_process.default.getActiveResourcesInfo();
|
|
94
|
-
const unexpectedActiveResources = activeResources.filter(activeResource => {
|
|
95
|
-
const index = expectedResources.indexOf(activeResource);
|
|
96
|
-
if (index >= 0) {
|
|
97
|
-
expectedResources.splice(index, 1);
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
101
|
-
});
|
|
102
|
-
const canExitProcess = !unexpectedActiveResources.length;
|
|
103
|
-
if (canExitProcess) {
|
|
104
|
-
return debug("no active resources detected, process can safely exit");
|
|
105
|
-
}
|
|
106
|
-
debug(`process is trying to exit, but is stuck on unexpected active resources:`, unexpectedActiveResources);
|
|
107
|
-
const elapsedTime = Date.now() - startedAtMs;
|
|
108
|
-
const killedChildren = killActiveChildProcesses(elapsedTime < 200 ? "SIGTERM" : "SIGKILL");
|
|
109
|
-
if (killedChildren > 0) {
|
|
110
|
-
const recheck = setTimeout(() => {
|
|
111
|
-
clearTimeout(recheck);
|
|
112
|
-
ensureProcessExitsAfterDelay(waitUntilExitMs, startedAtMs);
|
|
113
|
-
}, 50);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (elapsedTime > waitUntilExitMs) {
|
|
117
|
-
debug("active handles detected past the exit delay, forcefully exiting:", activeResources);
|
|
118
|
-
tryWarnActiveProcesses();
|
|
119
|
-
return import_node_process.default.exit(0);
|
|
120
|
-
}
|
|
121
|
-
const timeoutId = setTimeout(() => {
|
|
122
|
-
clearTimeout(timeoutId);
|
|
123
|
-
ensureProcessExitsAfterDelay(waitUntilExitMs, startedAtMs);
|
|
124
|
-
}, 100);
|
|
125
|
-
}
|
|
126
|
-
function killActiveChildProcesses(signal) {
|
|
127
|
-
try {
|
|
128
|
-
const children = import_node_process.default._getActiveHandles().filter(handle => handle instanceof import_node_child_process.ChildProcess);
|
|
129
|
-
for (const child of children) {
|
|
130
|
-
try {
|
|
131
|
-
child.kill(signal);
|
|
132
|
-
} catch (err) {
|
|
133
|
-
debug("failed to kill child process:", err);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return children.length;
|
|
137
|
-
} catch (err) {
|
|
138
|
-
debug("failed to enumerate active child processes:", err);
|
|
139
|
-
return 0;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function tryWarnActiveProcesses() {
|
|
143
|
-
let activeProcesses = [];
|
|
144
|
-
try {
|
|
145
|
-
const children = import_node_process.default._getActiveHandles().filter(handle => handle instanceof import_node_child_process.ChildProcess);
|
|
146
|
-
if (children.length) {
|
|
147
|
-
activeProcesses = children.map(child => child.spawnargs.join(" "));
|
|
148
|
-
}
|
|
149
|
-
} catch (error) {
|
|
150
|
-
debug("failed to get active process information:", error);
|
|
151
|
-
}
|
|
152
|
-
if (!activeProcesses.length) {
|
|
153
|
-
warn("Something prevented Expo from exiting, forcefully exiting now.");
|
|
154
|
-
} else {
|
|
155
|
-
const singularOrPlural = activeProcesses.length === 1 ? "1 process" : `${activeProcesses.length} processes`;
|
|
156
|
-
warn(`Detected ${singularOrPlural} preventing process from exiting, forcefully exiting now.`);
|
|
157
|
-
warn(" - " + activeProcesses.join("\n - "));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
function guardAsync(fn) {
|
|
161
|
-
let invoked = false;
|
|
162
|
-
let returnValue;
|
|
163
|
-
const guard = async (...args) => {
|
|
164
|
-
if (!invoked) {
|
|
165
|
-
invoked = true;
|
|
166
|
-
returnValue = await fn(...args);
|
|
167
|
-
}
|
|
168
|
-
return returnValue;
|
|
169
|
-
};
|
|
170
|
-
return guard;
|
|
171
|
-
}
|
|
172
|
-
function warn(...message) {
|
|
173
|
-
console.warn(...message.map(value => import_picocolors.default.yellow(value)));
|
|
174
|
-
}
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
-
get: () => from[key],
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
36
|
-
var exit_exports = {};
|
|
37
|
-
__export(exit_exports, {
|
|
38
|
-
ensureProcessExitsAfterDelay: () => ensureProcessExitsAfterDelay,
|
|
39
|
-
guardAsync: () => guardAsync,
|
|
40
|
-
installExitHooks: () => installExitHooks,
|
|
41
|
-
warn: () => warn
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(exit_exports);
|
|
44
|
-
var import_child_process = require("child_process");
|
|
45
|
-
var import_process = __toESM(require("process"), 1);
|
|
46
|
-
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
47
|
-
function _instanceof(left, right) {
|
|
48
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
49
|
-
return !!right[Symbol.hasInstance](left);
|
|
50
|
-
} else {
|
|
51
|
-
return left instanceof right;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
var debug = function () {
|
|
55
|
-
for (var _len = arguments.length, _ = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
|
-
_[_key] = arguments[_key];
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
var PRE_EXIT_SIGNALS = ["SIGHUP", "SIGINT", "SIGTERM", "SIGBREAK"];
|
|
60
|
-
var queue = [];
|
|
61
|
-
var unsubscribe = null;
|
|
62
|
-
function installExitHooks(asyncExitHook) {
|
|
63
|
-
if (!queue.length) {
|
|
64
|
-
unsubscribe = attachMasterListener();
|
|
65
|
-
}
|
|
66
|
-
queue.push(asyncExitHook);
|
|
67
|
-
return function () {
|
|
68
|
-
var index = queue.indexOf(asyncExitHook);
|
|
69
|
-
if (index >= 0) {
|
|
70
|
-
queue.splice(index, 1);
|
|
71
|
-
}
|
|
72
|
-
if (!queue.length) {
|
|
73
|
-
unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function createExitHook(signal) {
|
|
78
|
-
return guardAsync(async function () {
|
|
79
|
-
var _process_exitCode;
|
|
80
|
-
debug(`pre-exit (signal: ${signal}, queue length: ${queue.length})`);
|
|
81
|
-
var _iteratorNormalCompletion = true,
|
|
82
|
-
_didIteratorError = false,
|
|
83
|
-
_iteratorError = void 0;
|
|
84
|
-
try {
|
|
85
|
-
for (var _iterator = Object.entries(queue)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
86
|
-
var [index, hookAsync] = _step.value;
|
|
87
|
-
try {
|
|
88
|
-
await hookAsync(signal);
|
|
89
|
-
} catch (error) {
|
|
90
|
-
debug(`Error in exit hook: %O (queue: ${index})`, error);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
} catch (err) {
|
|
94
|
-
_didIteratorError = true;
|
|
95
|
-
_iteratorError = err;
|
|
96
|
-
} finally {
|
|
97
|
-
try {
|
|
98
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
99
|
-
_iterator.return();
|
|
100
|
-
}
|
|
101
|
-
} finally {
|
|
102
|
-
if (_didIteratorError) {
|
|
103
|
-
throw _iteratorError;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
debug(`post-exit (code: ${(_process_exitCode = import_process.default.exitCode) !== null && _process_exitCode !== void 0 ? _process_exitCode : 0})`);
|
|
108
|
-
import_process.default.exit();
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function attachMasterListener() {
|
|
112
|
-
var hooks = [];
|
|
113
|
-
var _iteratorNormalCompletion = true,
|
|
114
|
-
_didIteratorError = false,
|
|
115
|
-
_iteratorError = void 0;
|
|
116
|
-
try {
|
|
117
|
-
for (var _iterator = PRE_EXIT_SIGNALS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
118
|
-
var signal = _step.value;
|
|
119
|
-
var hook = createExitHook(signal);
|
|
120
|
-
hooks.push([signal, hook]);
|
|
121
|
-
import_process.default.on(signal, hook);
|
|
122
|
-
}
|
|
123
|
-
} catch (err) {
|
|
124
|
-
_didIteratorError = true;
|
|
125
|
-
_iteratorError = err;
|
|
126
|
-
} finally {
|
|
127
|
-
try {
|
|
128
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
129
|
-
_iterator.return();
|
|
130
|
-
}
|
|
131
|
-
} finally {
|
|
132
|
-
if (_didIteratorError) {
|
|
133
|
-
throw _iteratorError;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return function () {
|
|
138
|
-
var _iteratorNormalCompletion2 = true,
|
|
139
|
-
_didIteratorError2 = false,
|
|
140
|
-
_iteratorError2 = void 0;
|
|
141
|
-
try {
|
|
142
|
-
for (var _iterator2 = hooks[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
143
|
-
var [signal2, hook2] = _step2.value;
|
|
144
|
-
import_process.default.removeListener(signal2, hook2);
|
|
145
|
-
}
|
|
146
|
-
} catch (err) {
|
|
147
|
-
_didIteratorError2 = true;
|
|
148
|
-
_iteratorError2 = err;
|
|
149
|
-
} finally {
|
|
150
|
-
try {
|
|
151
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
152
|
-
_iterator2.return();
|
|
153
|
-
}
|
|
154
|
-
} finally {
|
|
155
|
-
if (_didIteratorError2) {
|
|
156
|
-
throw _iteratorError2;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
function ensureProcessExitsAfterDelay() {
|
|
163
|
-
var waitUntilExitMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1e4,
|
|
164
|
-
startedAtMs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Date.now();
|
|
165
|
-
var expectedResources = [import_process.default.stdout.isTTY ? "TTYWrap" : "PipeWrap", import_process.default.stderr.isTTY ? "TTYWrap" : "PipeWrap", import_process.default.stdin.isTTY ? "TTYWrap" : "PipeWrap"];
|
|
166
|
-
var activeResources = import_process.default.getActiveResourcesInfo();
|
|
167
|
-
var unexpectedActiveResources = activeResources.filter(function (activeResource) {
|
|
168
|
-
var index = expectedResources.indexOf(activeResource);
|
|
169
|
-
if (index >= 0) {
|
|
170
|
-
expectedResources.splice(index, 1);
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
return true;
|
|
174
|
-
});
|
|
175
|
-
var canExitProcess = !unexpectedActiveResources.length;
|
|
176
|
-
if (canExitProcess) {
|
|
177
|
-
return debug("no active resources detected, process can safely exit");
|
|
178
|
-
}
|
|
179
|
-
debug(`process is trying to exit, but is stuck on unexpected active resources:`, unexpectedActiveResources);
|
|
180
|
-
var elapsedTime = Date.now() - startedAtMs;
|
|
181
|
-
var killedChildren = killActiveChildProcesses(elapsedTime < 200 ? "SIGTERM" : "SIGKILL");
|
|
182
|
-
if (killedChildren > 0) {
|
|
183
|
-
var recheck = setTimeout(function () {
|
|
184
|
-
clearTimeout(recheck);
|
|
185
|
-
ensureProcessExitsAfterDelay(waitUntilExitMs, startedAtMs);
|
|
186
|
-
}, 50);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
if (elapsedTime > waitUntilExitMs) {
|
|
190
|
-
debug("active handles detected past the exit delay, forcefully exiting:", activeResources);
|
|
191
|
-
tryWarnActiveProcesses();
|
|
192
|
-
return import_process.default.exit(0);
|
|
193
|
-
}
|
|
194
|
-
var timeoutId = setTimeout(function () {
|
|
195
|
-
clearTimeout(timeoutId);
|
|
196
|
-
ensureProcessExitsAfterDelay(waitUntilExitMs, startedAtMs);
|
|
197
|
-
}, 100);
|
|
198
|
-
}
|
|
199
|
-
function killActiveChildProcesses(signal) {
|
|
200
|
-
try {
|
|
201
|
-
var children = import_process.default._getActiveHandles().filter(function (handle) {
|
|
202
|
-
return _instanceof(handle, import_child_process.ChildProcess);
|
|
203
|
-
});
|
|
204
|
-
var _iteratorNormalCompletion = true,
|
|
205
|
-
_didIteratorError = false,
|
|
206
|
-
_iteratorError = void 0;
|
|
207
|
-
try {
|
|
208
|
-
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
209
|
-
var child = _step.value;
|
|
210
|
-
try {
|
|
211
|
-
child.kill(signal);
|
|
212
|
-
} catch (err) {
|
|
213
|
-
debug("failed to kill child process:", err);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
} catch (err) {
|
|
217
|
-
_didIteratorError = true;
|
|
218
|
-
_iteratorError = err;
|
|
219
|
-
} finally {
|
|
220
|
-
try {
|
|
221
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
222
|
-
_iterator.return();
|
|
223
|
-
}
|
|
224
|
-
} finally {
|
|
225
|
-
if (_didIteratorError) {
|
|
226
|
-
throw _iteratorError;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return children.length;
|
|
231
|
-
} catch (err) {
|
|
232
|
-
debug("failed to enumerate active child processes:", err);
|
|
233
|
-
return 0;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
function tryWarnActiveProcesses() {
|
|
237
|
-
var activeProcesses = [];
|
|
238
|
-
try {
|
|
239
|
-
var children = import_process.default._getActiveHandles().filter(function (handle) {
|
|
240
|
-
return _instanceof(handle, import_child_process.ChildProcess);
|
|
241
|
-
});
|
|
242
|
-
if (children.length) {
|
|
243
|
-
activeProcesses = children.map(function (child) {
|
|
244
|
-
return child.spawnargs.join(" ");
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
} catch (error) {
|
|
248
|
-
debug("failed to get active process information:", error);
|
|
249
|
-
}
|
|
250
|
-
if (!activeProcesses.length) {
|
|
251
|
-
warn("Something prevented Expo from exiting, forcefully exiting now.");
|
|
252
|
-
} else {
|
|
253
|
-
var singularOrPlural = activeProcesses.length === 1 ? "1 process" : `${activeProcesses.length} processes`;
|
|
254
|
-
warn(`Detected ${singularOrPlural} preventing process from exiting, forcefully exiting now.`);
|
|
255
|
-
warn(" - " + activeProcesses.join("\n - "));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
function guardAsync(fn) {
|
|
259
|
-
var invoked = false;
|
|
260
|
-
var returnValue;
|
|
261
|
-
var guard = async function () {
|
|
262
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
263
|
-
args[_key] = arguments[_key];
|
|
264
|
-
}
|
|
265
|
-
if (!invoked) {
|
|
266
|
-
invoked = true;
|
|
267
|
-
returnValue = await fn(...args);
|
|
268
|
-
}
|
|
269
|
-
return returnValue;
|
|
270
|
-
};
|
|
271
|
-
return guard;
|
|
272
|
-
}
|
|
273
|
-
function warn() {
|
|
274
|
-
for (var _len = arguments.length, message = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
275
|
-
message[_key] = arguments[_key];
|
|
276
|
-
}
|
|
277
|
-
console.warn(...message.map(function (value) {
|
|
278
|
-
return import_picocolors.default.yellow(value);
|
|
279
|
-
}));
|
|
280
|
-
}
|
|
281
|
-
//# sourceMappingURL=exit.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","exit_exports","__export","ensureProcessExitsAfterDelay","guardAsync","installExitHooks","warn","module","exports","import_child_process","require","import_process","__toESM","import_picocolors","_instanceof","left","right","Symbol","hasInstance","debug","_len","arguments","length","_","Array","_key","PRE_EXIT_SIGNALS","queue","unsubscribe","asyncExitHook","attachMasterListener","push","index","indexOf","splice","createExitHook","signal","_process_exitCode","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Object","entries","iterator","_step","next","done","hookAsync","error","err","return","default","exitCode","exit","hooks","hook","on","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_iterator2","_step2","signal2","hook2","removeListener","waitUntilExitMs","startedAtMs","Date","now","expectedResources","stdout","isTTY","stderr","stdin","activeResources","getActiveResourcesInfo","unexpectedActiveResources","filter","activeResource","canExitProcess","elapsedTime","killedChildren","killActiveChildProcesses","recheck","setTimeout","clearTimeout"],"sources":["../../../src/utils/exit.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,YAAA;AAAAC,QAAA,CAAAD,YAAA;EA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,iBAAAA,SAAA;IAAA8C,WAAA,GAAA9C,SAAA,CAAAC,MAAA,QAAAD,SAAA,iBAAAA,SAAA,MAAA+C,IAAA,CAAAC,GAAA;EAEA,IAAIC,iBAAiB,IACnB3D,cAAK,CAAAyC,OAAA,CAAAmB,MAAA,CAAAC,KAAA,2BACP7D,cAAO,CAAAyC,OAAA,CAAAqB,MAAA,CAAAD,KAAA,2BACL7D,cAAM,CAAAyC,OAAA,CAAAsB,KACJ,CAAAF,KAAA,YAAgB,aAAe,CAEjC;EAAA,IACEG,eAAY,GAAAhE,cAAgB,CAAAyC,OAAA,CAAAwB,sBAAA;EAAA,IAC9BC,yBAAA,GAAAF,eAAA,CAAAG,MAAA,WAAAC,cAAA;IACA,IAAA/C,KAAK,GAAAsC,iBAAS,CAAgBrC,OAAK,CAAA8C,cAAS;IAC9C,IAAA/C,KAAA;MACFsC,iBAAA,CAAApC,MAAA,CAAAF,KAAA;MAGO,OAAS;IACd;IACA,OAAI;EAEJ;EACE,IAAAgD,cAAc,IAAAH,yBAAA,CAAAvD,MAAA;EACZ,IAAA0D,cAAU;IACV,OAAA7D,KAAA,wDAA8B;EAAA;EAGhCA,KAAA,0EAAO,EAAA0D,yBAAA;EACT,IAAAI,WAAA,GAAAb,IAAA,CAAAC,GAAA,KAAAF,WAAA;EAEA,IAAAe,cAAO,GAAAC,wBAAA,CAAAF,WAAA;EACT,IAAAC,cAAA;IACO,IAAAE,OAAS,GAAQC,UAAyB;MAC/CC,YAAgB,CAAAF,OAAQ;MAC1BjF,4BAAA,CAAA+D,eAAA,EAAAC,WAAA","ignoreList":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: true
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: () => from[key],
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
-
value: mod,
|
|
29
|
-
enumerable: true
|
|
30
|
-
}) : target, mod));
|
|
31
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
-
value: true
|
|
33
|
-
}), mod);
|
|
34
|
-
var getTerminalReporter_exports = {};
|
|
35
|
-
__export(getTerminalReporter_exports, {
|
|
36
|
-
getTerminalReporter: () => getTerminalReporter
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(getTerminalReporter_exports);
|
|
39
|
-
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
40
|
-
var import_projectImport = require("./projectImport.cjs");
|
|
41
|
-
async function getTerminalReporter(projectRoot) {
|
|
42
|
-
const {
|
|
43
|
-
Terminal,
|
|
44
|
-
TerminalReporter
|
|
45
|
-
} = await (0, import_projectImport.projectImport)(projectRoot, "metro");
|
|
46
|
-
let metroWelcomeMessagePrinted = false;
|
|
47
|
-
const terminal = new Terminal(process.stdout);
|
|
48
|
-
terminal._log = terminal.log;
|
|
49
|
-
terminal.log = (message, ...rest) => {
|
|
50
|
-
if (!metroWelcomeMessagePrinted) {
|
|
51
|
-
const match = message.match(/Welcome to Metro.+v(\d+\.\d+\.\d+)/);
|
|
52
|
-
if (match) {
|
|
53
|
-
const version = match[1];
|
|
54
|
-
metroWelcomeMessagePrinted = true;
|
|
55
|
-
return terminal._log(import_picocolors.default.dim(`
|
|
56
|
-
Using Metro Bundler v${version}`), ...rest);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return terminal._log(message, ...rest);
|
|
60
|
-
};
|
|
61
|
-
const terminalReporter = new TerminalReporter(terminal);
|
|
62
|
-
terminalReporter._logInitializing = () => {};
|
|
63
|
-
return terminalReporter;
|
|
64
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __export = (target, all) => {
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
-
get: () => from[key],
|
|
19
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
36
|
-
var getTerminalReporter_exports = {};
|
|
37
|
-
__export(getTerminalReporter_exports, {
|
|
38
|
-
getTerminalReporter: () => getTerminalReporter
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(getTerminalReporter_exports);
|
|
41
|
-
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
42
|
-
var import_projectImport = require("./projectImport.native.js");
|
|
43
|
-
async function getTerminalReporter(projectRoot) {
|
|
44
|
-
var {
|
|
45
|
-
Terminal,
|
|
46
|
-
TerminalReporter
|
|
47
|
-
} = await (0, import_projectImport.projectImport)(projectRoot, "metro");
|
|
48
|
-
var metroWelcomeMessagePrinted = false;
|
|
49
|
-
var terminal = new Terminal(process.stdout);
|
|
50
|
-
terminal._log = terminal.log;
|
|
51
|
-
terminal.log = function (message) {
|
|
52
|
-
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
53
|
-
rest[_key - 1] = arguments[_key];
|
|
54
|
-
}
|
|
55
|
-
if (!metroWelcomeMessagePrinted) {
|
|
56
|
-
var match = message.match(/Welcome to Metro.+v(\d+\.\d+\.\d+)/);
|
|
57
|
-
if (match) {
|
|
58
|
-
var version = match[1];
|
|
59
|
-
metroWelcomeMessagePrinted = true;
|
|
60
|
-
return terminal._log(import_picocolors.default.dim(`
|
|
61
|
-
Using Metro Bundler v${version}`), ...rest);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return terminal._log(message, ...rest);
|
|
65
|
-
};
|
|
66
|
-
var terminalReporter = new TerminalReporter(terminal);
|
|
67
|
-
terminalReporter._logInitializing = function () {};
|
|
68
|
-
return terminalReporter;
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=getTerminalReporter.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","getTerminalReporter_exports","__export","getTerminalReporter","module","exports","import_picocolors","__toESM","require","import_projectImport","projectRoot","Terminal","TerminalReporter","projectImport","metroWelcomeMessagePrinted","terminal","process","stdout","_log","log","message","_len","arguments","length","rest","Array","_key","match","version","default","dim","terminalReporter","_logInitializing"],"sources":["../../../src/utils/getTerminalReporter.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAIAC,MAAA,CAAAC,OAAA,GAAAT,YAAmB,CAAAK,2BAAA;AAEnB,IAAAK,iBAAA,GAAAC,OAA8B,CAAAC,OAAA;AAE9B,IAAAC,oBAAsB,GAAAD,OAAA,CAAoB,2BAAqB;AAC7D,eAAQL,mBAAUA,CAAAO,WAAqB;EAKvC,IAAI;IAAAC,QAAA;IAAAC;EAA6B,cAAAH,oBAAA,CAAAI,aAAA,EAAAH,WAAA;EAEjC,IAAAI,0BAA8B,QAAQ;EACpC,IAAAC,QAAiB,OAAOJ,QAAS,CAAAK,OAA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