react-native-electron-platform 0.0.5 → 0.0.7

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/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "react-native-electron-platform",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "A boilerplate and utilities for running React Native applications in Electron",
5
5
  "main": "index.mjs",
6
6
  "scripts": {
7
7
  "start": "electron src/main.mjs",
8
- "build": "webpack --config webpack.config.mjs",
9
- "test": "node test/test.mjs"
8
+ "build": "webpack --config webpack.config.mjs"
10
9
  },
11
10
  "keywords": [
12
11
  "react-native",
@@ -49,7 +48,6 @@
49
48
  "LICENSE",
50
49
  "CHANGELOG.md",
51
50
  "CODE_OF_CONDUCT.md",
52
- "CONTRIBUTING.md",
53
- "electron-builder.json"
51
+ "CONTRIBUTING.md"
54
52
  ]
55
53
  }
package/src/main.mjs CHANGED
@@ -52,7 +52,7 @@ function createWindow() {
52
52
  const primaryDisplay = screen.getPrimaryDisplay();
53
53
  const { x, y, width, height } = primaryDisplay.bounds;
54
54
 
55
- const iconPath = path.join(__dirname, "icon.ico");
55
+ const iconPath = path.join(app.getAppPath(), "electron/icon.ico");
56
56
  const preloadPath = path.join(__dirname, "preload.js");
57
57
 
58
58
  mainWindow = new BrowserWindow({
@@ -1,7 +1,6 @@
1
1
  {
2
- "appId": "com.${name}.desktop",
3
- "productName": "${name}",
4
- "name": "${name}",
2
+ "appId": "com.app.desktop",
3
+ "productName": "app",
5
4
  "asar": {
6
5
  "smartUnpack": true
7
6
  },
@@ -13,8 +12,8 @@
13
12
  "npmRebuild": false,
14
13
  "nodeGypRebuild": false,
15
14
  "directories": {
16
- "output": "../../dist",
17
- "buildResources": "electron"
15
+ "output": "dist",
16
+ "buildResources": "node_modules/react-native-electron-platform/src"
18
17
  },
19
18
  "publish": [
20
19
  {
@@ -55,13 +54,14 @@
55
54
  "!**/node_modules/react-native/**",
56
55
  "!**/node_modules/react-native-*/*",
57
56
  "!**/node_modules/rn-fetch-blob/**",
58
- "!**/locales/**"
57
+ "!**/locales/**",
58
+ "node_modules/react-native-electron-platform/src/**/*"
59
59
  ],
60
60
  "asarUnpack": [
61
61
  "**/*.node"
62
62
  ],
63
63
  "extraMetadata": {
64
- "main": "electron/main.js"
64
+ "main": "node_modules/react-native-electron-platform/src/main.mjs"
65
65
  },
66
66
  "win": {
67
67
  "target": [
@@ -81,7 +81,7 @@
81
81
  "allowToChangeInstallationDirectory": true,
82
82
  "createDesktopShortcut": true,
83
83
  "createStartMenuShortcut": true,
84
- "shortcutName": "${name}",
84
+ "shortcutName": "ris",
85
85
  "artifactName": "${productName} Setup ${version}.${ext}"
86
86
  },
87
87
  "msi": {
@@ -91,4 +91,4 @@
91
91
  "createStartMenuShortcut": true,
92
92
  "warningsAsErrors": false
93
93
  }
94
- }
94
+ }
Binary file
@@ -12,8 +12,8 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
12
12
  class CopyFontsPlugin {
13
13
  apply(compiler) {
14
14
  compiler.hooks.afterEmit.tap('CopyFontsPlugin', () => {
15
- const sourceDir = path.join(__dirname, '../../node_modules/react-native-vector-icons/Fonts');
16
- const destDir = path.join(__dirname, '../../web-build/fonts');
15
+ const sourceDir = path.join(__dirname, '../react-native-vector-icons/Fonts');
16
+ const destDir = path.join(process.cwd(), 'web-build/fonts');
17
17
 
18
18
  if (!fs.existsSync(destDir)) {
19
19
  fs.mkdirSync(destDir, { recursive: true });
@@ -31,7 +31,7 @@ class CopyFontsPlugin {
31
31
 
32
32
  export default {
33
33
  mode: 'development',
34
- entry: path.resolve(__dirname, '../../electron/index.js'),
34
+ entry: path.resolve(process.cwd(), 'electron/index.js'),
35
35
  devtool: 'source-map',
36
36
 
37
37
  devServer: {
@@ -42,7 +42,7 @@ export default {
42
42
  historyApiFallback: true,
43
43
  liveReload: true,
44
44
  static: {
45
- directory: path.join(__dirname, '../../web-build'),
45
+ directory: path.join(process.cwd(), 'web-build'),
46
46
  publicPath: '/',
47
47
  },
48
48
  client: {
@@ -133,7 +133,7 @@ export default {
133
133
 
134
134
  output: {
135
135
  filename: 'bundle.js',
136
- path: path.resolve(__dirname, '../../web-build'),
136
+ path: path.resolve(process.cwd(), 'web-build'),
137
137
  clean: true,
138
138
  libraryTarget: 'umd', // UMD fixes 'exports is not defined'
139
139
  globalObject: 'this',
package/src/icon.ico DELETED
Binary file
package/test/test.mjs DELETED
@@ -1,27 +0,0 @@
1
- import { getAllPackages, categorizePackages, isWebSupported, generateAlias, generateFallback } from '../src/webpackConfigHelper.mjs';
2
- import { WEB_UNSUPPORTED_PACKAGES } from './nonmodules.mjs';
3
-
4
- console.log('Testing webpackConfigHelper...');
5
-
6
- // Test getAllPackages
7
- const allPackages = getAllPackages();
8
- console.log('All packages:', Object.keys(allPackages));
9
-
10
- // Test categorizePackages
11
- const { webSupported, webUnsupported } = categorizePackages();
12
- console.log('Web supported:', webSupported.length);
13
- console.log('Web unsupported:', webUnsupported.length);
14
-
15
- // Test isWebSupported
16
- console.log('react-native-web supported:', isWebSupported('react-native-web'));
17
- console.log('react-native-fs supported:', isWebSupported('react-native-fs'));
18
-
19
- // Test generateAlias
20
- const alias = generateAlias();
21
- console.log('Alias keys:', Object.keys(alias));
22
-
23
- // Test generateFallback
24
- const fallback = generateFallback();
25
- console.log('Fallback keys:', Object.keys(fallback));
26
-
27
- console.log('Tests completed.');