tycono 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/bin/cli.js +5 -3
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -2,13 +2,15 @@
2
2
 
3
3
  import { fileURLToPath, pathToFileURL } from 'node:url';
4
4
  import { dirname, join } from 'node:path';
5
+ import { createRequire } from 'node:module';
5
6
 
6
7
  const __filename = fileURLToPath(import.meta.url);
7
8
  const __dirname = dirname(__filename);
8
- const pkgRoot = join(__dirname, '..');
9
9
 
10
- // Register tsx loader from package's own node_modules
11
- const tsxApiPath = pathToFileURL(join(pkgRoot, 'node_modules', 'tsx', 'dist', 'esm', 'api', 'index.mjs')).href;
10
+ // Resolve tsx using createRequire from THIS file's location
11
+ // This traverses up node_modules correctly for both local and npx flat installs
12
+ const require = createRequire(import.meta.url);
13
+ const tsxApiPath = pathToFileURL(require.resolve('tsx/esm/api')).href;
12
14
  const tsx = await import(tsxApiPath);
13
15
  tsx.register();
14
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {