prjct-cli 0.29.3 → 0.29.5
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/dist/bin/prjct.mjs +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +36 -11
package/dist/bin/prjct.mjs
CHANGED
|
@@ -12508,7 +12508,7 @@ var require_package = __commonJS({
|
|
|
12508
12508
|
"package.json"(exports, module) {
|
|
12509
12509
|
module.exports = {
|
|
12510
12510
|
name: "prjct-cli",
|
|
12511
|
-
version: "0.29.
|
|
12511
|
+
version: "0.29.4",
|
|
12512
12512
|
description: "Built for Claude - Ship fast, track progress, stay focused. Developer momentum tool for indie hackers.",
|
|
12513
12513
|
main: "core/index.ts",
|
|
12514
12514
|
bin: {
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -25,22 +25,42 @@ const ROOT = path.resolve(__dirname, '..')
|
|
|
25
25
|
* Detect if this is a global npm install
|
|
26
26
|
*/
|
|
27
27
|
function isGlobalInstall() {
|
|
28
|
-
// Check npm config
|
|
28
|
+
// Check npm config (most reliable)
|
|
29
29
|
if (process.env.npm_config_global === 'true') {
|
|
30
30
|
return true
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// Check install location
|
|
33
|
+
// Check install location against known global paths
|
|
34
34
|
const installPath = __dirname
|
|
35
35
|
const globalPaths = [
|
|
36
|
+
// macOS Intel
|
|
36
37
|
'/usr/local/lib/node_modules',
|
|
38
|
+
// macOS M1/M2 (Homebrew)
|
|
39
|
+
'/opt/homebrew/lib/node_modules',
|
|
40
|
+
// Linux
|
|
37
41
|
'/usr/lib/node_modules',
|
|
42
|
+
// Custom npm prefix
|
|
38
43
|
path.join(process.env.HOME || '', '.npm-global', 'lib', 'node_modules'),
|
|
44
|
+
// nvm
|
|
39
45
|
path.join(process.env.HOME || '', '.nvm'),
|
|
46
|
+
// Windows
|
|
40
47
|
path.join(process.env.APPDATA || '', 'npm', 'node_modules'),
|
|
48
|
+
// pnpm global
|
|
49
|
+
path.join(process.env.HOME || '', '.local', 'share', 'pnpm'),
|
|
50
|
+
// Volta
|
|
51
|
+
path.join(process.env.HOME || '', '.volta'),
|
|
41
52
|
]
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
if (globalPaths.some((p) => installPath.includes(p))) {
|
|
55
|
+
return true
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Fallback: if we're in ANY node_modules that's not in cwd, assume global
|
|
59
|
+
if (installPath.includes('node_modules') && !installPath.includes(process.cwd())) {
|
|
60
|
+
return true
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return false
|
|
44
64
|
}
|
|
45
65
|
|
|
46
66
|
/**
|
|
@@ -134,10 +154,9 @@ function updateStatusLineVersion() {
|
|
|
134
154
|
* Main
|
|
135
155
|
*/
|
|
136
156
|
async function main() {
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
157
|
+
// ALWAYS run setup - don't try to detect global vs local
|
|
158
|
+
// Worst case: setup runs unnecessarily on local dev installs (harmless)
|
|
159
|
+
// Best case: setup actually works for all users
|
|
141
160
|
|
|
142
161
|
console.log('')
|
|
143
162
|
console.log(' prjct-cli postinstall')
|
|
@@ -149,17 +168,23 @@ async function main() {
|
|
|
149
168
|
}
|
|
150
169
|
|
|
151
170
|
// Run full setup
|
|
171
|
+
let success = false
|
|
152
172
|
if (hasBun()) {
|
|
153
|
-
await runSetupBun()
|
|
173
|
+
success = await runSetupBun()
|
|
154
174
|
} else {
|
|
155
|
-
await runSetupCompiled()
|
|
175
|
+
success = await runSetupCompiled()
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!success) {
|
|
179
|
+
console.log(' ⚠ Setup incomplete. Run: npx prjct-cli setup')
|
|
156
180
|
}
|
|
157
181
|
|
|
158
182
|
console.log('')
|
|
159
183
|
}
|
|
160
184
|
|
|
161
185
|
main().catch((error) => {
|
|
162
|
-
//
|
|
163
|
-
console.
|
|
186
|
+
// Log error but don't fail npm install
|
|
187
|
+
console.error(' postinstall error:', error.message)
|
|
188
|
+
console.log(' Run manually: npx prjct-cli setup')
|
|
164
189
|
process.exit(0)
|
|
165
190
|
})
|