securewithtrace 0.51.0 → 0.54.0

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.
@@ -0,0 +1,2 @@
1
+ # Passed to bun as --config by bin/tracecli so the bunfig.toml of whatever
2
+ # directory the user runs in (and any preload it names) is never read.
package/bin/tracecli CHANGED
@@ -21,10 +21,20 @@ const installMessage = [
21
21
 
22
22
  const launcherPath = realpathSync(fileURLToPath(import.meta.url));
23
23
  const bundledEntry = resolve(dirname(launcherPath), '../dist/index.js');
24
- const child = spawn('bun', [bundledEntry, ...process.argv.slice(2)], {
25
- stdio: 'inherit',
26
- windowsHide: false,
27
- });
24
+ // Bun reads `.env` and `bunfig.toml` (which can preload code) from the
25
+ // directory the user runs in. A shared checkout must not be able to set the
26
+ // CLI's environment or run code inside it, so both are switched off; the empty
27
+ // config shipped beside this file replaces whatever the directory holds.
28
+ // `--no-env-file` needs Bun 1.3.3 or newer.
29
+ const emptyConfig = resolve(dirname(launcherPath), 'bunfig.toml');
30
+ const child = spawn(
31
+ 'bun',
32
+ ['--no-env-file', `--config=${emptyConfig}`, bundledEntry, ...process.argv.slice(2)],
33
+ {
34
+ stdio: 'inherit',
35
+ windowsHide: false,
36
+ }
37
+ );
28
38
 
29
39
  child.on('error', (error) => {
30
40
  if (error && 'code' in error && error.code === 'ENOENT') {