expo-modules-autolinking 3.0.11 → 3.0.13

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/CHANGELOG.md CHANGED
@@ -10,6 +10,19 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 3.0.13 — 2025-09-22
14
+
15
+ ### 🎉 New features
16
+
17
+ - Use app root to generate modules provider ([#39728](https://github.com/expo/expo/pull/39728) by [@gabrieldonadel](https://github.com/gabrieldonadel))
18
+
19
+ ## 3.0.12 — 2025-09-18
20
+
21
+ ### 💡 Others
22
+
23
+ - [iOS] Added support for passing pod targets that should be statically linked and not built as frameworks. ([#39742](https://github.com/expo/expo/pull/39742) by [@chrfalch](https://github.com/chrfalch))
24
+ - [Android] Migrated from `kotlinOptions` to `compilerOptions` DSL. ([#39794](https://github.com/expo/expo/pull/39794) by [@huextrat](https://github.com/huextrat))
25
+
13
26
  ## 3.0.11 — 2025-09-16
14
27
 
15
28
  ### 🐛 Bug fixes
@@ -11,6 +11,7 @@ function generateModulesProviderCommand(cli) {
11
11
  .option('-t, --target <path>', 'Path to the target file, where the package list should be written to.')
12
12
  .option('--entitlement <path>', 'Path to the Apple code signing entitlements file.')
13
13
  .option('-p, --packages <packages...>', 'Names of the packages to include in the generated modules provider.')
14
+ .option('--app-root <path>', 'Path to the app root directory.')
14
15
  .action(async (searchPaths, commandArguments) => {
15
16
  const platform = commandArguments.platform ?? 'apple';
16
17
  const autolinkingOptionsLoader = (0, autolinkingOptions_1.createAutolinkingOptionsLoader)({
@@ -20,7 +21,7 @@ function generateModulesProviderCommand(cli) {
20
21
  const autolinkingOptions = await autolinkingOptionsLoader.getPlatformOptions(platform);
21
22
  const expoModulesSearchResults = await (0, findModules_1.findModulesAsync)({
22
23
  autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(platform),
23
- appRoot: await autolinkingOptionsLoader.getAppRoot(),
24
+ appRoot: commandArguments.appRoot ?? (await autolinkingOptionsLoader.getAppRoot()),
24
25
  });
25
26
  const expoModulesResolveResults = await (0, resolveModules_1.resolveModulesAsync)(expoModulesSearchResults, autolinkingOptions);
26
27
  const includeModules = new Set(commandArguments.packages ?? []);
@@ -1 +1 @@
1
- {"version":3,"file":"generateModulesProviderCommand.js","sourceRoot":"","sources":["../../src/commands/generateModulesProviderCommand.ts"],"names":[],"mappings":";;AAkBA,wEAyCC;AAzDD,6DAI8B;AAC9B,4DAA8D;AAC9D,4EAAkF;AAClF,kEAAoE;AAQpE,0EAA0E;AAC1E,SAAgB,8BAA8B,CAAC,GAA8B;IAC3E,OAAO,IAAA,iDAA4B,EAAC,GAAG,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;SAC3F,MAAM,CACL,qBAAqB,EACrB,uEAAuE,CACxE;SACA,MAAM,CAAC,sBAAsB,EAAE,mDAAmD,CAAC;SACnF,MAAM,CACL,8BAA8B,EAC9B,qEAAqE,CACtE;SACA,MAAM,CACL,KAAK,EAAE,WAA4B,EAAE,gBAAkD,EAAE,EAAE;QACzF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,IAAI,OAAO,CAAC;QACtD,MAAM,wBAAwB,GAAG,IAAA,mDAA8B,EAAC;YAC9D,GAAG,gBAAgB;YACnB,WAAW;SACZ,CAAC,CAAC;QACH,MAAM,kBAAkB,GAAG,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAEvF,MAAM,wBAAwB,GAAG,MAAM,IAAA,8BAAgB,EAAC;YACtD,kBAAkB,EAAE,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC;YAC/E,OAAO,EAAE,MAAM,wBAAwB,CAAC,UAAU,EAAE;SACrD,CAAC,CAAC;QACH,MAAM,yBAAyB,GAAG,MAAM,IAAA,oCAAmB,EACzD,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;QAEF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,eAAe,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAClE,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CACvC,CAAC;QAEF,MAAM,IAAA,kDAA4B,EAAC,eAAe,EAAE;YAClD,QAAQ;YACR,UAAU,EAAE,gBAAgB,CAAC,MAAM;YACnC,eAAe,EAAE,gBAAgB,CAAC,WAAW,IAAI,IAAI;SACtD,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACN,CAAC","sourcesContent":["import commander from 'commander';\n\nimport {\n AutolinkingCommonArguments,\n createAutolinkingOptionsLoader,\n registerAutolinkingArguments,\n} from './autolinkingOptions';\nimport { findModulesAsync } from '../autolinking/findModules';\nimport { generateModulesProviderAsync } from '../autolinking/generatePackageList';\nimport { resolveModulesAsync } from '../autolinking/resolveModules';\n\ninterface GenerateModulesProviderArguments extends AutolinkingCommonArguments {\n target: string;\n entitlement?: string;\n packages?: string[] | null;\n}\n\n/** Generates a source file listing all packages to link in the runtime */\nexport function generateModulesProviderCommand(cli: commander.CommanderStatic) {\n return registerAutolinkingArguments(cli.command('generate-modules-provider [searchPaths...]'))\n .option(\n '-t, --target <path>',\n 'Path to the target file, where the package list should be written to.'\n )\n .option('--entitlement <path>', 'Path to the Apple code signing entitlements file.')\n .option(\n '-p, --packages <packages...>',\n 'Names of the packages to include in the generated modules provider.'\n )\n .action(\n async (searchPaths: string[] | null, commandArguments: GenerateModulesProviderArguments) => {\n const platform = commandArguments.platform ?? 'apple';\n const autolinkingOptionsLoader = createAutolinkingOptionsLoader({\n ...commandArguments,\n searchPaths,\n });\n const autolinkingOptions = await autolinkingOptionsLoader.getPlatformOptions(platform);\n\n const expoModulesSearchResults = await findModulesAsync({\n autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(platform),\n appRoot: await autolinkingOptionsLoader.getAppRoot(),\n });\n const expoModulesResolveResults = await resolveModulesAsync(\n expoModulesSearchResults,\n autolinkingOptions\n );\n\n const includeModules = new Set(commandArguments.packages ?? []);\n const filteredModules = expoModulesResolveResults.filter((module) =>\n includeModules.has(module.packageName)\n );\n\n await generateModulesProviderAsync(filteredModules, {\n platform,\n targetPath: commandArguments.target,\n entitlementPath: commandArguments.entitlement ?? null,\n });\n }\n );\n}\n"]}
1
+ {"version":3,"file":"generateModulesProviderCommand.js","sourceRoot":"","sources":["../../src/commands/generateModulesProviderCommand.ts"],"names":[],"mappings":";;AAmBA,wEA0CC;AA3DD,6DAI8B;AAC9B,4DAA8D;AAC9D,4EAAkF;AAClF,kEAAoE;AASpE,0EAA0E;AAC1E,SAAgB,8BAA8B,CAAC,GAA8B;IAC3E,OAAO,IAAA,iDAA4B,EAAC,GAAG,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;SAC3F,MAAM,CACL,qBAAqB,EACrB,uEAAuE,CACxE;SACA,MAAM,CAAC,sBAAsB,EAAE,mDAAmD,CAAC;SACnF,MAAM,CACL,8BAA8B,EAC9B,qEAAqE,CACtE;SACA,MAAM,CAAC,mBAAmB,EAAE,iCAAiC,CAAC;SAC9D,MAAM,CACL,KAAK,EAAE,WAA4B,EAAE,gBAAkD,EAAE,EAAE;QACzF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,IAAI,OAAO,CAAC;QACtD,MAAM,wBAAwB,GAAG,IAAA,mDAA8B,EAAC;YAC9D,GAAG,gBAAgB;YACnB,WAAW;SACZ,CAAC,CAAC;QACH,MAAM,kBAAkB,GAAG,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAEvF,MAAM,wBAAwB,GAAG,MAAM,IAAA,8BAAgB,EAAC;YACtD,kBAAkB,EAAE,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,QAAQ,CAAC;YAC/E,OAAO,EAAE,gBAAgB,CAAC,OAAO,IAAI,CAAC,MAAM,wBAAwB,CAAC,UAAU,EAAE,CAAC;SACnF,CAAC,CAAC;QACH,MAAM,yBAAyB,GAAG,MAAM,IAAA,oCAAmB,EACzD,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;QAEF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,eAAe,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAClE,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CACvC,CAAC;QAEF,MAAM,IAAA,kDAA4B,EAAC,eAAe,EAAE;YAClD,QAAQ;YACR,UAAU,EAAE,gBAAgB,CAAC,MAAM;YACnC,eAAe,EAAE,gBAAgB,CAAC,WAAW,IAAI,IAAI;SACtD,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACN,CAAC","sourcesContent":["import commander from 'commander';\n\nimport {\n AutolinkingCommonArguments,\n createAutolinkingOptionsLoader,\n registerAutolinkingArguments,\n} from './autolinkingOptions';\nimport { findModulesAsync } from '../autolinking/findModules';\nimport { generateModulesProviderAsync } from '../autolinking/generatePackageList';\nimport { resolveModulesAsync } from '../autolinking/resolveModules';\n\ninterface GenerateModulesProviderArguments extends AutolinkingCommonArguments {\n target: string;\n entitlement?: string;\n packages?: string[] | null;\n appRoot?: string;\n}\n\n/** Generates a source file listing all packages to link in the runtime */\nexport function generateModulesProviderCommand(cli: commander.CommanderStatic) {\n return registerAutolinkingArguments(cli.command('generate-modules-provider [searchPaths...]'))\n .option(\n '-t, --target <path>',\n 'Path to the target file, where the package list should be written to.'\n )\n .option('--entitlement <path>', 'Path to the Apple code signing entitlements file.')\n .option(\n '-p, --packages <packages...>',\n 'Names of the packages to include in the generated modules provider.'\n )\n .option('--app-root <path>', 'Path to the app root directory.')\n .action(\n async (searchPaths: string[] | null, commandArguments: GenerateModulesProviderArguments) => {\n const platform = commandArguments.platform ?? 'apple';\n const autolinkingOptionsLoader = createAutolinkingOptionsLoader({\n ...commandArguments,\n searchPaths,\n });\n const autolinkingOptions = await autolinkingOptionsLoader.getPlatformOptions(platform);\n\n const expoModulesSearchResults = await findModulesAsync({\n autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(platform),\n appRoot: commandArguments.appRoot ?? (await autolinkingOptionsLoader.getAppRoot()),\n });\n const expoModulesResolveResults = await resolveModulesAsync(\n expoModulesSearchResults,\n autolinkingOptions\n );\n\n const includeModules = new Set(commandArguments.packages ?? []);\n const filteredModules = expoModulesResolveResults.filter((module) =>\n includeModules.has(module.packageName)\n );\n\n await generateModulesProviderAsync(filteredModules, {\n platform,\n targetPath: commandArguments.target,\n entitlementPath: commandArguments.entitlement ?? null,\n });\n }\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-modules-autolinking",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "description": "Scripts that autolink Expo modules.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -46,5 +46,5 @@
46
46
  "require-from-string": "^2.0.2",
47
47
  "resolve-from": "^5.0.0"
48
48
  },
49
- "gitHead": "e1bc61d046f09264a85b7730a1b7ae931b0f0af4"
49
+ "gitHead": "6523053d0d997d2a21f580d2752b2f873c122038"
50
50
  }
@@ -37,8 +37,13 @@ module Expo
37
37
  include_tests = @options.fetch(:includeTests, false)
38
38
 
39
39
  # Add any additional framework modules to patch using the patched Podfile class in installer.rb
40
- additional_framework_modules_to_path = @options.fetch(:additionalFrameworkModulesToPatch, [])
41
- @podfile.expo_add_modules_to_patch(additional_framework_modules_to_path) if !additional_framework_modules_to_path.empty?
40
+ # We'll be reading from Podfile.properties.json and optionally parameters passed to use_expo_modules!
41
+ podfile_properties = JSON.parse(File.read(File.join(Pod::Config.instance.project_root, 'Podfile.properties.json'))) rescue {}
42
+ additional_framework_modules_to_patch = @options.fetch(:additionalFrameworkModulesToPatch, []) +
43
+ JSON.parse(podfile_properties['ios.forceStaticLinking'] || "[]")
44
+
45
+ Pod::UI.puts("Forcing static linking for pods: #{additional_framework_modules_to_patch}") if !additional_framework_modules_to_patch.empty?
46
+ @podfile.expo_add_modules_to_patch(additional_framework_modules_to_patch) if !additional_framework_modules_to_patch.empty?
42
47
 
43
48
  project_directory = Pod::Config.instance.project_root
44
49
 
@@ -161,6 +166,12 @@ module Expo
161
166
  return @target_definition.platform&.string_name
162
167
  end
163
168
 
169
+ # Returns the app project root if provided in the options.
170
+ public def custom_app_root
171
+ # TODO: Follow up on renaming `:projectRoot` and migrate to `appRoot`
172
+ return @options.fetch(:appRoot, @options.fetch(:projectRoot, nil))
173
+ end
174
+
164
175
  # privates
165
176
 
166
177
  private def resolve
@@ -225,12 +236,15 @@ module Expo
225
236
  end
226
237
 
227
238
  public def generate_modules_provider_command_args(target_path)
239
+ command_args = ['--target', target_path]
240
+
241
+ if !custom_app_root.nil?
242
+ command_args.concat(['--app-root', custom_app_root])
243
+ end
244
+
228
245
  node_command_args('generate-modules-provider').concat(
229
- [
230
- '--target',
231
- target_path,
232
- '--packages'
233
- ],
246
+ command_args,
247
+ ['--packages'],
234
248
  packages_to_generate.map(&:name)
235
249
  )
236
250
  end
@@ -245,6 +245,7 @@ module Expo
245
245
  platform = autolinking_manager.platform_name.downcase
246
246
  package_names = autolinking_manager.packages_to_generate.map { |package| "\"#{package.name}\"" }
247
247
  entitlement_param = entitlement_path.nil? ? '' : "--entitlement \"#{entitlement_path}\""
248
+ app_root_param = autolinking_manager.custom_app_root.nil? ? '' : "--app-root \"#{autolinking_manager.custom_app_root}\""
248
249
 
249
250
  <<~SUPPORT_SCRIPT
250
251
  #!/usr/bin/env bash
@@ -296,6 +297,7 @@ module Expo
296
297
  generate-modules-provider #{args.join(' ')} \\
297
298
  --target "#{modules_provider_path}" \\
298
299
  #{entitlement_param} \\
300
+ #{app_root_param} \\
299
301
  --platform "apple" \\
300
302
  --packages #{package_names.join(' ')}
301
303
  SUPPORT_SCRIPT
@@ -13,6 +13,7 @@ interface GenerateModulesProviderArguments extends AutolinkingCommonArguments {
13
13
  target: string;
14
14
  entitlement?: string;
15
15
  packages?: string[] | null;
16
+ appRoot?: string;
16
17
  }
17
18
 
18
19
  /** Generates a source file listing all packages to link in the runtime */
@@ -27,6 +28,7 @@ export function generateModulesProviderCommand(cli: commander.CommanderStatic) {
27
28
  '-p, --packages <packages...>',
28
29
  'Names of the packages to include in the generated modules provider.'
29
30
  )
31
+ .option('--app-root <path>', 'Path to the app root directory.')
30
32
  .action(
31
33
  async (searchPaths: string[] | null, commandArguments: GenerateModulesProviderArguments) => {
32
34
  const platform = commandArguments.platform ?? 'apple';
@@ -38,7 +40,7 @@ export function generateModulesProviderCommand(cli: commander.CommanderStatic) {
38
40
 
39
41
  const expoModulesSearchResults = await findModulesAsync({
40
42
  autolinkingOptions: await autolinkingOptionsLoader.getPlatformOptions(platform),
41
- appRoot: await autolinkingOptionsLoader.getAppRoot(),
43
+ appRoot: commandArguments.appRoot ?? (await autolinkingOptionsLoader.getAppRoot()),
42
44
  });
43
45
  const expoModulesResolveResults = await resolveModulesAsync(
44
46
  expoModulesSearchResults,