@expo/cli 0.1.0 → 0.1.3
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/build/bin/cli +38 -11
- package/build/bin/cli.map +1 -1
- package/build/src/config/index.js +7 -17
- package/build/src/config/index.js.map +1 -1
- package/build/src/export/createBundles.js +62 -0
- package/build/src/export/createBundles.js.map +1 -0
- package/build/src/export/createMetadataJson.js +36 -0
- package/build/src/export/createMetadataJson.js.map +1 -0
- package/build/src/export/exportApp.js +102 -0
- package/build/src/export/exportApp.js.map +1 -0
- package/build/src/export/exportAssets.js +106 -0
- package/build/src/export/exportAssets.js.map +1 -0
- package/build/src/export/exportAsync.js +49 -0
- package/build/src/export/exportAsync.js.map +1 -0
- package/build/src/export/fork-bundleAsync.js +138 -0
- package/build/src/export/fork-bundleAsync.js.map +1 -0
- package/build/src/export/getPublicExpoManifest.js +28 -0
- package/build/src/export/getPublicExpoManifest.js.map +1 -0
- package/build/src/export/getResolvedLocales.js +35 -0
- package/build/src/export/getResolvedLocales.js.map +1 -0
- package/build/src/export/index.js +77 -0
- package/build/src/export/index.js.map +1 -0
- package/build/src/export/printBundleSizes.js +122 -0
- package/build/src/export/printBundleSizes.js.map +1 -0
- package/build/src/export/resolveOptions.js +24 -0
- package/build/src/export/resolveOptions.js.map +1 -0
- package/build/src/export/saveAssets.js +65 -0
- package/build/src/export/saveAssets.js.map +1 -0
- package/build/src/export/writeContents.js +108 -0
- package/build/src/export/writeContents.js.map +1 -0
- package/build/src/install/index.js +13 -40
- package/build/src/install/index.js.map +1 -1
- package/build/src/login/index.js +6 -20
- package/build/src/login/index.js.map +1 -1
- package/build/src/logout/index.js +2 -17
- package/build/src/logout/index.js.map +1 -1
- package/build/src/prebuild/index.js +10 -21
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +1 -1
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/register/index.js +2 -17
- package/build/src/register/index.js.map +1 -1
- package/build/src/run/android/index.js +97 -0
- package/build/src/run/android/index.js.map +1 -0
- package/build/src/run/android/resolveDevice.js +23 -0
- package/build/src/run/android/resolveDevice.js.map +1 -0
- package/build/src/run/android/resolveGradleProps.js +37 -0
- package/build/src/run/android/resolveGradleProps.js.map +1 -0
- package/build/src/run/android/resolveInstallApkName.js +72 -0
- package/build/src/run/android/resolveInstallApkName.js.map +1 -0
- package/build/src/run/android/resolveLaunchProps.js +32 -0
- package/build/src/run/android/resolveLaunchProps.js.map +1 -0
- package/build/src/run/android/resolveOptions.js +25 -0
- package/build/src/run/android/resolveOptions.js.map +1 -0
- package/build/src/run/android/runAndroidAsync.js +74 -0
- package/build/src/run/android/runAndroidAsync.js.map +1 -0
- package/build/src/run/ensureNativeProject.js +33 -0
- package/build/src/run/ensureNativeProject.js.map +1 -0
- package/build/src/run/hints.js +22 -0
- package/build/src/run/hints.js.map +1 -0
- package/build/src/run/resolveBundlerProps.js +31 -0
- package/build/src/run/resolveBundlerProps.js.map +1 -0
- package/build/src/run/startBundler.js +76 -0
- package/build/src/run/startBundler.js.map +1 -0
- package/build/src/start/index.js +29 -39
- package/build/src/start/index.js.map +1 -1
- package/build/src/start/platforms/ExpoGoInstaller.js +4 -1
- package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
- package/build/src/start/platforms/PlatformManager.js +25 -0
- package/build/src/start/platforms/PlatformManager.js.map +1 -1
- package/build/src/start/platforms/android/ADBServer.js +3 -1
- package/build/src/start/platforms/android/ADBServer.js.map +1 -1
- package/build/src/start/platforms/android/AndroidDeviceManager.js +13 -1
- package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
- package/build/src/start/platforms/android/activateWindow.js +2 -0
- package/build/src/start/platforms/android/activateWindow.js.map +1 -1
- package/build/src/start/platforms/android/adb.js +37 -4
- package/build/src/start/platforms/android/adb.js.map +1 -1
- package/build/src/start/platforms/android/gradle.js +86 -0
- package/build/src/start/platforms/android/gradle.js.map +1 -0
- package/build/src/start/server/BundlerDevServer.js +62 -2
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/UrlCreator.js +2 -1
- package/build/src/start/server/UrlCreator.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +11 -14
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +22 -9
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
- package/build/src/start/server/middleware/createDevServerMiddleware.js +2 -2
- package/build/src/start/server/middleware/createDevServerMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/resolveAssets.js +4 -1
- package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js +10 -14
- package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/args.js +14 -0
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/array.js +29 -0
- package/build/src/utils/array.js.map +1 -1
- package/build/src/utils/dir.js +5 -1
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/downloadAppAsync.js +3 -0
- package/build/src/utils/downloadAppAsync.js.map +1 -1
- package/build/src/utils/downloadExpoGoAsync.js +11 -5
- package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
- package/build/src/utils/env.js +3 -0
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/resolveArgs.js +94 -0
- package/build/src/utils/resolveArgs.js.map +1 -0
- package/build/src/whoami/index.js +1 -17
- package/build/src/whoami/index.js.map +1 -1
- package/package.json +18 -13
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveDeviceAsync = resolveDeviceAsync;
|
|
6
|
+
var _androidDeviceManager = require("../../start/platforms/android/AndroidDeviceManager");
|
|
7
|
+
var _hints = require("../hints");
|
|
8
|
+
const debug = require("debug")("expo:android:resolveDevice");
|
|
9
|
+
async function resolveDeviceAsync(device) {
|
|
10
|
+
if (!device) {
|
|
11
|
+
const manager = await _androidDeviceManager.AndroidDeviceManager.resolveAsync();
|
|
12
|
+
debug(`Resolved default device (name: ${manager.device.name}, pid: ${manager.device.pid})`);
|
|
13
|
+
return manager;
|
|
14
|
+
}
|
|
15
|
+
debug(`Resolving device from argument: ${device}`);
|
|
16
|
+
const manager = device === true ? await _androidDeviceManager.AndroidDeviceManager.resolveAsync({
|
|
17
|
+
shouldPrompt: true
|
|
18
|
+
}) : await _androidDeviceManager.AndroidDeviceManager.resolveFromNameAsync(device);
|
|
19
|
+
(0, _hints).logDeviceArgument(manager.device.name);
|
|
20
|
+
return manager;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=resolveDevice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/resolveDevice.ts"],"sourcesContent":["import { AndroidDeviceManager } from '../../start/platforms/android/AndroidDeviceManager';\nimport { logDeviceArgument } from '../hints';\n\nconst debug = require('debug')('expo:android:resolveDevice');\n\n/** Given a `device` argument from the CLI, parse and prompt our way to a usable device for building. */\nexport async function resolveDeviceAsync(device?: string | boolean) {\n if (!device) {\n const manager = await AndroidDeviceManager.resolveAsync();\n debug(`Resolved default device (name: ${manager.device.name}, pid: ${manager.device.pid})`);\n return manager;\n }\n\n debug(`Resolving device from argument: ${device}`);\n const manager =\n device === true\n ? // `--device` (no props after)\n await AndroidDeviceManager.resolveAsync({ shouldPrompt: true })\n : // `--device <name>`\n await AndroidDeviceManager.resolveFromNameAsync(device);\n logDeviceArgument(manager.device.name);\n return manager;\n}\n"],"names":["resolveDeviceAsync","debug","require","device","manager","AndroidDeviceManager","resolveAsync","name","pid","shouldPrompt","resolveFromNameAsync","logDeviceArgument"],"mappings":"AAAA;;;;QAMsBA,kBAAkB,GAAlBA,kBAAkB;AANH,IAAA,qBAAoD,WAApD,oDAAoD,CAAA;AACvD,IAAA,MAAU,WAAV,UAAU,CAAA;AAE5C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,4BAA4B,CAAC,AAAC;AAGtD,eAAeF,kBAAkB,CAACG,MAAyB,EAAE;IAClE,IAAI,CAACA,MAAM,EAAE;QACX,MAAMC,OAAO,GAAG,MAAMC,qBAAoB,qBAAA,CAACC,YAAY,EAAE,AAAC;QAC1DL,KAAK,CAAC,CAAC,+BAA+B,EAAEG,OAAO,CAACD,MAAM,CAACI,IAAI,CAAC,OAAO,EAAEH,OAAO,CAACD,MAAM,CAACK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5F,OAAOJ,OAAO,CAAC;KAChB;IAEDH,KAAK,CAAC,CAAC,gCAAgC,EAAEE,MAAM,CAAC,CAAC,CAAC,CAAC;IACnD,MAAMC,OAAO,GACXD,MAAM,KAAK,IAAI,GAEX,MAAME,qBAAoB,qBAAA,CAACC,YAAY,CAAC;QAAEG,YAAY,EAAE,IAAI;KAAE,CAAC,GAE/D,MAAMJ,qBAAoB,qBAAA,CAACK,oBAAoB,CAACP,MAAM,CAAC,AAAC;IAC9DQ,CAAAA,GAAAA,MAAiB,AAAqB,CAAA,kBAArB,CAACP,OAAO,CAACD,MAAM,CAACI,IAAI,CAAC,CAAC;IACvC,OAAOH,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveGradleProps = resolveGradleProps;
|
|
6
|
+
var _path = _interopRequireDefault(require("path"));
|
|
7
|
+
var _errors = require("../../utils/errors");
|
|
8
|
+
function _interopRequireDefault(obj) {
|
|
9
|
+
return obj && obj.__esModule ? obj : {
|
|
10
|
+
default: obj
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function assertVariant(variant) {
|
|
14
|
+
if (variant && typeof variant !== "string") {
|
|
15
|
+
throw new _errors.CommandError("BAD_ARGS", "--variant must be a string");
|
|
16
|
+
}
|
|
17
|
+
return variant != null ? variant : "debug";
|
|
18
|
+
}
|
|
19
|
+
function resolveGradleProps(projectRoot, options) {
|
|
20
|
+
const variant = assertVariant(options.variant);
|
|
21
|
+
// NOTE(EvanBacon): Why would this be different? Can we get the different name?
|
|
22
|
+
const appName = "app";
|
|
23
|
+
const apkDirectory = _path.default.join(projectRoot, "android", appName, "build", "outputs", "apk");
|
|
24
|
+
// buildDeveloperTrust -> build, developer, trust (where developer, and trust are flavors).
|
|
25
|
+
// This won't work for non-standard flavor names like "myFlavor" would be treated as "my", "flavor".
|
|
26
|
+
const [buildType, ...flavors] = variant.split(/(?=[A-Z])/).map((v)=>v.toLowerCase()
|
|
27
|
+
);
|
|
28
|
+
const apkVariantDirectory = _path.default.join(apkDirectory, ...flavors, buildType);
|
|
29
|
+
return {
|
|
30
|
+
appName,
|
|
31
|
+
buildType,
|
|
32
|
+
flavors,
|
|
33
|
+
apkVariantDirectory
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=resolveGradleProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/resolveGradleProps.ts"],"sourcesContent":["import path from 'path';\n\nimport { CommandError } from '../../utils/errors';\n\nexport type GradleProps = {\n /** Directory for the APK based on the `variant`. */\n apkVariantDirectory: string;\n /** Name of the app, used in the `apkVariantDirectory`. */\n appName: string;\n /** First section of the provided `variant`, indicates the last part of the file name for the output APK. */\n buildType: string;\n /** Used to assemble the APK, also included in the output APK filename. */\n flavors?: string[];\n};\n\nfunction assertVariant(variant?: string) {\n if (variant && typeof variant !== 'string') {\n throw new CommandError('BAD_ARGS', '--variant must be a string');\n }\n return variant ?? 'debug';\n}\n\nexport function resolveGradleProps(\n projectRoot: string,\n options: { variant?: string }\n): GradleProps {\n const variant = assertVariant(options.variant);\n // NOTE(EvanBacon): Why would this be different? Can we get the different name?\n const appName = 'app';\n\n const apkDirectory = path.join(projectRoot, 'android', appName, 'build', 'outputs', 'apk');\n\n // buildDeveloperTrust -> build, developer, trust (where developer, and trust are flavors).\n // This won't work for non-standard flavor names like \"myFlavor\" would be treated as \"my\", \"flavor\".\n const [buildType, ...flavors] = variant.split(/(?=[A-Z])/).map((v) => v.toLowerCase());\n const apkVariantDirectory = path.join(apkDirectory, ...flavors, buildType);\n\n return {\n appName,\n buildType,\n flavors,\n apkVariantDirectory,\n };\n}\n"],"names":["resolveGradleProps","assertVariant","variant","CommandError","projectRoot","options","appName","apkDirectory","path","join","buildType","flavors","split","map","v","toLowerCase","apkVariantDirectory"],"mappings":"AAAA;;;;QAsBgBA,kBAAkB,GAAlBA,kBAAkB;AAtBjB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEM,IAAA,OAAoB,WAApB,oBAAoB,CAAA;;;;;;AAajD,SAASC,aAAa,CAACC,OAAgB,EAAE;IACvC,IAAIA,OAAO,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;QAC1C,MAAM,IAAIC,OAAY,aAAA,CAAC,UAAU,EAAE,4BAA4B,CAAC,CAAC;KAClE;IACD,OAAOD,OAAO,WAAPA,OAAO,GAAI,OAAO,CAAC;CAC3B;AAEM,SAASF,kBAAkB,CAChCI,WAAmB,EACnBC,OAA6B,EAChB;IACb,MAAMH,OAAO,GAAGD,aAAa,CAACI,OAAO,CAACH,OAAO,CAAC,AAAC;IAC/C,+EAA+E;IAC/E,MAAMI,OAAO,GAAG,KAAK,AAAC;IAEtB,MAAMC,YAAY,GAAGC,KAAI,QAAA,CAACC,IAAI,CAACL,WAAW,EAAE,SAAS,EAAEE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,AAAC;IAE3F,2FAA2F;IAC3F,oGAAoG;IACpG,MAAM,CAACI,SAAS,EAAE,GAAGC,OAAO,CAAC,GAAGT,OAAO,CAACU,KAAK,aAAa,CAACC,GAAG,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACC,WAAW,EAAE;IAAA,CAAC,AAAC;IACvF,MAAMC,mBAAmB,GAAGR,KAAI,QAAA,CAACC,IAAI,CAACF,YAAY,KAAKI,OAAO,EAAED,SAAS,CAAC,AAAC;IAE3E,OAAO;QACLJ,OAAO;QACPI,SAAS;QACTC,OAAO;QACPK,mBAAmB;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveInstallApkNameAsync = resolveInstallApkNameAsync;
|
|
6
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
7
|
+
var _path = _interopRequireDefault(require("path"));
|
|
8
|
+
var Log = _interopRequireWildcard(require("../../log"));
|
|
9
|
+
var _adb = require("../../start/platforms/android/adb");
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function _interopRequireWildcard(obj) {
|
|
16
|
+
if (obj && obj.__esModule) {
|
|
17
|
+
return obj;
|
|
18
|
+
} else {
|
|
19
|
+
var newObj = {};
|
|
20
|
+
if (obj != null) {
|
|
21
|
+
for(var key in obj){
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
23
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
24
|
+
if (desc.get || desc.set) {
|
|
25
|
+
Object.defineProperty(newObj, key, desc);
|
|
26
|
+
} else {
|
|
27
|
+
newObj[key] = obj[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
newObj.default = obj;
|
|
33
|
+
return newObj;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function resolveInstallApkNameAsync(device, { appName , buildType , flavors , apkVariantDirectory }) {
|
|
37
|
+
const availableCPUs = await (0, _adb).getDeviceABIsAsync(device);
|
|
38
|
+
availableCPUs.push(_adb.DeviceABI.universal);
|
|
39
|
+
Log.debug("Supported ABIs: " + availableCPUs.join(", "));
|
|
40
|
+
Log.debug("Searching for APK: " + apkVariantDirectory);
|
|
41
|
+
// Check for cpu specific builds first
|
|
42
|
+
for (const availableCPU of availableCPUs){
|
|
43
|
+
const apkName = getApkFileName(appName, buildType, flavors, availableCPU);
|
|
44
|
+
const apkPath = _path.default.join(apkVariantDirectory, apkName);
|
|
45
|
+
Log.debug("Checking for APK at:", apkPath);
|
|
46
|
+
if (_fs.default.existsSync(apkPath)) {
|
|
47
|
+
return apkName;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Otherwise use the default apk named after the variant: app-debug.apk
|
|
51
|
+
const apkName = getApkFileName(appName, buildType, flavors);
|
|
52
|
+
const apkPath = _path.default.join(apkVariantDirectory, apkName);
|
|
53
|
+
Log.debug("Checking for fallback APK at:", apkPath);
|
|
54
|
+
if (_fs.default.existsSync(apkPath)) {
|
|
55
|
+
return apkName;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function getApkFileName(appName, buildType, flavors, cpuArch) {
|
|
60
|
+
let apkName = `${appName}-`;
|
|
61
|
+
if (flavors) {
|
|
62
|
+
apkName += flavors.reduce((rest, flavor)=>`${rest}${flavor}-`
|
|
63
|
+
, "");
|
|
64
|
+
}
|
|
65
|
+
if (cpuArch) {
|
|
66
|
+
apkName += `${cpuArch}-`;
|
|
67
|
+
}
|
|
68
|
+
apkName += `${buildType}.apk`;
|
|
69
|
+
return apkName;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=resolveInstallApkName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/resolveInstallApkName.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../../log';\nimport { Device, DeviceABI, getDeviceABIsAsync } from '../../start/platforms/android/adb';\nimport { GradleProps } from './resolveGradleProps';\n\nexport async function resolveInstallApkNameAsync(\n device: Pick<Device, 'name' | 'pid'>,\n { appName, buildType, flavors, apkVariantDirectory }: GradleProps\n) {\n const availableCPUs = await getDeviceABIsAsync(device);\n availableCPUs.push(DeviceABI.universal);\n\n Log.debug('Supported ABIs: ' + availableCPUs.join(', '));\n Log.debug('Searching for APK: ' + apkVariantDirectory);\n\n // Check for cpu specific builds first\n for (const availableCPU of availableCPUs) {\n const apkName = getApkFileName(appName, buildType, flavors, availableCPU);\n const apkPath = path.join(apkVariantDirectory, apkName);\n Log.debug('Checking for APK at:', apkPath);\n if (fs.existsSync(apkPath)) {\n return apkName;\n }\n }\n\n // Otherwise use the default apk named after the variant: app-debug.apk\n const apkName = getApkFileName(appName, buildType, flavors);\n const apkPath = path.join(apkVariantDirectory, apkName);\n Log.debug('Checking for fallback APK at:', apkPath);\n if (fs.existsSync(apkPath)) {\n return apkName;\n }\n\n return null;\n}\n\nfunction getApkFileName(\n appName: string,\n buildType: string,\n flavors?: string[] | null,\n cpuArch?: string | null\n) {\n let apkName = `${appName}-`;\n if (flavors) {\n apkName += flavors.reduce((rest, flavor) => `${rest}${flavor}-`, '');\n }\n if (cpuArch) {\n apkName += `${cpuArch}-`;\n }\n apkName += `${buildType}.apk`;\n\n return apkName;\n}\n"],"names":["resolveInstallApkNameAsync","Log","device","appName","buildType","flavors","apkVariantDirectory","availableCPUs","getDeviceABIsAsync","push","DeviceABI","universal","debug","join","availableCPU","apkName","getApkFileName","apkPath","path","fs","existsSync","cpuArch","reduce","rest","flavor"],"mappings":"AAAA;;;;QAOsBA,0BAA0B,GAA1BA,0BAA0B;AAPjC,IAAA,GAAI,kC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ACxDd,GAAG,CAACW,KAAK,CAAC,+BAA+B,EAAEK,OAAO,CAAC,CAAC;IACpD,IAAIE,GAAE,QAAA,CAACC,UAAU,CAACH,OAAO,CAAC,EAAE;QAC1B,OAAOF,OAAO,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;CACb;AAED,SAASC,cAAc,CACrBb,OAAe,EACfC,SAAiB,EACjBC,OAAyB,EACzBgB,OAAuB,EACvB;IACA,IAAIN,OAAO,GAAG,CAAC,EAAEZ,OAAO,CAAC,CAAC,CAAC,AAAC;IAC5B,IAAIE,OAAO,EAAE;QACXU,OAAO,IAAIV,OAAO,CAACiB,MAAM,CAAC,CAACC,IAAI,EAAEC,MAAM,GAAK,CAAC,EAAED,IAAI,CAAC,EAAEC,MAAM,CAAC,CAAC,CAAC;QAAA,EAAE,EAAE,CAAC,CAAC;KACtE;IACD,IAAIH,OAAO,EAAE;QACXN,OAAO,IAAI,CAAC,EAAEM,OAAO,CAAC,CAAC,CAAC,CAAC;KAC1B;IACDN,OAAO,IAAI,CAAC,EAAEX,SAAS,CAAC,IAAI,CAAC,CAAC;IAE9B,OAAOW,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveLaunchPropsAsync = resolveLaunchPropsAsync;
|
|
6
|
+
var _configPlugins = require("@expo/config-plugins");
|
|
7
|
+
var _androidAppIdResolver = require("../../start/platforms/android/AndroidAppIdResolver");
|
|
8
|
+
var _errors = require("../../utils/errors");
|
|
9
|
+
async function getMainActivityAsync(projectRoot) {
|
|
10
|
+
const filePath = await _configPlugins.AndroidConfig.Paths.getAndroidManifestAsync(projectRoot);
|
|
11
|
+
const androidManifest = await _configPlugins.AndroidConfig.Manifest.readAndroidManifestAsync(filePath);
|
|
12
|
+
// Assert MainActivity defined.
|
|
13
|
+
const activity = await _configPlugins.AndroidConfig.Manifest.getRunnableActivity(androidManifest);
|
|
14
|
+
if (!activity) {
|
|
15
|
+
throw new _errors.CommandError("ANDROID_MALFORMED", `${filePath} is missing a runnable activity element.`);
|
|
16
|
+
}
|
|
17
|
+
// Often this is ".MainActivity"
|
|
18
|
+
return activity.$["android:name"];
|
|
19
|
+
}
|
|
20
|
+
async function resolveLaunchPropsAsync(projectRoot) {
|
|
21
|
+
// Often this is ".MainActivity"
|
|
22
|
+
const mainActivity = await getMainActivityAsync(projectRoot);
|
|
23
|
+
const packageName = await new _androidAppIdResolver.AndroidAppIdResolver(projectRoot).getAppIdFromNativeAsync();
|
|
24
|
+
const launchActivity = `${packageName}/${mainActivity}`;
|
|
25
|
+
return {
|
|
26
|
+
mainActivity,
|
|
27
|
+
launchActivity,
|
|
28
|
+
packageName
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=resolveLaunchProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/resolveLaunchProps.ts"],"sourcesContent":["import { AndroidConfig } from '@expo/config-plugins';\n\nimport { AndroidAppIdResolver } from '../../start/platforms/android/AndroidAppIdResolver';\nimport { CommandError } from '../../utils/errors';\n\nexport interface LaunchProps {\n packageName: string;\n mainActivity: string;\n launchActivity: string;\n}\n\nasync function getMainActivityAsync(projectRoot: string): Promise<string> {\n const filePath = await AndroidConfig.Paths.getAndroidManifestAsync(projectRoot);\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(filePath);\n\n // Assert MainActivity defined.\n const activity = await AndroidConfig.Manifest.getRunnableActivity(androidManifest);\n if (!activity) {\n throw new CommandError(\n 'ANDROID_MALFORMED',\n `${filePath} is missing a runnable activity element.`\n );\n }\n // Often this is \".MainActivity\"\n return activity.$['android:name'];\n}\n\nexport async function resolveLaunchPropsAsync(projectRoot: string): Promise<LaunchProps> {\n // Often this is \".MainActivity\"\n const mainActivity = await getMainActivityAsync(projectRoot);\n\n const packageName = await new AndroidAppIdResolver(projectRoot).getAppIdFromNativeAsync();\n const launchActivity = `${packageName}/${mainActivity}`;\n\n return {\n mainActivity,\n launchActivity,\n packageName,\n };\n}\n"],"names":["resolveLaunchPropsAsync","getMainActivityAsync","projectRoot","filePath","AndroidConfig","Paths","getAndroidManifestAsync","androidManifest","Manifest","readAndroidManifestAsync","activity","getRunnableActivity","CommandError","$","mainActivity","packageName","AndroidAppIdResolver","getAppIdFromNativeAsync","launchActivity"],"mappings":"AAAA;;;;QA2BsBA,uBAAuB,GAAvBA,uBAAuB;AA3Bf,IAAA,cAAsB,WAAtB,sBAAsB,CAAA;AAEf,IAAA,qBAAoD,WAApD,oDAAoD,CAAA;AAC5D,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AAQjD,eAAeC,oBAAoB,CAACC,WAAmB,EAAmB;IACxE,MAAMC,QAAQ,GAAG,MAAMC,cAAa,cAAA,CAACC,KAAK,CAACC,uBAAuB,CAACJ,WAAW,CAAC,AAAC;IAChF,MAAMK,eAAe,GAAG,MAAMH,cAAa,cAAA,CAACI,QAAQ,CAACC,wBAAwB,CAACN,QAAQ,CAAC,AAAC;IAExF,+BAA+B;IAC/B,MAAMO,QAAQ,GAAG,MAAMN,cAAa,cAAA,CAACI,QAAQ,CAACG,mBAAmB,CAACJ,eAAe,CAAC,AAAC;IACnF,IAAI,CAACG,QAAQ,EAAE;QACb,MAAM,IAAIE,OAAY,aAAA,CACpB,mBAAmB,EACnB,CAAC,EAAET,QAAQ,CAAC,wCAAwC,CAAC,CACtD,CAAC;KACH;IACD,gCAAgC;IAChC,OAAOO,QAAQ,CAACG,CAAC,CAAC,cAAc,CAAC,CAAC;CACnC;AAEM,eAAeb,uBAAuB,CAACE,WAAmB,EAAwB;IACvF,gCAAgC;IAChC,MAAMY,YAAY,GAAG,MAAMb,oBAAoB,CAACC,WAAW,CAAC,AAAC;IAE7D,MAAMa,WAAW,GAAG,MAAM,IAAIC,qBAAoB,qBAAA,CAACd,WAAW,CAAC,CAACe,uBAAuB,EAAE,AAAC;IAC1F,MAAMC,cAAc,GAAG,CAAC,EAAEH,WAAW,CAAC,CAAC,EAAED,YAAY,CAAC,CAAC,AAAC;IAExD,OAAO;QACLA,YAAY;QACZI,cAAc;QACdH,WAAW;KACZ,CAAC;CACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveOptionsAsync = resolveOptionsAsync;
|
|
6
|
+
var _resolveBundlerProps = require("../resolveBundlerProps");
|
|
7
|
+
var _resolveDevice = require("./resolveDevice");
|
|
8
|
+
var _resolveGradleProps = require("./resolveGradleProps");
|
|
9
|
+
var _resolveLaunchProps = require("./resolveLaunchProps");
|
|
10
|
+
async function resolveOptionsAsync(projectRoot, options) {
|
|
11
|
+
var _variant;
|
|
12
|
+
return {
|
|
13
|
+
...await (0, _resolveBundlerProps).resolveBundlerPropsAsync(projectRoot, options),
|
|
14
|
+
...(0, _resolveGradleProps).resolveGradleProps(projectRoot, options),
|
|
15
|
+
...await (0, _resolveLaunchProps).resolveLaunchPropsAsync(projectRoot),
|
|
16
|
+
variant: (_variant = options.variant) != null ? _variant : "debug",
|
|
17
|
+
// Resolve the device based on the provided device id or prompt
|
|
18
|
+
// from a list of devices (connected or simulated) that are filtered by the scheme.
|
|
19
|
+
device: await (0, _resolveDevice).resolveDeviceAsync(options.device),
|
|
20
|
+
buildCache: !!options.buildCache,
|
|
21
|
+
install: !!options.install
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=resolveOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/resolveOptions.ts"],"sourcesContent":["import { AndroidDeviceManager } from '../../start/platforms/android/AndroidDeviceManager';\nimport { BundlerProps, resolveBundlerPropsAsync } from '../resolveBundlerProps';\nimport { resolveDeviceAsync } from './resolveDevice';\nimport { GradleProps, resolveGradleProps } from './resolveGradleProps';\nimport { LaunchProps, resolveLaunchPropsAsync } from './resolveLaunchProps';\n\nexport type Options = {\n variant?: string;\n device?: boolean | string;\n port?: number;\n bundler?: boolean;\n install?: boolean;\n buildCache?: boolean;\n};\n\nexport type ResolvedOptions = GradleProps &\n BundlerProps &\n LaunchProps & {\n variant: string;\n buildCache: boolean;\n device: AndroidDeviceManager;\n install: boolean;\n };\n\nexport async function resolveOptionsAsync(\n projectRoot: string,\n options: Options\n): Promise<ResolvedOptions> {\n return {\n ...(await resolveBundlerPropsAsync(projectRoot, options)),\n ...resolveGradleProps(projectRoot, options),\n ...(await resolveLaunchPropsAsync(projectRoot)),\n variant: options.variant ?? 'debug',\n // Resolve the device based on the provided device id or prompt\n // from a list of devices (connected or simulated) that are filtered by the scheme.\n device: await resolveDeviceAsync(options.device),\n buildCache: !!options.buildCache,\n install: !!options.install,\n };\n}\n"],"names":["resolveOptionsAsync","projectRoot","options","resolveBundlerPropsAsync","resolveGradleProps","resolveLaunchPropsAsync","variant","device","resolveDeviceAsync","buildCache","install"],"mappings":"AAAA;;;;QAwBsBA,mBAAmB,GAAnBA,mBAAmB;AAvBc,IAAA,oBAAwB,WAAxB,wBAAwB,CAAA;AAC5C,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AACJ,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;AACjB,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;AAoBpE,eAAeA,mBAAmB,CACvCC,WAAmB,EACnBC,OAAgB,EACU;QAKfA,QAAe;IAJ1B,OAAO;QACL,GAAI,MAAMC,CAAAA,GAAAA,oBAAwB,AAAsB,CAAA,yBAAtB,CAACF,WAAW,EAAEC,OAAO,CAAC;QACxD,GAAGE,CAAAA,GAAAA,mBAAkB,AAAsB,CAAA,mBAAtB,CAACH,WAAW,EAAEC,OAAO,CAAC;QAC3C,GAAI,MAAMG,CAAAA,GAAAA,mBAAuB,AAAa,CAAA,wBAAb,CAACJ,WAAW,CAAC;QAC9CK,OAAO,EAAEJ,CAAAA,QAAe,GAAfA,OAAO,CAACI,OAAO,YAAfJ,QAAe,GAAI,OAAO;QACnC,+DAA+D;QAC/D,mFAAmF;QACnFK,MAAM,EAAE,MAAMC,CAAAA,GAAAA,cAAkB,AAAgB,CAAA,mBAAhB,CAACN,OAAO,CAACK,MAAM,CAAC;QAChDE,UAAU,EAAE,CAAC,CAACP,OAAO,CAACO,UAAU;QAChCC,OAAO,EAAE,CAAC,CAACR,OAAO,CAACQ,OAAO;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.runAndroidAsync = runAndroidAsync;
|
|
6
|
+
var _path = _interopRequireDefault(require("path"));
|
|
7
|
+
var _log = require("../../log");
|
|
8
|
+
var _gradle = require("../../start/platforms/android/gradle");
|
|
9
|
+
var _scheme = require("../../utils/scheme");
|
|
10
|
+
var _ensureNativeProject = require("../ensureNativeProject");
|
|
11
|
+
var _hints = require("../hints");
|
|
12
|
+
var _startBundler = require("../startBundler");
|
|
13
|
+
var _resolveInstallApkName = require("./resolveInstallApkName");
|
|
14
|
+
var _resolveOptions = require("./resolveOptions");
|
|
15
|
+
function _interopRequireDefault(obj) {
|
|
16
|
+
return obj && obj.__esModule ? obj : {
|
|
17
|
+
default: obj
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const debug = require("debug")("expo:run:android");
|
|
21
|
+
async function runAndroidAsync(projectRoot, { install , ...options }) {
|
|
22
|
+
var ref;
|
|
23
|
+
await (0, _ensureNativeProject).ensureNativeProjectAsync(projectRoot, {
|
|
24
|
+
platform: "android",
|
|
25
|
+
install
|
|
26
|
+
});
|
|
27
|
+
const props = await (0, _resolveOptions).resolveOptionsAsync(projectRoot, options);
|
|
28
|
+
debug("Package name: " + props.packageName);
|
|
29
|
+
_log.Log.log("\u203A Building app...");
|
|
30
|
+
const androidProjectRoot = _path.default.join(projectRoot, "android");
|
|
31
|
+
await (0, _gradle).assembleAsync(androidProjectRoot, {
|
|
32
|
+
variant: props.variant,
|
|
33
|
+
port: props.port,
|
|
34
|
+
appName: props.appName,
|
|
35
|
+
buildCache: props.buildCache
|
|
36
|
+
});
|
|
37
|
+
const manager = await (0, _startBundler).startBundlerAsync(projectRoot, {
|
|
38
|
+
port: props.port,
|
|
39
|
+
headless: !props.shouldStartBundler
|
|
40
|
+
});
|
|
41
|
+
await installAppAsync(androidProjectRoot, props);
|
|
42
|
+
await manager.getDefaultDevServer().openCustomRuntimeAsync("emulator", {
|
|
43
|
+
applicationId: props.packageName,
|
|
44
|
+
// If a scheme is specified then use that instead of the package name.
|
|
45
|
+
scheme: (ref = await (0, _scheme).getSchemesForAndroidAsync(projectRoot)) == null ? void 0 : ref[0]
|
|
46
|
+
}, {
|
|
47
|
+
device: props.device.device
|
|
48
|
+
});
|
|
49
|
+
if (props.shouldStartBundler) {
|
|
50
|
+
(0, _hints).logProjectLogsLocation();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function installAppAsync(androidProjectRoot, props) {
|
|
54
|
+
// Find the APK file path
|
|
55
|
+
const apkFile = await (0, _resolveInstallApkName).resolveInstallApkNameAsync(props.device.device, props);
|
|
56
|
+
if (apkFile) {
|
|
57
|
+
// Attempt to install the APK from the file path
|
|
58
|
+
const binaryPath = _path.default.join(props.apkVariantDirectory, apkFile);
|
|
59
|
+
debug("Installing:", binaryPath);
|
|
60
|
+
await props.device.installAppAsync(binaryPath);
|
|
61
|
+
} else {
|
|
62
|
+
// If we cannot resolve the APK file path then we can attempt to install using Gradle.
|
|
63
|
+
// This offers more advanced resolution that we may not have first class support for.
|
|
64
|
+
_log.Log.log("\u203A Failed to locate binary file, installing with Gradle...");
|
|
65
|
+
var _variant, _appName;
|
|
66
|
+
await (0, _gradle).installAsync(androidProjectRoot, {
|
|
67
|
+
variant: (_variant = props.variant) != null ? _variant : "debug",
|
|
68
|
+
appName: (_appName = props.appName) != null ? _appName : "app",
|
|
69
|
+
port: props.port
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=runAndroidAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/run/android/runAndroidAsync.ts"],"sourcesContent":["import path from 'path';\n\nimport { Log } from '../../log';\nimport { assembleAsync, installAsync } from '../../start/platforms/android/gradle';\nimport { getSchemesForAndroidAsync } from '../../utils/scheme';\nimport { ensureNativeProjectAsync } from '../ensureNativeProject';\nimport { logProjectLogsLocation } from '../hints';\nimport { startBundlerAsync } from '../startBundler';\nimport { resolveInstallApkNameAsync } from './resolveInstallApkName';\nimport { Options, ResolvedOptions, resolveOptionsAsync } from './resolveOptions';\n\nconst debug = require('debug')('expo:run:android');\n\nexport async function runAndroidAsync(projectRoot: string, { install, ...options }: Options) {\n await ensureNativeProjectAsync(projectRoot, { platform: 'android', install });\n\n const props = await resolveOptionsAsync(projectRoot, options);\n\n debug('Package name: ' + props.packageName);\n Log.log('› Building app...');\n\n const androidProjectRoot = path.join(projectRoot, 'android');\n\n await assembleAsync(androidProjectRoot, {\n variant: props.variant,\n port: props.port,\n appName: props.appName,\n buildCache: props.buildCache,\n });\n\n const manager = await startBundlerAsync(projectRoot, {\n port: props.port,\n headless: !props.shouldStartBundler,\n });\n\n await installAppAsync(androidProjectRoot, props);\n\n await manager.getDefaultDevServer().openCustomRuntimeAsync(\n 'emulator',\n {\n applicationId: props.packageName,\n // If a scheme is specified then use that instead of the package name.\n scheme: (await getSchemesForAndroidAsync(projectRoot))?.[0],\n },\n { device: props.device.device }\n );\n\n if (props.shouldStartBundler) {\n logProjectLogsLocation();\n }\n}\n\nasync function installAppAsync(androidProjectRoot: string, props: ResolvedOptions) {\n // Find the APK file path\n const apkFile = await resolveInstallApkNameAsync(props.device.device, props);\n\n if (apkFile) {\n // Attempt to install the APK from the file path\n const binaryPath = path.join(props.apkVariantDirectory, apkFile);\n debug('Installing:', binaryPath);\n await props.device.installAppAsync(binaryPath);\n } else {\n // If we cannot resolve the APK file path then we can attempt to install using Gradle.\n // This offers more advanced resolution that we may not have first class support for.\n Log.log('› Failed to locate binary file, installing with Gradle...');\n await installAsync(androidProjectRoot, {\n variant: props.variant ?? 'debug',\n appName: props.appName ?? 'app',\n port: props.port,\n });\n }\n}\n"],"names":["runAndroidAsync","debug","require","projectRoot","install","options","ensureNativeProjectAsync","platform","props","resolveOptionsAsync","packageName","Log","log","androidProjectRoot","path","join","assembleAsync","variant","port","appName","buildCache","manager","startBundlerAsync","headless","shouldStartBundler","installAppAsync","getDefaultDevServer","openCustomRuntimeAsync","applicationId","scheme","getSchemesForAndroidAsync","device","logProjectLogsLocation","apkFile","resolveInstallApkNameAsync","binaryPath","apkVariantDirectory","installAsync"],"mappings":"AAAA;;;;QAasBA,eAAe,GAAfA,eAAe;AAbpB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEH,IAAA,IAAW,WAAX,WAAW,CAAA;AACa,IAAA,OAAsC,WAAtC,sCAAsC,CAAA;AACxC,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AACrB,IAAA,oBAAwB,WAAxB,wBAAwB,CAAA;AAC1B,IAAA,MAAU,WAAV,UAAU,CAAA;AACf,IAAA,aAAiB,WAAjB,iBAAiB,CAAA;AACR,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AACN,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;;;;;;AAEhF,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,AAAC;AAE5C,eAAeF,eAAe,CAACG,WAAmB,EAAE,EAAEC,OAAO,CAAA,EAAE,GAAGC,OAAO,EAAW,EAAE;QA6B/E,GAA8C;IA5B1D,MAAMC,CAAAA,GAAAA,oBAAwB,A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4
|
+
});
|
|
5
|
+
exports.ensureNativeProjectAsync = ensureNativeProjectAsync;
|
|
6
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
7
|
+
var _path = _interopRequireDefault(require("path"));
|
|
8
|
+
var _clearNativeFolder = require("../prebuild/clearNativeFolder");
|
|
9
|
+
var _prebuildAsync = require("../prebuild/prebuildAsync");
|
|
10
|
+
var _profile = require("../utils/profile");
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
default: obj
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
async function ensureNativeProjectAsync(projectRoot, { platform , install }) {
|
|
17
|
+
// If the user has an empty android folder then the project won't build, this can happen when they delete the prebuild files in git.
|
|
18
|
+
// Check to ensure most of the core files are in place, and prompt to remove the folder if they aren't.
|
|
19
|
+
await (0, _profile).profile(_clearNativeFolder.promptToClearMalformedNativeProjectsAsync)(projectRoot, [
|
|
20
|
+
platform
|
|
21
|
+
]);
|
|
22
|
+
// If the project doesn't have native code, prebuild it...
|
|
23
|
+
if (!_fs.default.existsSync(_path.default.join(projectRoot, platform))) {
|
|
24
|
+
await (0, _prebuildAsync).prebuildAsync(projectRoot, {
|
|
25
|
+
install: !!install,
|
|
26
|
+
platforms: [
|
|
27
|
+
platform
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=ensureNativeProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/run/ensureNativeProject.ts"],"sourcesContent":["import { ModPlatform } from '@expo/config-plugins';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { promptToClearMalformedNativeProjectsAsync } from '../prebuild/clearNativeFolder';\nimport { prebuildAsync } from '../prebuild/prebuildAsync';\nimport { profile } from '../utils/profile';\n\nexport async function ensureNativeProjectAsync(\n projectRoot: string,\n { platform, install }: { platform: ModPlatform; install?: boolean }\n) {\n // If the user has an empty android folder then the project won't build, this can happen when they delete the prebuild files in git.\n // Check to ensure most of the core files are in place, and prompt to remove the folder if they aren't.\n await profile(promptToClearMalformedNativeProjectsAsync)(projectRoot, [platform]);\n\n // If the project doesn't have native code, prebuild it...\n if (!fs.existsSync(path.join(projectRoot, platform))) {\n await prebuildAsync(projectRoot, {\n install: !!install,\n platforms: [platform],\n });\n }\n}\n"],"names":["ensureNativeProjectAsync","projectRoot","platform","install","profile","promptToClearMalformedNativeProjectsAsync","fs","existsSync","path","join","prebuildAsync","platforms"],"mappings":"AAAA;;;;QAQsBA,wBAAwB,GAAxBA,wBAAwB;AAP/B,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEmC,IAAA,kBAA+B,WAA/B,+BAA+B,CAAA;AAC3D,IAAA,cAA2B,WAA3B,2BAA2B,CAAA;AACjC,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;;;;;;AAEnC,eAAeA,wBAAwB,CAC5CC,WAAmB,EACnB,EAAEC,QAAQ,CAAA,EAAEC,OAAO,CAAA,EAAgD,EACnE;IACA,oIAAoI;IACpI,uGAAuG;IACvG,MAAMC,CAAAA,GAAAA,QAAO,AAA2C,CAAA,QAA3C,CAACC,kBAAyC,0CAAA,CAAC,CAACJ,WAAW,EAAE;QAACC,QAAQ;KAAC,CAAC,CAAC;IAElF,0DAA0D;IAC1D,IAAI,CAACI,GAAE,QAAA,CAACC,UAAU,CAACC,KAAI,QAAA,CAACC,IAAI,CAACR,WAAW,EAAEC,QAAQ,CAAC,CAAC,EAAE;QACpD,MAAMQ,CAAAA,GAAAA,cAAa,AAGjB,CAAA,cAHiB,CAACT,WAAW,EAAE;YAC/BE,OAAO,EAAE,CAAC,CAACA,OAAO;YAClBQ,SAAS,EAAE;gBAACT,QAAQ;aAAC;SACtB,CAAC,CAAC;KACJ;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.logDeviceArgument = logDeviceArgument;
|
|
6
|
+
exports.logProjectLogsLocation = logProjectLogsLocation;
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var _log = require("../log");
|
|
9
|
+
var _env = require("../utils/env");
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
default: obj
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function logDeviceArgument(id) {
|
|
16
|
+
_log.Log.log(_chalk.default.dim`› Using --device ${id}`);
|
|
17
|
+
}
|
|
18
|
+
function logProjectLogsLocation() {
|
|
19
|
+
_log.Log.log(_chalk.default`› Logs for your project will appear below.${_env.env.CI ? "" : _chalk.default.dim(` Press Ctrl+C to exit.`)}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=hints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/run/hints.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { Log } from '../log';\nimport { env } from '../utils/env';\n\n/** Log the device argument to use for the next run: `Using --device foobar` */\nexport function logDeviceArgument(id: string) {\n Log.log(chalk.dim`› Using --device ${id}`);\n}\n\nexport function logProjectLogsLocation() {\n Log.log(\n chalk`› Logs for your project will appear below.${\n env.CI ? '' : chalk.dim(` Press Ctrl+C to exit.`)\n }`\n );\n}\n"],"names":["logDeviceArgument","logProjectLogsLocation","id","Log","log","chalk","dim","env","CI"],"mappings":"AAAA;;;;QAMgBA,iBAAiB,GAAjBA,iBAAiB;QAIjBC,sBAAsB,GAAtBA,sBAAsB;AAVpB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEL,IAAA,IAAQ,WAAR,QAAQ,CAAA;AACR,IAAA,IAAc,WAAd,cAAc,CAAA;;;;;;AAG3B,SAASD,iBAAiB,CAACE,EAAU,EAAE;IAC5CC,IAAG,IAAA,CAACC,GAAG,CAACC,MAAK,QAAA,CAACC,GAAG,CAAC,mBAAmB,EAAEJ,EAAE,CAAC,CAAC,CAAC,CAAC;CAC9C;AAEM,SAASD,sBAAsB,GAAG;IACvCE,IAAG,IAAA,CAACC,GAAG,CACLC,MAAK,QAAA,CAAC,4CAA0C,EAC9CE,IAAG,IAAA,CAACC,EAAE,GAAG,EAAE,GAAGH,MAAK,QAAA,CAACC,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAClD,CAAC,CACH,CAAC;CACH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.resolveBundlerPropsAsync = resolveBundlerPropsAsync;
|
|
6
|
+
var _errors = require("../utils/errors");
|
|
7
|
+
var _port = require("../utils/port");
|
|
8
|
+
async function resolveBundlerPropsAsync(projectRoot, options) {
|
|
9
|
+
const skipBundler = options.bundler === false;
|
|
10
|
+
if (// If the user disables the bundler then they should not pass in the port property.
|
|
11
|
+
skipBundler && options.port) {
|
|
12
|
+
throw new _errors.CommandError("BAD_ARGS", "--port and --no-bundler are mutually exclusive arguments");
|
|
13
|
+
}
|
|
14
|
+
// Resolve the port if the bundler is used.
|
|
15
|
+
let port = skipBundler ? null : await (0, _port).resolvePortAsync(projectRoot, {
|
|
16
|
+
reuseExistingPort: true,
|
|
17
|
+
defaultPort: options.port
|
|
18
|
+
});
|
|
19
|
+
// Skip bundling if the port is null
|
|
20
|
+
options.bundler = !!port;
|
|
21
|
+
if (!port) {
|
|
22
|
+
// any random number
|
|
23
|
+
port = 8081;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
shouldStartBundler: !skipBundler,
|
|
27
|
+
port
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=resolveBundlerProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/run/resolveBundlerProps.ts"],"sourcesContent":["import { CommandError } from '../utils/errors';\nimport { resolvePortAsync } from '../utils/port';\n\nexport interface BundlerProps {\n port: number;\n shouldStartBundler: boolean;\n}\n\nexport async function resolveBundlerPropsAsync(\n projectRoot: string,\n options: {\n port?: number;\n bundler?: boolean;\n }\n): Promise<BundlerProps> {\n const skipBundler = options.bundler === false;\n\n if (\n // If the user disables the bundler then they should not pass in the port property.\n skipBundler &&\n options.port\n ) {\n throw new CommandError('BAD_ARGS', '--port and --no-bundler are mutually exclusive arguments');\n }\n\n // Resolve the port if the bundler is used.\n let port = skipBundler\n ? null\n : await resolvePortAsync(projectRoot, { reuseExistingPort: true, defaultPort: options.port });\n\n // Skip bundling if the port is null\n options.bundler = !!port;\n if (!port) {\n // any random number\n port = 8081;\n }\n\n return {\n shouldStartBundler: !skipBundler,\n port,\n };\n}\n"],"names":["resolveBundlerPropsAsync","projectRoot","options","skipBundler","bundler","port","CommandError","resolvePortAsync","reuseExistingPort","defaultPort","shouldStartBundler"],"mappings":"AAAA;;;;QAQsBA,wBAAwB,GAAxBA,wBAAwB;AARjB,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACb,IAAA,KAAe,WAAf,eAAe,CAAA;AAOzC,eAAeA,wBAAwB,CAC5CC,WAAmB,EACnBC,OAGC,EACsB;IACvB,MAAMC,WAAW,GAAGD,OAAO,CAACE,OAAO,KAAK,KAAK,AAAC;IAE9C,IACE,mFAAmF;IACnFD,WAAW,IACXD,OAAO,CAACG,IAAI,EACZ;QACA,MAAM,IAAIC,OAAY,aAAA,CAAC,UAAU,EAAE,0DAA0D,CAAC,CAAC;KAChG;IAED,2CAA2C;IAC3C,IAAID,IAAI,GAAGF,WAAW,GAClB,IAAI,GACJ,MAAMI,CAAAA,GAAAA,KAAgB,AAAqE,CAAA,iBAArE,CAACN,WAAW,EAAE;QAAEO,iBAAiB,EAAE,IAAI;QAAEC,WAAW,EAAEP,OAAO,CAACG,IAAI;KAAE,CAAC,AAAC;IAEhG,oCAAoC;IACpCH,OAAO,CAACE,OAAO,GAAG,CAAC,CAACC,IAAI,CAAC;IACzB,IAAI,CAACA,IAAI,EAAE;QACT,oBAAoB;QACpBA,IAAI,GAAG,IAAI,CAAC;KACb;IAED,OAAO;QACLK,kBAAkB,EAAE,CAACP,WAAW;QAChCE,IAAI;KACL,CAAC;CACH"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.startBundlerAsync = startBundlerAsync;
|
|
6
|
+
var _config = require("@expo/config");
|
|
7
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
+
var Log = _interopRequireWildcard(require("../log"));
|
|
9
|
+
var _startInterface = require("../start/interface/startInterface");
|
|
10
|
+
var _devServerManager = require("../start/server/DevServerManager");
|
|
11
|
+
var _env = require("../utils/env");
|
|
12
|
+
function _interopRequireDefault(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : {
|
|
14
|
+
default: obj
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function _interopRequireWildcard(obj) {
|
|
18
|
+
if (obj && obj.__esModule) {
|
|
19
|
+
return obj;
|
|
20
|
+
} else {
|
|
21
|
+
var newObj = {};
|
|
22
|
+
if (obj != null) {
|
|
23
|
+
for(var key in obj){
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
25
|
+
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
|
26
|
+
if (desc.get || desc.set) {
|
|
27
|
+
Object.defineProperty(newObj, key, desc);
|
|
28
|
+
} else {
|
|
29
|
+
newObj[key] = obj[key];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
newObj.default = obj;
|
|
35
|
+
return newObj;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function startBundlerAsync(projectRoot, { port , headless }) {
|
|
39
|
+
const options = {
|
|
40
|
+
port,
|
|
41
|
+
headless,
|
|
42
|
+
devClient: true,
|
|
43
|
+
location: {}
|
|
44
|
+
};
|
|
45
|
+
const devServerManager = new _devServerManager.DevServerManager(projectRoot, options);
|
|
46
|
+
await devServerManager.startAsync([
|
|
47
|
+
{
|
|
48
|
+
// TODO: Allow swapping this value for another bundler.
|
|
49
|
+
type: "metro",
|
|
50
|
+
options
|
|
51
|
+
},
|
|
52
|
+
]);
|
|
53
|
+
// Present the Terminal UI.
|
|
54
|
+
if (!headless && !_env.env.CI) {
|
|
55
|
+
// Only read the config if we are going to use the results.
|
|
56
|
+
const { exp } = (0, _config).getConfig(projectRoot, {
|
|
57
|
+
// We don't need very many fields here, just use the lightest possible read.
|
|
58
|
+
skipSDKVersionRequirement: true,
|
|
59
|
+
skipPlugins: true
|
|
60
|
+
});
|
|
61
|
+
var _platforms;
|
|
62
|
+
await (0, _startInterface).startInterfaceAsync(devServerManager, {
|
|
63
|
+
platforms: (_platforms = exp.platforms) != null ? _platforms : []
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
var ref;
|
|
67
|
+
// Display the server location in CI...
|
|
68
|
+
const url = (ref = devServerManager.getDefaultDevServer()) == null ? void 0 : ref.getDevServerUrl();
|
|
69
|
+
if (url) {
|
|
70
|
+
Log.log(_chalk.default`Waiting on {underline ${url}}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return devServerManager;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=startBundler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/run/startBundler.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport { startInterfaceAsync } from '../start/interface/startInterface';\nimport { DevServerManager } from '../start/server/DevServerManager';\nimport { env } from '../utils/env';\n\nexport async function startBundlerAsync(\n projectRoot: string,\n {\n port,\n headless,\n }: {\n port: number;\n headless?: boolean;\n }\n): Promise<DevServerManager> {\n const options = {\n port,\n headless,\n devClient: true,\n location: {},\n };\n\n const devServerManager = new DevServerManager(projectRoot, options);\n\n await devServerManager.startAsync([\n {\n // TODO: Allow swapping this value for another bundler.\n type: 'metro',\n options,\n },\n ]);\n\n // Present the Terminal UI.\n if (!headless && !env.CI) {\n // Only read the config if we are going to use the results.\n const { exp } = getConfig(projectRoot, {\n // We don't need very many fields here, just use the lightest possible read.\n skipSDKVersionRequirement: true,\n skipPlugins: true,\n });\n await startInterfaceAsync(devServerManager, {\n platforms: exp.platforms ?? [],\n });\n } else {\n // Display the server location in CI...\n const url = devServerManager.getDefaultDevServer()?.getDevServerUrl();\n if (url) {\n Log.log(chalk`Waiting on {underline ${url}}`);\n }\n }\n return devServerManager;\n}\n"],"names":["startBundlerAsync","Log","projectRoot","port","headless","options","devClient","location","devServerManager","DevServerManager","startAsync","type","env","CI","exp","getConfig","skipSDKVersionRequirement","skipPlugins","startInterfaceAsync","platforms","url","getDefaultDevServer","getDevServerUrl","log","chalk"],"mappings":"AAAA;;;;QAQsBA,iBAAiB,GAAjBA,iBAAiB;AARb,IAAA,OAAc,WAAd,cAAc,CAAA;AACtB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACqB,IAAA,eAAmC,WAAnC,mCAAmC,CAAA;AACtC,IAAA,iBAAkC,WAAlC,kCAAkC,CAAA;AAC/C,IAAA,IAAc,WAAd,cAAc,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3B,eAAeD,iBAAiB,CACrCE,WAAmB,EACnB,EACEC,IAAI,CAAA,EACJC,QAAQ,CAAA,EAIT,EAC0B;IAC3B,MAAMC,OAAO,GAAG;QACdF,IAAI;QACJC,QAAQ;Q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0;
|
|
7
7
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
|
-
var Log = _interopRequireWildcard(require("../log"));
|
|
9
8
|
var _args = require("../utils/args");
|
|
10
9
|
var _errors = require("../utils/errors");
|
|
11
10
|
function _interopRequireDefault(obj) {
|
|
@@ -66,44 +65,35 @@ const expoStart = async (argv)=>{
|
|
|
66
65
|
"-m": "--host"
|
|
67
66
|
}, argv);
|
|
68
67
|
if (args["--help"]) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
--https Start the dev server with https protocol
|
|
99
|
-
--scheme <scheme> Custom URI protocol to use when launching an app
|
|
100
|
-
-p, --port <port> Port to start the dev server on (does not apply to web or tunnel). Default: 19000
|
|
101
|
-
|
|
102
|
-
--dev-client Experimental: Starts the bundler for use with the expo-development-client
|
|
103
|
-
--force-manifest-type <manifest-type> Override auto detection of manifest type
|
|
104
|
-
--private-key-path <path> Path to private key for code signing. Default: "private-key.pem" in the same directory as the certificate specified by the expo-updates configuration in app.json.
|
|
105
|
-
-h, --help output usage information
|
|
106
|
-
`, 0);
|
|
68
|
+
(0, _args).printHelp(`Start a local dev server for the app`, _chalk.default`npx expo start {dim <dir>}`, [
|
|
69
|
+
_chalk.default`<dir> Directory of the Expo project. {dim Default: Current working directory}`,
|
|
70
|
+
`-a, --android Opens your app in Expo Go on a connected Android device`,
|
|
71
|
+
`-i, --ios Opens your app in Expo Go in a currently running iOS simulator on your computer`,
|
|
72
|
+
`-w, --web Opens your app in a web browser`,
|
|
73
|
+
``,
|
|
74
|
+
`-c, --clear Clear the bundler cache`,
|
|
75
|
+
`--max-workers <num> Maximum number of tasks to allow Metro to spawn`,
|
|
76
|
+
`--no-dev Bundle in production mode`,
|
|
77
|
+
`--minify Minify JavaScript`,
|
|
78
|
+
``,
|
|
79
|
+
_chalk.default`-m, --host <mode> Dev server hosting type. {dim Default: lan}`,
|
|
80
|
+
_chalk.default` {bold lan}: Use the local network`,
|
|
81
|
+
_chalk.default` {bold tunnel}: Use any network by tunnel through ngrok`,
|
|
82
|
+
_chalk.default` {bold localhost}: Connect to the dev server over localhost`,
|
|
83
|
+
`--tunnel Same as --host tunnel`,
|
|
84
|
+
`--lan Same as --host lan`,
|
|
85
|
+
`--localhost Same as --host localhost`,
|
|
86
|
+
``,
|
|
87
|
+
`--offline Skip network requests and use anonymous manifest signatures`,
|
|
88
|
+
`--https Start the dev server with https protocol`,
|
|
89
|
+
`--scheme <scheme> Custom URI protocol to use when launching an app`,
|
|
90
|
+
_chalk.default`-p, --port <port> Port to start the dev server on (does not apply to web or tunnel). {dim Default: 19000}`,
|
|
91
|
+
``,
|
|
92
|
+
_chalk.default`--dev-client {yellow Experimental:} Starts the bundler for use with the expo-development-client`,
|
|
93
|
+
`--force-manifest-type <manifest-type> Override auto detection of manifest type`,
|
|
94
|
+
`--private-key-path <path> Path to private key for code signing. Default: "private-key.pem" in the same directory as the certificate specified by the expo-updates configuration in app.json.`,
|
|
95
|
+
`-h, --help Usage info`,
|
|
96
|
+
].join("\n"));
|
|
107
97
|
}
|
|
108
98
|
const projectRoot = (0, _args).getProjectRoot(args);
|
|
109
99
|
const { resolveOptionsAsync } = await Promise.resolve().then(function() {
|