@mono-labs/cli 0.0.54 → 0.0.55

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.
@@ -1,71 +1,73 @@
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
- const allowedPlatforms = ['ios', 'android']
7
+ const allowedPlatforms = ['ios', 'android'];
8
8
  function selectPlatform(platform) {
9
- if (!allowedPlatforms.includes(platform))
10
- throw new Error(`Invalid platform selected, must be one of ${allowedPlatforms.join(', ')}`)
11
- return platform
9
+ if (!allowedPlatforms.includes(platform))
10
+ throw new Error(
11
+ `Invalid platform selected, must be one of ${allowedPlatforms.join(', ')}`
12
+ );
13
+ return platform;
12
14
  }
13
15
 
14
16
  function selectProfile(dev, preview, prod, profile) {
15
- if (profile && (dev || preview || prod)) {
16
- throw new Error('Conflict between profile and dev/preview/prod')
17
- }
18
- if (dev) return 'development'
19
- if (preview) return 'preview'
20
- if (prod) return 'production'
21
- if (profile) return profile
22
- return 'development'
17
+ if (profile && (dev || preview || prod)) {
18
+ throw new Error('Conflict between profile and dev/preview/prod');
19
+ }
20
+ if (dev) return 'development';
21
+ if (preview) return 'preview';
22
+ if (prod) return 'production';
23
+ if (profile) return profile;
24
+ return 'development';
23
25
  }
24
26
 
25
27
  program
26
- .command('build')
27
- .description('Execute eas build command')
28
- .option('-d', 'Build to target development profile')
29
- .option('-p', 'Build to target preview profile')
30
- .option('--live', 'Build to target production profile')
31
- .option('--profile <string>', 'Build profile to use')
32
- .option('--os, --platform <string>', 'Platform to build', 'ios')
33
- .option('-f, --force', 'Force build to target production server')
34
- .action((str, options) => {
35
- console.log('its me')
36
- const platform = selectPlatform(str.platform)
37
- const profile = selectProfile(str.d, str.p, str.live, str.profile)
38
- const isDev = profile === 'development'
39
- //console.log(options);
40
- console.log(`Building ${platform} with profile ${'`'}${profile}${'`'}`)
41
- console.log('\n\n\n')
28
+ .command('build')
29
+ .description('Execute eas build command')
30
+ .option('-d', 'Build to target development profile')
31
+ .option('-p', 'Build to target preview profile')
32
+ .option('--live', 'Build to target production profile')
33
+ .option('--profile <string>', 'Build profile to use')
34
+ .option('--os, --platform <string>', 'Platform to build', 'ios')
35
+ .option('-f, --force', 'Force build to target production server')
36
+ .action((str, options) => {
37
+ console.log('its me');
38
+ const platform = selectPlatform(str.platform);
39
+ const profile = selectProfile(str.d, str.p, str.live, str.profile);
40
+ const isDev = profile === 'development';
41
+ //console.log(options);
42
+ console.log(`Building ${platform} with profile ${'`'}${profile}${'`'}`);
43
+ console.log('\n\n\n');
42
44
 
43
- const EXPO_FORCE_PRODUCTION = str.force || isDev ? 'false' : 'true'
44
- console.log('EXPO_FORCE_PRODUCTION', EXPO_FORCE_PRODUCTION)
45
+ const EXPO_FORCE_PRODUCTION = str.force || isDev ? 'false' : 'true';
46
+ console.log('EXPO_FORCE_PRODUCTION', EXPO_FORCE_PRODUCTION);
45
47
 
46
- let envObj = generateEnvValues(EXPO_FORCE_PRODUCTION, '', false)
47
- if (!isDev) {
48
- envObj.EXPO_PUBLIC_API_URL = `${STAGING_URL}`
49
- envObj.EXPO_FORCE_PROD = 'true'
50
- } else {
51
- const publicUrl = process.env.EXPO_PUBLIC_API_URL || `${STAGING_URL}`
52
- envObj.EXPO_PUBLIC_API_URL = publicUrl
53
- }
54
- console.log('envObj', envObj)
55
- envObj.EAS_BUILD_PROFILE = profile // your custom variable
48
+ let envObj = generateEnvValues(EXPO_FORCE_PRODUCTION, '', false);
49
+ if (!isDev) {
50
+ envObj.EXPO_PUBLIC_API_URL = `${STAGING_URL}`;
51
+ envObj.EXPO_FORCE_PROD = 'true';
52
+ } else {
53
+ const publicUrl = process.env.EXPO_PUBLIC_API_URL || `${STAGING_URL}`;
54
+ envObj.EXPO_PUBLIC_API_URL = publicUrl;
55
+ }
56
+ console.log('envObj', envObj);
57
+ envObj.EAS_BUILD_PROFILE = profile; // your custom variable
56
58
 
57
- const command = `w expo-app eas build --profile ${profile} --platform ${platform}`
58
- console.log('Running command:', command)
59
- const child = spawn('yarn', [command], {
60
- stdio: 'inherit',
61
- shell: true, // required if using shell-style commands or cross-platform support
62
- env: {
63
- ...envObj,
64
- },
65
- })
59
+ const command = `mono eas build --profile ${profile} --platform ${platform}`;
60
+ console.log('Running command:', command);
61
+ const child = spawn('yarn', [command], {
62
+ stdio: 'inherit',
63
+ shell: true, // required if using shell-style commands or cross-platform support
64
+ env: {
65
+ ...envObj,
66
+ },
67
+ });
66
68
 
67
- child.on('exit', (code) => {
68
- console.log(`Process exited with code ${code}`)
69
- process.exit(code ?? 0)
70
- })
71
- })
69
+ child.on('exit', (code) => {
70
+ console.log(`Process exited with code ${code}`);
71
+ process.exit(code ?? 0);
72
+ });
73
+ });
@@ -2,7 +2,7 @@ import fs from 'fs';
2
2
  import path from 'path';
3
3
 
4
4
  export function getRootDirectory() {
5
- return path.join(process.cwd(), 'myfile.json');
5
+ return path.join(process.cwd());
6
6
  }
7
7
 
8
8
  export function getRootJson() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",