@capacitor/cli 4.7.3 → 5.0.0-alpha.2
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/assets/android-template.tar.gz +0 -0
- package/assets/capacitor-cordova-android-plugins.tar.gz +0 -0
- package/assets/capacitor-cordova-ios-plugins.tar.gz +0 -0
- package/assets/ios-template.tar.gz +0 -0
- package/dist/android/add.js +6 -6
- package/dist/android/build.js +12 -9
- package/dist/android/common.js +27 -29
- package/dist/android/doctor.js +24 -24
- package/dist/android/open.js +3 -3
- package/dist/android/run.js +9 -6
- package/dist/android/update.js +53 -53
- package/dist/common.js +23 -23
- package/dist/config.js +67 -61
- package/dist/cordova.js +75 -75
- package/dist/declarations.d.ts +17 -1
- package/dist/index.js +32 -29
- package/dist/ios/add.js +2 -2
- package/dist/ios/build.js +9 -9
- package/dist/ios/common.js +12 -12
- package/dist/ios/doctor.js +6 -6
- package/dist/ios/open.js +2 -2
- package/dist/ios/run.js +7 -7
- package/dist/ios/update.js +58 -62
- package/dist/ipc.js +6 -6
- package/dist/log.js +2 -2
- package/dist/plugin.js +11 -11
- package/dist/sysconfig.js +6 -6
- package/dist/tasks/add.js +27 -27
- package/dist/tasks/build.js +7 -6
- package/dist/tasks/copy.js +42 -42
- package/dist/tasks/create.js +1 -1
- package/dist/tasks/doctor.js +10 -10
- package/dist/tasks/init.js +30 -27
- package/dist/tasks/list.js +12 -12
- package/dist/tasks/migrate.js +189 -407
- package/dist/tasks/new-plugin.js +1 -1
- package/dist/tasks/open.js +10 -10
- package/dist/tasks/run.js +13 -13
- package/dist/tasks/serve.js +1 -1
- package/dist/tasks/sourcemaps.js +9 -9
- package/dist/tasks/sync.js +15 -15
- package/dist/tasks/telemetry.js +4 -4
- package/dist/tasks/update.js +14 -14
- package/dist/telemetry.js +8 -8
- package/dist/util/cli.js +2 -2
- package/dist/util/fs.js +7 -7
- package/dist/util/native-run.js +3 -3
- package/dist/util/node.js +2 -2
- package/dist/util/subprocess.js +1 -1
- package/dist/util/template.js +1 -1
- package/dist/util/term.js +1 -1
- package/dist/util/xml.js +1 -1
- package/dist/web/copy.js +4 -4
- package/package.json +12 -11
- package/CHANGELOG.md +0 -805
package/dist/ios/build.js
CHANGED
|
@@ -11,9 +11,9 @@ const subprocess_1 = require("../util/subprocess");
|
|
|
11
11
|
async function buildiOS(config, buildOptions) {
|
|
12
12
|
var _a;
|
|
13
13
|
const theScheme = (_a = buildOptions.scheme) !== null && _a !== void 0 ? _a : 'App';
|
|
14
|
-
await common_1.runTask('Building xArchive', async () => subprocess_1.runCommand('xcodebuild', [
|
|
14
|
+
await (0, common_1.runTask)('Building xArchive', async () => (0, subprocess_1.runCommand)('xcodebuild', [
|
|
15
15
|
'-workspace',
|
|
16
|
-
path_1.basename(await config.ios.nativeXcodeWorkspaceDirAbs),
|
|
16
|
+
(0, path_1.basename)(await config.ios.nativeXcodeWorkspaceDirAbs),
|
|
17
17
|
'-scheme',
|
|
18
18
|
`${theScheme}`,
|
|
19
19
|
'-destination',
|
|
@@ -32,9 +32,9 @@ async function buildiOS(config, buildOptions) {
|
|
|
32
32
|
<string>app-store</string>
|
|
33
33
|
</dict>
|
|
34
34
|
</plist>`;
|
|
35
|
-
const archivePlistPath = path_1.join(`${config.ios.nativeProjectDirAbs}`, 'archive.plist');
|
|
36
|
-
utils_fs_1.writeFileSync(archivePlistPath, archivePlistContents);
|
|
37
|
-
await common_1.runTask('Building IPA', async () => subprocess_1.runCommand('xcodebuild', [
|
|
35
|
+
const archivePlistPath = (0, path_1.join)(`${config.ios.nativeProjectDirAbs}`, 'archive.plist');
|
|
36
|
+
(0, utils_fs_1.writeFileSync)(archivePlistPath, archivePlistContents);
|
|
37
|
+
await (0, common_1.runTask)('Building IPA', async () => (0, subprocess_1.runCommand)('xcodebuild', [
|
|
38
38
|
'archive',
|
|
39
39
|
'-archivePath',
|
|
40
40
|
`${theScheme}.xcarchive`,
|
|
@@ -47,10 +47,10 @@ async function buildiOS(config, buildOptions) {
|
|
|
47
47
|
], {
|
|
48
48
|
cwd: config.ios.nativeProjectDirAbs,
|
|
49
49
|
}));
|
|
50
|
-
await common_1.runTask('Cleaning up', async () => {
|
|
51
|
-
utils_fs_1.unlinkSync(archivePlistPath);
|
|
52
|
-
rimraf_1.default.sync(path_1.join(config.ios.nativeProjectDirAbs, `${theScheme}.xcarchive`));
|
|
50
|
+
await (0, common_1.runTask)('Cleaning up', async () => {
|
|
51
|
+
(0, utils_fs_1.unlinkSync)(archivePlistPath);
|
|
52
|
+
rimraf_1.default.sync((0, path_1.join)(config.ios.nativeProjectDirAbs, `${theScheme}.xcarchive`));
|
|
53
53
|
});
|
|
54
|
-
log_1.logSuccess(`Successfully generated an IPA at: ${path_1.join(config.ios.nativeProjectDirAbs, 'output')}`);
|
|
54
|
+
(0, log_1.logSuccess)(`Successfully generated an IPA at: ${(0, path_1.join)(config.ios.nativeProjectDirAbs, 'output')}`);
|
|
55
55
|
}
|
|
56
56
|
exports.buildiOS = buildiOS;
|
package/dist/ios/common.js
CHANGED
|
@@ -10,11 +10,11 @@ const cordova_1 = require("../cordova");
|
|
|
10
10
|
const plugin_1 = require("../plugin");
|
|
11
11
|
const subprocess_1 = require("../util/subprocess");
|
|
12
12
|
async function checkIOSPackage(config) {
|
|
13
|
-
return common_1.checkCapacitorPlatform(config, 'ios');
|
|
13
|
+
return (0, common_1.checkCapacitorPlatform)(config, 'ios');
|
|
14
14
|
}
|
|
15
15
|
exports.checkIOSPackage = checkIOSPackage;
|
|
16
16
|
async function checkCocoaPods(config) {
|
|
17
|
-
if (!(await subprocess_1.isInstalled(config.ios.podPath)) && config.cli.os === "mac" /* Mac */) {
|
|
17
|
+
if (!(await (0, subprocess_1.isInstalled)(config.ios.podPath)) && config.cli.os === "mac" /* OS.Mac */) {
|
|
18
18
|
return (`CocoaPods is not installed.\n` +
|
|
19
19
|
`See this install guide: ${colors_1.default.strong('https://capacitorjs.com/docs/getting-started/environment-setup#homebrew')}`);
|
|
20
20
|
}
|
|
@@ -32,19 +32,19 @@ async function resolvePlugin(plugin) {
|
|
|
32
32
|
if ((_a = plugin.manifest) === null || _a === void 0 ? void 0 : _a.ios) {
|
|
33
33
|
plugin.ios = {
|
|
34
34
|
name: plugin.name,
|
|
35
|
-
type: 0 /* Core */,
|
|
35
|
+
type: 0 /* PluginType.Core */,
|
|
36
36
|
path: (_b = plugin.manifest.ios.src) !== null && _b !== void 0 ? _b : platform,
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
else if (plugin.xml) {
|
|
40
40
|
plugin.ios = {
|
|
41
41
|
name: plugin.name,
|
|
42
|
-
type: 1 /* Cordova */,
|
|
42
|
+
type: 1 /* PluginType.Cordova */,
|
|
43
43
|
path: 'src/' + platform,
|
|
44
44
|
};
|
|
45
|
-
if (cordova_1.getIncompatibleCordovaPlugins(platform).includes(plugin.id) ||
|
|
46
|
-
!plugin_1.getPluginPlatform(plugin, platform)) {
|
|
47
|
-
plugin.ios.type = 2 /* Incompatible */;
|
|
45
|
+
if ((0, cordova_1.getIncompatibleCordovaPlugins)(platform).includes(plugin.id) ||
|
|
46
|
+
!(0, plugin_1.getPluginPlatform)(plugin, platform)) {
|
|
47
|
+
plugin.ios.type = 2 /* PluginType.Incompatible */;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
@@ -63,12 +63,12 @@ async function editProjectSettingsIOS(config) {
|
|
|
63
63
|
.replace(/</g, '<')
|
|
64
64
|
.replace(/>/g, '>');
|
|
65
65
|
const pbxPath = `${config.ios.nativeXcodeProjDirAbs}/project.pbxproj`;
|
|
66
|
-
const plistPath = path_1.resolve(config.ios.nativeTargetDirAbs, 'Info.plist');
|
|
67
|
-
let plistContent = await utils_fs_1.readFile(plistPath, { encoding: 'utf-8' });
|
|
66
|
+
const plistPath = (0, path_1.resolve)(config.ios.nativeTargetDirAbs, 'Info.plist');
|
|
67
|
+
let plistContent = await (0, utils_fs_1.readFile)(plistPath, { encoding: 'utf-8' });
|
|
68
68
|
plistContent = plistContent.replace(/<key>CFBundleDisplayName<\/key>[\s\S]?\s+<string>([^<]*)<\/string>/, `<key>CFBundleDisplayName</key>\n <string>${appName}</string>`);
|
|
69
|
-
let pbxContent = await utils_fs_1.readFile(pbxPath, { encoding: 'utf-8' });
|
|
69
|
+
let pbxContent = await (0, utils_fs_1.readFile)(pbxPath, { encoding: 'utf-8' });
|
|
70
70
|
pbxContent = pbxContent.replace(/PRODUCT_BUNDLE_IDENTIFIER = ([^;]+)/g, `PRODUCT_BUNDLE_IDENTIFIER = ${appId}`);
|
|
71
|
-
await utils_fs_1.writeFile(plistPath, plistContent, { encoding: 'utf-8' });
|
|
72
|
-
await utils_fs_1.writeFile(pbxPath, pbxContent, { encoding: 'utf-8' });
|
|
71
|
+
await (0, utils_fs_1.writeFile)(plistPath, plistContent, { encoding: 'utf-8' });
|
|
72
|
+
await (0, utils_fs_1.writeFile)(pbxPath, pbxContent, { encoding: 'utf-8' });
|
|
73
73
|
}
|
|
74
74
|
exports.editProjectSettingsIOS = editProjectSettingsIOS;
|
package/dist/ios/doctor.js
CHANGED
|
@@ -20,20 +20,20 @@ async function doctorIOS(config) {
|
|
|
20
20
|
// check online datebase of common errors
|
|
21
21
|
// check if www folder is empty (index.html does not exist)
|
|
22
22
|
try {
|
|
23
|
-
await common_1.check([
|
|
24
|
-
() => common_2.checkCocoaPods(config),
|
|
25
|
-
() => common_1.checkWebDir(config),
|
|
23
|
+
await (0, common_1.check)([
|
|
24
|
+
() => (0, common_2.checkCocoaPods)(config),
|
|
25
|
+
() => (0, common_1.checkWebDir)(config),
|
|
26
26
|
checkXcode,
|
|
27
27
|
]);
|
|
28
|
-
log_1.logSuccess('iOS looking great! 👌');
|
|
28
|
+
(0, log_1.logSuccess)('iOS looking great! 👌');
|
|
29
29
|
}
|
|
30
30
|
catch (e) {
|
|
31
|
-
errors_1.fatal((_a = e.stack) !== null && _a !== void 0 ? _a : e);
|
|
31
|
+
(0, errors_1.fatal)((_a = e.stack) !== null && _a !== void 0 ? _a : e);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
exports.doctorIOS = doctorIOS;
|
|
35
35
|
async function checkXcode() {
|
|
36
|
-
if (!(await subprocess_1.isInstalled('xcodebuild'))) {
|
|
36
|
+
if (!(await (0, subprocess_1.isInstalled)('xcodebuild'))) {
|
|
37
37
|
return `Xcode is not installed`;
|
|
38
38
|
}
|
|
39
39
|
// const matches = output.match(/^Xcode (.*)/);
|
package/dist/ios/open.js
CHANGED
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const open_1 = tslib_1.__importDefault(require("open"));
|
|
6
6
|
const common_1 = require("../common");
|
|
7
7
|
async function openIOS(config) {
|
|
8
|
-
await open_1.default(await config.ios.nativeXcodeWorkspaceDirAbs, { wait: false });
|
|
9
|
-
await common_1.wait(3000);
|
|
8
|
+
await (0, open_1.default)(await config.ios.nativeXcodeWorkspaceDirAbs, { wait: false });
|
|
9
|
+
await (0, common_1.wait)(3000);
|
|
10
10
|
}
|
|
11
11
|
exports.openIOS = openIOS;
|
package/dist/ios/run.js
CHANGED
|
@@ -8,14 +8,14 @@ const colors_1 = tslib_1.__importDefault(require("../colors"));
|
|
|
8
8
|
const common_1 = require("../common");
|
|
9
9
|
const native_run_1 = require("../util/native-run");
|
|
10
10
|
const subprocess_1 = require("../util/subprocess");
|
|
11
|
-
const debug = debug_1.default('capacitor:ios:run');
|
|
11
|
+
const debug = (0, debug_1.default)('capacitor:ios:run');
|
|
12
12
|
async function runIOS(config, { target: selectedTarget, scheme: selectedScheme }) {
|
|
13
|
-
const target = await common_1.promptForPlatformTarget(await native_run_1.getPlatformTargets('ios'), selectedTarget);
|
|
13
|
+
const target = await (0, common_1.promptForPlatformTarget)(await (0, native_run_1.getPlatformTargets)('ios'), selectedTarget);
|
|
14
14
|
const runScheme = selectedScheme || config.ios.scheme;
|
|
15
|
-
const derivedDataPath = path_1.resolve(config.ios.platformDirAbs, 'DerivedData', target.id);
|
|
15
|
+
const derivedDataPath = (0, path_1.resolve)(config.ios.platformDirAbs, 'DerivedData', target.id);
|
|
16
16
|
const xcodebuildArgs = [
|
|
17
17
|
'-workspace',
|
|
18
|
-
path_1.basename(await config.ios.nativeXcodeWorkspaceDirAbs),
|
|
18
|
+
(0, path_1.basename)(await config.ios.nativeXcodeWorkspaceDirAbs),
|
|
19
19
|
'-scheme',
|
|
20
20
|
runScheme,
|
|
21
21
|
'-configuration',
|
|
@@ -26,13 +26,13 @@ async function runIOS(config, { target: selectedTarget, scheme: selectedScheme }
|
|
|
26
26
|
derivedDataPath,
|
|
27
27
|
];
|
|
28
28
|
debug('Invoking xcodebuild with args: %O', xcodebuildArgs);
|
|
29
|
-
await common_1.runTask('Running xcodebuild', async () => subprocess_1.runCommand('xcrun', ['xcodebuild', ...xcodebuildArgs], {
|
|
29
|
+
await (0, common_1.runTask)('Running xcodebuild', async () => (0, subprocess_1.runCommand)('xcrun', ['xcodebuild', ...xcodebuildArgs], {
|
|
30
30
|
cwd: config.ios.nativeProjectDirAbs,
|
|
31
31
|
}));
|
|
32
32
|
const appName = `${runScheme}.app`;
|
|
33
|
-
const appPath = path_1.resolve(derivedDataPath, 'Build/Products', target.virtual ? 'Debug-iphonesimulator' : 'Debug-iphoneos', appName);
|
|
33
|
+
const appPath = (0, path_1.resolve)(derivedDataPath, 'Build/Products', target.virtual ? 'Debug-iphonesimulator' : 'Debug-iphoneos', appName);
|
|
34
34
|
const nativeRunArgs = ['ios', '--app', appPath, '--target', target.id];
|
|
35
35
|
debug('Invoking native-run with args: %O', nativeRunArgs);
|
|
36
|
-
await common_1.runTask(`Deploying ${colors_1.default.strong(appName)} to ${colors_1.default.input(target.id)}`, async () => native_run_1.runNativeRun(nativeRunArgs));
|
|
36
|
+
await (0, common_1.runTask)(`Deploying ${colors_1.default.strong(appName)} to ${colors_1.default.input(target.id)}`, async () => (0, native_run_1.runNativeRun)(nativeRunArgs));
|
|
37
37
|
}
|
|
38
38
|
exports.runIOS = runIOS;
|
package/dist/ios/update.js
CHANGED
|
@@ -19,52 +19,48 @@ const common_2 = require("./common");
|
|
|
19
19
|
const platform = 'ios';
|
|
20
20
|
async function updateIOS(config, deployment) {
|
|
21
21
|
const plugins = await getPluginsTask(config);
|
|
22
|
-
const capacitorPlugins = plugins.filter(p => plugin_1.getPluginType(p, platform) === 0 /* Core */);
|
|
23
|
-
plugin_1.printPlugins(capacitorPlugins, 'ios');
|
|
22
|
+
const capacitorPlugins = plugins.filter(p => (0, plugin_1.getPluginType)(p, platform) === 0 /* PluginType.Core */);
|
|
23
|
+
(0, plugin_1.printPlugins)(capacitorPlugins, 'ios');
|
|
24
24
|
await removePluginsNativeFiles(config);
|
|
25
|
-
const cordovaPlugins = plugins.filter(p => plugin_1.getPluginType(p, platform) === 1 /* Cordova */);
|
|
25
|
+
const cordovaPlugins = plugins.filter(p => (0, plugin_1.getPluginType)(p, platform) === 1 /* PluginType.Cordova */);
|
|
26
26
|
if (cordovaPlugins.length > 0) {
|
|
27
27
|
await copyPluginsNativeFiles(config, cordovaPlugins);
|
|
28
28
|
}
|
|
29
|
-
if (!(await utils_fs_1.pathExists(await config.ios.webDirAbs))) {
|
|
30
|
-
await copy_1.copy(config, platform);
|
|
29
|
+
if (!(await (0, utils_fs_1.pathExists)(await config.ios.webDirAbs))) {
|
|
30
|
+
await (0, copy_1.copy)(config, platform);
|
|
31
31
|
}
|
|
32
|
-
await cordova_1.handleCordovaPluginsJS(cordovaPlugins, config, platform);
|
|
33
|
-
await cordova_1.checkPluginDependencies(plugins, platform);
|
|
32
|
+
await (0, cordova_1.handleCordovaPluginsJS)(cordovaPlugins, config, platform);
|
|
33
|
+
await (0, cordova_1.checkPluginDependencies)(plugins, platform);
|
|
34
34
|
await generateCordovaPodspecs(cordovaPlugins, config);
|
|
35
35
|
await installCocoaPodsPlugins(config, plugins, deployment);
|
|
36
|
-
await cordova_1.logCordovaManualSteps(cordovaPlugins, config, platform);
|
|
37
|
-
const incompatibleCordovaPlugins = plugins.filter(p => plugin_1.getPluginType(p, platform) === 2 /* Incompatible */);
|
|
38
|
-
plugin_1.printPlugins(incompatibleCordovaPlugins, platform, 'incompatible');
|
|
39
|
-
await common_1.checkPlatformVersions(config, platform);
|
|
36
|
+
await (0, cordova_1.logCordovaManualSteps)(cordovaPlugins, config, platform);
|
|
37
|
+
const incompatibleCordovaPlugins = plugins.filter(p => (0, plugin_1.getPluginType)(p, platform) === 2 /* PluginType.Incompatible */);
|
|
38
|
+
(0, plugin_1.printPlugins)(incompatibleCordovaPlugins, platform, 'incompatible');
|
|
39
|
+
await (0, common_1.checkPlatformVersions)(config, platform);
|
|
40
40
|
}
|
|
41
41
|
exports.updateIOS = updateIOS;
|
|
42
42
|
async function installCocoaPodsPlugins(config, plugins, deployment) {
|
|
43
|
-
await common_1.runTask(`Updating iOS native dependencies with ${colors_1.default.input(`${config.ios.podPath} install`)}`, () => {
|
|
43
|
+
await (0, common_1.runTask)(`Updating iOS native dependencies with ${colors_1.default.input(`${config.ios.podPath} install`)}`, () => {
|
|
44
44
|
return updatePodfile(config, plugins, deployment);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
exports.installCocoaPodsPlugins = installCocoaPodsPlugins;
|
|
48
48
|
async function updatePodfile(config, plugins, deployment) {
|
|
49
49
|
const dependenciesContent = await generatePodFile(config, plugins);
|
|
50
|
-
const podfilePath = path_1.join(config.ios.nativeProjectDirAbs, 'Podfile');
|
|
51
|
-
|
|
52
|
-
let podfileContent = await utils_fs_1.readFile(podfilePath, { encoding: 'utf-8' });
|
|
50
|
+
const podfilePath = (0, path_1.join)(config.ios.nativeProjectDirAbs, 'Podfile');
|
|
51
|
+
let podfileContent = await (0, utils_fs_1.readFile)(podfilePath, { encoding: 'utf-8' });
|
|
53
52
|
podfileContent = podfileContent.replace(/(def capacitor_pods)[\s\S]+?(\nend)/, `$1${dependenciesContent}$2`);
|
|
54
|
-
await utils_fs_1.writeFile(podfilePath, podfileContent, { encoding: 'utf-8' });
|
|
55
|
-
const podCommandExists = await subprocess_1.isInstalled('pod');
|
|
53
|
+
await (0, utils_fs_1.writeFile)(podfilePath, podfileContent, { encoding: 'utf-8' });
|
|
54
|
+
const podCommandExists = await (0, subprocess_1.isInstalled)('pod');
|
|
56
55
|
if (podCommandExists) {
|
|
57
|
-
|
|
58
|
-
await utils_fs_1.remove(podfileLockPath);
|
|
59
|
-
}
|
|
60
|
-
await subprocess_1.runCommand(config.ios.podPath, ['install', ...(deployment ? ['--deployment'] : [])], { cwd: config.ios.nativeProjectDirAbs });
|
|
56
|
+
await (0, subprocess_1.runCommand)(config.ios.podPath, ['install', ...(deployment ? ['--deployment'] : [])], { cwd: config.ios.nativeProjectDirAbs });
|
|
61
57
|
}
|
|
62
58
|
else {
|
|
63
59
|
log_1.logger.warn('Skipping pod install because CocoaPods is not installed');
|
|
64
60
|
}
|
|
65
|
-
const isXcodebuildAvailable = await subprocess_1.isInstalled('xcodebuild');
|
|
61
|
+
const isXcodebuildAvailable = await (0, subprocess_1.isInstalled)('xcodebuild');
|
|
66
62
|
if (isXcodebuildAvailable) {
|
|
67
|
-
await subprocess_1.runCommand('xcodebuild', ['-project', path_1.basename(`${config.ios.nativeXcodeProjDirAbs}`), 'clean'], {
|
|
63
|
+
await (0, subprocess_1.runCommand)('xcodebuild', ['-project', (0, path_1.basename)(`${config.ios.nativeXcodeProjDirAbs}`), 'clean'], {
|
|
68
64
|
cwd: config.ios.nativeProjectDirAbs,
|
|
69
65
|
});
|
|
70
66
|
}
|
|
@@ -73,23 +69,23 @@ async function updatePodfile(config, plugins, deployment) {
|
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
async function generatePodFile(config, plugins) {
|
|
76
|
-
const capacitoriOSPath = node_1.resolveNode(config.app.rootDir, '@capacitor/ios', 'package.json');
|
|
72
|
+
const capacitoriOSPath = (0, node_1.resolveNode)(config.app.rootDir, '@capacitor/ios', 'package.json');
|
|
77
73
|
if (!capacitoriOSPath) {
|
|
78
|
-
errors_1.fatal(`Unable to find ${colors_1.default.strong('node_modules/@capacitor/ios')}.\n` +
|
|
74
|
+
(0, errors_1.fatal)(`Unable to find ${colors_1.default.strong('node_modules/@capacitor/ios')}.\n` +
|
|
79
75
|
`Are you sure ${colors_1.default.strong('@capacitor/ios')} is installed?`);
|
|
80
76
|
}
|
|
81
77
|
const podfilePath = config.ios.nativeProjectDirAbs;
|
|
82
|
-
const relativeCapacitoriOSPath = fs_1.convertToUnixPath(path_1.relative(podfilePath, await utils_fs_1.realpath(path_1.dirname(capacitoriOSPath))));
|
|
83
|
-
const capacitorPlugins = plugins.filter(p => plugin_1.getPluginType(p, platform) === 0 /* Core */);
|
|
78
|
+
const relativeCapacitoriOSPath = (0, fs_1.convertToUnixPath)((0, path_1.relative)(podfilePath, await (0, utils_fs_1.realpath)((0, path_1.dirname)(capacitoriOSPath))));
|
|
79
|
+
const capacitorPlugins = plugins.filter(p => (0, plugin_1.getPluginType)(p, platform) === 0 /* PluginType.Core */);
|
|
84
80
|
const pods = await Promise.all(capacitorPlugins.map(async (p) => {
|
|
85
81
|
if (!p.ios) {
|
|
86
82
|
return '';
|
|
87
83
|
}
|
|
88
|
-
return ` pod '${p.ios.name}', :path => '${fs_1.convertToUnixPath(path_1.relative(podfilePath, await utils_fs_1.realpath(p.rootPath)))}'\n`;
|
|
84
|
+
return ` pod '${p.ios.name}', :path => '${(0, fs_1.convertToUnixPath)((0, path_1.relative)(podfilePath, await (0, utils_fs_1.realpath)(p.rootPath)))}'\n`;
|
|
89
85
|
}));
|
|
90
|
-
const cordovaPlugins = plugins.filter(p => plugin_1.getPluginType(p, platform) === 1 /* Cordova */);
|
|
86
|
+
const cordovaPlugins = plugins.filter(p => (0, plugin_1.getPluginType)(p, platform) === 1 /* PluginType.Cordova */);
|
|
91
87
|
cordovaPlugins.map(async (p) => {
|
|
92
|
-
const podspecs = plugin_1.getPlatformElement(p, platform, 'podspec');
|
|
88
|
+
const podspecs = (0, plugin_1.getPlatformElement)(p, platform, 'podspec');
|
|
93
89
|
podspecs.map((podspec) => {
|
|
94
90
|
podspec.pods.map((pPods) => {
|
|
95
91
|
pPods.pod.map((pod) => {
|
|
@@ -110,7 +106,7 @@ async function generatePodFile(config, plugins) {
|
|
|
110
106
|
});
|
|
111
107
|
});
|
|
112
108
|
});
|
|
113
|
-
const staticPlugins = cordovaPlugins.filter(p => cordova_1.needsStaticPod(p, config));
|
|
109
|
+
const staticPlugins = cordovaPlugins.filter(p => (0, cordova_1.needsStaticPod)(p, config));
|
|
114
110
|
const noStaticPlugins = cordovaPlugins.filter(el => !staticPlugins.includes(el));
|
|
115
111
|
if (noStaticPlugins.length > 0) {
|
|
116
112
|
pods.push(` pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'\n`);
|
|
@@ -142,7 +138,7 @@ function isFramework(framework) {
|
|
|
142
138
|
return framework.$.src.split('.').pop().includes('framework');
|
|
143
139
|
}
|
|
144
140
|
async function generateCordovaPodspecs(cordovaPlugins, config) {
|
|
145
|
-
const staticPlugins = cordovaPlugins.filter(p => cordova_1.needsStaticPod(p, config));
|
|
141
|
+
const staticPlugins = cordovaPlugins.filter(p => (0, cordova_1.needsStaticPod)(p, config));
|
|
146
142
|
const noStaticPlugins = cordovaPlugins.filter(el => !staticPlugins.includes(el));
|
|
147
143
|
generateCordovaPodspec(noStaticPlugins, config, false);
|
|
148
144
|
generateCordovaPodspec(staticPlugins, config, true);
|
|
@@ -164,7 +160,7 @@ async function generateCordovaPodspec(cordovaPlugins, config, isStatic) {
|
|
|
164
160
|
sourcesFolderName += 'static';
|
|
165
161
|
}
|
|
166
162
|
cordovaPlugins.map((plugin) => {
|
|
167
|
-
const frameworks = plugin_1.getPlatformElement(plugin, platform, 'framework');
|
|
163
|
+
const frameworks = (0, plugin_1.getPlatformElement)(plugin, platform, 'framework');
|
|
168
164
|
frameworks.map((framework) => {
|
|
169
165
|
if (!framework.$.type) {
|
|
170
166
|
const name = getFrameworkName(framework);
|
|
@@ -175,7 +171,7 @@ async function generateCordovaPodspec(cordovaPlugins, config, isStatic) {
|
|
|
175
171
|
}
|
|
176
172
|
}
|
|
177
173
|
else if (framework.$.custom && framework.$.custom === 'true') {
|
|
178
|
-
const frameworktPath = path_1.join(sourcesFolderName, plugin.name, name);
|
|
174
|
+
const frameworktPath = (0, path_1.join)(sourcesFolderName, plugin.name, name);
|
|
179
175
|
if (!customFrameworks.includes(frameworktPath)) {
|
|
180
176
|
customFrameworks.push(frameworktPath);
|
|
181
177
|
}
|
|
@@ -202,8 +198,8 @@ async function generateCordovaPodspec(cordovaPlugins, config, isStatic) {
|
|
|
202
198
|
}
|
|
203
199
|
}
|
|
204
200
|
});
|
|
205
|
-
prefsArray = prefsArray.concat(plugin_1.getAllElements(plugin, platform, 'preference'));
|
|
206
|
-
const podspecs = plugin_1.getPlatformElement(plugin, platform, 'podspec');
|
|
201
|
+
prefsArray = prefsArray.concat((0, plugin_1.getAllElements)(plugin, platform, 'preference'));
|
|
202
|
+
const podspecs = (0, plugin_1.getPlatformElement)(plugin, platform, 'podspec');
|
|
207
203
|
podspecs.map((podspec) => {
|
|
208
204
|
podspec.pods.map((pods) => {
|
|
209
205
|
pods.pod.map((pod) => {
|
|
@@ -217,14 +213,14 @@ async function generateCordovaPodspec(cordovaPlugins, config, isStatic) {
|
|
|
217
213
|
});
|
|
218
214
|
});
|
|
219
215
|
});
|
|
220
|
-
const sourceFiles = plugin_1.getPlatformElement(plugin, platform, 'source-file');
|
|
216
|
+
const sourceFiles = (0, plugin_1.getPlatformElement)(plugin, platform, 'source-file');
|
|
221
217
|
sourceFiles.map((sourceFile) => {
|
|
222
218
|
if (sourceFile.$.framework && sourceFile.$.framework === 'true') {
|
|
223
219
|
let fileName = sourceFile.$.src.split('/').pop();
|
|
224
220
|
if (!fileName.startsWith('lib')) {
|
|
225
221
|
fileName = 'lib' + fileName;
|
|
226
222
|
}
|
|
227
|
-
const frameworktPath = path_1.join(sourcesFolderName, plugin.name, fileName);
|
|
223
|
+
const frameworktPath = (0, path_1.join)(sourcesFolderName, plugin.name, fileName);
|
|
228
224
|
if (!sourceFrameworks.includes(frameworktPath)) {
|
|
229
225
|
sourceFrameworks.push(frameworktPath);
|
|
230
226
|
}
|
|
@@ -282,7 +278,7 @@ async function generateCordovaPodspec(cordovaPlugins, config, isStatic) {
|
|
|
282
278
|
s.swift_version = '5.1'
|
|
283
279
|
${frameworksString}
|
|
284
280
|
end`;
|
|
285
|
-
await utils_fs_1.writeFile(path_1.join(config.ios.cordovaPluginsDirAbs, `${name}.podspec`), content);
|
|
281
|
+
await (0, utils_fs_1.writeFile)((0, path_1.join)(config.ios.cordovaPluginsDirAbs, `${name}.podspec`), content);
|
|
286
282
|
}
|
|
287
283
|
function getLinkerFlags(config) {
|
|
288
284
|
var _a;
|
|
@@ -293,15 +289,15 @@ function getLinkerFlags(config) {
|
|
|
293
289
|
}
|
|
294
290
|
async function copyPluginsNativeFiles(config, cordovaPlugins) {
|
|
295
291
|
for (const p of cordovaPlugins) {
|
|
296
|
-
const sourceFiles = plugin_1.getPlatformElement(p, platform, 'source-file');
|
|
297
|
-
const headerFiles = plugin_1.getPlatformElement(p, platform, 'header-file');
|
|
292
|
+
const sourceFiles = (0, plugin_1.getPlatformElement)(p, platform, 'source-file');
|
|
293
|
+
const headerFiles = (0, plugin_1.getPlatformElement)(p, platform, 'header-file');
|
|
298
294
|
const codeFiles = sourceFiles.concat(headerFiles);
|
|
299
|
-
const frameworks = plugin_1.getPlatformElement(p, platform, 'framework');
|
|
295
|
+
const frameworks = (0, plugin_1.getPlatformElement)(p, platform, 'framework');
|
|
300
296
|
let sourcesFolderName = 'sources';
|
|
301
|
-
if (cordova_1.needsStaticPod(p, config)) {
|
|
297
|
+
if ((0, cordova_1.needsStaticPod)(p, config)) {
|
|
302
298
|
sourcesFolderName += 'static';
|
|
303
299
|
}
|
|
304
|
-
const sourcesFolder = path_1.join(config.ios.cordovaPluginsDirAbs, sourcesFolderName, p.name);
|
|
300
|
+
const sourcesFolder = (0, path_1.join)(config.ios.cordovaPluginsDirAbs, sourcesFolderName, p.name);
|
|
305
301
|
for (const codeFile of codeFiles) {
|
|
306
302
|
let fileName = codeFile.$.src.split('/').pop();
|
|
307
303
|
const fileExt = codeFile.$.src.split('.').pop();
|
|
@@ -313,57 +309,57 @@ async function copyPluginsNativeFiles(config, cordovaPlugins) {
|
|
|
313
309
|
codeFile.$['compiler-flags'] === '-fno-objc-arc') {
|
|
314
310
|
destFolder = 'noarc';
|
|
315
311
|
}
|
|
316
|
-
const filePath = plugin_1.getFilePath(config, p, codeFile.$.src);
|
|
317
|
-
const fileDest = path_1.join(config.ios.cordovaPluginsDirAbs, destFolder, p.name, fileName);
|
|
318
|
-
await utils_fs_1.copy(filePath, fileDest);
|
|
312
|
+
const filePath = (0, plugin_1.getFilePath)(config, p, codeFile.$.src);
|
|
313
|
+
const fileDest = (0, path_1.join)(config.ios.cordovaPluginsDirAbs, destFolder, p.name, fileName);
|
|
314
|
+
await (0, utils_fs_1.copy)(filePath, fileDest);
|
|
319
315
|
if (!codeFile.$.framework) {
|
|
320
|
-
let fileContent = await utils_fs_1.readFile(fileDest, { encoding: 'utf-8' });
|
|
316
|
+
let fileContent = await (0, utils_fs_1.readFile)(fileDest, { encoding: 'utf-8' });
|
|
321
317
|
if (fileExt === 'swift') {
|
|
322
318
|
fileContent = 'import Cordova\n' + fileContent;
|
|
323
|
-
await utils_fs_1.writeFile(fileDest, fileContent, { encoding: 'utf-8' });
|
|
319
|
+
await (0, utils_fs_1.writeFile)(fileDest, fileContent, { encoding: 'utf-8' });
|
|
324
320
|
}
|
|
325
321
|
else {
|
|
326
322
|
if (fileContent.includes('@import Firebase;')) {
|
|
327
323
|
fileContent = fileContent.replace('@import Firebase;', '#import <Firebase/Firebase.h>');
|
|
328
|
-
await utils_fs_1.writeFile(fileDest, fileContent, { encoding: 'utf-8' });
|
|
324
|
+
await (0, utils_fs_1.writeFile)(fileDest, fileContent, { encoding: 'utf-8' });
|
|
329
325
|
}
|
|
330
326
|
if (fileContent.includes('[NSBundle bundleForClass:[self class]]') ||
|
|
331
327
|
fileContent.includes('[NSBundle bundleForClass:[CDVCapture class]]')) {
|
|
332
328
|
fileContent = fileContent.replace('[NSBundle bundleForClass:[self class]]', '[NSBundle mainBundle]');
|
|
333
329
|
fileContent = fileContent.replace('[NSBundle bundleForClass:[CDVCapture class]]', '[NSBundle mainBundle]');
|
|
334
|
-
await utils_fs_1.writeFile(fileDest, fileContent, { encoding: 'utf-8' });
|
|
330
|
+
await (0, utils_fs_1.writeFile)(fileDest, fileContent, { encoding: 'utf-8' });
|
|
335
331
|
}
|
|
336
332
|
if (fileContent.includes('[self.webView superview]') ||
|
|
337
333
|
fileContent.includes('self.webView.superview')) {
|
|
338
334
|
fileContent = fileContent.replace(/\[self.webView superview\]/g, 'self.viewController.view');
|
|
339
335
|
fileContent = fileContent.replace(/self.webView.superview/g, 'self.viewController.view');
|
|
340
|
-
await utils_fs_1.writeFile(fileDest, fileContent, { encoding: 'utf-8' });
|
|
336
|
+
await (0, utils_fs_1.writeFile)(fileDest, fileContent, { encoding: 'utf-8' });
|
|
341
337
|
}
|
|
342
338
|
}
|
|
343
339
|
}
|
|
344
340
|
}
|
|
345
|
-
const resourceFiles = plugin_1.getPlatformElement(p, platform, 'resource-file');
|
|
341
|
+
const resourceFiles = (0, plugin_1.getPlatformElement)(p, platform, 'resource-file');
|
|
346
342
|
for (const resourceFile of resourceFiles) {
|
|
347
343
|
const fileName = resourceFile.$.src.split('/').pop();
|
|
348
|
-
await utils_fs_1.copy(plugin_1.getFilePath(config, p, resourceFile.$.src), path_1.join(config.ios.cordovaPluginsDirAbs, 'resources', fileName));
|
|
344
|
+
await (0, utils_fs_1.copy)((0, plugin_1.getFilePath)(config, p, resourceFile.$.src), (0, path_1.join)(config.ios.cordovaPluginsDirAbs, 'resources', fileName));
|
|
349
345
|
}
|
|
350
346
|
for (const framework of frameworks) {
|
|
351
347
|
if (framework.$.custom && framework.$.custom === 'true') {
|
|
352
|
-
await utils_fs_1.copy(plugin_1.getFilePath(config, p, framework.$.src), path_1.join(sourcesFolder, framework.$.src));
|
|
348
|
+
await (0, utils_fs_1.copy)((0, plugin_1.getFilePath)(config, p, framework.$.src), (0, path_1.join)(sourcesFolder, framework.$.src));
|
|
353
349
|
}
|
|
354
350
|
}
|
|
355
351
|
}
|
|
356
352
|
}
|
|
357
353
|
async function removePluginsNativeFiles(config) {
|
|
358
|
-
await utils_fs_1.remove(config.ios.cordovaPluginsDirAbs);
|
|
359
|
-
await template_1.extractTemplate(config.cli.assets.ios.cordovaPluginsTemplateArchiveAbs, config.ios.cordovaPluginsDirAbs);
|
|
354
|
+
await (0, utils_fs_1.remove)(config.ios.cordovaPluginsDirAbs);
|
|
355
|
+
await (0, template_1.extractTemplate)(config.cli.assets.ios.cordovaPluginsTemplateArchiveAbs, config.ios.cordovaPluginsDirAbs);
|
|
360
356
|
}
|
|
361
357
|
function filterResources(plugin) {
|
|
362
|
-
const resources = plugin_1.getPlatformElement(plugin, platform, 'resource-file');
|
|
358
|
+
const resources = (0, plugin_1.getPlatformElement)(plugin, platform, 'resource-file');
|
|
363
359
|
return resources.length > 0;
|
|
364
360
|
}
|
|
365
361
|
function filterARCFiles(plugin) {
|
|
366
|
-
const sources = plugin_1.getPlatformElement(plugin, platform, 'source-file');
|
|
362
|
+
const sources = (0, plugin_1.getPlatformElement)(plugin, platform, 'source-file');
|
|
367
363
|
const sourcesARC = sources.filter((sourceFile) => sourceFile.$['compiler-flags'] &&
|
|
368
364
|
sourceFile.$['compiler-flags'] === '-fno-objc-arc');
|
|
369
365
|
return sourcesARC.length > 0;
|
|
@@ -373,9 +369,9 @@ function removeNoSystem(library, sourceFrameworks) {
|
|
|
373
369
|
return libraries.length === 0;
|
|
374
370
|
}
|
|
375
371
|
async function getPluginsTask(config) {
|
|
376
|
-
return await common_1.runTask('Updating iOS plugins', async () => {
|
|
377
|
-
const allPlugins = await plugin_1.getPlugins(config, 'ios');
|
|
378
|
-
const iosPlugins = await common_2.getIOSPlugins(allPlugins);
|
|
372
|
+
return await (0, common_1.runTask)('Updating iOS plugins', async () => {
|
|
373
|
+
const allPlugins = await (0, plugin_1.getPlugins)(config, 'ios');
|
|
374
|
+
const iosPlugins = await (0, common_2.getIOSPlugins)(allPlugins);
|
|
379
375
|
return iosPlugins;
|
|
380
376
|
});
|
|
381
377
|
}
|
package/dist/ipc.js
CHANGED
|
@@ -8,17 +8,17 @@ const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
|
8
8
|
const https_1 = require("https");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const cli_1 = require("./util/cli");
|
|
11
|
-
const debug = debug_1.default('capacitor:ipc');
|
|
11
|
+
const debug = (0, debug_1.default)('capacitor:ipc');
|
|
12
12
|
/**
|
|
13
13
|
* Send an IPC message to a forked process.
|
|
14
14
|
*/
|
|
15
15
|
async function send(msg) {
|
|
16
16
|
const dir = cli_1.ENV_PATHS.log;
|
|
17
|
-
await utils_fs_1.mkdirp(dir);
|
|
18
|
-
const logPath = path_1.resolve(dir, 'ipc.log');
|
|
17
|
+
await (0, utils_fs_1.mkdirp)(dir);
|
|
18
|
+
const logPath = (0, path_1.resolve)(dir, 'ipc.log');
|
|
19
19
|
debug('Sending %O IPC message to forked process (logs: %O)', msg.type, logPath);
|
|
20
|
-
const fd = await utils_fs_1.open(logPath, 'a');
|
|
21
|
-
const p = utils_subprocess_1.fork(process.argv[1], ['📡'], { stdio: ['ignore', fd, fd, 'ipc'] });
|
|
20
|
+
const fd = await (0, utils_fs_1.open)(logPath, 'a');
|
|
21
|
+
const p = (0, utils_subprocess_1.fork)(process.argv[1], ['📡'], { stdio: ['ignore', fd, fd, 'ipc'] });
|
|
22
22
|
p.send(msg);
|
|
23
23
|
p.disconnect();
|
|
24
24
|
p.unref();
|
|
@@ -35,7 +35,7 @@ async function receive(msg) {
|
|
|
35
35
|
const now = new Date().toISOString();
|
|
36
36
|
const { data } = msg;
|
|
37
37
|
// This request is only made if telemetry is on.
|
|
38
|
-
const req = https_1.request({
|
|
38
|
+
const req = (0, https_1.request)({
|
|
39
39
|
hostname: 'api.ionicjs.com',
|
|
40
40
|
port: 443,
|
|
41
41
|
path: '/events/metrics',
|
package/dist/log.js
CHANGED
|
@@ -9,10 +9,10 @@ const options = {
|
|
|
9
9
|
colors: colors_1.default,
|
|
10
10
|
stream: process.argv.includes('--json') ? process.stderr : process.stdout,
|
|
11
11
|
};
|
|
12
|
-
exports.output = term_1.isInteractive()
|
|
12
|
+
exports.output = (0, term_1.isInteractive)()
|
|
13
13
|
? new cli_framework_output_1.TTYOutputStrategy(options)
|
|
14
14
|
: new cli_framework_output_1.StreamOutputStrategy(options);
|
|
15
|
-
exports.logger = cli_framework_output_1.createDefaultLogger({
|
|
15
|
+
exports.logger = (0, cli_framework_output_1.createDefaultLogger)({
|
|
16
16
|
output: exports.output,
|
|
17
17
|
formatterOptions: {
|
|
18
18
|
titleize: false,
|
package/dist/plugin.js
CHANGED
|
@@ -29,13 +29,13 @@ async function getPlugins(config, platform) {
|
|
|
29
29
|
exports.getPlugins = getPlugins;
|
|
30
30
|
async function resolvePlugin(config, name) {
|
|
31
31
|
try {
|
|
32
|
-
const packagePath = node_1.resolveNode(config.app.rootDir, name, 'package.json');
|
|
32
|
+
const packagePath = (0, node_1.resolveNode)(config.app.rootDir, name, 'package.json');
|
|
33
33
|
if (!packagePath) {
|
|
34
|
-
errors_1.fatal(`Unable to find ${colors_1.default.strong(`node_modules/${name}`)}.\n` +
|
|
34
|
+
(0, errors_1.fatal)(`Unable to find ${colors_1.default.strong(`node_modules/${name}`)}.\n` +
|
|
35
35
|
`Are you sure ${colors_1.default.strong(name)} is installed?`);
|
|
36
36
|
}
|
|
37
|
-
const rootPath = path_1.dirname(packagePath);
|
|
38
|
-
const meta = await utils_fs_1.readJSON(packagePath);
|
|
37
|
+
const rootPath = (0, path_1.dirname)(packagePath);
|
|
38
|
+
const meta = await (0, utils_fs_1.readJSON)(packagePath);
|
|
39
39
|
if (!meta) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
@@ -49,8 +49,8 @@ async function resolvePlugin(config, name) {
|
|
|
49
49
|
manifest: meta.capacitor,
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
const pluginXMLPath = path_1.join(rootPath, 'plugin.xml');
|
|
53
|
-
const xmlMeta = await xml_1.readXML(pluginXMLPath);
|
|
52
|
+
const pluginXMLPath = (0, path_1.join)(rootPath, 'plugin.xml');
|
|
53
|
+
const xmlMeta = await (0, xml_1.readXML)(pluginXMLPath);
|
|
54
54
|
return {
|
|
55
55
|
id: name,
|
|
56
56
|
name: fixName(name),
|
|
@@ -130,11 +130,11 @@ function getPluginType(p, platform) {
|
|
|
130
130
|
var _a, _b, _c, _d;
|
|
131
131
|
switch (platform) {
|
|
132
132
|
case 'ios':
|
|
133
|
-
return (_b = (_a = p.ios) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : 0 /* Core */;
|
|
133
|
+
return (_b = (_a = p.ios) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : 0 /* PluginType.Core */;
|
|
134
134
|
case 'android':
|
|
135
|
-
return (_d = (_c = p.android) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 0 /* Core */;
|
|
135
|
+
return (_d = (_c = p.android) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 0 /* PluginType.Core */;
|
|
136
136
|
}
|
|
137
|
-
return 0 /* Core */;
|
|
137
|
+
return 0 /* PluginType.Core */;
|
|
138
138
|
}
|
|
139
139
|
exports.getPluginType = getPluginType;
|
|
140
140
|
/**
|
|
@@ -160,13 +160,13 @@ function getFilePath(config, plugin, path) {
|
|
|
160
160
|
...pathSegments.slice(2),
|
|
161
161
|
];
|
|
162
162
|
}
|
|
163
|
-
const filePath = node_1.resolveNode(config.app.rootDir, ...pathSegments);
|
|
163
|
+
const filePath = (0, node_1.resolveNode)(config.app.rootDir, ...pathSegments);
|
|
164
164
|
if (!filePath) {
|
|
165
165
|
throw new Error(`Can't resolve module ${pathSegments[0]}`);
|
|
166
166
|
}
|
|
167
167
|
return filePath;
|
|
168
168
|
}
|
|
169
|
-
return path_1.join(plugin.rootPath, path);
|
|
169
|
+
return (0, path_1.join)(plugin.rootPath, path);
|
|
170
170
|
}
|
|
171
171
|
exports.getFilePath = getFilePath;
|
|
172
172
|
/**
|
package/dist/sysconfig.js
CHANGED
|
@@ -7,20 +7,20 @@ const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const cli_1 = require("./util/cli");
|
|
9
9
|
const uuid_1 = require("./util/uuid");
|
|
10
|
-
const debug = debug_1.default('capacitor:sysconfig');
|
|
10
|
+
const debug = (0, debug_1.default)('capacitor:sysconfig');
|
|
11
11
|
const SYSCONFIG_FILE = 'sysconfig.json';
|
|
12
|
-
const SYSCONFIG_PATH = path_1.resolve(cli_1.ENV_PATHS.config, SYSCONFIG_FILE);
|
|
12
|
+
const SYSCONFIG_PATH = (0, path_1.resolve)(cli_1.ENV_PATHS.config, SYSCONFIG_FILE);
|
|
13
13
|
async function readConfig() {
|
|
14
14
|
debug('Reading from %O', SYSCONFIG_PATH);
|
|
15
15
|
try {
|
|
16
|
-
return await utils_fs_1.readJSON(SYSCONFIG_PATH);
|
|
16
|
+
return await (0, utils_fs_1.readJSON)(SYSCONFIG_PATH);
|
|
17
17
|
}
|
|
18
18
|
catch (e) {
|
|
19
19
|
if (e.code !== 'ENOENT') {
|
|
20
20
|
throw e;
|
|
21
21
|
}
|
|
22
22
|
const sysconfig = {
|
|
23
|
-
machine: uuid_1.uuidv4(),
|
|
23
|
+
machine: (0, uuid_1.uuidv4)(),
|
|
24
24
|
};
|
|
25
25
|
await writeConfig(sysconfig);
|
|
26
26
|
return sysconfig;
|
|
@@ -29,7 +29,7 @@ async function readConfig() {
|
|
|
29
29
|
exports.readConfig = readConfig;
|
|
30
30
|
async function writeConfig(sysconfig) {
|
|
31
31
|
debug('Writing to %O', SYSCONFIG_PATH);
|
|
32
|
-
await utils_fs_1.mkdirp(path_1.dirname(SYSCONFIG_PATH));
|
|
33
|
-
await utils_fs_1.writeJSON(SYSCONFIG_PATH, sysconfig, { spaces: '\t' });
|
|
32
|
+
await (0, utils_fs_1.mkdirp)((0, path_1.dirname)(SYSCONFIG_PATH));
|
|
33
|
+
await (0, utils_fs_1.writeJSON)(SYSCONFIG_PATH, sysconfig, { spaces: '\t' });
|
|
34
34
|
}
|
|
35
35
|
exports.writeConfig = writeConfig;
|