codeadd 0.1.5 → 0.1.7
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 +2 -2
- package/package.json +1 -1
- package/src/config.js +2 -2
- package/src/doctor.js +5 -5
- package/src/installer.js +5 -5
- package/src/uninstaller.js +4 -4
- package/src/updater.js +3 -3
- package/src/validator.js +2 -2
package/README.md
CHANGED
|
@@ -39,14 +39,14 @@ npx codeadd uninstall --force
|
|
|
39
39
|
- `update`: update installed files to latest GitHub release
|
|
40
40
|
- `uninstall`: remove files installed by ADD from current project
|
|
41
41
|
- `doctor`: verify Node, Git, and ADD installation health
|
|
42
|
-
- `validate`: verify file hashes from `.
|
|
42
|
+
- `validate`: verify file hashes from `.codeadd/manifest.json`
|
|
43
43
|
- `validate --repair`: restore missing or modified files
|
|
44
44
|
- `config show`: print current ADD installation config
|
|
45
45
|
- `config show --verbose`: config + release update check
|
|
46
46
|
|
|
47
47
|
## What gets installed
|
|
48
48
|
|
|
49
|
-
- Core (`.
|
|
49
|
+
- Core (`.codeadd/`): always installed
|
|
50
50
|
- Provider integration (optional, selected interactively):
|
|
51
51
|
- Claude Code -> `.claude/`
|
|
52
52
|
- Codex (OpenAI) -> `.agent/`
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -4,12 +4,12 @@ import { intro, outro, spinner, log } from '@clack/prompts';
|
|
|
4
4
|
import { getLatestTag } from './github.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Read and parse .
|
|
7
|
+
* Read and parse .codeadd/manifest.json.
|
|
8
8
|
* @param {string} cwd
|
|
9
9
|
* @returns {{ version: string, releaseTag: string, installedAt: string, providers: string[], files: string[], hashes?: object } | null}
|
|
10
10
|
*/
|
|
11
11
|
function readManifest(cwd) {
|
|
12
|
-
const manifestPath = path.join(cwd, '.
|
|
12
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
13
13
|
if (!fs.existsSync(manifestPath)) return null;
|
|
14
14
|
try {
|
|
15
15
|
return JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
package/src/doctor.js
CHANGED
|
@@ -42,12 +42,12 @@ function checkGit() {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Check if .
|
|
45
|
+
* Check if .codeadd/ directory exists and is non-empty.
|
|
46
46
|
* @param {string} cwd
|
|
47
47
|
* @returns {{ok: boolean, exists: boolean, hasFiles: boolean}}
|
|
48
48
|
*/
|
|
49
49
|
function checkAddDir(cwd) {
|
|
50
|
-
const addDir = path.join(cwd, '.
|
|
50
|
+
const addDir = path.join(cwd, '.codeadd');
|
|
51
51
|
const exists = fs.existsSync(addDir);
|
|
52
52
|
let hasFiles = false;
|
|
53
53
|
if (exists) {
|
|
@@ -71,7 +71,7 @@ function checkAddDir(cwd) {
|
|
|
71
71
|
* @returns {{ok: boolean, exists: boolean, valid: boolean}}
|
|
72
72
|
*/
|
|
73
73
|
function checkManifest(cwd) {
|
|
74
|
-
const manifestPath = path.join(cwd, '.
|
|
74
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
75
75
|
const exists = fs.existsSync(manifestPath);
|
|
76
76
|
let valid = false;
|
|
77
77
|
if (exists) {
|
|
@@ -118,7 +118,7 @@ export async function doctor(cwd) {
|
|
|
118
118
|
|
|
119
119
|
const addIcon = addCheck.ok ? 'OK' : addCheck.exists ? 'WARN' : 'ERROR';
|
|
120
120
|
const addStatus = addCheck.ok ? 'present' : addCheck.exists ? 'empty' : 'missing';
|
|
121
|
-
log.info(`${addIcon} .
|
|
121
|
+
log.info(`${addIcon} .codeadd/ directory: ${addStatus}`);
|
|
122
122
|
|
|
123
123
|
let manifestIcon;
|
|
124
124
|
let manifestStatus;
|
|
@@ -145,7 +145,7 @@ export async function doctor(cwd) {
|
|
|
145
145
|
const issues = [];
|
|
146
146
|
if (!nodeCheck.ok) issues.push('Node.js >= 18 required');
|
|
147
147
|
if (!gitCheck.ok) issues.push('Git not found');
|
|
148
|
-
if (!addCheck.ok) issues.push('.
|
|
148
|
+
if (!addCheck.ok) issues.push('.codeadd/ directory missing or empty');
|
|
149
149
|
if (!manifestCheck.ok) issues.push('manifest.json missing or invalid');
|
|
150
150
|
|
|
151
151
|
outro(`ERROR Issues found:\n${issues.map((i) => ` - ${i}`).join('\n')}`);
|
package/src/installer.js
CHANGED
|
@@ -39,7 +39,7 @@ function calculateHash(filePath) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* Write .
|
|
42
|
+
* Write .codeadd/manifest.json
|
|
43
43
|
* @param {string} cwd
|
|
44
44
|
* @param {string} version
|
|
45
45
|
* @param {string[]} providers
|
|
@@ -48,7 +48,7 @@ function calculateHash(filePath) {
|
|
|
48
48
|
* @param {object} [metadata]
|
|
49
49
|
*/
|
|
50
50
|
export function writeManifest(cwd, version, providers, files, releaseTag, metadata = {}) {
|
|
51
|
-
const manifestPath = path.join(cwd, '.
|
|
51
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
52
52
|
|
|
53
53
|
const hashes = {};
|
|
54
54
|
for (const file of files) {
|
|
@@ -208,9 +208,9 @@ export async function install(cwd, options = {}) {
|
|
|
208
208
|
s.stop(`Selected tag: ${installSource.downloadValue}`);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
const addDir = path.join(cwd, '.
|
|
211
|
+
const addDir = path.join(cwd, '.codeadd');
|
|
212
212
|
if (dirExists(addDir)) {
|
|
213
|
-
await promptConfirm('.
|
|
213
|
+
await promptConfirm('.codeadd/ already exists. Overwrite with latest version?');
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
const selectedKeys = await promptProviders();
|
|
@@ -237,7 +237,7 @@ export async function install(cwd, options = {}) {
|
|
|
237
237
|
|
|
238
238
|
const allFiles = [];
|
|
239
239
|
|
|
240
|
-
const coreFiles = copyFromZip(zip, zipRoot, 'framwork/.
|
|
240
|
+
const coreFiles = copyFromZip(zip, zipRoot, 'framwork/.codeadd', addDir, cwd);
|
|
241
241
|
allFiles.push(...coreFiles);
|
|
242
242
|
|
|
243
243
|
for (const p of providers) {
|
package/src/uninstaller.js
CHANGED
|
@@ -3,17 +3,17 @@ import path from 'node:path';
|
|
|
3
3
|
import { intro, outro, spinner, log } from '@clack/prompts';
|
|
4
4
|
import { promptConfirm } from './prompt.js';
|
|
5
5
|
|
|
6
|
-
const ADD_DIRS = ['.add', '.claude', '.agent', '.agents', '.kilocode', '.opencode'];
|
|
6
|
+
const ADD_DIRS = ['.codeadd', '.add', '.claude', '.agent', '.agents', '.kilocode', '.opencode'];
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Read and parse .
|
|
9
|
+
* Read and parse .codeadd/manifest.json.
|
|
10
10
|
* @param {string} cwd
|
|
11
11
|
* @returns {{ version: string, providers: string[], files: string[], corrupted?: boolean } | null}
|
|
12
12
|
* Returns null if manifest does not exist.
|
|
13
13
|
* Returns object with corrupted=true if file exists but JSON is invalid.
|
|
14
14
|
*/
|
|
15
15
|
export function readManifest(cwd) {
|
|
16
|
-
const manifestPath = path.join(cwd, '.
|
|
16
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
17
17
|
if (!fs.existsSync(manifestPath)) return null;
|
|
18
18
|
try {
|
|
19
19
|
return JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
@@ -160,7 +160,7 @@ export async function uninstall(cwd, force = false) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
const manifestPath = path.join(cwd, '.
|
|
163
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
164
164
|
try {
|
|
165
165
|
if (fs.existsSync(manifestPath)) {
|
|
166
166
|
fs.unlinkSync(manifestPath);
|
package/src/updater.js
CHANGED
|
@@ -61,7 +61,7 @@ function copyFromZip(zip, zipRoot, srcPrefix, destDir, cwd) {
|
|
|
61
61
|
export async function update(cwd) {
|
|
62
62
|
intro('ADD CLI - Update');
|
|
63
63
|
|
|
64
|
-
const manifestPath = path.join(cwd, '.
|
|
64
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
65
65
|
if (!fs.existsSync(manifestPath)) {
|
|
66
66
|
throw new Error('No ADD installation found. Run `npx codeadd install` first.');
|
|
67
67
|
}
|
|
@@ -97,9 +97,9 @@ export async function update(cwd) {
|
|
|
97
97
|
if (!zipRoot) throw new Error('Unexpected zip structure.');
|
|
98
98
|
|
|
99
99
|
const allFiles = [];
|
|
100
|
-
const addDir = path.join(cwd, '.
|
|
100
|
+
const addDir = path.join(cwd, '.codeadd');
|
|
101
101
|
|
|
102
|
-
const coreFiles = copyFromZip(zip, zipRoot, 'framwork/.
|
|
102
|
+
const coreFiles = copyFromZip(zip, zipRoot, 'framwork/.codeadd', addDir, cwd);
|
|
103
103
|
allFiles.push(...coreFiles);
|
|
104
104
|
|
|
105
105
|
const providers = resolveSelected(providerKeys);
|
package/src/validator.js
CHANGED
|
@@ -6,12 +6,12 @@ import { intro, outro, spinner, log } from '@clack/prompts';
|
|
|
6
6
|
import { downloadZip } from './github.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Read and parse .
|
|
9
|
+
* Read and parse .codeadd/manifest.json.
|
|
10
10
|
* @param {string} cwd
|
|
11
11
|
* @returns {{ version: string, releaseTag: string, installedAt: string, providers: string[], files: string[], hashes?: object } | null}
|
|
12
12
|
*/
|
|
13
13
|
function readManifest(cwd) {
|
|
14
|
-
const manifestPath = path.join(cwd, '.
|
|
14
|
+
const manifestPath = path.join(cwd, '.codeadd', 'manifest.json');
|
|
15
15
|
if (!fs.existsSync(manifestPath)) return null;
|
|
16
16
|
try {
|
|
17
17
|
return JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|