@mono-labs/cli 0.0.62 → 0.0.64

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/lib/app.js CHANGED
@@ -1,47 +1,50 @@
1
- import { Command } from 'commander'
1
+ import { Command } from 'commander';
2
2
 
3
- import { STAGING_URL } from './config.js'
3
+ import { STAGING_URL } from './config.js';
4
4
 
5
5
  import fs from 'node:fs';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { dirname, join } from 'node:path';
8
8
 
9
-
10
9
  const __filename = fileURLToPath(import.meta.url);
11
10
  const __dirname = dirname(__filename);
12
11
 
13
- const pkgPath = join(__dirname, '../', 'package.json');
12
+ const pkgPath = join(__dirname, '../', 'package.json');
14
13
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
15
14
 
16
- const version = pkg.version || '0.0.1'
17
- export const program = new Command()
15
+ const version = pkg.version || '0.0.1';
16
+ export const program = new Command();
18
17
 
19
18
  const getBinFromPackageJSON = () => {
20
19
  const keyList = Object.keys(pkg.bin);
21
- if(keyList.length === 0) {
20
+ if (keyList.length === 0) {
22
21
  throw new Error('No bin field found in package.json');
23
22
  }
24
23
  return keyList[0];
25
- }
26
-
24
+ };
27
25
 
28
26
  const programName = getBinFromPackageJSON();
29
27
  console.log('description', pkg.description);
30
28
 
31
- program.name(programName).description(pkg.description || '').version(version)
32
- const EXPO_PUBLIC_API_URL =
33
- (process.env.EXPO_PUBLIC_API_URL && process.env.EXPO_PUBLIC_API_URL.length > 0) || STAGING_URL
29
+ program
30
+ .name(programName)
31
+ .description(pkg.description || '')
32
+ .version(version);
33
+ const NEXT_PUBLIC_API_URL =
34
+ (process.env.NEXT_PUBLIC_API_URL &&
35
+ process.env.NEXT_PUBLIC_API_URL.length > 0) ||
36
+ STAGING_URL;
34
37
 
35
38
  export const generateEnvValues = (
36
39
  forceProd = false,
37
40
  ngrokUrl = 'localhost:3000',
38
- useAtlas = false,
41
+ useAtlas = false
39
42
  ) => {
40
43
  return {
41
44
  ...process.env,
42
- EXPO_PUBLIC_API_URL,
43
- EXPO_FORCE_PROD: forceProd,
45
+ NEXT_PUBLIC_API_URL,
46
+ NEXT_FORCE_PROD: forceProd,
44
47
  EXPO_PRIVATE_API_URL: ngrokUrl,
45
48
  EXPO_UNSTABLE_ATLAS: useAtlas,
46
- }
47
- }
49
+ };
50
+ };
@@ -42,16 +42,16 @@ program
42
42
  console.log(`Building ${platform} with profile ${'`'}${profile}${'`'}`);
43
43
  console.log('\n\n\n');
44
44
 
45
- const EXPO_FORCE_PRODUCTION = str.force || isDev ? 'false' : 'true';
46
- console.log('EXPO_FORCE_PRODUCTION', EXPO_FORCE_PRODUCTION);
45
+ const NEXT_FORCE_PROD = str.force || isDev ? 'false' : 'true';
46
+ console.log('NEXT_FORCE_PROD', NEXT_FORCE_PROD);
47
47
 
48
- let envObj = generateEnvValues(EXPO_FORCE_PRODUCTION, '', false);
48
+ let envObj = generateEnvValues(NEXT_FORCE_PROD, '', false);
49
49
  if (!isDev) {
50
- envObj.EXPO_PUBLIC_API_URL = `${STAGING_URL}`;
51
- envObj.EXPO_FORCE_PROD = 'true';
50
+ envObj.NEXT_PUBLIC_API_URL = `${STAGING_URL}`;
51
+ envObj.NEXT_FORCE_PROD = 'true';
52
52
  } else {
53
- const publicUrl = process.env.EXPO_PUBLIC_API_URL || `${STAGING_URL}`;
54
- envObj.EXPO_PUBLIC_API_URL = publicUrl;
53
+ const publicUrl = process.env.NEXT_PUBLIC_API_URL || `${STAGING_URL}`;
54
+ envObj.NEXT_PUBLIC_API_URL = publicUrl;
55
55
  }
