@dalzoubi/dev-agents-sync 1.0.0 → 1.0.2

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dalzoubi/dev-agents-sync",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "CLI that syncs managed dev-agent prompts into consumer repos (.claude/ and/or .cursor/).",
6
6
  "bin": {
7
- "dev-agents-sync": "./src/cli.mjs"
7
+ "dev-agents-sync": "src/cli.mjs"
8
8
  },
9
9
  "exports": {
10
10
  ".": "./src/index.mjs",
@@ -35,7 +35,7 @@ export async function runCheck(consumerCwd, opts = {}) {
35
35
 
36
36
  let fileMap;
37
37
  try {
38
- fileMap = await fetcher(repo, `v${lock.resolvedVersion}`, token);
38
+ fileMap = await fetcher(repo, lock.resolvedVersion, token);
39
39
  } catch (err) {
40
40
  const wrapped = new Error(
41
41
  `tooling error while fetching v${lock.resolvedVersion}: ${err.message}`,
@@ -50,7 +50,7 @@ export async function runDiff(consumerCwd, opts = {}) {
50
50
 
51
51
  const lock = readLockfile(consumerCwd);
52
52
 
53
- const fileMap = await fetcher(repo, `v${lock.resolvedVersion}`, token);
53
+ const fileMap = await fetcher(repo, lock.resolvedVersion, token);
54
54
  const scoped = filterFileMapByTargets(normalizeFileMap(fileMap), lock.targets);
55
55
 
56
56
  let combined = '';
@@ -101,7 +101,7 @@ export async function runInit(consumerCwd, opts = {}) {
101
101
 
102
102
  const resolvedVersion = resolveRange(availableTags, range);
103
103
 
104
- const fileMap = await fetcher(repo, `v${resolvedVersion}`, token);
104
+ const fileMap = await fetcher(repo, resolvedVersion, token);
105
105
  const normalized = normalizeFileMap(fileMap);
106
106
  const scoped = filterFileMapByTargets(normalized, resolvedTargets);
107
107
 
@@ -49,7 +49,7 @@ export async function runUpdate(consumerCwd, opts = {}) {
49
49
  };
50
50
  }
51
51
 
52
- const fileMap = await fetcher(repo, `v${targetVersion}`, token);
52
+ const fileMap = await fetcher(repo, targetVersion, token);
53
53
  const normalized = normalizeFileMap(fileMap);
54
54
  const scoped = filterFileMapByTargets(normalized, lock.targets);
55
55
 
@@ -210,6 +210,23 @@ describe('init — --targets flag', () => {
210
210
  assert.ok(!existsSync(path.join(consumerDir, '.claude')));
211
211
  });
212
212
 
213
+ it('passes BARE semver (no v prefix) as the tag to the fetcher', async () => {
214
+ // Regression: init/update/diff/check used to do fetcher(repo, `v${version}`),
215
+ // which combined with the fetcher's own `v` prefix to produce `vv1.0.0`
216
+ // and a 404 against real GitHub.
217
+ let capturedTag = null;
218
+ const spyFetcher = async (_repo, tag) => {
219
+ capturedTag = tag;
220
+ return buildFixtureFileMap(['claude', 'cursor']);
221
+ };
222
+ await runInit(consumerDir, {
223
+ targets: ['claude'],
224
+ fetcher: spyFetcher,
225
+ availableTags: AVAILABLE_TAGS,
226
+ });
227
+ assert.equal(capturedTag, '1.2.0', 'fetcher must receive bare semver, not v-prefixed');
228
+ });
229
+
213
230
  it('--targets cursor records targets: ["cursor"] in lockfile', async () => {
214
231
  await runInit(consumerDir, {
215
232
  targets: ['cursor'],