@mono-labs/cli 0.0.24 → 0.0.26

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 (2) hide show
  1. package/lib/app.js +6 -17
  2. package/package.json +1 -1
package/lib/app.js CHANGED
@@ -1,27 +1,23 @@
1
1
  import { Command } from 'commander'
2
2
 
3
3
  import { STAGING_URL } from './config.js'
4
- const packageJSON = JSON.parse(fs.readFileSync(join('./', 'package.json'), 'utf8'));
5
4
 
6
5
  import fs from 'node:fs';
7
6
  import { fileURLToPath } from 'node:url';
8
7
  import { dirname, join } from 'node:path';
9
8
 
10
- // path to this file's folder inside node_modules
9
+
11
10
  const __filename = fileURLToPath(import.meta.url);
12
11
  const __dirname = dirname(__filename);
13
12
 
14
- // package.json sitting next to this file (or one folder up as needed)
15
- const pkgPath = join(__dirname, '../', 'package.json'); // same folder
16
- // const pkgPath = join(__dirname, '..', 'package.json'); // parent folder
17
-
13
+ const pkgPath = join(__dirname, '../', 'package.json');
18
14
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
19
15
 
20
- const version = '0.0.1'
16
+ const version = pkg.version || '0.0.1'
21
17
  export const program = new Command()
22
18
 
23
19
  const getBinFromPackageJSON = () => {
24
- const keyList = Object.keys(packageJSON.bin);
20
+ const keyList = Object.keys(pkg.bin);
25
21
  if(keyList.length === 0) {
26
22
  throw new Error('No bin field found in package.json');
27
23
  }
@@ -29,17 +25,12 @@ const getBinFromPackageJSON = () => {
29
25
  }
30
26
 
31
27
 
32
- console.log('binfromjson', getBinFromPackageJSON());
33
-
34
- console.log('pkg', pkg);
35
-
36
28
  const programName = getBinFromPackageJSON();
37
- console.log('description', packageJSON.description);
29
+ console.log('description', pkg.description);
38
30
 
39
- program.name(programName).description(packageJSON.description || '').version(version)
31
+ program.name(programName).description(pkg.description || '').version(version)
40
32
  const EXPO_PUBLIC_API_URL =
41
33
  (process.env.EXPO_PUBLIC_API_URL && process.env.EXPO_PUBLIC_API_URL.length > 0) || STAGING_URL
42
- const CLIENT_NAME = process.env.CLIENT_NAME || 'jawdrop'
43
34
 
44
35
  export const generateEnvValues = (
45
36
  forceProd = false,
@@ -49,10 +40,8 @@ export const generateEnvValues = (
49
40
  return {
50
41
  ...process.env,
51
42
  EXPO_PUBLIC_API_URL,
52
- CLIENT_NAME,
53
43
  EXPO_FORCE_PROD: forceProd,
54
44
  EXPO_PRIVATE_API_URL: ngrokUrl,
55
45
  EXPO_UNSTABLE_ATLAS: useAtlas,
56
- EXPO_CLIENT_NAME: CLIENT_NAME,
57
46
  }
58
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",