56
56
  console.log('envObj', envObj);
57
57
  envObj.EAS_BUILD_PROFILE = profile; // your custom variable
@@ -1,263 +1,276 @@
1
+ import { spawn } from 'child_process';
2
+ import 'dotenv/config';
3
+ import inquirer from 'inquirer';
4
+ import treeKill from 'tree-kill';
1
5
 
2
- import { spawn } from 'child_process'
3
- import 'dotenv/config'
4
- import inquirer from 'inquirer'
5
- import treeKill from 'tree-kill'
6
+ import { generateEnvValues } from '../../app.js';
7
+ import { STAGING_URL } from '../../config.js';
8
+ import { getNgrokUrl } from './ngrok.js';
6
9
 
7
- import { generateEnvValues } from '../../app.js'
8
- import { STAGING_URL } from '../../config.js'
9
- import { getNgrokUrl } from './ngrok.js'
10
-
11
- // EXPO_FORCE_PROD = true;
12
10
  // EXPO_UNSTABLE_ATLAS = false;
13
11
 
14
12
  // Import the runDevCommand function
15
13
  const colors = {
16
- red: '\x1b[31m',
17
- green: '\x1b[32m',
18
- yellow: '\x1b[33m',
19
- white: '\x1b[37m',
20
- blue: '\x1b[34m',
21
- magenta: '\x1b[35m',
22
- cyan: '\x1b[36m',
23
- reset: '\x1b[0m',
24
- }
14
+ red: '\x1b[31m',
15
+ green: '\x1b[32m',
16
+ yellow: '\x1b[33m',
17
+ white: '\x1b[37m',
18
+ blue: '\x1b[34m',
19
+ magenta: '\x1b[35m',
20
+ cyan: '\x1b[36m',
21
+ reset: '\x1b[0m',
22
+ };
25
23
 
26
24
  function getContinuedServices() {
27
- const continuedServices = Object.keys(devServices).filter((key) => devServices[key].continue)
28
- return continuedServices
25
+ const continuedServices = Object.keys(devServices).filter(
26
+ (key) => devServices[key].continue
27
+ );
28
+ return continuedServices;
29
29
  }
30
30
 
31
31
  function getPrepServices() {
32
- const continuedServices = Object.keys(devServices).filter((key) => !devServices[key].continue)
33
- return continuedServices
32
+ const continuedServices = Object.keys(devServices).filter(
33
+ (key) => !devServices[key].continue
34
+ );
35
+ return continuedServices;
34
36
  }
35
37
 
36
38
  const devServicesRoot = {
37
- docker: {
38
- command: 'docker compose up -d',
39
- key: '?',
40
- icon: '🐳',
41
- stdio: 'ignore',
42
- },
43
- backend: {
44
- command: 'yarn backend server',
45
- key: 'b',
46
- color: colors.yellow,
47
- continue: true,
48
- icon: '🦾',
49
- },
50
- // app: {
51
- // command: 'yarn workspace app expo start -c --tunnel --dev-client',
52
- // key: 'a',
53
- // color: colors.white,
54
- // continue: true,
55
- // icon: '📱',
56
- // stdio: ['inherit', 'inherit', 'inherit'],
57
- // },
58
- dynamo: {
59
- command: 'yarn backend dynamodb-admin -p 8082 --dynamo-endpoint=http://localhost:8000',
60
- key: 'd',
61
- continue: true,
62
- icon: '📦',
63
- },
64
- }
39
+ docker: {
40
+ command: 'docker compose up -d',
41
+ key: '?',
42
+ icon: '🐳',
43
+ stdio: 'ignore',
44
+ },
45
+ backend: {
46
+ command: 'yarn backend server',
47
+ key: 'b',
48
+ color: colors.yellow,
49
+ continue: true,
50
+ icon: '🦾',
51
+ },
52
+ // app: {
53
+ // command: 'yarn workspace app expo start -c --tunnel --dev-client',
54
+ // key: 'a',
55
+ // color: colors.white,
56
+ // continue: true,
57
+ // icon: '📱',
58
+ // stdio: ['inherit', 'inherit', 'inherit'],
59
+ // },
60
+ dynamo: {
61
+ command:
62
+ 'yarn backend dynamodb-admin -p 8082 --dynamo-endpoint=http://localhost:8000',
63
+ key: 'd',
64
+ continue: true,
65
+ icon: '📦',
66
+ },
67
+ };
65
68
 
