@skitterbyte/skitterspec-azure-boards 2.5.0 → 2.6.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.
@@ -21,9 +21,9 @@ const {
21
21
  findSpecFolder,
22
22
  resolveSpec,
23
23
  liveWorktreePaths,
24
- resolvePrimaryCheckout,
25
24
  } = require('../../../env/resolve.js')
26
25
  const { loadEnvConfig } = require('../../../env/config.js')
26
+ const { primaryAnchor, attachProject, projectIn } = require('../../../env/project.js')
27
27
  const { readSnapshot, parseFrontmatter, lintPhases, fieldsOf, projectionOf, compareStored, comparableDescription } = require('../../sync-core')
28
28
 
29
29
  function makeSpecHelpers({ program = 'spec-sync' } = {}) {
@@ -136,9 +136,16 @@ function makeSpecHelpers({ program = 'spec-sync' } = {}) {
136
136
  }
137
137
  let primary
138
138
  let env
139
+ let prefix = ''
139
140
  try {
140
- primary = resolvePrimaryCheckout(dir, git) || dir
141
+ // The project folder in the primary checkout, with where it sits in its
142
+ // repo attached — worktrees are laid out beside the REPO, and each holds
143
+ // the project at the same prefix (feat-subfolder-project).
144
+ const anchor = primaryAnchor(dir, git)
145
+ primary = anchor.dir || dir
146
+ prefix = anchor.prefix
141
147
  env = loadEnvConfig(primary)
148
+ attachProject(env.config, anchor)
142
149
  } catch {
143
150
  return here
144
151
  }
@@ -147,7 +154,7 @@ function makeSpecHelpers({ program = 'spec-sync' } = {}) {
147
154
  // symlinks (macOS /var → /private/var) where `resolveSpec` does not.
148
155
  const real = (p) => {
149
156
  try {
150
- return fs.realpathSync(p)
157
+ return fs.realpathSync.native(p)
151
158
  } catch {
152
159
  return path.resolve(p)
153
160
  }
@@ -156,8 +163,10 @@ function makeSpecHelpers({ program = 'spec-sync' } = {}) {
156
163
  const byName = new Map(here.map((s) => [s.spec, s]))
157
164
  for (const listed of liveWorktreePaths(git)) {
158
165
  const tree = real(listed)
159
- if (tree === self) continue
160
- for (const s of listSpecs(tree, config)) {
166
+ // The project folder inside this worktree — where its specs are.
167
+ const project = real(projectIn(listed, prefix))
168
+ if (project === self) continue
169
+ for (const s of listSpecs(project, config)) {
161
170
  let own = null
162
171
  try {
163
172
  own = real(resolveSpec(s.spec, primary, env.config, { searchDirs: [tree] }).worktreePath)