@mono-labs/cli 0.0.228 → 0.0.229

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,6 +1,6 @@
1
- // Boot logic: load root + haste configuration
1
+ // Boot logic: load root + mono configuration
2
2
  import {
3
- getHasteConfig,
3
+ getMonoConfig,
4
4
  getRootDirectory,
5
5
  getRootJson,
6
6
  } from '../loadFromRoot.js';
@@ -8,7 +8,7 @@ import {
8
8
  export function boot() {
9
9
  const rootDir = getRootDirectory();
10
10
  const rootJson = getRootJson();
11
- const { files, config } = getHasteConfig();
11
+ const { files, config } = getMonoConfig();
12
12
  return { rootDir, rootJson, files, config };
13
13
  }
14
14
 
@@ -1,13 +1,13 @@
1
1
  import { program } from '../../app.js';
2
2
  import { Command } from 'commander';
3
- import runHasteCommand from './runHasteCommand.js';
3
+ import runMonoCommand from './runMonoCommand.js';
4
4
  import { verifyOptionValue } from './validators.js';
5
5
  import { mergeData, setData } from './dataLayer.js';
6
- import { getHasteConfig } from '../loadFromRoot.js';
6
+ import { getMonoConfig } from '../loadFromRoot.js';
7
7
  import { pruneRepo } from '../prune/prune.js';
8
8
  import { testFlag } from './testflag.js';
9
9
  /**
10
- * Register commander commands for each haste file definition.
10
+ * Register commander commands for each mono file definition.
11
11
  * Handles argument, options, validation, and action wiring.
12
12
  */
13
13
  export function createConfigCommands() {
@@ -44,7 +44,7 @@ export function createCliCommands() {
44
44
 
45
45
  export function buildCommands(files) {
46
46
  try {
47
- const { config } = getHasteConfig();
47
+ const { config } = getMonoConfig();
48
48
  Object.entries(files).forEach(([commandName, configObject]) => {
49
49
  const optionsData = configObject.options || {};
50
50
 
@@ -147,7 +147,7 @@ export function buildCommands(files) {
147
147
  const argVal = arg || configObject.argument?.default;
148
148
 
149
149
  mergeData({ ...optionVals, arg: argVal });
150
- await runHasteCommand(configObject, optionVals);
150
+ await runMonoCommand(configObject, optionVals);
151
151
  } catch (err) {
152
152
  console.error('Error executing mono command:', err.message);
153
153
  }
@@ -1,7 +1,7 @@
1
1
  import { runForeground } from './runners/runForeground.js';
2
2
  import { runBackground } from './runners/runBackground.js';
3
3
  import { killAllBackground } from './runners/processManager.js';
4
- import { getHasteConfig } from '../loadFromRoot.js';
4
+ import { getMonoConfig } from '../loadFromRoot.js';
5
5
  import { parseEnvFile } from './readEnv.js';
6
6
  import path from 'node:path';
7
7
  import { testFlag } from './testflag.js';
@@ -19,14 +19,14 @@ export function getAllowAllKeys(cfg) {
19
19
  }
20
20
 
21
21
  /**
22
- * Orchestrate execution of a single haste command definition.
22
+ * Orchestrate execution of a single mono command definition.
23
23
  * Phases:
24
24
  * 1. Preactions (sequential, blocking) via runForeground
25
25
  * 2. Actions (background except last; last attached) via runBackground
26
26
  * Environment selection based on --stage flag and injection of AWS_PROFILE.
27
27
  */
28
- export async function runHasteCommand(configObject, options = {}) {
29
- const { config } = getHasteConfig();
28
+ export async function runMonoCommand(configObject, options = {}) {
29
+ const { config } = getMonoConfig();
30
30
  const devConfig = configObject.environments?.dev ?? {};
31
31
 
32
32
  // Usage:
@@ -102,4 +102,4 @@ export async function runHasteCommand(configObject, options = {}) {
102
102
  }
103
103
  }
104
104
 
105
- export default runHasteCommand;
105
+ export default runMonoCommand;
@@ -1,5 +1,5 @@
1
1
  import { execSync } from 'child_process';
2
- import { getRootJson, getHasteConfig } from '../loadFromRoot.js';
2
+ import { getRootJson, getMonoConfig } from '../loadFromRoot.js';
3
3
 
4
4
  //Run Action List before all script actions
5
5
 
@@ -10,7 +10,7 @@ export function executeCommandsIfWorkspaceAction(
10
10
  commands = [],
11
11
  fullEnv
12
12
  ) {
13
- const { config } = getHasteConfig();
13
+ const { config } = getMonoConfig();
14
14
  const workspacemap = config.workspace?.packageMaps || {};
15
15
 
16
16
  const result = execSync('yarn workspaces list --json', { encoding: 'utf8' })
@@ -13,7 +13,7 @@ export function getRootJson() {
13
13
  return data;
14
14
  }
15
15
 
16
- export function getHasteFiles() {
16
+ export function getMonoFiles() {
17
17
  const dir = path.join(process.cwd(), '.mono');
18
18
 
19
19
  if (!fs.existsSync(dir)) {
@@ -26,11 +26,11 @@ export function getHasteFiles() {
26
26
 
27
27
  const disallowedFiles = ['tools'];
28
28
 
29
- export function getHasteConfig() {
30
- const objHaste = getHasteFiles();
31
- const hasteFileConfig = {};
29
+ export function getMonoConfig() {
30
+ const objMono = getMonoFiles();
31
+ const monoFileConfig = {};
32
32
  let configObject = {};
33
- for (const file of objHaste) {
33
+ for (const file of objMono) {
34
34
  const fileName = path.basename(file).replace('.json', '');
35
35
  if (disallowedFiles.includes(fileName))
36
36
  throw new Error(`Disallowed file name in .mono directory: ${fileName}`);
@@ -41,12 +41,12 @@ export function getHasteConfig() {
41
41
  } else {
42
42
  const raw = fs.readFileSync(file, 'utf-8');
43
43
  const data = JSON.parse(raw);
44
- hasteFileConfig[fileName] = data;
44
+ monoFileConfig[fileName] = data;
45
45
  }
46
46
  }
47
47
 
48
48
  return {
49
- files: hasteFileConfig,
49
+ files: monoFileConfig,
50
50
  // config: {
51
51
  // workspace: workspaceMap,
52
52
  // },
@@ -1,6 +1,6 @@
1
- import { getHasteConfig } from './commands/loadFromRoot.js';
1
+ import { getMonoConfig } from './commands/loadFromRoot.js';
2
2
  export function generateNewEnvList(processEnv) {
3
- const { config } = getHasteConfig();
3
+ const { config } = getMonoConfig();
4
4
 
5
5
  const envMapList = config.envMap ?? ['FAILURE'];
6
6
  const envKeys = Object.keys(processEnv).filter((k) => k.startsWith('MONO_'));
package/lib/index.js CHANGED
@@ -9,14 +9,14 @@ import './commands/seed/index.js';
9
9
  import './commands/submit/index.js';
10
10
  import './commands/update/index.js';
11
11
  import './commands/build-process/index.js';
12
- import { getHasteConfig } from './commands/loadFromRoot.js';
12
+ import { getMonoConfig } from './commands/loadFromRoot.js';
13
13
  import { executeCommandsIfWorkspaceAction } from './commands/build-process/test.js';
14
14
  import os from 'node:os';
15
15
  import path from 'node:path';
16
16
  const homeBin = path.join(os.homedir(), 'bin');
17
17
  const PATH = [homeBin, process.env.PATH].filter(Boolean).join(path.delimiter);
18
18
 
19
- const { config } = getHasteConfig();
19
+ const { config } = getMonoConfig();
20
20
 
21
21
  const workspacemap = config.workspace?.packageMaps || {};
22
22
  const preactions = config.workspace?.preactions || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.228",
3
+ "version": "0.0.229",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types.d.ts",
package/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Type definitions for mono-labs CLI
2
2
 
3
3
  declare module '@mono-labs/cli' {
4
- export interface HasteConfig {
4
+ export interface MonoConfig {
5
5
  envMap?: Record<string, string>;
6
6
  workspace?: {
7
7
  packageMaps?: Record<string, string>;
@@ -9,7 +9,7 @@ declare module '@mono-labs/cli' {
9
9
  };
10
10
  }
11
11
 
12
- export interface HasteFiles {
12
+ export interface MonoFiles {
13
13
  [commandName: string]: CommandConfig;
14
14
  }
15
15
 
@@ -42,8 +42,8 @@ declare module '@mono-labs/cli' {
42
42
  export interface BootResult {
43
43
  rootDir: string;
44
44
  rootJson: any;
45
- files: HasteFiles;
46
- config: HasteConfig;
45
+ files: MonoFiles;
46
+ config: MonoConfig;
47
47
  }
48
48
 
49
49
  export function filterUnwantedEnvVarsEAS(env: string): NodeJS.ProcessEnv;
@@ -60,17 +60,17 @@ declare module '@mono-labs/cli' {
60
60
 
61
61
  export function boot(): BootResult;
62
62
 
63
- export function getHasteConfig(): {
64
- files: HasteFiles;
65
- config: HasteConfig;
63
+ export function getMonoConfig(): {
64
+ files: MonoFiles;
65
+ config: MonoConfig;
66
66
  };
67
67
 
68
68
  export function getRootDirectory(): string;
69
69
  export function getRootJson(): any;
70
70
 
71
- export function buildCommands(files: HasteFiles): void;
71
+ export function buildCommands(files: MonoFiles): void;
72
72
 
73
- export function runHasteCommand(
73
+ export function runMonoCommand(
74
74
  configObject: CommandConfig,
75
75
  options: Record<string, any>
76
76
  ): Promise<void>;