66
- const devServices = {}
69
+ const devServices = {};
67
70
  Object.keys(devServicesRoot).forEach((key) => {
68
- const service = devServicesRoot[key]
69
- devServices[key] = {
70
- ...service,
71
- name: key,
72
- }
73
- })
74
- const childProcesses = {}
75
- let allowRestart = true
71
+ const service = devServicesRoot[key];
72
+ devServices[key] = {
73
+ ...service,
74
+ name: key,
75
+ };
76
+ });
77
+ const childProcesses = {};
78
+ let allowRestart = true;
76
79
 
77
- const totalRetries = 5
80
+ const totalRetries = 5;
78
81
 
79
82
  function startService(key, forceProd, ngrokUrl, stage, envObj) {
80
- const { command, stdio } = devServices[key]
81
- const isContinued = devServices[key].continue
83
+ const { command, stdio } = devServices[key];
84
+ const isContinued = devServices[key].continue;
82
85
 
83
- const child = spawn(command, {
84
- stdio: stdio ? stdio : ['ignore', 'pipe', 'pipe'],
85
- shell: true,
86
- env: {
87
- ...envObj,
88
- },
89
- })
86
+ const child = spawn(command, {
87
+ stdio: stdio ? stdio : ['ignore', 'pipe', 'pipe'],
88
+ shell: true,
89
+ env: {
90
+ ...envObj,
91
+ },
92
+ });
90
93
 
91
- childProcesses[key] = child
92
- childManager(child, devServices[key], false, () => {
93
- if (isContinued && allowRestart && key !== 'backend') {
94
- setTimeout(() => startService(key, forceProd, ngrokUrl, stage, envObj), 2000)
95
- }
96
- })
94
+ childProcesses[key] = child;
95
+ childManager(child, devServices[key], false, () => {
96
+ if (isContinued && allowRestart && key !== 'backend') {
97
+ setTimeout(
98
+ () => startService(key, forceProd, ngrokUrl, stage, envObj),
99
+ 2000
100
+ );
101
+ }
102
+ });
97
103
  }
98
104
 
99
105
  const write = (color, message) => {
100
- process.stdout.write(`${color}${message}${colors.reset}\n`)
101
- }
106
+ process.stdout.write(`${color}${message}${colors.reset}\n`);
107
+ };
102
108
 
103
- const serviceSigInt = {}
109
+ const serviceSigInt = {};
104
110
 
