@travetto/pack 3.1.0-rc.2 → 3.1.0-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/pack",
3
- "version": "3.1.0-rc.2",
3
+ "version": "3.1.0-rc.3",
4
4
  "description": "Code packing utilities",
5
5
  "keywords": [
6
6
  "travetto",
@@ -97,7 +97,7 @@ export class PackOperation {
97
97
  */
98
98
  static async * writePackageJson(cfg: CommonPackConfig): AsyncIterable<string[]> {
99
99
  const file = 'package.json';
100
- const pkg = { type: RootIndex.manifest.moduleType };
100
+ const pkg = { type: RootIndex.manifest.moduleType, main: `${cfg.mainName}.js` };
101
101
 
102
102
  yield* PackOperation.title(cfg, cliTpl`${{ title: 'Writing' }} ${{ path: file }}`);
103
103
 
@@ -242,9 +242,11 @@ export class PackOperation {
242
242
 
243
243
  if (cfg.ejectFile) {
244
244
  yield ActiveShellCommand.chdir(cfg.workspace);
245
+ await ActiveShellCommand.mkdir(path.dirname(cfg.output));
245
246
  yield ActiveShellCommand.zip(cfg.output);
246
247
  yield ActiveShellCommand.chdir(path.cwd());
247
248
  } else {
249
+ await fs.mkdir(path.dirname(cfg.output), { recursive: true });
248
250
  const [cmd, ...args] = ActiveShellCommand.zip(cfg.output);
249
251
  await ExecUtil.spawn(cmd, args, { cwd: cfg.workspace }).result;
250
252
  }