@mono-labs/cli 0.0.87 → 0.0.89

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,4 +1,5 @@
1
1
  import { program } from '../../app.js';
2
+ import { Command } from 'commander';
2
3
  import runHasteCommand from './runHasteCommand.js';
3
4
  import { verifyOptionValue } from './validators.js';
4
5
  import { mergeData, setData } from './dataLayer.js';
@@ -7,6 +8,33 @@ import { getHasteConfig } from '../loadFromRoot.js';
7
8
  * Register commander commands for each haste file definition.
8
9
  * Handles argument, options, validation, and action wiring.
9
10
  */
11
+ export function createCliCommands() {
12
+ const config = new Command('config').description('Manage configuration');
13
+
14
+ config
15
+ .command('set <key> <value>')
16
+ .description('Set a configuration value')
17
+ .action((key, value) => {
18
+ console.log(`Setting ${key} to ${value}`);
19
+ });
20
+
21
+ config
22
+ .command('get <key>')
23
+ .description('Get a configuration value')
24
+ .action((key) => {
25
+ console.log(`Value of ${key} is ...`);
26
+ });
27
+
28
+ config
29
+ .command('list')
30
+ .description('List all configuration values')
31
+ .action(() => {
32
+ console.log('Listing config...');
33
+ });
34
+
35
+ return config;
36
+ }
37
+
10
38
  export function buildCommands(files) {
11
39
  const { config } = getHasteConfig();
12
40
  Object.entries(files).forEach(([commandName, configObject]) => {
@@ -1,7 +1,8 @@
1
1
  // Orchestrator for modular build-process command system.
2
2
  import { boot } from './boot.js';
3
- import { buildCommands } from './cliFactory.js';
3
+ import { buildCommands, createCliCommands } from './cliFactory.js';
4
4
  import { ensureSignalHandlers } from './runners/processManager.js';
5
+ import { program } from '../../app.js';
5
6
 
6
7
  const { files, config, rootDir } = boot();
7
8
  console.log('[build-process] root:', rootDir);
@@ -9,5 +10,6 @@ console.log('[build-process] commands discovered:', Object.keys(files));
9
10
 
10
11
  ensureSignalHandlers();
11
12
  buildCommands(files);
13
+ program.addCommand(createCliCommands());
12
14
 
13
15
  // (No direct export; importing this file registers commands on the shared commander program.)
@@ -24,12 +24,16 @@ export function getHasteFiles() {
24
24
  return files.map((f) => path.join(dir, f));
25
25
  }
26
26
 
27
+ const disallowedFiles = ['tools'];
28
+
27
29
  export function getHasteConfig() {
28
30
  const objHaste = getHasteFiles();
29
31
  const hasteFileConfig = {};
30
32
  let configObject = {};
31
33
  for (const file of objHaste) {
32
34
  const fileName = path.basename(file).replace('.json', '');
35
+ if (disallowedFiles.includes(fileName))
36
+ throw new Error(`Disallowed file name in .mono directory: ${fileName}`);
33
37
  if (fileName === 'config') {
34
38
  const raw = fs.readFileSync(file, 'utf-8');
35
39
  const data = JSON.parse(raw);
package/lib/index.js CHANGED
@@ -38,6 +38,7 @@ program.on('command:*', (operands) => {
38
38
 
39
39
  let envObj = {};
40
40
 
41
+ console.log('envKeys:', envKeys);
41
42
  envKeys.map((k) => {
42
43
  envMapList.map((item) => {
43
44
  envObj[k.replace('MONO', item)] = process.env[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",