105
- function childManager(child, service, nowrite = false, restartCallback = undefined) {
106
- const color = service.color || undefined
107
- const writeToBox = (data) => {
108
- if (color) write(color, data.toString())
109
- }
111
+ function childManager(
112
+ child,
113
+ service,
114
+ nowrite = false,
115
+ restartCallback = undefined
116
+ ) {
117
+ const color = service.color || undefined;
118
+ const writeToBox = (data) => {
119
+ if (color) write(color, data.toString());
120
+ };
110
121
 
111
- if (!nowrite) {
112
- child.stdout?.on('data', writeToBox)
113
- child.stderr?.on('data', writeToBox)
114
- }
122
+ if (!nowrite) {
123
+ child.stdout?.on('data', writeToBox);
124
+ child.stderr?.on('data', writeToBox);
125
+ }
115
126
 
116
- child.on('sigint', (code) => {
117
- console.log('sigint')
118
- console.log(`\n${service.icon || '🔚'} ${service.name || 'Service'} exited with code ${code}`)
119
- if (restartCallback) restartCallback()
120
- })
127
+ child.on('sigint', (code) => {
128
+ console.log('sigint');
129
+ console.log(
130
+ `\n${service.icon || '🔚'} ${service.name || 'Service'} exited with code ${code}`
131
+ );
132
+ if (restartCallback) restartCallback();
133
+ });
121
134
 
122
- child.on('exit', (code) => {
123
- if (!serviceSigInt[service.name] && restartCallback) {
124
- console.log(
125
- `\n${service.icon || '🔚'} ${service.name || 'Service'} exited with code ${code}\n`
126
- )
127
- restartCallback()
128
- }
129
- })
135
+ child.on('exit', (code) => {
136
+ if (!serviceSigInt[service.name] && restartCallback) {
137
+ console.log(
138
+ `\n${service.icon || '🔚'} ${service.name || 'Service'} exited with code ${code}\n`
139
+ );
140
+ restartCallback();
141
+ }
142
+ });
130
143
  }
131
144
 
132
145
  export async function dev(_forceProd, useAtlas, argServices, stage) {
133
- const forceProd = stage === true ? true : _forceProd
134
- let acceptedServices = argServices || undefined
135
- if (acceptedServices === undefined && !stage) {
136
- const { acceptedServices: services } = await inquirer.prompt([
137
- {
138
- type: 'checkbox',
139
- name: 'acceptedServices',
140
- message: 'Select services to run:',
141
- choices: Object.keys(devServices).map((key) => ({
142
- name: key,
143
- value: key,
144
- })),
145
- default: Object.keys(devServices).map((key) => key),
146
- },
147
- ])
146
+ const forceProd = stage === true ? true : _forceProd;
147
+ let acceptedServices = argServices || undefined;
148
+ if (acceptedServices === undefined && !stage) {
149
+ const { acceptedServices: services } = await inquirer.prompt([
150
+ {
151
+ type: 'checkbox',
152
+ name: 'acceptedServices',
153
+ message: 'Select services to run:',
154
+ choices: Object.keys(devServices).map((key) => ({
155
+ name: key,
156
+ value: key,
157
+ })),
158
+ default: Object.keys(devServices).map((key) => key),
159
+ },
160
+ ]);
148
161
 
149
- acceptedServices = services
150
- }
162
+ acceptedServices = services;
163
+ }
151
164
 
152
- let ngrokUrl = ''
153
- if (!forceProd && !stage) {
154
- let envObj = generateEnvValues(forceProd)
155
- getPrepServices().forEach((key) => {
156
- const { command, stdio } = devServices[key]
157
- if (acceptedServices.includes(key)) {
158
- console.log(`Running command for service ${key}: ${command}`)
159
- const child = spawn(command, {
160
- stdio: ['pipe', 'inherit', 'pipe'], // Read from terminal, but capture output
161
- shell: true,
162
- env: {
163
- ...envObj,
164
- },
165
- })
166
- if (key === 'app') {
167
- child.on('sigint', () => {
168
- console.log('SIGINT received for app service')
169
- })
170
- child.on('exit', () => {
171
- console.log('exit received for app service')
172
- })
173
- }
165
+ let ngrokUrl = '';
166
+ if (!forceProd && !stage) {
167
+ let envObj = generateEnvValues(forceProd);
168
+ getPrepServices().forEach((key) => {
169
+ const { command, stdio } = devServices[key];
170
+ if (acceptedServices.includes(key)) {
171
+ console.log(`Running command for service ${key}: ${command}`);
172
+ const child = spawn(command, {
173
+ stdio: ['pipe', 'inherit', 'pipe'], // Read from terminal, but capture output
174
+ shell: true,
175
+ env: {
176
+ ...envObj,
177
+ },
178
+ });
179
+ if (key === 'app') {
180
+ child.on('sigint', () => {
181
+ console.log('SIGINT received for app service');
182
+ });
183
+ child.on('exit', () => {
184
+ console.log('exit received for app service');
185
+ });
186
+ }
174
187
 
175
- childProcesses[key] = child
176
- childManager(child, devServices[key], true)
177
- }
178
- })
188
+ childProcesses[key] = child;
189
+ childManager(child, devServices[key], true);
190
+ }
191
+ });
179
192
 
180
- while (!ngrokUrl) {
181
- try {
182
- ngrokUrl = (await getNgrokUrl()) + '/'
183
- } catch (e) {
184
- console.log('Ngrok failed to start. Retrying in 2 seconds...')
185
- console.log(e)
186
- await new Promise((res) => setTimeout(res, 2000)) // Delay before retry
187
- }
188
- }
189
- }
193
+ while (!ngrokUrl) {
194
+ try {
195
+ ngrokUrl = (await getNgrokUrl()) + '/';
196
+ } catch (e) {
197
+ console.log('Ngrok failed to start. Retrying in 2 seconds...');
198
+ console.log(e);
199
+ await new Promise((res) => setTimeout(res, 2000)); // Delay before retry
200
+ }
201
+ }
202
+ }
190
203
 
191
- let envObj = generateEnvValues(forceProd, ngrokUrl, useAtlas)
192
- if (stage) {
193
- envObj.EXPO_PUBLIC_API_URL = `${STAGING_URL}`
194
- envObj.ApiUrl = `${STAGING_URL}`
195
- envObj.EXPO_FORCE_PROD = 'true'
196
- } else {
197
- const publicUrl = process.env.EXPO_PUBLIC_API_URL || `${STAGING_URL}`
198
- envObj.EXPO_PUBLIC_API_URL = publicUrl
199
- envObj.ApiUrl = `${STAGING_URL}`
200
- }
204
+ let envObj = generateEnvValues(forceProd, ngrokUrl, useAtlas);
205
+ if (stage) {
206
+ envObj.NEXT_PUBLIC_API_URL = `${STAGING_URL}`;
207
+ envObj.ApiUrl = `${STAGING_URL}`;
208
+ envObj.NEXT_FORCE_PROD = 'true';
209
+ } else {
210
+ const publicUrl = process.env.NEXT_PUBLIC_API_URL || `${STAGING_URL}`;
211
+ envObj.NEXT_PUBLIC_API_URL = publicUrl;
212
+ envObj.ApiUrl = `${STAGING_URL}`;
213
+ }
201
214
 
202
- setTimeout(
203
- () => {
204
- console.log('ngrokUrl', ngrokUrl)
205
- console.log('envObj', envObj)
206
- getContinuedServices().forEach((key) => {
207
- if (stage && key === 'app') {
208
- startService(key, forceProd, ngrokUrl, stage, envObj)
209
- } else {
210
- if (!stage && acceptedServices.includes(key)) {
211
- startService(key, forceProd, ngrokUrl, stage, envObj)
212
- }
213
- }
214
- })
215
- },
216
- !forceProd ? 5000 : 100
217
- )
215
+ setTimeout(
216
+ () => {
217
+ console.log('ngrokUrl', ngrokUrl);
218
+ console.log('envObj', envObj);
219
+ getContinuedServices().forEach((key) => {
220
+ if (stage && key === 'app') {
221
+ startService(key, forceProd, ngrokUrl, stage, envObj);
222
+ } else {
223
+ if (!stage && acceptedServices.includes(key)) {
224
+ startService(key, forceProd, ngrokUrl, stage, envObj);
225
+ }
226
+ }
227
+ });
228
+ },
229
+ !forceProd ? 5000 : 100
230
+ );
218
231
 
219
- async function shutdown() {
220
- console.log('\n🛑 Shutting down all services...')
221
- for (const [key, child] of Object.entries(childProcesses)) {
222
- if (
223
- child &&
224
- child.pid &&
225
- !child.killed &&
226
- devServices[key].continue &&
227
- !['docker'].includes(key)
228
- ) {
229
- console.log(`→ Killing service: ${key}`)
230
- await new Promise((resolve) => {
231
- treeKill(child.pid, 'SIGTERM', (err) => {
232
- if (!err) {
233
- console.log(`✅ ${key} has been tree-killed.`)
234
- }
235
- resolve()
236
- })
237
- })
238
- }
239
- if (key === ' docker') {
240
- spawn(command, {
241
- stdio: 'docker-compose down', // Read from terminal, but capture output
242
- shell: true,
243
- env: {
244
- ...envObj,
245
- },
246
- })
247
- }
248
- }
249
- }
232
+ async function shutdown() {
233
+ console.log('\n🛑 Shutting down all services...');
234
+ for (const [key, child] of Object.entries(childProcesses)) {
235
+ if (
236
+ child &&
237
+ child.pid &&
238
+ !child.killed &&
239
+ devServices[key].continue &&
240
+ !['docker'].includes(key)
241
+ ) {
242
+ console.log(`→ Killing service: ${key}`);
243
+ await new Promise((resolve) => {
244
+ treeKill(child.pid, 'SIGTERM', (err) => {
245
+ if (!err) {
246
+ console.log(`✅ ${key} has been tree-killed.`);
247
+ }
248
+ resolve();
249
+ });
250
+ });
251
+ }
252
+ if (key === ' docker') {
253
+ spawn(command, {
254
+ stdio: 'docker-compose down', // Read from terminal, but capture output
255
+ shell: true,
256
+ env: {
257
+ ...envObj,
258
+ },
259
+ });
260
+ }
261
+ }
262
+ }
250
263
 
251
- process.on('SIGINT', () => {
252
- shutdown().then(() => process.exit(0))
253
- })
264
+ process.on('SIGINT', () => {
265
+ shutdown().then(() => process.exit(0));
266
+ });
254
267
 
255
- process.on('SIGTERM', () => {
256
- shutdown().then(() => process.exit(0))
257
- })
268
+ process.on('SIGTERM', () => {
269
+ shutdown().then(() => process.exit(0));
270
+ });
258
271
 
259
- // Exit signal
260
- process.on('exit', () => {
261
- console.log('👋 Process exiting...')
262
- })
272
+ // Exit signal
273
+ process.on('exit', () => {
274
+ console.log('👋 Process exiting...');
275
+ });
263
276
  }
@@ -1,8 +1,8 @@
1
- import { spawn } from 'child_process'
1
+ import { spawn } from 'child_process';
2
2
 
3
- import { program } from '../../app.js'
4
- import { generateEnvValues } from '../../app.js'
5
- import { STAGING_URL } from '../../config.js'
3
+ import { program } from '../../app.js';
4
+ import { generateEnvValues } from '../../app.js';
5
+ import { STAGING_URL } from '../../config.js';
6
6
 
7
7
  program
8
8
  .command('submit')
@@ -10,29 +10,29 @@ program
10
10
  .option('--android', 'Build to target preview profile')
11
11
  .option('--ios', 'Build to target production profile')
12
12
  .action((str, options) => {
13
- console.log('its me')
14
- console.log('test')
13
+ console.log('its me');
14
+ console.log('test');
15
15
  //console.log(options);
16
- console.log(str)
16
+ console.log(str);
17
17
 
18
- let envObj = generateEnvValues(true, '', false)
18
+ let envObj = generateEnvValues(true, '', false);
19
19
 
20
- envObj.EXPO_PUBLIC_API_URL = `${STAGING_URL}`
21
- envObj.EXPO_FORCE_PROD = 'true'
22
- envObj.EAS_BUILD_PROFILE = 'production'
20
+ envObj.NEXT_PUBLIC_API_URL = `${STAGING_URL}`;
21
+ envObj.NEXT_FORCE_PROD = 'true';
22
+ envObj.EAS_BUILD_PROFILE = 'production';
23
23
 
24
- const command = `workspace app eas submit ${str.android ? `--platform android` : `--platform ios`}`
25
- console.log('Running command:', command)
24
+ const command = `workspace app eas submit ${str.android ? `--platform android` : `--platform ios`}`;
25
+ console.log('Running command:', command);
26
26
  const child = spawn('yarn', [command], {
27
27
  stdio: 'inherit',
28
28
  shell: true, // required if using shell-style commands or cross-platform support
29
29
  env: {
30
30
  ...envObj,
31
31
  },
32
- })
32
+ });
33
33
 
34
34
  child.on('exit', (code) => {
35
- console.log(`Process exited with code ${code}`)
36
- process.exit(code ?? 0)
37
- })
38
- })
35
+ console.log(`Process exited with code ${code}`);
36
+ process.exit(code ?? 0);
37
+ });
38
+ });
@@ -1,13 +1,13 @@
1
- import { spawn } from 'child_process'
2
- import inquirer from 'inquirer'
1
+ import { spawn } from 'child_process';
2
+ import inquirer from 'inquirer';
3
3
 
