@travetto/pack 7.1.2 → 7.1.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/README.md CHANGED
@@ -170,9 +170,10 @@ As indicated, any of the pack operations can be ejected, and produce an output t
170
170
  $ trv pack:docker -x /dev/stdout web:http
171
171
 
172
172
  #!/bin/sh
173
- export DIST=/tmp/<temp-folder>
174
- export TRV_OUT=<workspace-root>/.trv/output
175
173
  export ROOT=<workspace-root>/related/todo-app
174
+ export TRV_OUT=<workspace-root>/.trv/output
175
+ export REPO_ROOT=<workspace-root>
176
+ export DIST=/tmp/<temp-folder>
176
177
  export MODULE=@travetto/todo-app
177
178
 
178
179
  # Cleaning Output $DIST
@@ -225,7 +226,7 @@ cp -r -p $ROOT/resources/* $DIST/resources
225
226
 
226
227
  echo "Writing Manifest manifest.json"
227
228
 
228
- TRV_MODULE=$MODULE npx trvc manifest:production $DIST/manifest.json
229
+ TRV_MODULE=$MODULE node $REPO_ROOT/node_modules/.bin/trvc manifest:production $DIST/manifest.json
229
230
 
230
231
  # Bundling Output minify=true sourcemap=false entryPoint=@travetto/cli/support/entry.trv.ts
231
232
 
@@ -240,7 +241,7 @@ export BUNDLE_OUTPUT=$DIST
240
241
  export BUNDLE_ENV_FILE=.env
241
242
  export TRV_MANIFEST=$TRV_OUT/node_modules/$MODULE
242
243
  cd $TRV_OUT
243
- npx rollup -c $TRV_OUT/node_modules/@travetto/pack/support/rollup/build.js
244
+ node $REPO_ROOT/node_modules/.bin/rollup -c $TRV_OUT/node_modules/@travetto/pack/support/rollup/build.js
244
245
  cd $ROOT
245
246
 
246
247
  # Pulling Docker Base Image node:25-alpine
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/pack",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "type": "module",
5
5
  "description": "Code packing utilities",
6
6
  "keywords": [
@@ -30,12 +30,12 @@
30
30
  "@rollup/plugin-json": "^6.1.0",
31
31
  "@rollup/plugin-node-resolve": "^16.0.3",
32
32
  "@rollup/plugin-terser": "^0.4.4",
33
- "@travetto/runtime": "^7.1.2",
34
- "@travetto/terminal": "^7.1.2",
33
+ "@travetto/runtime": "^7.1.3",
34
+ "@travetto/terminal": "^7.1.3",
35
35
  "rollup": "^4.55.1"
36
36
  },
37
37
  "peerDependencies": {
38
- "@travetto/cli": "^7.1.2"
38
+ "@travetto/cli": "^7.1.3"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@travetto/cli": {
@@ -54,7 +54,7 @@ export class PackOperation {
54
54
  const cwd = RuntimeIndex.outputRoot;
55
55
  const out = RuntimeIndex.manifest.build.outputFolder;
56
56
 
57
- const bundleCommand = ['npx', 'rollup', '-c', RuntimeIndex.resolveFileImport(config.rollupConfiguration)];
57
+ const bundleCommand = [process.argv0, RuntimeIndex.resolvePackageCommand('rollup'), '-c', RuntimeIndex.resolveFileImport(config.rollupConfiguration)];
58
58
 
59
59
  const entryPointFile = RuntimeIndex.getFromImport(config.entryPoint)!.outputFile.split(`${out}/`)[1];
60
60
 
@@ -225,7 +225,7 @@ export class PackOperation {
225
225
  */
226
226
  static async * writeManifest(config: CommonPackConfig): AsyncIterable<string[]> {
227
227
  const out = path.resolve(config.buildDirectory, config.manifestFile);
228
- const cmd = ['npx', 'trvc', 'manifest:production', out];
228
+ const cmd = [process.argv0, RuntimeIndex.resolvePackageCommand('trvc'), 'manifest:production', out];
229
229
  const env = { ...Env.TRV_MODULE.export(config.module) };
230
230
 
231
231
  yield* PackOperation.title(config, cliTpl`${{ title: 'Writing Manifest' }} ${{ path: config.manifestFile }}`);
@@ -2,7 +2,7 @@ import fs from 'node:fs/promises';
2
2
  import { spawn, type SpawnOptions } from 'node:child_process';
3
3
  import path from 'node:path';
4
4
 
5
- import { AppError, ExecUtil, RuntimeIndex } from '@travetto/runtime';
5
+ import { AppError, ExecUtil, Runtime, RuntimeIndex } from '@travetto/runtime';
6
6
 
7
7
  import { ActiveShellCommand } from './shell.ts';
8
8
 
@@ -40,7 +40,8 @@ export class PackUtil {
40
40
  * Finalize eject output
41
41
  */
42
42
  static async writeEjectOutput(workspace: string, module: string, output: AsyncIterable<string>, file: string): Promise<void> {
43
- const vars = { DIST: workspace, TRV_OUT: RuntimeIndex.outputRoot, ROOT: path.resolve(), MODULE: module };
43
+ const repoRoot = Runtime.workspaceRelative('.');
44
+ const vars = { ROOT: path.resolve(), TRV_OUT: RuntimeIndex.outputRoot, REPO_ROOT: repoRoot, DIST: workspace, MODULE: module };
44
45
 
45
46
  const replaceArgs = (text: string): string => Object.entries(vars)
46
47
  .reduce((result, [key, value]) => result.replaceAll(value, ActiveShellCommand.var(key)), text);