@travetto/compiler
Advanced tools
Comparing version 3.4.0-rc.5 to 3.4.0-rc.6
@@ -10,9 +10,9 @@ #!/usr/bin/env node | ||
'Available Commands:', | ||
' * start|watch - Run the compiler in watch mode', | ||
' * stop - Stop the compiler if running', | ||
' * restart - Restart the compiler in watch mode', | ||
' * build - Ensure the project is built and upto date', | ||
' * clean - Clean out the output and compiler caches', | ||
' * info - Retrieve the compiler information, if running', | ||
' * manifest - Generate the project manifest', | ||
' * start|watch - Run the compiler in watch mode', | ||
' * stop - Stop the compiler if running', | ||
' * restart - Restart the compiler in watch mode', | ||
' * build - Ensure the project is built and upto date', | ||
' * clean - Clean out the output and compiler caches', | ||
' * info - Retrieve the compiler information, if running', | ||
' * manifest [output] [prod] - Generate the project manifest', | ||
].join('\n'); | ||
@@ -22,2 +22,3 @@ | ||
const [op, ...args] = process.argv.slice(2); | ||
const baseArgs = args.filter(x => !x.startsWith('-')); | ||
@@ -31,3 +32,3 @@ switch (op) { | ||
case 'clean': return ops.clean(); | ||
case 'manifest': return ops.manifest(args); | ||
case 'manifest': return ops.manifest(baseArgs[0], /prod/i.test(baseArgs[1] ?? '')); | ||
case 'start': return ops.compile('watch'); | ||
@@ -34,0 +35,0 @@ case 'watch': |
{ | ||
"name": "@travetto/compiler", | ||
"version": "3.4.0-rc.5", | ||
"version": "3.4.0-rc.6", | ||
"description": "The compiler infrastructure for the Travetto framework", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"peerDependencies": { | ||
"@travetto/cli": "^3.4.0-rc.7" | ||
"@travetto/cli": "^3.4.0-rc.9" | ||
}, | ||
@@ -43,0 +43,0 @@ "peerDependenciesMeta": { |
@@ -33,3 +33,3 @@ <!-- This file was generated by @travetto/doc and should not be modified directly --> | ||
* `info` - Retrieve the compiler information, if running | ||
* `manifest` - Generate the project manifest | ||
* `manifest [output] [prod]` - Generate the project manifest | ||
In addition to the normal output, the compiler supports an environment variable `TRV_BUILD` that supports the following values: `debug`, `info`, `warn` or `none`. This provides different level of logging during the build process which is helpful to diagnose any odd behaviors. When invoking an unknown command (e.g. `<other>` from above), the default level is `warn`. Otherwise the default logging level is `info`. | ||
@@ -36,0 +36,0 @@ |
@@ -66,5 +66,5 @@ import fs from 'fs/promises'; | ||
/** Manifest entry point */ | ||
async manifest(args: (string | undefined)[] = []): Promise<void> { | ||
async manifest(output?: string, prod?: boolean): Promise<void> { | ||
await ops.compile('run', true); | ||
await CompilerSetup.exportManifest(ctx, ...args.filter(x => !x?.startsWith('-'))); return; | ||
await CompilerSetup.exportManifest(ctx, output, prod); return; | ||
} | ||
@@ -71,0 +71,0 @@ }; |
@@ -149,9 +149,3 @@ import http from 'http'; | ||
case 'info': | ||
default: { | ||
out = this.info ?? {}; | ||
if (req.url?.includes('?env')) { | ||
Object.assign(out!, { env: process.env }); | ||
} | ||
break; | ||
} | ||
default: out = this.info ?? {}; break; | ||
} | ||
@@ -158,0 +152,0 @@ res.end(JSON.stringify(out)); |
@@ -149,3 +149,3 @@ import path from 'path'; | ||
*/ | ||
static async exportManifest(ctx: ManifestContext, output?: string, env = 'dev'): Promise<void> { | ||
static async exportManifest(ctx: ManifestContext, output?: string, prod?: boolean): Promise<void> { | ||
const { ManifestUtil } = await this.#importManifest(ctx); | ||
@@ -155,3 +155,3 @@ let manifest = await ManifestUtil.buildManifest(ctx); | ||
// If in prod mode, only include std modules | ||
if (/^prod/i.test(env)) { | ||
if (prod) { | ||
manifest = ManifestUtil.createProductionManifest(manifest); | ||
@@ -158,0 +158,0 @@ } |
75478
1643