4
- import { program } from '../../app.js'
5
- import { STAGING_URL } from '../../config.js'
6
- import { getEASBranches } from './eas.js'
4
+ import { program } from '../../app.js';
5
+ import { STAGING_URL } from '../../config.js';
6
+ import { getEASBranches } from './eas.js';
7
7
 
8
- const EXPO_PUBLIC_API_URL = STAGING_URL
9
- const EXPO_FORCE_PROD = true
10
- const EXPO_BUILD_PROFILE = 'production'
8
+ const NEXT_PUBLIC_API_URL = STAGING_URL;
9
+ const NEXT_FORCE_PROD = true;
10
+ const EXPO_BUILD_PROFILE = 'production';
11
11
 
12
12
  program
13
13
  .command('update')
@@ -16,7 +16,7 @@ program
16
16
  .action(async (str) => {
17
17
  //console.log(raw.toString());
18
18
 
19
- const { auto } = str
19
+ const { auto } = str;
20
20
 
21
21
  if (auto) {
22
22
  const fastChild = spawn(`yarn eas update --auto`, {
@@ -24,26 +24,26 @@ program
24
24
  shell: true,
25
25
  env: {
26
26
  ...process.env,
27
- EXPO_FORCE_PROD,
28
- EXPO_PUBLIC_API_URL,
27
+ NEXT_FORCE_PROD,
28
+ NEXT_PUBLIC_API_URL,
29
29
  EXPO_BUILD_PROFILE,
30
30
  },
31
- })
31
+ });
32
32
  fastChild.stdout.on('data', (data) => {
33
- process.stdout.write(data) // pipe to main stdout
34
- })
33
+ process.stdout.write(data); // pipe to main stdout
34
+ });
35
35
 
