@mainset/cli 0.3.2 → 0.4.0-rc.1

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,3 +1,3 @@
1
- export * from './node-package.mjs';
1
+ export * from './node-sourcer.mjs';
2
2
  export * from './source-code.mjs';
3
3
  export * from './web-app.mjs';
@@ -3,10 +3,10 @@ import path from 'path';
3
3
  import { runtimePathById } from '../runtime/index.mjs';
4
4
  import { consoleColorize, initProcessCatchErrorLogger, } from '../utils/index.mjs';
5
5
  import { execImmediatePurgeDist, execImmediateRslibCLICommand, execImmediateTypeScriptCompileTypeOnly, runStreamingRslibCLICommand, runStreamingTypeScriptCompileTypeOnly, } from './process-runner-chunks/index.mjs';
6
- function registerNodePackageCommand(program) {
6
+ function registerNodeSourcerCommand(program) {
7
7
  program
8
- .command('node-package')
9
- .description('Run node package build or watch using Rslib')
8
+ .command('node-sourcer')
9
+ .description('Run node-sourcer build or watch using Rslib')
10
10
  .requiredOption('-e, --exec <type>', 'Execution mode: build or watch')
11
11
  // .option('-b, --builder <builder>', 'Builder tool (default: rslib)', 'rslib')
12
12
  .option('-c, --config <path>', 'Path to config file', './rslib.config.mts')
@@ -17,10 +17,10 @@ function registerNodePackageCommand(program) {
17
17
  ? customRslibConfigPath
18
18
  : path.resolve(runtimePathById.root,
19
19
  // NOTE: possibility to check if package is installed, otherwise throw error
20
- 'node_modules', '@mainset/builder-rslib/dist/esm/rslib.node-package.config.mjs');
20
+ 'node_modules', '@mainset/builder-rslib/dist/esm/rslib.node-sourcer.config.mjs');
21
21
  if (options.exec === 'build') {
22
22
  // ========== Build mode ==========
23
- console.log('\n🏗️ [mainset cli] node-package: build');
23
+ console.log('\n🏗️ [mainset cli] node-sourcer: build');
24
24
  try {
25
25
  // Step 1: purge dist folder
26
26
  execImmediatePurgeDist();
@@ -32,12 +32,12 @@ function registerNodePackageCommand(program) {
32
32
  console.log('\n✅ Build completed successfully\n');
33
33
  }
34
34
  catch (error) {
35
- initProcessCatchErrorLogger('node-package', error, 'build');
35
+ initProcessCatchErrorLogger('node-sourcer', error, 'build');
36
36
  }
37
37
  }
38
38
  else if (options.exec === 'watch') {
39
39
  // ========== Watch mode ==========
40
- console.log('\n🏗️ [mainset cli] node-package: watch');
40
+ console.log('\n🏗️ [mainset cli] node-sourcer: watch');
41
41
  try {
42
42
  // Step 1: purge dist folder
43
43
  execImmediatePurgeDist();
@@ -52,13 +52,13 @@ function registerNodePackageCommand(program) {
52
52
  runStreamingTypeScriptCompileTypeOnly();
53
53
  }
54
54
  catch (error) {
55
- initProcessCatchErrorLogger('node-package', error, 'watch');
55
+ initProcessCatchErrorLogger('node-sourcer', error, 'watch');
56
56
  }
57
57
  }
58
58
  else {
59
- console.error(consoleColorize('BRIGHT_YELLOW', `[mainset cli][node-package] Unknown exec mode: "${options.exec}"`));
59
+ console.error(consoleColorize('BRIGHT_YELLOW', `[mainset cli][node-sourcer] Unknown exec mode: "${options.exec}"`));
60
60
  process.exit(1);
61
61
  }
62
62
  });
63
63
  }
64
- export { registerNodePackageCommand };
64
+ export { registerNodeSourcerCommand };
@@ -18,7 +18,7 @@ function registerWebAppCommand(program) {
18
18
  .option('--serveMode <mode>', 'Serve mode: ssr or csr (default: ssr)', 'ssr')
19
19
  .action((options) => {
20
20
  // !IMPORTANT: Load environment variables from .env file ONLY when we are compiling Web Applications
21
- // as it logs {missing .env file} console error during {course-code} / {node-package} compilation
21
+ // as it logs {missing .env file} console error during {source-code} / {node-sourcer} compilation
22
22
  initDotenv();
23
23
  // Step 0: determinate command params
24
24
  const customWebpackConfigPath = path.resolve(runtimePathById.root, options.config || './config/webpack.config.mjs');
@@ -3,7 +3,7 @@ function initDotenv() {
3
3
  // Load environment-specific .env file
4
4
  return dotenv.config();
5
5
  }
6
- // REVIEW: investigate if {.env} file need's to be loaded during {course-code} / {node-package} compilation
6
+ // REVIEW: investigate if {.env} file need's to be loaded during {source-code} / {node-sourcer} compilation
7
7
  // Auto-execute configuration
8
8
  // initDotenv();
9
9
  export { initDotenv };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
- import { registerNodePackageCommand, registerSourceCodeCommand, registerWebAppCommand, } from './commands/index.mjs';
3
+ import { registerNodeSourcerCommand, registerSourceCodeCommand, registerWebAppCommand, } from './commands/index.mjs';
4
4
  import { verifyOrSetNodeEnv } from './utils/index.mjs';
5
5
  // !IMPORTANT: Set NODE_ENV is case it is not passed
6
6
  verifyOrSetNodeEnv();
@@ -10,6 +10,6 @@ program
10
10
  .description('CLI to manage frontend tooling and infrastructure')
11
11
  .version('0.1.0');
12
12
  registerSourceCodeCommand(program);
13
- registerNodePackageCommand(program);
13
+ registerNodeSourcerCommand(program);
14
14
  registerWebAppCommand(program);
15
15
  program.parse(process.argv);
@@ -1,3 +1,3 @@
1
- export * from './node-package.mjs';
1
+ export * from './node-sourcer.mjs';
2
2
  export * from './source-code.mjs';
3
3
  export * from './web-app.mjs';
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ declare function registerNodeSourcerCommand(program: Command): void;
3
+ export { registerNodeSourcerCommand };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mainset/cli",
3
- "version": "0.3.2",
3
+ "version": "0.4.0-rc.1",
4
4
  "description": "A unified CLI tool for accelerating development, based on mainset vision of front-end infrastructure",
5
5
  "homepage": "https://github.com/mainset/dev-stack-fe/tree/main/packages/cli",
6
6
  "bugs": {
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- declare function registerNodePackageCommand(program: Command): void;
3
- export { registerNodePackageCommand };