@appsent-co/react-native-watchos 0.1.0 → 0.1.1
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/build/xcframework/Hermes.xcframework/Info.plist +4 -4
- package/build/xcframework/Hermes.xcframework/watchos-arm64/hermes.framework/hermes +0 -0
- package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/hermes +0 -0
- package/build/xcframework/ReactNativeWatchOSCxx.xcframework/Info.plist +4 -4
- package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/libReactNativeWatchOSCxx.a +0 -0
- package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64-simulator/libReactNativeWatchOSCxx.a +0 -0
- package/build/xcframework/device/libReactNativeWatchOSCxx.a +0 -0
- package/build/xcframework/simulator/libReactNativeWatchOSCxx.a +0 -0
- package/cli/init.js +16 -6
- package/package.json +15 -13
- package/plugin/src/index.js +38 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>hermes.framework/hermes</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>watchos-arm64
|
|
11
|
+
<string>watchos-arm64</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>hermes.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
@@ -17,14 +17,12 @@
|
|
|
17
17
|
</array>
|
|
18
18
|
<key>SupportedPlatform</key>
|
|
19
19
|
<string>watchos</string>
|
|
20
|
-
<key>SupportedPlatformVariant</key>
|
|
21
|
-
<string>simulator</string>
|
|
22
20
|
</dict>
|
|
23
21
|
<dict>
|
|
24
22
|
<key>BinaryPath</key>
|
|
25
23
|
<string>hermes.framework/hermes</string>
|
|
26
24
|
<key>LibraryIdentifier</key>
|
|
27
|
-
<string>watchos-arm64</string>
|
|
25
|
+
<string>watchos-arm64-simulator</string>
|
|
28
26
|
<key>LibraryPath</key>
|
|
29
27
|
<string>hermes.framework</string>
|
|
30
28
|
<key>SupportedArchitectures</key>
|
|
@@ -33,6 +31,8 @@
|
|
|
33
31
|
</array>
|
|
34
32
|
<key>SupportedPlatform</key>
|
|
35
33
|
<string>watchos</string>
|
|
34
|
+
<key>SupportedPlatformVariant</key>
|
|
35
|
+
<string>simulator</string>
|
|
36
36
|
</dict>
|
|
37
37
|
</array>
|
|
38
38
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
package/build/xcframework/Hermes.xcframework/watchos-arm64-simulator/hermes.framework/hermes
CHANGED
|
Binary file
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<key>HeadersPath</key>
|
|
11
11
|
<string>Headers</string>
|
|
12
12
|
<key>LibraryIdentifier</key>
|
|
13
|
-
<string>watchos-arm64
|
|
13
|
+
<string>watchos-arm64</string>
|
|
14
14
|
<key>LibraryPath</key>
|
|
15
15
|
<string>libReactNativeWatchOSCxx.a</string>
|
|
16
16
|
<key>SupportedArchitectures</key>
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
</array>
|
|
20
20
|
<key>SupportedPlatform</key>
|
|
21
21
|
<string>watchos</string>
|
|
22
|
-
<key>SupportedPlatformVariant</key>
|
|
23
|
-
<string>simulator</string>
|
|
24
22
|
</dict>
|
|
25
23
|
<dict>
|
|
26
24
|
<key>BinaryPath</key>
|
|
@@ -28,7 +26,7 @@
|
|
|
28
26
|
<key>HeadersPath</key>
|
|
29
27
|
<string>Headers</string>
|
|
30
28
|
<key>LibraryIdentifier</key>
|
|
31
|
-
<string>watchos-arm64</string>
|
|
29
|
+
<string>watchos-arm64-simulator</string>
|
|
32
30
|
<key>LibraryPath</key>
|
|
33
31
|
<string>libReactNativeWatchOSCxx.a</string>
|
|
34
32
|
<key>SupportedArchitectures</key>
|
|
@@ -37,6 +35,8 @@
|
|
|
37
35
|
</array>
|
|
38
36
|
<key>SupportedPlatform</key>
|
|
39
37
|
<string>watchos</string>
|
|
38
|
+
<key>SupportedPlatformVariant</key>
|
|
39
|
+
<string>simulator</string>
|
|
40
40
|
</dict>
|
|
41
41
|
</array>
|
|
42
42
|
<key>CFBundlePackageType</key>
|
package/build/xcframework/ReactNativeWatchOSCxx.xcframework/watchos-arm64/libReactNativeWatchOSCxx.a
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cli/init.js
CHANGED
|
@@ -119,11 +119,15 @@ function patchAppJson(cwd, targetName) {
|
|
|
119
119
|
const isEntry = (entry, name) =>
|
|
120
120
|
Array.isArray(entry) ? entry[0] === name : entry === name;
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
// `npx expo install` auto-adds the plugin as a bare string in the wrong
|
|
123
|
+
// position (before @bacons/apple-targets) and with no targetName. Strip
|
|
124
|
+
// any existing entry so we can reinsert it in the correct position.
|
|
125
|
+
const removed = [];
|
|
126
|
+
for (let i = plugins.length - 1; i >= 0; i--) {
|
|
127
|
+
if (isEntry(plugins[i], '@appsent-co/react-native-watchos')) {
|
|
128
|
+
removed.push(plugins[i]);
|
|
129
|
+
plugins.splice(i, 1);
|
|
130
|
+
}
|
|
127
131
|
}
|
|
128
132
|
|
|
129
133
|
const entry = ['@appsent-co/react-native-watchos', { targetName }];
|
|
@@ -134,7 +138,13 @@ function patchAppJson(cwd, targetName) {
|
|
|
134
138
|
else plugins.push(entry);
|
|
135
139
|
|
|
136
140
|
fs.writeFileSync(p, JSON.stringify(json, null, 2) + '\n');
|
|
137
|
-
|
|
141
|
+
if (removed.length) {
|
|
142
|
+
console.log(
|
|
143
|
+
`› Replaced existing @appsent-co/react-native-watchos entry in ${path.relative(cwd, p)}`
|
|
144
|
+
);
|
|
145
|
+
} else {
|
|
146
|
+
console.log(`› Patched ${path.relative(cwd, p)}`);
|
|
147
|
+
}
|
|
138
148
|
}
|
|
139
149
|
|
|
140
150
|
function spawnInherit(cmd, args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsent-co/react-native-watchos",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Build WatchOS apps in react-native",
|
|
5
5
|
"main": "./plugin/src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -37,6 +37,15 @@
|
|
|
37
37
|
"build/xcframework",
|
|
38
38
|
"!**/.*"
|
|
39
39
|
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build:xcframework": "./scripts/build-xcframework.sh",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"clean": "del-cli build/xcframework example/ios",
|
|
44
|
+
"docs": "pnpm --filter react-native-watchos-docs start",
|
|
45
|
+
"docs:build": "pnpm --filter react-native-watchos-docs build",
|
|
46
|
+
"release": "release-it --only-version",
|
|
47
|
+
"prepublishOnly": "pnpm build:xcframework"
|
|
48
|
+
},
|
|
40
49
|
"keywords": [
|
|
41
50
|
"react-native",
|
|
42
51
|
"watchos",
|
|
@@ -74,21 +83,21 @@
|
|
|
74
83
|
"globals": "^15.14.0",
|
|
75
84
|
"prettier": "^3.6.2",
|
|
76
85
|
"react": "19.1.0",
|
|
77
|
-
"react-reconciler": "0.32.0",
|
|
78
86
|
"release-it": "^19.0.4",
|
|
79
87
|
"typescript": "^5.9.2"
|
|
80
88
|
},
|
|
81
89
|
"dependencies": {
|
|
82
90
|
"@expo/config-plugins": "^54.0.0",
|
|
91
|
+
"react-reconciler": "0.32.0",
|
|
83
92
|
"whatwg-fetch": "^3.6.20"
|
|
84
93
|
},
|
|
85
94
|
"peerDependencies": {
|
|
86
95
|
"@bacons/apple-targets": ">=4.0.0",
|
|
87
96
|
"expo": ">=54.0.0",
|
|
88
97
|
"react": "*",
|
|
89
|
-
"react-native": "*"
|
|
90
|
-
"react-reconciler": "*"
|
|
98
|
+
"react-native": "*"
|
|
91
99
|
},
|
|
100
|
+
"packageManager": "pnpm@10.10.0",
|
|
92
101
|
"commitlint": {
|
|
93
102
|
"extends": [
|
|
94
103
|
"@commitlint/config-conventional"
|
|
@@ -107,6 +116,7 @@
|
|
|
107
116
|
},
|
|
108
117
|
"plugins": {
|
|
109
118
|
"@release-it/conventional-changelog": {
|
|
119
|
+
"ignoreRecommendedBump": true,
|
|
110
120
|
"preset": {
|
|
111
121
|
"name": "angular"
|
|
112
122
|
}
|
|
@@ -119,13 +129,5 @@
|
|
|
119
129
|
"tabWidth": 2,
|
|
120
130
|
"trailingComma": "es5",
|
|
121
131
|
"useTabs": false
|
|
122
|
-
},
|
|
123
|
-
"scripts": {
|
|
124
|
-
"build:xcframework": "./scripts/build-xcframework.sh",
|
|
125
|
-
"lint": "eslint .",
|
|
126
|
-
"clean": "del-cli build/xcframework example/ios",
|
|
127
|
-
"docs": "pnpm --filter react-native-watchos-docs start",
|
|
128
|
-
"docs:build": "pnpm --filter react-native-watchos-docs build",
|
|
129
|
-
"release": "release-it --only-version"
|
|
130
132
|
}
|
|
131
|
-
}
|
|
133
|
+
}
|
package/plugin/src/index.js
CHANGED
|
@@ -49,6 +49,7 @@ const withWatchTurboModuleCodegen = require('./withWatchTurboModuleCodegen');
|
|
|
49
49
|
* @type {import('@expo/config-plugins').ConfigPlugin<ReactNativeWatchOSPluginOpts | void>}
|
|
50
50
|
*/
|
|
51
51
|
const withReactNativeWatchOS = (config, opts) => {
|
|
52
|
+
assertPluginOrder(config);
|
|
52
53
|
const targetName = (opts && opts.targetName) || 'watch';
|
|
53
54
|
const bundleName = (opts && opts.bundleName) || 'main';
|
|
54
55
|
const entryFile = opts && opts.entryFile;
|
|
@@ -65,5 +66,42 @@ const withReactNativeWatchOS = (config, opts) => {
|
|
|
65
66
|
]);
|
|
66
67
|
};
|
|
67
68
|
|
|
69
|
+
/**
|
|
70
|
+
* @param {{ plugins?: Array<string | [string, unknown] | unknown> }} config
|
|
71
|
+
*/
|
|
72
|
+
function assertPluginOrder(config) {
|
|
73
|
+
const plugins = Array.isArray(config && config.plugins)
|
|
74
|
+
? config.plugins
|
|
75
|
+
: null;
|
|
76
|
+
if (!plugins) return;
|
|
77
|
+
|
|
78
|
+
/** @param {unknown} e */
|
|
79
|
+
const nameOf = (e) =>
|
|
80
|
+
typeof e === 'string' ? e : Array.isArray(e) ? e[0] : null;
|
|
81
|
+
const ourIdx = plugins.findIndex(
|
|
82
|
+
(e) => nameOf(e) === '@appsent-co/react-native-watchos'
|
|
83
|
+
);
|
|
84
|
+
const baconsIdx = plugins.findIndex(
|
|
85
|
+
(e) => nameOf(e) === '@bacons/apple-targets'
|
|
86
|
+
);
|
|
87
|
+
if (ourIdx < 0) return;
|
|
88
|
+
|
|
89
|
+
if (baconsIdx < 0) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
'[@appsent-co/react-native-watchos] requires "@bacons/apple-targets" ' +
|
|
92
|
+
'to be present in your Expo plugins array (before this plugin). ' +
|
|
93
|
+
'Run `npx react-native-watchos init` to wire it up.'
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (baconsIdx > ourIdx) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
'[@appsent-co/react-native-watchos] must come AFTER ' +
|
|
99
|
+
'"@bacons/apple-targets" in your Expo plugins array, so the watch ' +
|
|
100
|
+
'target exists when this plugin patches the pbxproj. ' +
|
|
101
|
+
'Run `npx react-native-watchos init` to fix the order.'
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
68
106
|
module.exports = withReactNativeWatchOS;
|
|
69
107
|
module.exports.default = withReactNativeWatchOS;
|