@mono-labs/cli 0.0.13 → 0.0.14

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