create-zudo-doc 5.0.0 → 5.0.1

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.
@@ -32,5 +32,5 @@ export declare function deriveDocSkillName(projectName: string): string;
32
32
  *
33
33
  * Bumped in lockstep by scripts/release-create-zudo-doc.sh.
34
34
  */
35
- export declare const ZUDO_DOC_PIN = "^5.0.0";
35
+ export declare const ZUDO_DOC_PIN = "^5.0.1";
36
36
  export declare function scaffold(choices: UserChoices): Promise<void>;
package/dist/scaffold.js CHANGED
@@ -43,7 +43,7 @@ export function deriveDocSkillName(projectName) {
43
43
  *
44
44
  * Bumped in lockstep by scripts/release-create-zudo-doc.sh.
45
45
  */
46
- export const ZUDO_DOC_PIN = "^5.0.0";
46
+ export const ZUDO_DOC_PIN = "^5.0.1";
47
47
  /**
48
48
  * Files in `templates/base/**` that must not be copied by the unconditional
49
49
  * base mirror. Each entry is matched against the path relative to
@@ -703,7 +703,7 @@ function generatePackageJson(choices) {
703
703
  // `/exclude` at module scope from the always-bundled chrome graph; #3110
704
704
  // moved compileExclude into @takazudo/zudo-doc, so docHistory-OFF projects
705
705
  // no longer need the package at all.
706
- deps["@takazudo/zudo-doc-history-server"] = "^5.0.0";
706
+ deps["@takazudo/zudo-doc-history-server"] = "^5.0.1";
707
707
  // tsx is no longer needed here: the relocated package plugin imports the
708
708
  // runner directly (no `tsx -e` spawn) since the package ships compiled
709
709
  // dist/ — package-first migration #2321 (#2337).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zudo-doc",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Create a new zudo-doc documentation site",
5
5
  "license": "MIT",
6
6
  "author": "Takeshi Takatsudo",
@@ -201,6 +201,26 @@ if [ ! -d "$DOCS_DIR" ]; then
201
201
  exit 1
202
202
  fi
203
203
 
204
+ # Helper: physical (symlink-resolved) form of a directory path; echoes the
205
+ # input unchanged when it is not a directory. Stock macOS ships no realpath(1)
206
+ # and BSD readlink has no -f, so `cd` + `pwd -P` is the only resolver available
207
+ # on every platform this script targets (it is also copied verbatim into
208
+ # downstream projects by create-zudo-doc, so it must stay portable).
209
+ physical_dir() {
210
+ local resolved
211
+ # Fall back to the input on ANY resolution failure -- notably an unreadable
212
+ # directory, where `cd` fails and the subshell yields "". Without the
213
+ # non-empty guard, two different unreadable paths would both collapse to ""
214
+ # and compare EQUAL, silently skipping a link that should have been created.
215
+ # stderr is suppressed so a permission-denied probe stays quiet.
216
+ if [ -d "$1" ] && resolved="$(cd "$1" 2>/dev/null && pwd -P)" &&
217
+ [ -n "$resolved" ]; then
218
+ printf '%s\n' "$resolved"
219
+ else
220
+ printf '%s\n' "$1"
221
+ fi
222
+ }
223
+
204
224
  # Helper: replace a symlink or file at the given path
205
225
  ensure_symlink() {
206
226
  local link_path="$1"
@@ -228,7 +248,17 @@ safe_link_tracked_skill() {
228
248
  if [ -L "$link_path" ]; then
229
249
  local current_target
230
250
  current_target="$(readlink "$link_path")"
231
- if [ "$current_target" = "$link_target" ]; then
251
+ # Compare where the link actually LANDS, not the literal string it stores.
252
+ # link_target is built from MAIN_PROJECT_DIR, which comes from
253
+ # `git worktree list` and is therefore always PHYSICAL, while an existing
254
+ # link may hold an unresolved path for the same directory. A raw string
255
+ # compare then mis-reports our own correct link as foreign whenever the
256
+ # project or its parents sit behind a symlink (macOS $TMPDIR: /var ->
257
+ # /private/var; also a symlinked $HOME or repo checkout), so the link was
258
+ # skipped with a spurious "already links to ..." warning instead of
259
+ # no-opping (zudolab/zudo-doc#3156 D4).
260
+ if [ "$current_target" = "$link_target" ] ||
261
+ [ "$(physical_dir "$link_path")" = "$(physical_dir "$link_target")" ]; then
232
262
  return 0 # already correct -> no-op
233
263
  fi
234
264
  if [ -e "$link_path" ]; then