Skip to content

Commit 7afc41f

Browse files
committed
Update scoped facet test to use @scope/name identity and add ^test/^types Turborepo dependencies
1 parent 644f53b commit 7afc41f

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

packages/cli/src/commands/publish/__tests__/publish.test.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,26 @@ describe('publishCommand — registry interaction (preserved scenarios)', () =>
511511
expect(stdout).toContain('an admin will review your submission shortly')
512512
})
513513

514-
test('namespaced facet: URL-encodes the slash', async () => {
514+
test('scoped facet: URL-encodes the scoped identity', async () => {
515+
// The facet identity grammar (FacetManifestSchema) accepts an unscoped
516+
// slug (`cowsay`) or a scoped `@scope/name` (`@acme/cowsay`); the legacy
517+
// bare-slash form (`acme/cowsay`) is no longer a valid manifest name.
518+
//
519+
// TODO(scoped-routes): the registry has moved to literal-slash scoped
520+
// routes (`/v0/facets/@scope/name/...`), but the engine registry client
521+
// still hits the single-`{name}` route and lets openapi-fetch percent-
522+
// encode the whole identity (`@acme/cowsay` → `%40acme%2Fcowsay`). The
523+
// scoped-route migration (publish/resolve/download) is tracked separately;
524+
// this assertion documents the *current* client behavior and is expected
525+
// to flip to the literal-slash form when that lands.
515526
await buildFacetFixture(projectRoot, {
516-
name: 'acme/cowsay',
527+
name: '@acme/cowsay',
517528
version: '0.1.0',
518529
commands: { cowsay: '# cowsay\n' },
519530
})
520531
const spy = createFetchSpy(
521532
() =>
522-
new Response(JSON.stringify(fixtures.publishResponse({ name: 'acme/cowsay' })), {
533+
new Response(JSON.stringify(fixtures.publishResponse({ name: '@acme/cowsay' })), {
523534
status: 201,
524535
}),
525536
)
@@ -530,7 +541,7 @@ describe('publishCommand — registry interaction (preserved scenarios)', () =>
530541
expect(spy.calls).toHaveLength(1)
531542
const call = spy.calls[0]
532543
if (call === undefined) expect.unreachable()
533-
expect(call.url).toBe('https://api.test/v0/facets/acme%2Fcowsay/versions')
544+
expect(call.url).toBe('https://api.test/v0/facets/%40acme%2Fcowsay/versions')
534545
})
535546

536547
test('413 (tarball too large): renders the registry error verbatim', async () => {

turbo.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"outputs": ["dist/**"]
99
},
1010
"test": {
11-
"dependsOn": [],
11+
"dependsOn": ["^test"],
1212
"inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/bunfig.toml"],
1313
"outputs": ["$TURBO_ROOT$/test-results/**"]
1414
},
@@ -18,7 +18,7 @@
1818
"outputs": ["$TURBO_ROOT$/test-results/**"]
1919
},
2020
"types": {
21-
"dependsOn": []
21+
"dependsOn": ["^types"]
2222
},
2323
"check": {
2424
"dependsOn": [

0 commit comments

Comments
 (0)