prjct-cli 0.4.4 → 0.4.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/CHANGELOG.md +38 -2
- package/bin/prjct +9 -0
- package/core/commands.js +41 -9
- package/core/migrator.js +1 -1
- package/package.json +1 -1
- package/scripts/post-install.js +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
- Cross-platform file operations
|
|
16
16
|
- Windows Terminal integration
|
|
17
17
|
|
|
18
|
+
## [0.4.5] - 2025-10-02
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **Critical Bug Fixes** - All commands now enforce global architecture correctly
|
|
22
|
+
- `/p:design` now creates designs in global `analysis/designs/` instead of local `.prjct/designs/`
|
|
23
|
+
- `/p:cleanup` now operates on global project data instead of local `.prjct/`
|
|
24
|
+
- `getDaysSinceLastShip()` now reads from global `memory/context.jsonl` instead of local
|
|
25
|
+
- All commands verify project is initialized before execution
|
|
26
|
+
- Prevents creation of invalid local `.prjct/` structures
|
|
27
|
+
- **Fixed post-install.js** - `currentVersion` now declared before use (prevents ReferenceError)
|
|
28
|
+
- **Added 'Apps' directory** to migration scanner for better project detection
|
|
29
|
+
|
|
30
|
+
### Technical Details
|
|
31
|
+
- **Global Architecture**: All commands now use `pathManager.getGlobalProjectPath(projectId)`
|
|
32
|
+
- design(), cleanup(), getDaysSinceLastShip() fully migrated
|
|
33
|
+
- Prevents LOCAL .prjct/ creation
|
|
34
|
+
- Requires project initialization before command execution
|
|
35
|
+
- **Migration Enhancement**: Added ~/Apps to common directories scan
|
|
36
|
+
- **Post-Install Fix**: currentVersion variable properly declared at function start
|
|
37
|
+
|
|
18
38
|
## [0.4.4] - 2025-10-02
|
|
19
39
|
|
|
20
40
|
### Added
|
|
@@ -39,7 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
39
59
|
- **Automatic Data Migration** - Seamless upgrade from v0.1.0 to v0.4.4
|
|
40
60
|
- Post-install hook automatically detects legacy `.prjct/` projects
|
|
41
61
|
- Migrates data from local structure to new global architecture (`~/.prjct-cli/projects/{id}/`)
|
|
42
|
-
- Scans common project directories (Projects, Documents, Developer, Code,
|
|
62
|
+
- Scans common project directories (Projects, Documents, Developer, Code, **Apps**)
|
|
43
63
|
- Preserves all project data during migration (now, next, shipped, ideas, memory)
|
|
44
64
|
- Cleans up legacy directories while keeping config for compatibility
|
|
45
65
|
- No user intervention required - migration happens automatically on update
|
|
@@ -51,23 +71,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
51
71
|
- Ensures tracking happens even during force updates
|
|
52
72
|
- Enables reliable auto-updates across all configured editors
|
|
53
73
|
|
|
74
|
+
### Fixed
|
|
75
|
+
- **Global Architecture Enforcement** - All commands now enforce global architecture correctly
|
|
76
|
+
- `/p:design` now creates designs in global `analysis/designs/` instead of local `.prjct/designs/`
|
|
77
|
+
- `/p:cleanup` now operates on global project data instead of local `.prjct/`
|
|
78
|
+
- `getDaysSinceLastShip()` now reads from global `memory/context.jsonl` instead of local
|
|
79
|
+
- All commands verify project is initialized before execution
|
|
80
|
+
- Prevents creation of invalid local `.prjct/` structures
|
|
81
|
+
- **Fixed post-install.js** - `currentVersion` now declared before use (prevents ReferenceError)
|
|
82
|
+
- **Added 'Apps' directory** to migration scanner for better project detection
|
|
83
|
+
|
|
54
84
|
### Technical Details
|
|
55
85
|
- **Post-Install Hook**: Runs after `npm install -g prjct-cli` or `npm update -g prjct-cli`
|
|
56
86
|
- First install: Auto-detects editors and installs commands
|
|
57
87
|
- Updates: Checks version change and auto-updates commands in tracked editors
|
|
58
88
|
- **Migration**: Automatically detects and migrates legacy projects from v0.1.0
|
|
59
89
|
- Silent operation with debug mode via `DEBUG=1` environment variable
|
|
90
|
+
- **Fixed**: currentVersion variable now properly declared at function start
|
|
91
|
+
- **Enhanced**: Better error handling with debug logging
|
|
60
92
|
- **Pre-Uninstall Hook**: Runs before `npm uninstall -g prjct-cli`
|
|
61
93
|
- Reads tracking config to find all installed editors
|
|
62
94
|
- Removes command directories from each editor
|
|
63
95
|
- Cleans up tracking configuration
|
|
64
96
|
- Fails gracefully to not block uninstall
|
|
65
97
|
- **Migration System**: Automatic upgrade path from v0.1.0 to v0.4.4
|
|
66
|
-
- Scans common project directories (fast, non-intrusive)
|
|
98
|
+
- Scans common project directories including **~/Apps** (fast, non-intrusive)
|
|
67
99
|
- Migrates local `.prjct/` to global `~/.prjct-cli/projects/{id}/`
|
|
68
100
|
- Preserves all data: core, progress, planning, analysis, memory layers
|
|
69
101
|
- Cleans legacy directories while keeping compatibility config
|
|
70
102
|
- Zero data loss, seamless upgrade experience
|
|
103
|
+
- **Global Architecture**: All commands now use `pathManager.getGlobalProjectPath(projectId)`
|
|
104
|
+
- design(), cleanup(), getDaysSinceLastShip() fully migrated
|
|
105
|
+
- Prevents LOCAL .prjct/ creation
|
|
106
|
+
- Requires project initialization before command execution
|
|
71
107
|
|
|
72
108
|
## [0.4.3] - 2025-10-02
|
|
73
109
|
|
package/bin/prjct
CHANGED
|
@@ -139,6 +139,15 @@ async function main() {
|
|
|
139
139
|
|
|
140
140
|
result = await commands.analyze(analyzeOptions);
|
|
141
141
|
break;
|
|
142
|
+
case '--version':
|
|
143
|
+
case '-v':
|
|
144
|
+
case 'version':
|
|
145
|
+
const packageJson = require('../package.json');
|
|
146
|
+
result = {
|
|
147
|
+
success: true,
|
|
148
|
+
message: `prjct-cli v${packageJson.version}`
|
|
149
|
+
};
|
|
150
|
+
break;
|
|
142
151
|
case '--help':
|
|
143
152
|
case '-h':
|
|
144
153
|
case 'help':
|
package/core/commands.js
CHANGED
|
@@ -1236,9 +1236,23 @@ ${dryRun ? '⚠️ DRY RUN - No changes were made' : '✅ All changes applied su
|
|
|
1236
1236
|
try {
|
|
1237
1237
|
await this.initializeAgent()
|
|
1238
1238
|
|
|
1239
|
+
// Verify project is initialized
|
|
1240
|
+
if (!await configManager.isConfigured(projectPath)) {
|
|
1241
|
+
return {
|
|
1242
|
+
success: false,
|
|
1243
|
+
message: this.agent.formatResponse(
|
|
1244
|
+
`Project not initialized. Run ${this.agentInfo.config.commandPrefix}init first.`,
|
|
1245
|
+
'warning'
|
|
1246
|
+
),
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1239
1250
|
const type = options.type || 'architecture'
|
|
1240
1251
|
|
|
1241
|
-
|
|
1252
|
+
// Use global architecture
|
|
1253
|
+
const projectId = await configManager.getProjectId(projectPath)
|
|
1254
|
+
const globalPath = pathManager.getGlobalProjectPath(projectId)
|
|
1255
|
+
const designDir = path.join(globalPath, 'analysis', 'designs')
|
|
1242
1256
|
await this.agent.createDirectory(designDir)
|
|
1243
1257
|
|
|
1244
1258
|
let designContent = ''
|
|
@@ -1484,7 +1498,11 @@ ${diagram}
|
|
|
1484
1498
|
async getDaysSinceLastShip(projectPath) {
|
|
1485
1499
|
try {
|
|
1486
1500
|
await this.initializeAgent()
|
|
1487
|
-
|
|
1501
|
+
|
|
1502
|
+
// Use global architecture
|
|
1503
|
+
const projectId = await configManager.getProjectId(projectPath)
|
|
1504
|
+
const globalPath = pathManager.getGlobalProjectPath(projectId)
|
|
1505
|
+
const memoryFile = path.join(globalPath, 'memory', 'context.jsonl')
|
|
1488
1506
|
const memory = await this.agent.readFile(memoryFile)
|
|
1489
1507
|
const lines = memory
|
|
1490
1508
|
.trim()
|
|
@@ -1670,14 +1688,28 @@ ${diagram}
|
|
|
1670
1688
|
async cleanup(projectPath = process.cwd()) {
|
|
1671
1689
|
try {
|
|
1672
1690
|
await this.initializeAgent()
|
|
1673
|
-
|
|
1691
|
+
|
|
1692
|
+
// Verify project is initialized
|
|
1693
|
+
if (!await configManager.isConfigured(projectPath)) {
|
|
1694
|
+
return {
|
|
1695
|
+
success: false,
|
|
1696
|
+
message: this.agent.formatResponse(
|
|
1697
|
+
`Project not initialized. Run ${this.agentInfo.config.commandPrefix}init first.`,
|
|
1698
|
+
'warning'
|
|
1699
|
+
),
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
// Use global architecture
|
|
1704
|
+
const projectId = await configManager.getProjectId(projectPath)
|
|
1705
|
+
const globalPath = pathManager.getGlobalProjectPath(projectId)
|
|
1674
1706
|
|
|
1675
1707
|
let totalFreed = 0
|
|
1676
1708
|
let filesRemoved = 0
|
|
1677
1709
|
let tasksArchived = 0
|
|
1678
1710
|
|
|
1679
1711
|
try {
|
|
1680
|
-
const tempDir = path.join(
|
|
1712
|
+
const tempDir = path.join(globalPath, 'temp')
|
|
1681
1713
|
const tempFiles = await fs.readdir(tempDir).catch(() => [])
|
|
1682
1714
|
for (const file of tempFiles) {
|
|
1683
1715
|
const filePath = path.join(tempDir, file)
|
|
@@ -1690,7 +1722,7 @@ ${diagram}
|
|
|
1690
1722
|
}
|
|
1691
1723
|
|
|
1692
1724
|
try {
|
|
1693
|
-
const memoryFile = path.join(
|
|
1725
|
+
const memoryFile = path.join(globalPath, 'memory', 'context.jsonl')
|
|
1694
1726
|
const content = await this.agent.readFile(memoryFile)
|
|
1695
1727
|
const lines = content.split('\n').filter(line => line.trim())
|
|
1696
1728
|
const now = new Date()
|
|
@@ -1714,7 +1746,7 @@ ${diagram}
|
|
|
1714
1746
|
}
|
|
1715
1747
|
|
|
1716
1748
|
if (archivedLines.length > 0) {
|
|
1717
|
-
const archiveFile = path.join(
|
|
1749
|
+
const archiveFile = path.join(globalPath, 'memory', `archive-${now.toISOString().split('T')[0]}.jsonl`)
|
|
1718
1750
|
await this.agent.writeFile(archiveFile, archivedLines.join('\n') + '\n')
|
|
1719
1751
|
await this.agent.writeFile(memoryFile, recentLines.join('\n') + '\n')
|
|
1720
1752
|
tasksArchived = archivedLines.length
|
|
@@ -1722,10 +1754,10 @@ ${diagram}
|
|
|
1722
1754
|
} catch (e) {
|
|
1723
1755
|
}
|
|
1724
1756
|
|
|
1725
|
-
const files = await fs.readdir(
|
|
1757
|
+
const files = await fs.readdir(globalPath)
|
|
1726
1758
|
for (const file of files) {
|
|
1727
1759
|
if (file.endsWith('.md') || file.endsWith('.txt')) {
|
|
1728
|
-
const filePath = path.join(
|
|
1760
|
+
const filePath = path.join(globalPath, file)
|
|
1729
1761
|
const stats = await fs.stat(filePath)
|
|
1730
1762
|
if (stats.size === 0) {
|
|
1731
1763
|
await fs.unlink(filePath)
|
|
@@ -1735,7 +1767,7 @@ ${diagram}
|
|
|
1735
1767
|
}
|
|
1736
1768
|
|
|
1737
1769
|
try {
|
|
1738
|
-
const shippedFile = path.join(
|
|
1770
|
+
const shippedFile = path.join(globalPath, 'progress', 'shipped.md')
|
|
1739
1771
|
const content = await this.agent.readFile(shippedFile)
|
|
1740
1772
|
const lines = content.split('\n')
|
|
1741
1773
|
const now = new Date()
|
package/core/migrator.js
CHANGED
|
@@ -510,7 +510,7 @@ class Migrator {
|
|
|
510
510
|
if (deepScan) {
|
|
511
511
|
searchPaths = [os.homedir()]
|
|
512
512
|
} else {
|
|
513
|
-
const commonDirs = ['Projects', 'Documents', 'Developer', 'Code', 'dev', 'workspace', 'repos', 'src']
|
|
513
|
+
const commonDirs = ['Projects', 'Documents', 'Developer', 'Code', 'dev', 'workspace', 'repos', 'src', 'Apps']
|
|
514
514
|
searchPaths = commonDirs
|
|
515
515
|
.map(dir => path.join(os.homedir(), dir))
|
|
516
516
|
.filter(dirPath => {
|
package/package.json
CHANGED
package/scripts/post-install.js
CHANGED
|
@@ -21,11 +21,18 @@ const { execSync } = require('child_process')
|
|
|
21
21
|
|
|
22
22
|
async function main() {
|
|
23
23
|
try {
|
|
24
|
+
// Get current package version (needed by multiple code paths)
|
|
25
|
+
const packageJson = require('../package.json')
|
|
26
|
+
const currentVersion = packageJson.version
|
|
27
|
+
|
|
24
28
|
// Check if this is a global installation
|
|
25
29
|
const isGlobal = await checkIfGlobalInstall()
|
|
26
30
|
|
|
27
31
|
if (!isGlobal) {
|
|
28
32
|
// Skip post-install for local/dev installations
|
|
33
|
+
if (process.env.DEBUG) {
|
|
34
|
+
console.log(chalk.gray('[post-install] Skipping - not a global install'))
|
|
35
|
+
}
|
|
29
36
|
return
|
|
30
37
|
}
|
|
31
38
|
|
|
@@ -62,15 +69,16 @@ async function main() {
|
|
|
62
69
|
console.log(chalk.green(`✅ Commands installed in: ${results.editors.join(', ')}`))
|
|
63
70
|
console.log(chalk.gray(` Commands installed: ${results.totalInstalled}`))
|
|
64
71
|
console.log(chalk.cyan(`\n✨ prjct-cli ${currentVersion} is ready!\n`))
|
|
72
|
+
} else {
|
|
73
|
+
console.log(chalk.yellow('⚠️ Some editors could not be configured'))
|
|
74
|
+
if (process.env.DEBUG) {
|
|
75
|
+
console.log(chalk.gray(` Error: ${results.message || 'Unknown error'}`))
|
|
76
|
+
}
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
return
|
|
68
80
|
}
|
|
69
81
|
|
|
70
|
-
// Get current package version
|
|
71
|
-
const packageJson = require('../package.json')
|
|
72
|
-
const currentVersion = packageJson.version
|
|
73
|
-
|
|
74
82
|
// Check if version has changed
|
|
75
83
|
const versionChanged = await editorsConfig.hasVersionChanged(currentVersion)
|
|
76
84
|
|