create-agentuity 2.0.0-beta.1 → 2.0.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.
- package/bin.js +35 -5
- package/package.json +2 -2
package/bin.js
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const pkg = require('./package.json');
|
|
7
|
+
|
|
8
|
+
// Determine the dist-tag based on create-agentuity version
|
|
9
|
+
// Must match the logic in scripts/publish.ts:
|
|
10
|
+
// - Beta versions (-beta.) → use @beta
|
|
11
|
+
// - Other prereleases (-alpha., -rc., etc.) → use @next
|
|
12
|
+
// - Stable versions → use @latest
|
|
13
|
+
export function getDistTag(version) {
|
|
14
|
+
// Check for beta prerelease first
|
|
15
|
+
if (/-beta\./.test(version)) {
|
|
16
|
+
return 'beta';
|
|
17
|
+
}
|
|
18
|
+
// Check for other prerelease identifiers: alpha, rc, canary, next, etc.
|
|
19
|
+
if (/-([a-zA-Z]+)/.test(version)) {
|
|
20
|
+
return 'next';
|
|
21
|
+
}
|
|
22
|
+
return 'latest';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Only run when executed directly, not when imported for testing
|
|
26
|
+
const isMain =
|
|
27
|
+
typeof Bun !== 'undefined'
|
|
28
|
+
? Bun.main === new URL(import.meta.url).pathname
|
|
29
|
+
: process.argv[1] === new URL(import.meta.url).pathname;
|
|
30
|
+
|
|
31
|
+
if (isMain) {
|
|
32
|
+
const distTag = getDistTag(pkg.version);
|
|
33
|
+
const args = process.argv.slice(2);
|
|
34
|
+
const result = spawnSync('bunx', [`@agentuity/cli@${distTag}`, 'create', ...args], {
|
|
35
|
+
stdio: 'inherit',
|
|
36
|
+
});
|
|
37
|
+
process.exit(result.status || 0);
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-agentuity",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"description": "Create a new Agentuity project",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "echo 'No build required'",
|
|
13
|
-
"test": "
|
|
13
|
+
"test": "bun test bin.test.js"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"bin.js"
|