update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
61
electron/node_modules/@capacitor/cli/dist/util/spm.js
generated
vendored
61
electron/node_modules/@capacitor/cli/dist/util/spm.js
generated
vendored
|
|
@ -45,12 +45,12 @@ exports.generatePackageFile = generatePackageFile;
|
|||
async function checkPluginsForPackageSwift(config, plugins) {
|
||||
const iOSCapacitorPlugins = plugins.filter((p) => (0, plugin_1.getPluginType)(p, 'ios') === 0 /* PluginType.Core */);
|
||||
const packageSwiftPluginList = await pluginsWithPackageSwift(iOSCapacitorPlugins);
|
||||
if (plugins.length == packageSwiftPluginList.length) {
|
||||
log_1.logger.debug(`Found ${plugins.length} iOS plugins, ${packageSwiftPluginList.length} have a Package.swift file`);
|
||||
log_1.logger.info('All plugins have a Package.swift file and will be included in Package.swift');
|
||||
if (iOSCapacitorPlugins.length == packageSwiftPluginList.length) {
|
||||
log_1.logger.debug(`Found ${iOSCapacitorPlugins.length} Capacitor iOS plugins, ${packageSwiftPluginList.length} have a Package.swift file`);
|
||||
log_1.logger.info('All Capacitor plugins have a Package.swift file and will be included in Package.swift');
|
||||
}
|
||||
else {
|
||||
log_1.logger.warn('Some installed packages are not compatable with SPM');
|
||||
log_1.logger.warn('Some installed Capacitor plugins are not compatible with SPM');
|
||||
}
|
||||
return packageSwiftPluginList;
|
||||
}
|
||||
|
|
@ -84,11 +84,12 @@ async function removeCocoapodsFiles(config) {
|
|||
}
|
||||
exports.removeCocoapodsFiles = removeCocoapodsFiles;
|
||||
async function generatePackageText(config, plugins) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
||||
const iosPlatformVersion = await (0, common_1.getCapacitorPackageVersion)(config, config.ios.name);
|
||||
const iosVersion = (0, common_2.getMajoriOSVersion)(config);
|
||||
const packageTraits = (_d = (_c = (_b = (_a = config.app.extConfig.experimental) === null || _a === void 0 ? void 0 : _a.ios) === null || _b === void 0 ? void 0 : _b.spm) === null || _c === void 0 ? void 0 : _c.packageTraits) !== null && _d !== void 0 ? _d : {};
|
||||
const swiftToolsVersion = (_h = (_g = (_f = (_e = config.app.extConfig.experimental) === null || _e === void 0 ? void 0 : _e.ios) === null || _f === void 0 ? void 0 : _f.spm) === null || _g === void 0 ? void 0 : _g.swiftToolsVersion) !== null && _h !== void 0 ? _h : '5.9';
|
||||
const packageOptions = (_h = (_g = (_f = (_e = config.app.extConfig.experimental) === null || _e === void 0 ? void 0 : _e.ios) === null || _f === void 0 ? void 0 : _f.spm) === null || _g === void 0 ? void 0 : _g.packageOptions) !== null && _h !== void 0 ? _h : {};
|
||||
const swiftToolsVersion = (_m = (_l = (_k = (_j = config.app.extConfig.experimental) === null || _j === void 0 ? void 0 : _j.ios) === null || _k === void 0 ? void 0 : _k.spm) === null || _l === void 0 ? void 0 : _l.swiftToolsVersion) !== null && _m !== void 0 ? _m : '5.9';
|
||||
let packageSwiftText = `// swift-tools-version: ${swiftToolsVersion}
|
||||
import PackageDescription
|
||||
|
||||
|
|
@ -105,10 +106,28 @@ let package = Package(
|
|||
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "${iosPlatformVersion}")`;
|
||||
for (const plugin of plugins) {
|
||||
if ((0, plugin_1.getPluginType)(plugin, config.ios.name) === 1 /* PluginType.Cordova */) {
|
||||
packageSwiftText += `,\n .package(name: "${plugin.name}", path: "../../capacitor-cordova-ios-plugins/sources/${plugin.name}")`;
|
||||
const platformTag = (0, plugin_1.getPluginPlatform)(plugin, config.ios.name);
|
||||
if ((_o = platformTag.$) === null || _o === void 0 ? void 0 : _o.package) {
|
||||
const relPath = (0, path_1.relative)(config.ios.nativeXcodeProjDirAbs, plugin.rootPath);
|
||||
packageSwiftText += `,\n .package(name: "${plugin.id}", path: "${relPath}")`;
|
||||
}
|
||||
else {
|
||||
const sourceFiles = (0, plugin_1.getPlatformElement)(plugin, config.ios.name, 'source-file');
|
||||
const headerFiles = (0, plugin_1.getPlatformElement)(plugin, config.ios.name, 'header-file');
|
||||
if (sourceFiles.length === 0 && headerFiles.length === 0) {
|
||||
continue;
|
||||
}
|
||||
packageSwiftText += `,\n .package(name: "${plugin.name}", path: "../../capacitor-cordova-ios-plugins/sources/${plugin.name}")`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const relPath = (0, path_1.relative)(config.ios.nativeXcodeProjDirAbs, plugin.rootPath);
|
||||
const options = packageOptions[plugin.id];
|
||||
const symlink = options === null || options === void 0 ? void 0 : options.symlink;
|
||||
const symlinkFolder = (0, path_1.join)('symlinks', plugin.name);
|
||||
const relPath = symlink ? symlinkFolder : (0, path_1.relative)(config.ios.nativeXcodeProjDirAbs, plugin.rootPath);
|
||||
if (symlink) {
|
||||
await (0, fs_extra_1.ensureSymlink)(plugin.rootPath, (0, path_1.resolve)(config.ios.nativeProjectDirAbs, 'CapApp-SPM', symlinkFolder));
|
||||
}
|
||||
const traits = packageTraits[plugin.id];
|
||||
const traitsSuffix = (traits === null || traits === void 0 ? void 0 : traits.length)
|
||||
? `, traits: [${traits
|
||||
|
|
@ -118,7 +137,7 @@ let package = Package(
|
|||
})
|
||||
.join(', ')}]`
|
||||
: '';
|
||||
packageSwiftText += `,\n .package(name: "${(_j = plugin.ios) === null || _j === void 0 ? void 0 : _j.name}", path: "${relPath}"${traitsSuffix})`;
|
||||
packageSwiftText += `,\n .package(name: "${(_p = plugin.ios) === null || _p === void 0 ? void 0 : _p.name}", path: "${relPath}"${traitsSuffix})`;
|
||||
}
|
||||
}
|
||||
packageSwiftText += `
|
||||
|
|
@ -130,7 +149,29 @@ let package = Package(
|
|||
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
||||
.product(name: "Cordova", package: "capacitor-swift-pm")`;
|
||||
for (const plugin of plugins) {
|
||||
packageSwiftText += `,\n .product(name: "${(_k = plugin.ios) === null || _k === void 0 ? void 0 : _k.name}", package: "${(_l = plugin.ios) === null || _l === void 0 ? void 0 : _l.name}")`;
|
||||
const aliases = Object.entries((_r = (_q = packageOptions[plugin.id]) === null || _q === void 0 ? void 0 : _q.moduleAliases) !== null && _r !== void 0 ? _r : {});
|
||||
const aliasText = (aliases === null || aliases === void 0 ? void 0 : aliases.length)
|
||||
? `, moduleAliases: [${aliases
|
||||
.map(([target, replacement]) => {
|
||||
return `"${target}": "${replacement}"`;
|
||||
})
|
||||
.join(', ')}]`
|
||||
: '';
|
||||
let pluginText = `,\n .product(name: "${(_s = plugin.ios) === null || _s === void 0 ? void 0 : _s.name}", package: "${(_t = plugin.ios) === null || _t === void 0 ? void 0 : _t.name}"${aliasText})`;
|
||||
if ((0, plugin_1.getPluginType)(plugin, config.ios.name) === 1 /* PluginType.Cordova */) {
|
||||
const platformTag = (0, plugin_1.getPluginPlatform)(plugin, config.ios.name);
|
||||
if ((_u = platformTag.$) === null || _u === void 0 ? void 0 : _u.package) {
|
||||
pluginText = `,\n .product(name: "${plugin.id}", package: "${plugin.id}")`;
|
||||
}
|
||||
else {
|
||||
const sourceFiles = (0, plugin_1.getPlatformElement)(plugin, config.ios.name, 'source-file');
|
||||
const headerFiles = (0, plugin_1.getPlatformElement)(plugin, config.ios.name, 'header-file');
|
||||
if (sourceFiles.length === 0 && headerFiles.length === 0) {
|
||||
pluginText = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
packageSwiftText += pluginText;
|
||||
}
|
||||
packageSwiftText += `
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue