@garyr/pt-cli 0.31.0 → 0.32.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/README.md +9 -0
- package/package.json +2 -1
- package/tests/config.test.ts +17 -2
package/README.md
CHANGED
|
@@ -119,3 +119,12 @@ pt init ./new-project --file my-template.json --yes
|
|
|
119
119
|
An official agent skill is included in this repository: [`skills/agency-pt-operator/SKILL.md`](skills/agency-pt-operator/SKILL.md).
|
|
120
120
|
|
|
121
121
|
Equipping your agent with this skill allows it to automatically use `pt-cli` to lay down standardized boilerplate and capture new architectures you develop together.
|
|
122
|
+
## Warning
|
|
123
|
+
|
|
124
|
+
**⚠️ Beta Software Warning**: This project is in beta stage. While stable for most use cases, please make regular backups of your template configurations before running updates or major changes.
|
|
125
|
+
|
|
126
|
+
**💾 Backup Paths**:
|
|
127
|
+
- **Linux/macOS**: `~/.pt/` or `/home/username/.pt/` and `/Users/username/.pt/`
|
|
128
|
+
- **Windows**: `%USERPROFILE%\.pt\` (typically `C:\Users\Username\.pt\`)
|
|
129
|
+
|
|
130
|
+
Always back up these directories before installing new versions or making significant changes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@garyr/pt-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Project Template CLI - Learn structures and initialize projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"start": "tsx src/index.ts",
|
|
13
13
|
"dev": "tsx src/index.ts",
|
|
14
14
|
"test": "node --import tsx --test tests/**/*.test.ts",
|
|
15
|
+
"test:sequential": "node --import tsx --test tests/config.test.ts && node --import tsx --test tests/init.test.ts && node --import tsx --test tests/learn.test.ts && node --import tsx --test tests/substitute.test.ts && node --import tsx --test tests/config-utils.test.ts",
|
|
15
16
|
"prepublishOnly": "npm run build",
|
|
16
17
|
"build:linux": "bun build ./src/index.ts --compile --target=bun-linux-x64 --outfile ../BUILD/pt-cli/pt-linux",
|
|
17
18
|
"build:macos": "bun build ./src/index.ts --compile --target=bun-darwin-x64 --outfile ../BUILD/pt-cli/pt-macos",
|
package/tests/config.test.ts
CHANGED
|
@@ -2,12 +2,16 @@ import { test, before, after } from 'node:test';
|
|
|
2
2
|
import assert from 'node:assert';
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
|
+
import os from 'os';
|
|
5
6
|
|
|
6
7
|
// Force a temporary home directory for testing before importing anything from the CLI
|
|
7
8
|
const testHome = path.join(process.cwd(), '.test-home-config');
|
|
8
|
-
process.env.HOME = testHome;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// Mock os.homedir() to return the test directory (Node.js doesn't use HOME env var on Linux)
|
|
11
|
+
const originalHomedir = os.homedir;
|
|
12
|
+
os.homedir = () => testHome;
|
|
13
|
+
|
|
14
|
+
import { normalizeVariable, saveConfig, loadConfig, PtConfig, CONFIG_PATH, HOME_DIR } from '../src/config.js';
|
|
11
15
|
|
|
12
16
|
test('normalizeVariable key ordering', () => {
|
|
13
17
|
const variableInput = {
|
|
@@ -760,4 +764,15 @@ test('saveConfig preserves existing config when not deleting', () => {
|
|
|
760
764
|
if (savedConfig) {
|
|
761
765
|
saveConfig(savedConfig);
|
|
762
766
|
}
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
// Cleanup: restore original os.homedir function and clean up test directory
|
|
770
|
+
after(() => {
|
|
771
|
+
// Restore original os.homedir function
|
|
772
|
+
os.homedir = originalHomedir;
|
|
773
|
+
|
|
774
|
+
// Clean up test home directory if it exists
|
|
775
|
+
if (fs.existsSync(testHome)) {
|
|
776
|
+
fs.rmdirSync(testHome, { recursive: true });
|
|
777
|
+
}
|
|
763
778
|
});
|