azcodr 2.0.0 → 2.1.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/.agents/hooks.json +3 -3
- package/.github/workflows/publish.yml +0 -4
- package/bin/azcodr.js +9 -4
- package/lib/cli-parse.d.ts +32 -0
- package/lib/cli-parse.d.ts.map +1 -0
- package/lib/cli-parse.js +45 -41
- package/lib/cli-parse.js.map +1 -0
- package/lib/cli-target.d.ts +66 -0
- package/lib/cli-target.d.ts.map +1 -0
- package/lib/cli-target.js +89 -96
- package/lib/cli-target.js.map +1 -0
- package/lib/cli.d.ts +40 -0
- package/lib/cli.d.ts.map +1 -0
- package/lib/cli.js +122 -136
- package/lib/cli.js.map +1 -0
- package/lib/errors.d.ts +39 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +16 -18
- package/lib/errors.js.map +1 -0
- package/lib/git.d.ts +15 -0
- package/lib/git.d.ts.map +1 -0
- package/lib/git.js +25 -22
- package/lib/git.js.map +1 -0
- package/lib/guards.d.ts +35 -0
- package/lib/guards.d.ts.map +1 -0
- package/lib/guards.js +62 -63
- package/lib/guards.js.map +1 -0
- package/lib/index.d.ts +6 -199
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +4 -5
- package/lib/index.js.map +1 -0
- package/lib/links.d.ts +28 -0
- package/lib/links.d.ts.map +1 -0
- package/lib/links.js +105 -99
- package/lib/links.js.map +1 -0
- package/lib/permissions.d.ts +9 -0
- package/lib/permissions.d.ts.map +1 -0
- package/lib/permissions.js +36 -36
- package/lib/permissions.js.map +1 -0
- package/lib/repo.d.ts +20 -0
- package/lib/repo.d.ts.map +1 -0
- package/lib/repo.js +73 -71
- package/lib/repo.js.map +1 -0
- package/lib/scaffold.d.ts +80 -0
- package/lib/scaffold.d.ts.map +1 -0
- package/lib/scaffold.js +159 -196
- package/lib/scaffold.js.map +1 -0
- package/memory.md +16 -0
- package/package.json +13 -3
- package/scripts/test_coverage.js +2 -2
- package/scripts/validate/adr.js +11 -7
- package/scripts/validate/io.js +7 -9
- package/scripts/validate/links.js +6 -7
- package/scripts/validate/parity.js +5 -7
- package/scripts/validate/root.js +6 -7
- package/scripts/validate/rules.js +7 -9
- package/scripts/validate/skills.js +8 -10
- package/scripts/validate/text.js +3 -5
- package/scripts/validate-cli.js +1 -2
- package/scripts/validate.js +37 -19
- package/src/cli-parse.ts +77 -0
- package/src/cli-target.ts +167 -0
- package/src/cli.ts +240 -0
- package/src/errors.ts +35 -0
- package/src/git.ts +34 -0
- package/src/guards.ts +101 -0
- package/src/index.ts +39 -0
- package/src/links.ts +139 -0
- package/src/permissions.ts +42 -0
- package/src/repo.ts +94 -0
- package/src/scaffold.ts +273 -0
package/lib/guards.js
CHANGED
|
@@ -1,71 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import process from 'node:process';
|
|
5
|
+
import { ScaffoldError, ERROR_CODES } from './errors.js';
|
|
6
|
+
import { getTemplateDir } from './scaffold.js';
|
|
8
7
|
/**
|
|
9
8
|
* Filesystem scope guard (Supply Chain: filesystem access).
|
|
10
9
|
* Constrains all reads/writes to targetDir / templateDir.
|
|
11
10
|
*/
|
|
12
|
-
function assertInside(root, candidate, message) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
export function assertInside(root, candidate, message) {
|
|
12
|
+
const resolvedRoot = path.resolve(root);
|
|
13
|
+
const resolvedCandidate = path.resolve(root, candidate);
|
|
14
|
+
const relative = path.relative(resolvedRoot, resolvedCandidate);
|
|
15
|
+
if (relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
16
|
+
throw new ScaffoldError('E_PATH_ESCAPE', message || `${ERROR_CODES.E_PATH_ESCAPE}: ${candidate}`);
|
|
17
|
+
}
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
/**
|
|
22
20
|
* Normalizes a path for protected-target comparison. On Windows the filesystem
|
|
23
21
|
* is case-insensitive, so `C:\Users\Name` and `c:\users\name` are the same
|
|
24
22
|
* directory and must compare equal.
|
|
25
23
|
*/
|
|
26
|
-
function normalizeForComparison(p) {
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
export function normalizeForComparison(p) {
|
|
25
|
+
const resolved = path.resolve(p);
|
|
26
|
+
return process.platform === 'win32' ? resolved.toLowerCase() : resolved;
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
function readHomeDir() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
try {
|
|
30
|
+
return os.homedir();
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
37
35
|
}
|
|
38
|
-
|
|
39
36
|
function isFilesystemRoot(resolvedTarget) {
|
|
40
|
-
|
|
37
|
+
return resolvedTarget === path.parse(resolvedTarget).root;
|
|
41
38
|
}
|
|
42
|
-
|
|
43
39
|
function isHomeOrParent(normalizedTarget, home) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
if (!home)
|
|
41
|
+
return false;
|
|
42
|
+
if (normalizedTarget === normalizeForComparison(home))
|
|
43
|
+
return true;
|
|
44
|
+
const parent = path.dirname(path.resolve(home));
|
|
45
|
+
return normalizedTarget === normalizeForComparison(parent);
|
|
48
46
|
}
|
|
49
|
-
|
|
50
47
|
function isTemplateAncestor(resolvedTarget, templateDir) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
const resolvedTemplate = path.resolve(templateDir);
|
|
49
|
+
const relative = path.relative(resolvedTarget, resolvedTemplate);
|
|
50
|
+
return relative !== '' && !relative.startsWith('..') && !path.isAbsolute(relative);
|
|
54
51
|
}
|
|
55
|
-
|
|
56
52
|
function resolvesToProtectedLocation(resolvedTarget, home) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
// Symlink alias: a symlink to / or ~ must not bypass the lexical checks.
|
|
54
|
+
let real = '';
|
|
55
|
+
try {
|
|
56
|
+
if (!fs.existsSync(resolvedTarget))
|
|
57
|
+
return false;
|
|
58
|
+
real = fs.realpathSync(resolvedTarget);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
if (real === path.parse(real).root)
|
|
64
|
+
return true;
|
|
65
|
+
return Boolean(home) && normalizeForComparison(real) === normalizeForComparison(home);
|
|
67
66
|
}
|
|
68
|
-
|
|
69
67
|
/**
|
|
70
68
|
* Returns true when `targetDir` is a location the scaffolder must never write
|
|
71
69
|
* into: the filesystem root, the user's home directory, the home directory's
|
|
@@ -76,21 +74,22 @@ function resolvesToProtectedLocation(resolvedTarget, home) {
|
|
|
76
74
|
* Lexical comparison is not enough: a symlink pointing at home must also be
|
|
77
75
|
* caught, so an existing target is resolved with realpath before comparing.
|
|
78
76
|
*/
|
|
79
|
-
function isProtectedTarget(targetDir, options = {}) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
export function isProtectedTarget(targetDir, options = {}) {
|
|
78
|
+
const resolvedTarget = path.resolve(targetDir);
|
|
79
|
+
const normalizedTarget = normalizeForComparison(resolvedTarget);
|
|
80
|
+
if (isFilesystemRoot(resolvedTarget))
|
|
81
|
+
return true;
|
|
82
|
+
const home = readHomeDir();
|
|
83
|
+
if (isHomeOrParent(normalizedTarget, home))
|
|
84
|
+
return true;
|
|
85
|
+
const { templateDir = getTemplateDir() } = options;
|
|
86
|
+
if (isTemplateAncestor(resolvedTarget, templateDir))
|
|
87
|
+
return true;
|
|
88
|
+
return resolvesToProtectedLocation(resolvedTarget, home);
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
isProtectedTarget
|
|
90
|
+
export default {
|
|
91
|
+
assertInside,
|
|
92
|
+
normalizeForComparison,
|
|
93
|
+
isProtectedTarget
|
|
96
94
|
};
|
|
95
|
+
//# sourceMappingURL=guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAS/C;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,SAAiB,EAAE,OAAgB;IAC5E,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAChE,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,aAAa,CAAC,eAAe,EAAE,OAAO,IAAI,GAAG,WAAW,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC,CAAC;IACpG,CAAC;AACH,CAAC;AAED;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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** Target directory path where template should be scaffolded (default: process.cwd()) */
|
|
8
|
-
targetDir?: string;
|
|
9
|
-
/** Force overwrite if target directory is non-empty (default: false) */
|
|
10
|
-
force?: boolean;
|
|
11
|
-
/** Skip git repository initialization (default: false) */
|
|
12
|
-
noGit?: boolean;
|
|
13
|
-
/** Custom template root directory (default: azcodr root) */
|
|
14
|
-
templateDir?: string;
|
|
15
|
-
/** Simulate scaffolding without writing files or running git (default: false) */
|
|
16
|
-
dryRun?: boolean;
|
|
17
|
-
/** Suppress console output messages (default: false) */
|
|
18
|
-
silent?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ScaffoldResult {
|
|
22
|
-
/** Whether the scaffolding succeeded */
|
|
23
|
-
success: boolean;
|
|
24
|
-
/** Absolute resolved path of the target directory */
|
|
25
|
-
targetDir: string;
|
|
26
|
-
/** Whether git init was successfully executed */
|
|
27
|
-
gitInitialized: boolean;
|
|
28
|
-
/** Whether execution ran in dry-run simulation mode */
|
|
29
|
-
dryRun: boolean;
|
|
30
|
-
/** List of files, directories, and symlinks created or simulated */
|
|
31
|
-
actions: string[];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ValidateTargetOptions {
|
|
35
|
-
/** Custom template root directory */
|
|
36
|
-
templateDir?: string;
|
|
37
|
-
/** Force allow non-empty directory */
|
|
38
|
-
force?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Bypass the protected-target guard (filesystem root, home, home's parent,
|
|
41
|
-
* template ancestors). The CLI never passes this. Programmatic use only.
|
|
42
|
-
*/
|
|
43
|
-
allowProtected?: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface InitGitOptions {
|
|
47
|
-
/** If true, skips git initialization */
|
|
48
|
-
noGit?: boolean;
|
|
49
|
-
/** If true, simulates git initialization without executing */
|
|
50
|
-
dryRun?: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface CopyTemplateOptions {
|
|
54
|
-
/** If true, simulates copy without writing to disk */
|
|
55
|
-
dryRun?: boolean;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Machine-readable failure codes thrown by this library.
|
|
60
|
-
*
|
|
61
|
-
* Branch on `error.code`, never on `error.message`: message wording may change
|
|
62
|
-
* between releases, codes are part of the public contract.
|
|
63
|
-
*/
|
|
64
|
-
export type ScaffoldErrorCode =
|
|
65
|
-
| 'E_TARGET_IS_TEMPLATE'
|
|
66
|
-
| 'E_TARGET_NOT_EMPTY'
|
|
67
|
-
| 'E_TARGET_IS_PROTECTED'
|
|
68
|
-
| 'E_GIT_ARGS_INVALID'
|
|
69
|
-
| 'E_GIT_BLOCKED'
|
|
70
|
-
| 'E_PATH_ESCAPE';
|
|
71
|
-
|
|
72
|
-
/** Error type thrown by every azcodr API. Always carries a `code`. */
|
|
73
|
-
export interface ScaffoldErrorShape extends Error {
|
|
74
|
-
name: 'ScaffoldError';
|
|
75
|
-
code: ScaffoldErrorCode;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export declare class ScaffoldError extends Error implements ScaffoldErrorShape {
|
|
79
|
-
constructor(code: ScaffoldErrorCode, message: string);
|
|
80
|
-
name: 'ScaffoldError';
|
|
81
|
-
code: ScaffoldErrorCode;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Human-readable prefix for each code, as thrown. */
|
|
85
|
-
export declare const ERROR_CODES: Readonly<Record<ScaffoldErrorCode, string>>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* High-level orchestration function to scaffold the azcodr workspace into targetDir.
|
|
89
|
-
*/
|
|
90
|
-
export function scaffold(options?: ScaffoldOptions): ScaffoldResult;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Validates the target directory to ensure it is suitable for scaffolding.
|
|
94
|
-
*/
|
|
95
|
-
export function validateTarget(targetDir: string, options?: ValidateTargetOptions): void;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Copies template items into target directory and sets up symlinks and permissions.
|
|
99
|
-
*/
|
|
100
|
-
export function copyTemplate(
|
|
101
|
-
targetDir: string,
|
|
102
|
-
templateDir?: string,
|
|
103
|
-
options?: CopyTemplateOptions
|
|
104
|
-
): string[];
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Safely creates or updates a symbolic link, falling back to a file copy if symlinks are unsupported.
|
|
108
|
-
*/
|
|
109
|
-
export function ensureSymlink(options: {
|
|
110
|
-
targetDir: string;
|
|
111
|
-
linkName: string;
|
|
112
|
-
targetFileName: string;
|
|
113
|
-
dryRun?: boolean;
|
|
114
|
-
}): boolean;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Creates a symlink, falling back to a text pointer (not a full copy).
|
|
118
|
-
*/
|
|
119
|
-
export function ensureSymlinkOrPointer(options: {
|
|
120
|
-
targetDir: string;
|
|
121
|
-
linkName: string;
|
|
122
|
-
targetFileName: string;
|
|
123
|
-
dryRun?: boolean;
|
|
124
|
-
}): boolean;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Detects whether linkName and targetFileName refer to the same entry on a case-insensitive filesystem.
|
|
128
|
-
*/
|
|
129
|
-
export function isSameCaseInsensitiveFile(
|
|
130
|
-
targetDir: string,
|
|
131
|
-
linkName: string,
|
|
132
|
-
targetFileName: string
|
|
133
|
-
): boolean;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Ensures all bash scripts in skill directories have executable permissions (0o755).
|
|
137
|
-
*/
|
|
138
|
-
export function makeScriptsExecutable(targetDir: string, dryRun?: boolean): string[];
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Initializes a git repository in the target directory if not already inside one.
|
|
142
|
-
*/
|
|
143
|
-
export function initGit(targetDir: string, options?: InitGitOptions): boolean;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Detects whether targetDir is already inside an existing Git worktree.
|
|
147
|
-
* Shell access is limited to `git rev-parse` via a shell-free allowlisted spawn.
|
|
148
|
-
*/
|
|
149
|
-
export function isInsideGitWorkTree(targetDir: string): boolean;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Spawns `git` with argv (never a shell string) through an explicit
|
|
153
|
-
* subcommand allowlist. @throws ScaffoldError with E_GIT_ARGS_INVALID or E_GIT_BLOCKED.
|
|
154
|
-
*/
|
|
155
|
-
export function runGit(args: string[], options?: Record<string, unknown>): string;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Scope guard: throws if `candidate` resolves outside `root`.
|
|
159
|
-
* @throws ScaffoldError with E_PATH_ESCAPE.
|
|
160
|
-
*/
|
|
161
|
-
export function assertInside(root: string, candidate: string, message?: string): void;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Returns true when `targetDir` is a protected system location the scaffolder
|
|
165
|
-
* must never write into (filesystem root, home, home's parent, template
|
|
166
|
-
* ancestors, symlink aliases). @throws never; pure predicate.
|
|
167
|
-
*/
|
|
168
|
-
export function isProtectedTarget(targetDir: string, options?: ValidateTargetOptions): boolean;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Returns the root path to the azcodr template files.
|
|
172
|
-
*/
|
|
173
|
-
export function getTemplateDir(): string;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Array of essential template files and directories copied during scaffolding.
|
|
177
|
-
*/
|
|
178
|
-
export const TEMPLATE_ITEMS: readonly string[];
|
|
179
|
-
|
|
180
|
-
declare const defaultExport: {
|
|
181
|
-
scaffold: typeof scaffold;
|
|
182
|
-
validateTarget: typeof validateTarget;
|
|
183
|
-
copyTemplate: typeof copyTemplate;
|
|
184
|
-
ensureSymlink: typeof ensureSymlink;
|
|
185
|
-
ensureSymlinkOrPointer: typeof ensureSymlinkOrPointer;
|
|
186
|
-
isSameCaseInsensitiveFile: typeof isSameCaseInsensitiveFile;
|
|
187
|
-
makeScriptsExecutable: typeof makeScriptsExecutable;
|
|
188
|
-
initGit: typeof initGit;
|
|
189
|
-
isInsideGitWorkTree: typeof isInsideGitWorkTree;
|
|
190
|
-
runGit: typeof runGit;
|
|
191
|
-
assertInside: typeof assertInside;
|
|
192
|
-
isProtectedTarget: typeof isProtectedTarget;
|
|
193
|
-
getTemplateDir: typeof getTemplateDir;
|
|
194
|
-
TEMPLATE_ITEMS: typeof TEMPLATE_ITEMS;
|
|
195
|
-
ScaffoldError: typeof ScaffoldError;
|
|
196
|
-
ERROR_CODES: typeof ERROR_CODES;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
export default defaultExport;
|
|
1
|
+
export type ScaffoldErrorCode = 'E_TARGET_IS_TEMPLATE' | 'E_TARGET_NOT_EMPTY' | 'E_TARGET_IS_PROTECTED' | 'E_GIT_ARGS_INVALID' | 'E_GIT_BLOCKED' | 'E_PATH_ESCAPE';
|
|
2
|
+
export { scaffold, validateTarget, copyTemplate, ensureSymlink, ensureSymlinkOrPointer, isSameCaseInsensitiveFile, makeScriptsExecutable, initGit, isInsideGitWorkTree, runGit, assertInside, isProtectedTarget, getTemplateDir, TEMPLATE_ITEMS, ScaffoldError, ERROR_CODES } from './scaffold.js';
|
|
3
|
+
export type { ScaffoldOptions, ScaffoldResult, ValidateTargetOptions, CopyTemplateOptions, EnsureSymlinkOptions, InitGitOptions, ScaffoldErrorShape } from './scaffold.js';
|
|
4
|
+
import scaffoldModule from './scaffold.js';
|
|
5
|
+
export default scaffoldModule;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB,sBAAsB,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,eAAe,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,OAAO,EACP,mBAAmB,EACnB,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,eAAe,EACf,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,cAAc,MAAM,eAAe,CAAC;AAC3C,eAAe,cAAc,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports = scaffold;
|
|
1
|
+
export { scaffold, validateTarget, copyTemplate, ensureSymlink, ensureSymlinkOrPointer, isSameCaseInsensitiveFile, makeScriptsExecutable, initGit, isInsideGitWorkTree, runGit, assertInside, isProtectedTarget, getTemplateDir, TEMPLATE_ITEMS, ScaffoldError, ERROR_CODES } from './scaffold.js';
|
|
2
|
+
import scaffoldModule from './scaffold.js';
|
|
3
|
+
export default scaffoldModule;
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,OAAO,EACP,mBAAmB,EACnB,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,WAAW,EACZ,MAAM,eAAe,CAAC;AAYvB,OAAO,cAAc,MAAM,eAAe,CAAC;AAC3C,eAAe,cAAc,CAAC"}
|
package/lib/links.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface EnsureSymlinkOptions {
|
|
2
|
+
targetDir: string;
|
|
3
|
+
linkName: string;
|
|
4
|
+
targetFileName: string;
|
|
5
|
+
dryRun?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Detects whether linkName and targetFileName refer to the same entry on a case-insensitive filesystem.
|
|
9
|
+
* Uses exact directory listing (not existsSync, which lies on case-insensitive systems).
|
|
10
|
+
*/
|
|
11
|
+
export declare function isSameCaseInsensitiveFile(targetDir: string, linkName: string, targetFileName: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Safely creates or updates a symbolic link, falling back to a file copy if symlinks are unsupported.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ensureSymlink(options: EnsureSymlinkOptions): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a symlink, falling back to a text pointer (not a full copy).
|
|
18
|
+
* Used for .github/copilot-instructions.md where a full AGENTS.md copy would
|
|
19
|
+
* break relative markdown links (they resolve from .github/, not root).
|
|
20
|
+
*/
|
|
21
|
+
export declare function ensureSymlinkOrPointer(options: EnsureSymlinkOptions): boolean;
|
|
22
|
+
declare const _default: {
|
|
23
|
+
isSameCaseInsensitiveFile: typeof isSameCaseInsensitiveFile;
|
|
24
|
+
ensureSymlink: typeof ensureSymlink;
|
|
25
|
+
ensureSymlinkOrPointer: typeof ensureSymlinkOrPointer;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
//# sourceMappingURL=links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA6DD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAWT;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAapE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAmB7E;;;;;;AAED,wBAIE"}
|
package/lib/links.js
CHANGED
|
@@ -1,123 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const fs = require('node:fs');
|
|
4
|
-
const path = require('node:path');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Detects whether linkName and targetFileName refer to the same entry on a case-insensitive filesystem.
|
|
8
|
-
* Uses exact directory listing (not existsSync, which lies on case-insensitive systems).
|
|
9
|
-
*/
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
10
3
|
function namesDifferOnlyByCase(linkName, targetFileName) {
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
if (linkName.toLowerCase() !== targetFileName.toLowerCase())
|
|
5
|
+
return false;
|
|
6
|
+
return linkName !== targetFileName;
|
|
13
7
|
}
|
|
14
|
-
|
|
15
8
|
function readDirEntries(targetDir) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
try {
|
|
10
|
+
return fs.readdirSync(targetDir);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
21
15
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
function bothEntriesExist(options) {
|
|
17
|
+
const { targetDir, linkName, targetFileName, entries } = options;
|
|
18
|
+
if (!entries.includes(targetFileName) || !entries.includes(linkName))
|
|
19
|
+
return false;
|
|
20
|
+
try {
|
|
21
|
+
fs.lstatSync(path.join(targetDir, targetFileName));
|
|
22
|
+
fs.lstatSync(path.join(targetDir, linkName));
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
function accessiblePair(targetPath, linkPath) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function isSameCaseInsensitiveFile(targetDir, linkName, targetFileName) {
|
|
48
|
-
if (linkName === targetFileName) return true;
|
|
49
|
-
if (!namesDifferOnlyByCase(linkName, targetFileName)) return false;
|
|
50
|
-
const entries = readDirEntries(targetDir);
|
|
51
|
-
if (entries === null) return false;
|
|
52
|
-
if (bothEntriesExist({ targetDir, linkName, targetFileName, entries })) {
|
|
53
|
-
return !fs.lstatSync(path.join(targetDir, linkName)).isSymbolicLink();
|
|
54
|
-
}
|
|
55
|
-
const targetPath = path.join(targetDir, targetFileName);
|
|
56
|
-
const linkPath = path.join(targetDir, linkName);
|
|
57
|
-
return accessiblePair(targetPath, linkPath);
|
|
30
|
+
if (!fs.existsSync(targetPath) || !fs.existsSync(linkPath))
|
|
31
|
+
return false;
|
|
32
|
+
try {
|
|
33
|
+
fs.lstatSync(targetPath);
|
|
34
|
+
fs.lstatSync(linkPath);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
58
40
|
}
|
|
59
|
-
|
|
60
41
|
function removeIfExists(linkPath) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
42
|
+
try {
|
|
43
|
+
fs.lstatSync(linkPath);
|
|
44
|
+
fs.rmSync(linkPath, { force: true });
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Path does not exist, proceed
|
|
48
|
+
}
|
|
67
49
|
}
|
|
68
|
-
|
|
69
50
|
function copyFallback(targetDir, linkName, targetFileName) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
const sourceFile = path.resolve(targetDir, targetFileName);
|
|
52
|
+
if (fs.existsSync(sourceFile)) {
|
|
53
|
+
fs.copyFileSync(sourceFile, path.join(targetDir, linkName));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Detects whether linkName and targetFileName refer to the same entry on a case-insensitive filesystem.
|
|
58
|
+
* Uses exact directory listing (not existsSync, which lies on case-insensitive systems).
|
|
59
|
+
*/
|
|
60
|
+
export function isSameCaseInsensitiveFile(targetDir, linkName, targetFileName) {
|
|
61
|
+
if (linkName === targetFileName)
|
|
62
|
+
return true;
|
|
63
|
+
if (!namesDifferOnlyByCase(linkName, targetFileName))
|
|
64
|
+
return false;
|
|
65
|
+
const entries = readDirEntries(targetDir);
|
|
66
|
+
if (entries === null)
|
|
67
|
+
return false;
|
|
68
|
+
if (bothEntriesExist({ targetDir, linkName, targetFileName, entries })) {
|
|
69
|
+
return !fs.lstatSync(path.join(targetDir, linkName)).isSymbolicLink();
|
|
70
|
+
}
|
|
71
|
+
const targetPath = path.join(targetDir, targetFileName);
|
|
72
|
+
const linkPath = path.join(targetDir, linkName);
|
|
73
|
+
return accessiblePair(targetPath, linkPath);
|
|
75
74
|
}
|
|
76
|
-
|
|
77
75
|
/**
|
|
78
76
|
* Safely creates or updates a symbolic link, falling back to a file copy if symlinks are unsupported.
|
|
79
77
|
*/
|
|
80
|
-
function ensureSymlink(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
export function ensureSymlink(options) {
|
|
79
|
+
const { targetDir, linkName, targetFileName, dryRun = false } = options;
|
|
80
|
+
if (dryRun)
|
|
81
|
+
return true;
|
|
82
|
+
if (isSameCaseInsensitiveFile(targetDir, linkName, targetFileName))
|
|
83
|
+
return true;
|
|
84
|
+
const linkPath = path.join(targetDir, linkName);
|
|
85
|
+
removeIfExists(linkPath);
|
|
86
|
+
try {
|
|
87
|
+
fs.symlinkSync(targetFileName, linkPath, 'file');
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
copyFallback(targetDir, linkName, targetFileName);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
92
94
|
}
|
|
93
|
-
|
|
94
95
|
/**
|
|
95
96
|
* Creates a symlink, falling back to a text pointer (not a full copy).
|
|
96
97
|
* Used for .github/copilot-instructions.md where a full AGENTS.md copy would
|
|
97
98
|
* break relative markdown links (they resolve from .github/, not root).
|
|
98
99
|
*/
|
|
99
|
-
function ensureSymlinkOrPointer(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
export function ensureSymlinkOrPointer(options) {
|
|
101
|
+
const { targetDir, linkName, targetFileName, dryRun = false } = options;
|
|
102
|
+
if (dryRun)
|
|
103
|
+
return true;
|
|
104
|
+
const linkPath = path.join(targetDir, linkName);
|
|
103
105
|
try {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
try {
|
|
107
|
+
fs.lstatSync(linkPath);
|
|
108
|
+
const existing = fs.existsSync(linkPath) ? fs.readFileSync(linkPath, 'utf-8') : '';
|
|
109
|
+
if (existing.trim() === targetFileName)
|
|
110
|
+
return true;
|
|
111
|
+
fs.rmSync(linkPath, { force: true });
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Path does not exist, proceed
|
|
115
|
+
}
|
|
116
|
+
fs.symlinkSync(targetFileName, linkPath, 'file');
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
fs.writeFileSync(linkPath, `${targetFileName}\n`, 'utf-8');
|
|
121
|
+
return true;
|
|
110
122
|
}
|
|
111
|
-
fs.symlinkSync(targetFileName, linkPath, 'file');
|
|
112
|
-
return true;
|
|
113
|
-
} catch {
|
|
114
|
-
fs.writeFileSync(linkPath, `${targetFileName}\n`, 'utf-8');
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
123
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
ensureSymlinkOrPointer
|
|
124
|
+
export default {
|
|
125
|
+
isSameCaseInsensitiveFile,
|
|
126
|
+
ensureSymlink,
|
|
127
|
+
ensureSymlinkOrPointer
|
|
123
128
|
};
|
|
129
|
+
//# sourceMappingURL=links.js.map
|
package/lib/links.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"links.js","sourceRoot":"","sources":["../src/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAgB7B,SAAS,qBAAqB,CAAC,QAAgB,EAAE,cAAsB;IACrE,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,WAAW,EAAE;QAAE,OAAO,KAAK,CAAC;IAC1E,OAAO,QAAQ,KAAK,cAAc,CAAC;AACrC,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACvC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAgC;IACxD,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACjE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc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