@travetto/runtime 8.0.0-alpha.5 → 8.0.0-alpha.6
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 +1 -1
- package/package.json +1 -1
- package/src/context.ts +7 -1
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
|
|
73
|
+
getInstallCommand(pkg: string, production?: boolean): string;
|
|
74
74
|
}
|
|
75
75
|
```
|
|
76
76
|
|
package/package.json
CHANGED
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
|
|
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}`;
|