@travetto/runtime 8.0.0-alpha.5 → 8.0.0-alpha.7

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.
package/README.md CHANGED
@@ -70,7 +70,7 @@ class $Runtime {
70
70
  /** Import from a given path */
71
71
  async importFrom<T = unknown>(location?: string): Promise<T>;
72
72
  /** Get an install command for a given npm module */
73
- getInstallCommand(pkg: string, production = false): string;
73
+ getInstallCommand(pkg: string, production?: boolean): string;
74
74
  }
75
75
  ```
76
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/runtime",
3
- "version": "8.0.0-alpha.5",
3
+ "version": "8.0.0-alpha.7",
4
4
  "type": "module",
5
5
  "description": "Runtime for travetto applications.",
6
6
  "keywords": [
package/src/context.ts CHANGED
@@ -138,7 +138,13 @@ class $Runtime {
138
138
  }
139
139
 
140
140
  /** Get an install command for a given npm module */
141
- getInstallCommand(pkg: string, production = false): string {
141
+ getInstallCommand(pkg: string, production?: boolean): string {
142
+ if (production === undefined) {
143
+ const module = RuntimeIndex.getModule(pkg);
144
+ if (module !== undefined) {
145
+ production = module.production;
146
+ }
147
+ }
142
148
  switch (this.workspace.manager) {
143
149
  case 'npm': return `npm install ${production ? '' : '--save-dev '}${pkg}`;
144
150
  case 'yarn': return `yarn add ${production ? '' : '--dev '}${pkg}`;
@@ -41,7 +41,7 @@ export class FileLoader {
41
41
  * Read a file as utf8 text, after resolving the path
42
42
  * @param relativePath The path to read
43
43
  */
44
- async readText(relativePath: string): Promise<string> {
44
+ async readUTF8(relativePath: string): Promise<string> {
45
45
  const file = await this.resolve(relativePath);
46
46
  return fs.readFile(file, 'utf8');
47
47
  }