Socket
Socket
Sign inDemoInstall

@expo/config-plugins

Package Overview
Dependencies
Maintainers
24
Versions
154
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.8.3 to 7.8.4

build/plugins/withFinalizedMod.d.ts

1

build/index.d.ts

@@ -22,2 +22,3 @@ /**

export { withDangerousMod } from './plugins/withDangerousMod';
export { withFinalizedMod } from './plugins/withFinalizedMod';
export { withMod, withBaseMod } from './plugins/withMod';

@@ -24,0 +25,0 @@ export { withAppDelegate, withInfoPlist, withEntitlementsPlist, withExpoPlist, withXcodeProject, withPodfileProperties, } from './plugins/ios-plugins';

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

withDangerousMod: true,
withFinalizedMod: true,
withMod: true,

@@ -136,2 +137,8 @@ withBaseMod: true,

});
Object.defineProperty(exports, "withFinalizedMod", {
enumerable: true,
get: function () {
return _withFinalizedMod().withFinalizedMod;
}
});
Object.defineProperty(exports, "withGradleProperties", {

@@ -347,2 +354,9 @@ enumerable: true,

}
function _withFinalizedMod() {
const data = require("./plugins/withFinalizedMod");
_withFinalizedMod = function () {
return data;
};
return data;
}
function _withMod() {

@@ -349,0 +363,0 @@ const data = require("./plugins/withMod");

@@ -89,6 +89,10 @@ import { ExpoConfig } from '@expo/config-types';

/**
* Dangerously make a modification before any other android mods have been run.
* Dangerously make a modification before any other platform mods have been run.
*/
dangerous?: Mod<unknown>;
/**
* Dangerously make a modification after all the other platform mods have been run.
*/
finalized?: Mod<unknown>;
/**
* Modify the `android/app/src/main/AndroidManifest.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).

@@ -140,6 +144,10 @@ */

/**
* Dangerously make a modification before any other android mods have been run.
* Dangerously make a modification before any other platform mods have been run.
*/
dangerous?: Mod<unknown>;
/**
* Dangerously make a modification after all the other platform mods have been run.
*/
finalized?: Mod<unknown>;
/**
* Modify the `ios/<name>/Info.plist` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).

@@ -146,0 +154,0 @@ */

@@ -22,2 +22,3 @@ import { ForwardedBaseModOptions } from './createBaseMod';

}): Promise<ExportedConfig>;
export declare function sortMods(commands: [string, any][], precedences: Record<string, number>): [string, any][];
/**

@@ -24,0 +25,0 @@ * A generic plugin compiler.

50

build/plugins/mod-compiler.js

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

exports.evalModsAsync = evalModsAsync;
exports.sortMods = sortMods;
exports.withDefaultBaseMods = withDefaultBaseMods;

@@ -127,14 +128,14 @@ exports.withIntrospectionBaseMods = withIntrospectionBaseMods;

}
function sortMods(commands, order) {
const allKeys = commands.map(([key]) => key);
const completeOrder = [...new Set([...order, ...allKeys])];
const sorted = [];
while (completeOrder.length) {
const group = completeOrder.shift();
const commandSet = commands.find(([key]) => key === group);
if (commandSet) {
sorted.push(commandSet);
}
}
return sorted;
function sortMods(commands, precedences) {
const seen = new Set();
const dedupedCommands = commands.filter(([key]) => {
const duplicate = seen.has(key);
seen.add(key);
return !duplicate;
});
return dedupedCommands.sort(([keyA], [keyB]) => {
const precedenceA = precedences[keyA] || 0;
const precedenceB = precedences[keyB] || 0;
return precedenceA - precedenceB;
});
}

@@ -149,8 +150,11 @@ function getRawClone({

}
const orders = {
ios: [
// dangerous runs first
'dangerous',
// run the XcodeProject mod second because many plugins attempt to read from it.
'xcodeproj']
const precedences = {
ios: {
// dangerous runs first
dangerous: -2,
// run the XcodeProject mod second because many plugins attempt to read from it.
xcodeproj: -1,
// put the finalized mod at the last
finalized: 1
}
};

@@ -178,5 +182,9 @@ /**

if (entries.length) {
var _orders$platformName;
// Move dangerous item to the first position if it exists, this ensures that all dangerous code runs first.
entries = sortMods(entries, (_orders$platformName = orders[platformName]) !== null && _orders$platformName !== void 0 ? _orders$platformName : ['dangerous']);
var _precedences$platform;
// Move dangerous item to the first position and finalized item to the last position if it exists.
// This ensures that all dangerous code runs first and finalized applies last.
entries = sortMods(entries, (_precedences$platform = precedences[platformName]) !== null && _precedences$platform !== void 0 ? _precedences$platform : {
dangerous: -1,
finalized: 1
});
debug(`run in order: ${entries.map(([name]) => name).join(', ')}`);

@@ -183,0 +191,0 @@ const platformProjectRoot = _path().default.join(projectRoot, platformName);

@@ -8,2 +8,3 @@ import { ForwardedBaseModOptions } from './createBaseMod';

dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
manifest: import("./createBaseMod").BaseModProviderMethods<Manifest.AndroidManifest, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

@@ -27,2 +28,3 @@ gradleProperties: import("./createBaseMod").BaseModProviderMethods<Properties.PropertiesItem[], Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
manifest: import("./createBaseMod").BaseModProviderMethods<Manifest.AndroidManifest, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

@@ -29,0 +31,0 @@ gradleProperties: import("./createBaseMod").BaseModProviderMethods<Properties.PropertiesItem[], Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

@@ -152,2 +152,14 @@ "use strict";

}),
finalized: (0, _createBaseMod().provider)({
getFilePath() {
return '';
},
async read() {
return {
filePath: '',
modResults: {}
};
},
async write() {}
}),
// Append a rule to supply gradle.properties data to mods on `mods.android.gradleProperties`

@@ -154,0 +166,0 @@ manifest: (0, _createBaseMod().provider)({

@@ -9,2 +9,3 @@ import { JSONObject, JSONValue } from '@expo/json-file';

dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
appDelegate: import("./createBaseMod").BaseModProviderMethods<Paths.AppDelegateProjectFile, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

@@ -23,2 +24,3 @@ expoPlist: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

dangerous: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
finalized: import("./createBaseMod").BaseModProviderMethods<unknown, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;
appDelegate: import("./createBaseMod").BaseModProviderMethods<Paths.AppDelegateProjectFile, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

@@ -25,0 +27,0 @@ expoPlist: import("./createBaseMod").BaseModProviderMethods<JSONObject, Partial<Pick<import("./withMod").BaseModOptions, "skipEmptyMod" | "saveToInternal">>>;

@@ -153,2 +153,11 @@ "use strict";

}),
finalized: (0, _createBaseMod().provider)({
getFilePath() {
return '';
},
async read() {
return {};
},
async write() {}
}),
// Append a rule to supply AppDelegate data to mods on `mods.ios.appDelegate`

@@ -155,0 +164,0 @@ appDelegate: (0, _createBaseMod().provider)({

{
"name": "@expo/config-plugins",
"version": "7.8.3",
"version": "7.8.4",
"description": "A library for Expo config plugins",

@@ -63,3 +63,3 @@ "main": "build/index.js",

},
"gitHead": "b5a3db3c8993f3b22e8cba1e2c6005fee57988c2"
"gitHead": "102899632731658eecba006c0d1c79b98ba8f5f7"
}

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

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