neex 0.6.27 → 0.6.28

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.
@@ -110,7 +110,7 @@ function addBuildCommands(program) {
110
110
  .option('-d, --delay <ms>', 'Delay before rebuild in milliseconds', parseInt)
111
111
  .option('--clean', 'Clean output directory before build')
112
112
  .option('--verbose', 'Verbose output')
113
- .option('--info', 'Show detailed information during build')
113
+ .option('--info', 'Show detailed build information')
114
114
  .option('--source-map', 'Generate source maps')
115
115
  .option('--target <target>', 'Target ECMAScript version', 'es2020')
116
116
  .option('--module <module>', 'Module system', 'commonjs')
@@ -129,14 +129,32 @@ function addBuildCommands(program) {
129
129
  process.exit(1);
130
130
  }
131
131
  // Get build configuration
132
- let buildConfig;
133
- try {
134
- buildConfig = await getBuildConfig(file, options.output, showInfo);
135
- }
136
- catch (error) {
137
- console.error(chalk_1.default.red(`${figures_1.default.cross} neex build: ${error instanceof Error ? error.message : 'Unknown error occurred'}`));
138
- process.exit(1);
139
- }
132
+ const buildConfig = await getBuildConfig(file, options.output, showInfo);
133
+ // Create BuildManager instance with all required options
134
+ const buildManager = new build_manager_js_1.BuildManager({
135
+ runnerName: 'neex build',
136
+ inputFile: file,
137
+ outputDir: options.output,
138
+ buildType: buildConfig.buildType,
139
+ buildCommand: buildConfig.buildCommand,
140
+ showInfo: showInfo,
141
+ color: !options.color,
142
+ showTiming: !options.timing,
143
+ watch: options.watch,
144
+ delay: parseInt(options.delay),
145
+ verbose: options.verbose,
146
+ clean: options.clean,
147
+ sourceMap: options.sourceMap,
148
+ target: options.target,
149
+ module: options.module,
150
+ parallel: false,
151
+ groupOutput: false,
152
+ isServerMode: false,
153
+ printOutput: true,
154
+ prefix: true,
155
+ stopOnError: false,
156
+ minimalOutput: false
157
+ });
140
158
  // Setup ignore patterns for watch mode
141
159
  const ignorePatterns = options.ignore || [
142
160
  'node_modules/**',
@@ -168,34 +186,26 @@ function addBuildCommands(program) {
168
186
  console.log(chalk_1.default.green(`${figures_1.default.tick} neex build: Starting build process...`));
169
187
  console.log(chalk_1.default.gray(`${'='.repeat(60)}`));
170
188
  }
171
- // Create BuildManager instance
172
- buildManager = new build_manager_js_1.BuildManager({
173
- runnerName: 'neex build',
174
- inputFile: file,
175
- outputDir: options.output,
176
- buildType: buildConfig.buildType,
177
- buildCommand: buildConfig.buildCommand,
178
- parallel: false,
179
- groupOutput: false,
180
- isServerMode: false,
181
- color: options.color,
182
- showTiming: options.timing,
183
- prefix: options.prefix,
184
- stopOnError: options.stopOnError,
185
- printOutput: true,
186
- minimalOutput: options.minimal,
187
- watch: options.watch,
188
- ignore: ignorePatterns,
189
- delay: options.delay || 1000,
190
- verbose: options.verbose,
191
- showInfo: showInfo,
192
- clean: options.clean,
193
- sourceMap: options.sourceMap,
194
- target: options.target,
195
- module: options.module
196
- });
197
189
  // Start the build process
198
- await buildManager.start();
190
+ try {
191
+ if (showInfo) {
192
+ console.log(chalk_1.default.blue(`${figures_1.default.info} neex build: Analyzing ${chalk_1.default.cyan(path.basename(file))}`));
193
+ }
194
+ await buildManager.start();
195
+ if (showInfo) {
196
+ console.log(chalk_1.default.green(`${figures_1.default.tick} Build completed successfully`));
197
+ }
198
+ else {
199
+ console.log(chalk_1.default.green(`${figures_1.default.tick} Build completed`));
200
+ }
201
+ }
202
+ catch (error) {
203
+ console.error(chalk_1.default.red(`${figures_1.default.cross} Build failed`));
204
+ if (error instanceof Error) {
205
+ console.error(chalk_1.default.red(`Error: ${error.message}`));
206
+ }
207
+ process.exit(1);
208
+ }
199
209
  }
200
210
  catch (error) {
201
211
  console.error(chalk_1.default.red(`${figures_1.default.cross} neex build: Fatal error occurred`));
@@ -155,13 +155,15 @@ function addStartCommands(program) {
155
155
  'Thumbs.db'
156
156
  ];
157
157
  const extensions = options.ext || ['js', 'mjs', 'json'];
158
+ // Ensure environment is always set to production unless explicitly overridden
159
+ const environment = options.env === 'development' ? options.env : 'production';
158
160
  // Log configuration only if --info flag is set
159
161
  if (showInfo) {
160
162
  console.log(chalk_1.default.blue(`${figures_1.default.info} neex start: Configuration:`));
161
163
  console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Target: ${chalk_1.default.cyan(file)}`));
162
164
  console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Runtime: ${chalk_1.default.cyan(startConfig.runtime)}`));
163
165
  console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Process name: ${chalk_1.default.cyan(startConfig.processName)}`));
164
- console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Environment: ${chalk_1.default.cyan(options.env)}`));
166
+ console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Environment: ${chalk_1.default.cyan(environment)}`));
165
167
  console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Watch mode: ${chalk_1.default.cyan(options.watch ? 'Yes' : 'No')}`));
166
168
  console.log(chalk_1.default.blue(` ${figures_1.default.arrowRight} Cluster mode: ${chalk_1.default.cyan(options.cluster ? 'Yes' : 'No')}`));
167
169
  if (options.cluster) {
@@ -185,7 +187,7 @@ function addStartCommands(program) {
185
187
  console.log(chalk_1.default.blue(`${figures_1.default.info} neex start: Verbose mode enabled - showing detailed logs`));
186
188
  }
187
189
  console.log(chalk_1.default.green(`${figures_1.default.tick} neex start: Starting production application server...`));
188
- console.log(chalk_1.default.green(`${figures_1.default.tick} neex start: Launching ${chalk_1.default.cyan(startConfig.processName)} in ${chalk_1.default.cyan(options.env)} mode...`));
190
+ console.log(chalk_1.default.green(`${figures_1.default.tick} neex start: Launching ${chalk_1.default.cyan(startConfig.processName)} in ${chalk_1.default.cyan(environment)} mode...`));
189
191
  console.log(chalk_1.default.blue(`${figures_1.default.info} neex start: Press Ctrl+C to stop the application server`));
190
192
  console.log(chalk_1.default.gray(`${'='.repeat(60)}`));
191
193
  }
@@ -196,7 +198,7 @@ function addStartCommands(program) {
196
198
  command: startConfig.command,
197
199
  processName: startConfig.processName,
198
200
  runtime: startConfig.runtime,
199
- environment: options.env,
201
+ environment: environment,
200
202
  parallel: false,
201
203
  color: options.color,
202
204
  showTiming: options.timing,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neex",
3
- "version": "0.6.27",
3
+ "version": "0.6.28",
4
4
  "description": "The Modern Build System for Polyrepo-in-Monorepo Architecture",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",