pushwave-client 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugin/index.js +37 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushwave-client",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "PushWave Client, Expo Push Notifications SaaS SDK",
5
5
  "homepage": "https://github.com/luruk-hai/pushwave-client#readme",
6
6
  "bugs": {
package/plugin/index.js CHANGED
@@ -1,37 +1,55 @@
1
1
  const {
2
2
  createRunOncePlugin,
3
3
  withAppBuildGradle,
4
+ withProjectBuildGradle,
4
5
  } = require("@expo/config-plugins");
5
6
 
6
7
  const pkg = require("../package.json");
7
8
 
8
- const PLAY_INTEGRITY_DEP = 'implementation("com.google.android.play:integrity:1.3.0")';
9
+ const PLAY_INTEGRITY_DEP = 'implementation("com.google.android.play:integrity:1.4.0")';
9
10
 
10
11
  function withPushwaveAndroid(config) {
11
- return withAppBuildGradle(config, (config) => {
12
- if (config.modResults.language !== "groovy") {
13
- return config;
14
- }
15
-
16
- const content = config.modResults.contents;
12
+ // Inject into module-level build.gradle (Groovy)
13
+ config = withAppBuildGradle(config, (config) => {
14
+ const { language, contents } = config.modResults;
15
+ if (language !== "groovy") return config;
17
16
 
18
- if (content.includes(PLAY_INTEGRITY_DEP)) {
19
- return config;
17
+ if (!contents.includes(PLAY_INTEGRITY_DEP)) {
18
+ config.modResults.contents = contents.replace(
19
+ /dependencies\s?{[^}]*}/,
20
+ (match) => {
21
+ if (match.includes(PLAY_INTEGRITY_DEP)) return match;
22
+ return match.replace(
23
+ /dependencies\s?{/,
24
+ `dependencies {\n ${PLAY_INTEGRITY_DEP}\n`
25
+ );
26
+ }
27
+ );
20
28
  }
29
+ return config;
30
+ });
21
31
 
22
- config.modResults.contents = content.replace(
23
- /dependencies\s?{[^}]*}/,
24
- (match) => {
25
- if (match.includes(PLAY_INTEGRITY_DEP)) return match;
26
- return match.replace(
27
- /dependencies\s?{/,
28
- `dependencies {\n ${PLAY_INTEGRITY_DEP}\n`
29
- );
30
- }
31
- );
32
+ // Inject into project-level build.gradle.kts (Kotlin DSL)
33
+ config = withProjectBuildGradle(config, (config) => {
34
+ const { language, contents } = config.modResults;
35
+ if (language !== "kts") return config;
32
36
 
37
+ if (!contents.includes(PLAY_INTEGRITY_DEP)) {
38
+ config.modResults.contents = contents.replace(
39
+ /dependencies\s?{[^}]*}/,
40
+ (match) => {
41
+ if (match.includes(PLAY_INTEGRITY_DEP)) return match;
42
+ return match.replace(
43
+ /dependencies\s?{/,
44
+ `dependencies {\n ${PLAY_INTEGRITY_DEP}\n`
45
+ );
46
+ }
47
+ );
48
+ }
33
49
  return config;
34
50
  });
51
+
52
+ return config;
35
53
  }
36
54
 
37
55
  const withPushwaveClient = (config) => {