@sleeperhq/mini-core 0.0.4 → 0.0.5

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 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);
@@ -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.4",
3
+ "version": "0.0.5",
4
4
  "description": "Core library frameworks for developing Sleeper Mini Apps.",
5
5
  "main": "index.ts",
6
6
  "types": "index.d.ts",
@@ -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: 'sleeper',
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:['@babel/plugin-transform-runtime'],
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,