@mono-labs/cli 0.0.36 → 0.0.38

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,49 +1,57 @@
1
- import fs from 'fs'
2
- import path from 'path'
1
+ import fs from 'fs';
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(), 'myfile.json');
6
6
  }
7
7
 
8
8
  export function getRootJson() {
9
- const jsonPath = path.join(process.cwd(), 'package.json') // cwd + file
10
- const raw = fs.readFileSync(jsonPath, 'utf-8')
11
- const data = JSON.parse(raw)
9
+ const jsonPath = path.join(process.cwd(), 'package.json'); // cwd + file
10
+ const raw = fs.readFileSync(jsonPath, 'utf-8');
11
+ const data = JSON.parse(raw);
12
12
 
13
- return data
13
+ return data;
14
14
  }
15
15
 
16
16
  export function getHasteFiles() {
17
- const dir = path.join(process.cwd(), '.mono')
17
+ const dir = path.join(process.cwd(), '.mono');
18
18
 
19
- if (!fs.existsSync(dir)) {
20
- return []
21
- }
19
+ if (!fs.existsSync(dir)) {
20
+ return [];
21
+ }
22
22
 
23
- const files = fs.readdirSync(dir) // names only
24
- return files.map((f) => path.join(dir, f))
23
+ const files = fs.readdirSync(dir); // names only
24
+ return files.map((f) => path.join(dir, f));
25
25
  }
26
26
 
27
27
  const workspaceMap = {
28
- "web": "next-app",
29
- "app": "expo-app"
30
- }
28
+ web: 'next-app',
29
+ app: 'expo-app',
30
+ };
31
31
  export function getHasteConfig() {
32
- const objHaste = getHasteFiles()
33
- const hasteFileConfig = {}
34
- for (const file of objHaste) {
35
- const fileName = path.basename(file).replace('.json', '')
36
- if(fileName === 'config') {
37
- continue
38
- } else {
39
- const raw = fs.readFileSync(file, 'utf-8')
40
- console.log('file content', file, raw)
41
- const data = JSON.parse(raw)
42
- hasteFileConfig[fileName] = data
43
- }
44
- }
45
-
46
- return {files:hasteFileConfig, config: {
47
- workspace: workspaceMap
48
- }}
32
+ const objHaste = getHasteFiles();
33
+ const hasteFileConfig = {};
34
+ let configObject = {};
35
+ for (const file of objHaste) {
36
+ const fileName = path.basename(file).replace('.json', '');
37
+ if (fileName === 'config') {
38
+ const raw = fs.readFileSync(file, 'utf-8');
39
+ console.log('file content', file, raw);
40
+ const data = JSON.parse(raw);
41
+ if (data) configObject = data;
42
+ } else {
43
+ const raw = fs.readFileSync(file, 'utf-8');
44
+ console.log('file content', file, raw);
45
+ const data = JSON.parse(raw);
46
+ hasteFileConfig[fileName] = data;
47
+ }
48
+ }
49
+
50
+ return {
51
+ files: hasteFileConfig,
52
+ // config: {
53
+ // workspace: workspaceMap,
54
+ // },
55
+ config: configObject,
56
+ };
49
57
  }
package/lib/index.js CHANGED
@@ -14,12 +14,7 @@ import './commands/seed/index.js'
14
14
  import './commands/submit/index.js'
15
15
  import './commands/update/index.js'
16
16
  import './commands/build-process/index.js'
17
- import { getHasteConfig} from '../loadFromRoot.js'
18
- const workspaceMap = {
19
- "web": "next-app",
20
- "app": "expo-app"
21
- }
22
-
17
+ import { getHasteConfig} from './commands/loadFromRoot.js'
23
18
 
24
19
  const {config} = getHasteConfig()
25
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -35,6 +35,7 @@
35
35
  "cross-spawn": "^7.0.6",
36
36
  "dotenv": "^17.2.0",
37
37
  "inquirer": "^12.8.2",
38
+ "prettier": "^3.6.2",
38
39
  "tree-kill": "^1.2.2"
39
40
  },
40
41
  "devDependencies": {