@mono-labs/cli 0.0.16 → 0.0.18

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 +9 -5
  2. package/package.json +1 -1
package/lib/app.js CHANGED
@@ -1,24 +1,28 @@
1
1
  import { Command } from 'commander'
2
2
 
3
3
  import { STAGING_URL } from './config.js'
4
-
4
+ import fs from 'fs'
5
5
  import { join } from 'node:path';
6
- const packageJSON = JSON.parse(readFileSync(join('../', 'package.json'), 'utf8'));
6
+ const packageJSON = JSON.parse(fs.readFileSync(join('./', 'package.json'), 'utf8'));
7
7
 
8
8
  const version = '0.0.1'
9
9
  export const program = new Command()
10
10
 
11
11
  const getBinFromPackageJSON = () => {
12
- const keyList = Object.keys(packageJSON.bin());
12
+ const keyList = Object.keys(packageJSON.bin);
13
13
  if(keyList.length === 0) {
14
14
  throw new Error('No bin field found in package.json');
15
15
  }
16
- return typeof binField === 'string' ? binField : binField?.[Object.keys(binField)[0]];
16
+ return keyList[0];
17
17
  }
18
18
 
19
+
19
20
  console.log('binfromjson', getBinFromPackageJSON());
20
21
 
21
- program.name('haste').description('CLI to manage Haste project').version(version)
22
+ const programName = getBinFromPackageJSON();
23
+ console.log('description', packageJSON.description);
24
+
25
+ program.name(programName).description(packageJSON.description).version(version)
22
26
  const EXPO_PUBLIC_API_URL =
23
27
  (process.env.EXPO_PUBLIC_API_URL && process.env.EXPO_PUBLIC_API_URL.length > 0) || STAGING_URL
24
28
  const CLIENT_NAME = process.env.CLIENT_NAME || 'jawdrop'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",