@sleeperhq/mini-core 0.0.4 → 0.0.6
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/bin/build_mini.js +8 -0
- package/mini_packages.json +2 -1
- package/package.json +2 -2
- package/src/components/index.tsx +2 -2
- package/webpack.config.js +4 -2
package/bin/build_mini.js
CHANGED
|
@@ -131,6 +131,13 @@ const setProjectName = (name) => {
|
|
|
131
131
|
fs.writeFileSync(podfilePath, newPodfileString);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
const setUniqueName = (name) => {
|
|
135
|
+
const webpackConfigPath = path.join('node_modules', '@sleeperhq', 'mini-core', 'webpack.config.js');
|
|
136
|
+
const webpackConfigString = fs.readFileSync(webpackConfigPath).toString();
|
|
137
|
+
const newWebpackConfigString = webpackConfigString.replace(/uniqueName: '.*'/, `uniqueName: '${name}'`);
|
|
138
|
+
fs.writeFileSync(webpackConfigPath, newWebpackConfigString);
|
|
139
|
+
}
|
|
140
|
+
|
|
134
141
|
const validateProjectName = (name) => {
|
|
135
142
|
const regex = /^[a-zA-Z0-9_]+$/;
|
|
136
143
|
return regex.test(name);
|
|
@@ -148,6 +155,7 @@ const main = async () => {
|
|
|
148
155
|
if (projectName !== fallback) {
|
|
149
156
|
await spawnProcess(`yarn react-native-rename "${projectName}" --skipAllGitChecks`, "rename command exited with non-zero code");
|
|
150
157
|
setProjectName(projectName);
|
|
158
|
+
setUniqueName(projectName);
|
|
151
159
|
}
|
|
152
160
|
|
|
153
161
|
const commands = getCommands(projectName);
|
package/mini_packages.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@react-navigation/native": "6.1.17",
|
|
20
20
|
"@react-navigation/stack": "6.4.0",
|
|
21
21
|
"@shopify/flash-list": "1.7.0",
|
|
22
|
-
"@sleeperhq/mini-core": "0.0.
|
|
22
|
+
"@sleeperhq/mini-core": "0.0.6",
|
|
23
23
|
"amazon-cognito-identity-js": "6.3.2",
|
|
24
24
|
"crypto-js": "3.3.0",
|
|
25
25
|
"decimal.js-light": "2.5.1",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"react-native-image-pan-zoom": "2.1.12",
|
|
53
53
|
"react-native-image-picker": "4.10.3",
|
|
54
54
|
"react-native-image-resizer": "1.4.5",
|
|
55
|
+
"react-native-interactable": "2.0.1",
|
|
55
56
|
"react-native-iphone-x-helper": "1.3.1",
|
|
56
57
|
"react-native-json-tree": "1.3.0",
|
|
57
58
|
"react-native-keep-awake": "4.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sleeperhq/mini-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Core library frameworks for developing Sleeper Mini Apps.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/plugin-transform-runtime": "7.25.9",
|
|
38
38
|
"@babel/runtime": "7.26.0",
|
|
39
|
-
"@callstack/repack": "blitzstudios/repack.git#callstack-repack-v0.5.
|
|
39
|
+
"@callstack/repack": "blitzstudios/repack.git#callstack-repack-v0.5.4-gitpkg",
|
|
40
40
|
"@react-native-community/cli": "15.0.1",
|
|
41
41
|
"@react-native-community/cli-platform-android": "15.0.1",
|
|
42
42
|
"@react-native-community/cli-platform-apple": "15.0.1",
|
package/src/components/index.tsx
CHANGED
|
@@ -7,10 +7,10 @@ import type {SwitchProps} from '../../declarations/switch';
|
|
|
7
7
|
import { AvatarProps, AvatarLeagueProps, AvatarPlayerProps, AvatarTeamProps } from '../../declarations/avatar';
|
|
8
8
|
|
|
9
9
|
const _SleeperModule = React.lazy(() =>
|
|
10
|
-
Federated.importModule('sleeper', 'index').catch(() => ({
|
|
10
|
+
Federated.importModule('sleeper', 'index').catch((e) => ({
|
|
11
11
|
default: props => {
|
|
12
12
|
console.log(
|
|
13
|
-
`[Sleeper] Failed to load <${props?.component}>. Check connection to the app
|
|
13
|
+
`[Sleeper] Failed to load <${props?.component}>. Check connection to the app. (${e})`,
|
|
14
14
|
);
|
|
15
15
|
return <View />;
|
|
16
16
|
},
|
package/webpack.config.js
CHANGED
|
@@ -120,7 +120,7 @@ module.exports = env => {
|
|
|
120
120
|
: 'index.ios.bundle',
|
|
121
121
|
chunkFilename: '[name].chunk.bundle',
|
|
122
122
|
publicPath: Repack.getPublicPath({platform, devServer}),
|
|
123
|
-
uniqueName: '
|
|
123
|
+
uniqueName: 'template',
|
|
124
124
|
},
|
|
125
125
|
/**
|
|
126
126
|
* Configures optimization of the built bundle.
|
|
@@ -210,7 +210,9 @@ module.exports = env => {
|
|
|
210
210
|
['@babel/preset-typescript', { allowDeclareFields: true }],
|
|
211
211
|
],
|
|
212
212
|
// sourceType: "unambiguous",
|
|
213
|
-
plugins:
|
|
213
|
+
plugins: devServer && devServer.hmr
|
|
214
|
+
? ['@babel/plugin-transform-runtime', 'module:react-refresh/babel']
|
|
215
|
+
: ['@babel/plugin-transform-runtime'],
|
|
214
216
|
babelrc: false,
|
|
215
217
|
comments: true, // necessary for named chunks
|
|
216
218
|
cacheDirectory: true,
|