@chrisivey01/builder 1.0.5 → 1.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.
Files changed (3) hide show
  1. package/index.d.ts +4 -0
  2. package/index.js +15 -4
  3. package/package.json +4 -1
package/index.d.ts CHANGED
@@ -47,6 +47,10 @@ export type BuilderOptions = {
47
47
  * - Port for web dev server. Defaults to 5173
48
48
  */
49
49
  webDevPort?: number;
50
+ /**
51
+ * - Server IP address for remote access. Checks SERVER_IP or HOST env vars if not provided
52
+ */
53
+ serverIP?: string;
50
54
  /**
51
55
  * - Build configurations for different targets
52
56
  */
package/index.js CHANGED
@@ -20,15 +20,26 @@ import { basename, resolve } from 'path';
20
20
  * @property {number} [restartTimeout] - Timeout for restart requests in milliseconds. Defaults to 2000
21
21
  * @property {number} [debounceDelay] - Debounce delay for rebuilds in milliseconds. Defaults to 500
22
22
  * @property {number} [webDevPort] - Port for web dev server. Defaults to 5173
23
+ * @property {string} [serverIP] - Server IP address for remote access. Checks SERVER_IP or HOST env vars if not provided
23
24
  * @property {Record<string, BuildConfig>} [builds] - Build configurations for different targets
24
25
  * @property {Record<string, string>} [define] - Additional esbuild define values
25
26
  */
26
27
 
27
28
  /**
28
- * Get the local network IP address
29
- * @returns {string} The local IP address or fallback to 127.0.0.1
29
+ * Get the network IP address for remote access
30
+ * Checks environment variables first (SERVER_IP or HOST) for remote development
31
+ * @returns {string} The network IP address or fallback to 127.0.0.1
30
32
  */
31
- function getLocalIP() {
33
+ function getNetworkIP() {
34
+ // Check environment variables first for remote development
35
+ if (process.env.SERVER_IP) {
36
+ return process.env.SERVER_IP;
37
+ }
38
+ if (process.env.HOST) {
39
+ return process.env.HOST;
40
+ }
41
+
42
+ // Try to get from network interfaces
32
43
  const nets = networkInterfaces();
33
44
  for (const name of Object.keys(nets)) {
34
45
  for (const net of nets[name]) {
@@ -54,7 +65,7 @@ export async function build(options = {}) {
54
65
  const IS_REDM = args.includes('--redm');
55
66
  const HAS_WEB_DIR = fs.existsSync(resolve(cwd, './web'));
56
67
  const PORT = IS_REDM ? 4700 : 4689;
57
- const SERVER_IP = getLocalIP();
68
+ const SERVER_IP = options.serverIP || getNetworkIP();
58
69
 
59
70
  // Configuration defaults
60
71
  const config = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisivey01/builder",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Build tool for FiveM/RedM resources with watch mode and auto-restart",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -22,6 +22,9 @@
22
22
  ],
23
23
  "author": "Chris Ivey",
24
24
  "license": "MIT",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
25
28
  "dependencies": {
26
29
  "esbuild": "^0.27.2"
27
30
  },