create-better-t-stack 3.11.0-pr749.5d055e3 → 3.11.0-pr749.f5b98a1
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/package.json +4 -6
- package/scripts/postinstall.mjs +0 -129
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.11.0-pr749.
|
|
3
|
+
"version": "3.11.0-pr749.f5b98a1",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"better-auth",
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"bin",
|
|
44
|
-
"templates"
|
|
45
|
-
"scripts/postinstall.mjs"
|
|
44
|
+
"templates"
|
|
46
45
|
],
|
|
47
46
|
"type": "module",
|
|
48
47
|
"publishConfig": {
|
|
@@ -57,11 +56,10 @@
|
|
|
57
56
|
"test:watch": "bun test --watch",
|
|
58
57
|
"test:coverage": "bun test --coverage",
|
|
59
58
|
"test:ci": "AGENT=1 bun test --bail=5",
|
|
60
|
-
"prepublishOnly": "echo 'Build binaries separately before publishing'"
|
|
61
|
-
"postinstall": "node ./scripts/postinstall.mjs || true"
|
|
59
|
+
"prepublishOnly": "echo 'Build binaries separately before publishing'"
|
|
62
60
|
},
|
|
63
61
|
"dependencies": {
|
|
64
|
-
"@better-t-stack/types": "3.11.0-pr749.
|
|
62
|
+
"@better-t-stack/types": "3.11.0-pr749.f5b98a1",
|
|
65
63
|
"@clack/prompts": "^1.0.0-alpha.8",
|
|
66
64
|
"commander": "^14.0.2",
|
|
67
65
|
"consola": "^3.4.2",
|
package/scripts/postinstall.mjs
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Postinstall script for create-better-t-stack.
|
|
5
|
-
* Symlinks the platform-specific binary to the bin directory for convenience.
|
|
6
|
-
*
|
|
7
|
-
* This runs after npm install to set up the binary.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import fs from "fs";
|
|
11
|
-
import path from "path";
|
|
12
|
-
import os from "os";
|
|
13
|
-
import { fileURLToPath } from "url";
|
|
14
|
-
import { createRequire } from "module";
|
|
15
|
-
|
|
16
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const require = createRequire(import.meta.url);
|
|
18
|
-
|
|
19
|
-
function detectPlatformAndArch() {
|
|
20
|
-
let platform;
|
|
21
|
-
switch (os.platform()) {
|
|
22
|
-
case "darwin":
|
|
23
|
-
platform = "darwin";
|
|
24
|
-
break;
|
|
25
|
-
case "linux":
|
|
26
|
-
platform = "linux";
|
|
27
|
-
break;
|
|
28
|
-
case "win32":
|
|
29
|
-
platform = "windows";
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
platform = os.platform();
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let arch;
|
|
37
|
-
switch (os.arch()) {
|
|
38
|
-
case "x64":
|
|
39
|
-
arch = "x64";
|
|
40
|
-
break;
|
|
41
|
-
case "arm64":
|
|
42
|
-
arch = "arm64";
|
|
43
|
-
break;
|
|
44
|
-
default:
|
|
45
|
-
arch = os.arch();
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return { platform, arch };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function findBinary() {
|
|
53
|
-
const { platform, arch } = detectPlatformAndArch();
|
|
54
|
-
// Scoped package: @better-t-stack/cli-{platform}-{arch}
|
|
55
|
-
const packageName = `@better-t-stack/cli-${platform}-${arch}`;
|
|
56
|
-
const binaryName = platform === "windows" ? "create-better-t-stack.exe" : "create-better-t-stack";
|
|
57
|
-
|
|
58
|
-
try {
|
|
59
|
-
// Use require.resolve to find the package
|
|
60
|
-
const packageJsonPath = require.resolve(`${packageName}/package.json`);
|
|
61
|
-
const packageDir = path.dirname(packageJsonPath);
|
|
62
|
-
const binaryPath = path.join(packageDir, "bin", binaryName);
|
|
63
|
-
|
|
64
|
-
if (!fs.existsSync(binaryPath)) {
|
|
65
|
-
throw new Error(`Binary not found at ${binaryPath}`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return { binaryPath, binaryName };
|
|
69
|
-
} catch (error) {
|
|
70
|
-
throw new Error(`Could not find package ${packageName}: ${error.message}`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function prepareBinDirectory(binaryName) {
|
|
75
|
-
const binDir = path.join(__dirname, "..", "bin");
|
|
76
|
-
const targetPath = path.join(binDir, binaryName);
|
|
77
|
-
|
|
78
|
-
// Ensure bin directory exists
|
|
79
|
-
if (!fs.existsSync(binDir)) {
|
|
80
|
-
fs.mkdirSync(binDir, { recursive: true });
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Remove existing binary/symlink if it exists
|
|
84
|
-
try {
|
|
85
|
-
if (fs.existsSync(targetPath) || fs.lstatSync(targetPath).isSymbolicLink()) {
|
|
86
|
-
fs.unlinkSync(targetPath);
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
// File doesn't exist, that's fine
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return { binDir, targetPath };
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function symlinkBinary(sourcePath, binaryName) {
|
|
96
|
-
const { targetPath } = prepareBinDirectory(binaryName);
|
|
97
|
-
|
|
98
|
-
fs.symlinkSync(sourcePath, targetPath);
|
|
99
|
-
console.log(`create-better-t-stack binary symlinked: ${targetPath} -> ${sourcePath}`);
|
|
100
|
-
|
|
101
|
-
// Verify the file exists after operation
|
|
102
|
-
if (!fs.existsSync(targetPath)) {
|
|
103
|
-
throw new Error(`Failed to symlink binary to ${targetPath}`);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
async function main() {
|
|
108
|
-
try {
|
|
109
|
-
if (os.platform() === "win32") {
|
|
110
|
-
// On Windows, symlinks require admin privileges
|
|
111
|
-
// The bin stub will find the binary directly
|
|
112
|
-
console.log("Windows detected: skipping symlink (bin stub will find binary directly)");
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const { binaryPath, binaryName } = findBinary();
|
|
117
|
-
symlinkBinary(binaryPath, binaryName);
|
|
118
|
-
} catch (error) {
|
|
119
|
-
// Don't fail the install if we can't symlink - the bin stub will still work
|
|
120
|
-
console.log(`Note: Could not symlink binary (${error.message}). The CLI will still work.`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
try {
|
|
125
|
-
main();
|
|
126
|
-
} catch (error) {
|
|
127
|
-
// Silently continue - postinstall failures shouldn't break the install
|
|
128
|
-
console.log("Postinstall completed with warnings.");
|
|
129
|
-
}
|