Skip to content

Commit 17434ca

Browse files
committed
fix: missing react-native-schedule-exact-alarm-permission dependency
1 parent ec108eb commit 17434ca

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

configs/jsactions/rollup-plugin-collect-dependencies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async function getTransitiveDependencies(packagePath, isExternal) {
166166
return Array.from(result);
167167
}
168168

169-
async function copyJsModule(moduleSourcePath, to) {
169+
export async function copyJsModule(moduleSourcePath, to) {
170170
if (existsSync(to)) {
171171
return;
172172
}

configs/jsactions/rollup.config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import command from "rollup-plugin-command";
1010
import { promisify } from "util";
1111
import { nodeResolve } from "@rollup/plugin-node-resolve";
1212
import typescript from "@rollup/plugin-typescript";
13-
import { collectDependencies } from "./rollup-plugin-collect-dependencies";
13+
import { collectDependencies, copyJsModule } from "./rollup-plugin-collect-dependencies";
1414
import { licenseCustomTemplate, copyLicenseFile } from "./rollup-helper";
1515
import { bigJsImportReplacer } from "./rollup-plugin-bigjs-import-replacer";
1616

@@ -87,6 +87,18 @@ export default async args => {
8787
join(dirname(require.resolve("fbjs")), "lib", "invariant.js"),
8888
join(path, "invariant.js")
8989
);
90+
91+
// We dynamically import react-native-schedule-exact-alarm-permission as it works only on Android
92+
// so we need to copy it here as collectDependencies won't detect it.
93+
await copyJsModule(
94+
// require returns a path to commonjs index.js file
95+
join(
96+
dirname(require.resolve("react-native-schedule-exact-alarm-permission")),
97+
"../",
98+
"../"
99+
),
100+
join(outDir, "node_modules", "react-native-schedule-exact-alarm-permission")
101+
);
90102
} else if (args.configProject === "nanoflowcommons") {
91103
// `invariant` is being used silently by @react-native-community/geolocation; it is not listed as a dependency nor peerDependency.
92104
// https://github.dev/react-native-geolocation/react-native-geolocation/blob/1786929f2be581da91082ff857c2393da5e597b3/js/implementation.native.js#L13

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
- We have fixed an issue with missing react-native-schedule-exact-alarm-permission dependency
10+
911
## [4.1.1] Native Mobile Resources - 2024-6-25
12+
1013
- We have fixed an issue with checking blocked permissions on iOS
1114

1215
## [4.1.0] Native Mobile Resources - 2024-5-28

packages/jsActions/mobile-resources-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353
"rimraf": "^2.7.1",
5454
"rollup": "^2.68.0"
5555
}
56-
}
56+
}

0 commit comments

Comments
 (0)