36
36
  fastChild.stderr.on('data', (data) => {
37
- process.stderr.write(data) // pipe errors
38
- })
37
+ process.stderr.write(data); // pipe errors
38
+ });
39
39
  fastChild.on('message', (data) => {
40
- console.log(`Message from child process: ${data}`)
41
- })
42
- return
40
+ console.log(`Message from child process: ${data}`);
41
+ });
42
+ return;
43
43
  }
44
44
 
45
- const branches = getEASBranches().map((branch) => branch.name)
46
- console.log('branches', branches)
45
+ const branches = getEASBranches().map((branch) => branch.name);
46
+ console.log('branches', branches);
47
47
 
48
48
  const { branch } = await inquirer.prompt([
49
49
  {
@@ -56,7 +56,7 @@ program
56
56
  })),
57
57
  default: Object.keys(branches).map((key) => branches[key]),
58
58
  },
59
- ])
59
+ ]);
60
60
 
61
61
  const { message } = await inquirer.prompt([
62
62
  {
@@ -66,27 +66,27 @@ program
66
66
  default: 'No message provided', // Optional default
67
67
  validate: (input) => input.trim() !== '' || 'Message cannot be empty.',
68
68
  },
69
- ])
70
- const command = `yarn eas update --branch ${branch} --message "${message}"`
69
+ ]);
70
+ const command = `yarn eas update --branch ${branch} --message "${message}"`;
71
71
  const child = spawn(`${command} --non-interactive`, {
72
72
  stdio: ['inherit', 'pipe', 'pipe'], // Read from terminal, but capture output
73
73
  shell: true,
74
74
  env: {
75
75
  ...process.env,
76
- EXPO_FORCE_PROD,
77
- EXPO_PUBLIC_API_URL,
76
+ NEXT_FORCE_PROD,
77
+ NEXT_PUBLIC_API_URL,
78
78
  EXPO_BUILD_PROFILE,
79
79
  },
80
- })
80
+ });
81
81
 
82
82
  child.stdout.on('data', (data) => {
83
- process.stdout.write(data) // pipe to main stdout
84
- })
83
+ process.stdout.write(data); // pipe to main stdout
84
+ });
85
85
 
86
86
  child.stderr.on('data', (data) => {
87
- process.stderr.write(data) // pipe errors
88
- })
87
+ process.stderr.write(data); // pipe errors
88
+ });
89
89
  child.on('message', (data) => {
90
- console.log(`Message from child process: ${data}`)
91
- })
92
- })
90
+ console.log(`Message from child process: ${data}`);
91
+ });
92
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",