Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@expo/config-plugins

Package Overview
Dependencies
Maintainers
24
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/config-plugins - npm Package Compare versions

Comparing version 7.7.0 to 7.8.0

38

build/ios/BundleIdentifier.js

@@ -70,5 +70,5 @@ "use strict";

}
function _withDangerousMod() {
const data = require("../plugins/withDangerousMod");
_withDangerousMod = function () {
function _iosPlugins() {
const data = require("../plugins/ios-plugins");
_iosPlugins = function () {
return data;

@@ -82,9 +82,10 @@ };

}) => {
return (0, _withDangerousMod().withDangerousMod)(config, ['ios', async config => {
return (0, _iosPlugins().withXcodeProject)(config, async config => {
var _config$ios;
const bundleId = bundleIdentifier !== null && bundleIdentifier !== void 0 ? bundleIdentifier : (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.bundleIdentifier;
(0, _assert().default)(bundleId, '`bundleIdentifier` must be defined in the app config (`expo.ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.');
await setBundleIdentifierForPbxproj(config.modRequest.projectRoot, bundleId);
// Should never happen.
(0, _assert().default)(bundleId, '`bundleIdentifier` must be defined in the app config (`ios.bundleIdentifier`) or passed to the plugin `withBundleIdentifier`.');
config.modResults = updateBundleIdentifierForPbxprojObject(config.modResults, bundleId, false);
return config;
}]);
});
};

@@ -152,11 +153,3 @@ exports.withBundleIdentifier = withBundleIdentifier;

const bundleIdentifier = (0, _string().trimQuotes)(bundleIdentifierRaw);
// it's possible to use interpolation for the bundle identifier
// the most common case is when the last part of the id is set to `$(PRODUCT_NAME:rfc1034identifier)`
// in this case, PRODUCT_NAME should be replaced with its value
// the `rfc1034identifier` modifier replaces all non-alphanumeric characters with dashes
const bundleIdentifierParts = bundleIdentifier.split('.');
if (bundleIdentifierParts[bundleIdentifierParts.length - 1] === '$(PRODUCT_NAME:rfc1034identifier)' && xcBuildConfiguration.buildSettings.PRODUCT_NAME) {
bundleIdentifierParts[bundleIdentifierParts.length - 1] = xcBuildConfiguration.buildSettings.PRODUCT_NAME.replace(/[^a-zA-Z0-9]/g, '-');
}
return bundleIdentifierParts.join('.');
return (0, _Xcodeproj().resolveXcodeBuildSetting)(bundleIdentifier, setting => xcBuildConfiguration.buildSettings[setting]);
} else {

@@ -177,2 +170,13 @@ return null;

project.parseSync();
_fs().default.writeFileSync(pbxprojPath, updateBundleIdentifierForPbxprojObject(project, bundleIdentifier, updateProductName).writeSync());
}
/**
* Updates the bundle identifier for a given pbxproj
*
* @param {string} project pbxproj file
* @param {string} bundleIdentifier Bundle identifier to set in the pbxproj
* @param {boolean} [updateProductName=true] Whether to update PRODUCT_NAME
*/
function updateBundleIdentifierForPbxprojObject(project, bundleIdentifier, updateProductName = true) {
const [, nativeTarget] = (0, _Target().findFirstNativeTarget)(project);

@@ -191,3 +195,3 @@ (0, _Xcodeproj().getBuildConfigurationsForListId)(project, nativeTarget.buildConfigurationList).forEach(([, item]) => {

});
_fs().default.writeFileSync(pbxprojPath, project.writeSync());
return project;
}

@@ -194,0 +198,0 @@

@@ -0,1 +1,7 @@

/**
* Copyright © 2023-present 650 Industries, Inc. (aka Expo)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { ExpoConfig } from '@expo/config-types';

@@ -87,1 +93,2 @@ import xcode, { PBXFile, PBXGroup, PBXNativeTarget, PBXProject, XCBuildConfiguration, XCConfigurationList, XcodeProject } from 'xcode';

export declare function unquote(value: string): string;
export declare function resolveXcodeBuildSetting(value: string, lookup: (buildSetting: string) => string | undefined): string;

@@ -24,2 +24,3 @@ "use strict";

exports.resolvePathOrProject = resolvePathOrProject;
exports.resolveXcodeBuildSetting = resolveXcodeBuildSetting;
exports.sanitizedName = sanitizedName;

@@ -86,2 +87,9 @@ exports.unquote = unquote;

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright © 2023-present 650 Industries, Inc. (aka Expo)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
function getProjectName(projectRoot) {

@@ -403,2 +411,83 @@ const sourceRoot = Paths().getSourceRoot(projectRoot);

}
function resolveXcodeBuildSetting(value, lookup) {
const parsedValue = value === null || value === void 0 ? void 0 : value.replace(/\$\(([^()]*|\([^)]*\))\)/g, match => {
var _resolved5;
// Remove the `$(` and `)`, then split modifier(s) from the variable name.
const [variable, ...transformations] = match.slice(2, -1).split(':');
// Resolve the variable recursively.
let lookedUp = lookup(variable);
if (lookedUp) {
lookedUp = resolveXcodeBuildSetting(lookedUp, lookup);
}
let resolved = lookedUp;
// Ref: http://codeworkshop.net/posts/xcode-build-setting-transformations
transformations.forEach(modifier => {
var _resolved, _resolved2, _resolved3, _resolved4, _modifier$match;
switch (modifier) {
case 'lower':
// A lowercase representation.
resolved = (_resolved = resolved) === null || _resolved === void 0 ? void 0 : _resolved.toLowerCase();
break;
case 'upper':
// An uppercase representation.
resolved = (_resolved2 = resolved) === null || _resolved2 === void 0 ? void 0 : _resolved2.toUpperCase();
break;
case 'suffix':
if (resolved) {
// The extension of a path including the '.' divider.
resolved = _path().default.extname(resolved);
}
break;
case 'file':
if (resolved) {
// The file portion of a path.
resolved = _path().default.basename(resolved);
}
break;
case 'dir':
if (resolved) {
// The directory portion of a path.
resolved = _path().default.dirname(resolved);
}
break;
case 'base':
if (resolved) {
// The base name of a path - the last path component with any extension removed.
const b = _path().default.basename(resolved);
const extensionIndex = b.lastIndexOf('.');
resolved = extensionIndex === -1 ? b : b.slice(0, extensionIndex);
}
break;
case 'rfc1034identifier':
// A representation suitable for use in a DNS name.
// TODO: Check the spec if there is one, this is just what we had before.
resolved = (_resolved3 = resolved) === null || _resolved3 === void 0 ? void 0 : _resolved3.replace(/[^a-zA-Z0-9]/g, '-');
// resolved = resolved.replace(/[\/\*\s]/g, '-');
break;
case 'c99extidentifier':
// Like identifier, but with support for extended characters allowed by C99. Added in Xcode 6.
// TODO: Check the spec if there is one.
resolved = (_resolved4 = resolved) === null || _resolved4 === void 0 ? void 0 : _resolved4.replace(/[-\s]/g, '_');
break;
case 'standardizepath':
if (resolved) {
// The equivalent of calling stringByStandardizingPath on the string.
// https://developer.apple.com/documentation/foundation/nsstring/1407194-standardizingpath
resolved = _path().default.resolve(resolved);
}
break;
default:
resolved || (resolved = (_modifier$match = modifier.match(/default=(.*)/)) === null || _modifier$match === void 0 ? void 0 : _modifier$match[1]);
break;
}
});
return resolveXcodeBuildSetting((_resolved5 = resolved) !== null && _resolved5 !== void 0 ? _resolved5 : '', lookup);
});
if (parsedValue !== value) {
return resolveXcodeBuildSetting(parsedValue, lookup);
}
return value;
}
//# sourceMappingURL=Xcodeproj.js.map

@@ -7,9 +7,6 @@ "use strict";

exports.UnexpectedError = exports.PluginError = void 0;
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
class UnexpectedError extends Error {
name = 'UnexpectedError';
constructor(message) {
super(`${message}\nPlease report this as an issue on https://github.com/expo/expo-cli/issues`);
_defineProperty(this, "name", 'UnexpectedError');
}

@@ -22,2 +19,4 @@ }

class PluginError extends Error {
name = 'PluginError';
isPluginError = true;
constructor(message, code, cause) {

@@ -27,4 +26,2 @@ super(cause ? `${message}\n└─ Cause: ${cause.name}: ${cause.message}` : message);

this.cause = cause;
_defineProperty(this, "name", 'PluginError');
_defineProperty(this, "isPluginError", true);
}

@@ -31,0 +28,0 @@ }

{
"name": "@expo/config-plugins",
"version": "7.7.0",
"version": "7.8.0",
"description": "A library for Expo config plugins",
"main": "build/index.js",
"scripts": {
"watch": "tsc --watch --preserveWatchOutput",
"build": "tsc --emitDeclarationOnly && babel src --out-dir build --extensions \".ts\" --source-maps --ignore \"src/**/__mocks__/*\",\"src/**/__tests__/*\",\"src/**/__integration_tests__/*\"",
"prepare": "yarn run clean && yarn build",
"clean": "rimraf build ./tsconfig.tsbuildinfo",
"lint": "eslint .",
"test": "jest"
"clean": "expo-module clean",
"lint": "expo-module lint",
"prepare": "expo-module clean && yarn run build",
"prepublishOnly": "expo-module prepublishOnly",
"test": "expo-module test",
"typecheck": "expo-module typecheck"
},

@@ -36,5 +37,5 @@ "repository": {

"@expo/config-types": "^50.0.0-alpha.1",
"@expo/fingerprint": "^0.4.0",
"@expo/json-file": "~8.2.37",
"@expo/plist": "^0.0.20",
"@expo/fingerprint": "^0.6.0",
"@expo/json-file": "~8.3.0",
"@expo/plist": "^0.1.0",
"@expo/sdk-runtime-versions": "^1.0.0",

@@ -56,3 +57,4 @@ "@react-native/normalize-color": "^2.0.0",

"@types/find-up": "^4.0.0",
"@types/xml2js": "~0.4.11"
"@types/xml2js": "~0.4.11",
"expo-module-scripts": "^3.3.0"
},

@@ -62,3 +64,3 @@ "publishConfig": {

},
"gitHead": "3142a086578deffd8704a8f1b6f0f661527d836c"
"gitHead": "2763e9cc6f2317b40da73382fe2595f8deebff46"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc