Skip to content

Commit

Permalink
fix: missing react-native-schedule-exact-alarm-permission dependency (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vadymv-mendix authored Jun 25, 2024
2 parents ec108eb + 17434ca commit bd0004f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configs/jsactions/rollup-plugin-collect-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async function getTransitiveDependencies(packagePath, isExternal) {
return Array.from(result);
}

async function copyJsModule(moduleSourcePath, to) {
export async function copyJsModule(moduleSourcePath, to) {
if (existsSync(to)) {
return;
}
Expand Down
14 changes: 13 additions & 1 deletion configs/jsactions/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import command from "rollup-plugin-command";
import { promisify } from "util";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import { collectDependencies } from "./rollup-plugin-collect-dependencies";
import { collectDependencies, copyJsModule } from "./rollup-plugin-collect-dependencies";
import { licenseCustomTemplate, copyLicenseFile } from "./rollup-helper";
import { bigJsImportReplacer } from "./rollup-plugin-bigjs-import-replacer";

Expand Down Expand Up @@ -87,6 +87,18 @@ export default async args => {
join(dirname(require.resolve("fbjs")), "lib", "invariant.js"),
join(path, "invariant.js")
);

// We dynamically import react-native-schedule-exact-alarm-permission as it works only on Android
// so we need to copy it here as collectDependencies won't detect it.
await copyJsModule(
// require returns a path to commonjs index.js file
join(
dirname(require.resolve("react-native-schedule-exact-alarm-permission")),
"../",
"../"
),
join(outDir, "node_modules", "react-native-schedule-exact-alarm-permission")
);
} else if (args.configProject === "nanoflowcommons") {
// `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
// https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13
Expand Down
3 changes: 3 additions & 0 deletions packages/jsActions/mobile-resources-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

- We have fixed an issue with missing react-native-schedule-exact-alarm-permission dependency

## [4.1.1] Native Mobile Resources - 2024-6-25

- We have fixed an issue with checking blocked permissions on iOS

## [4.1.0] Native Mobile Resources - 2024-5-28
Expand Down
2 changes: 1 addition & 1 deletion packages/jsActions/mobile-resources-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"rimraf": "^2.7.1",
"rollup": "^2.68.0"
}
}
}

0 comments on commit bd0004f

Please sign in to comment.