tycono 0.1.0 → 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 +13 -3
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -1,10 +1,20 @@
1
- #!/usr/bin/env -S node --import tsx
1
+ #!/usr/bin/env node
2
2
 
3
- import { fileURLToPath } from 'node:url';
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
9
 
9
- const { main } = await import(join(__dirname, 'tycono.ts'));
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;
14
+ const tsx = await import(tsxApiPath);
15
+ tsx.register();
16
+
17
+ // Now we can import .ts files
18
+ const entryPath = pathToFileURL(join(__dirname, 'tycono.ts')).href;
19
+ const { main } = await import(entryPath);
10
20
  await main(process.argv.slice(2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {