@teamscala/service-boot 0.23.513 → 0.23.514
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 +1 -1
- package/src/capability-slug.test.ts +14 -15
- package/src/capability-slug.ts +18 -11
package/package.json
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
// @system codegen
|
|
2
|
-
// @status generated
|
|
3
|
-
// @edit change the suite in the owned-suites band, then re-run codegen. Hand-edits are overwritten.
|
|
4
|
-
//
|
|
5
|
-
// This suite's assertions are OWNED by the codegen band: the band module
|
|
6
|
-
// carries them verbatim, this file is the emission, and hand edits here are
|
|
7
|
-
// overwritten on the next run. The rationale each assertion carries moved
|
|
8
|
-
// with it into the band.
|
|
9
|
-
|
|
10
1
|
import { describe, expect, test } from "bun:test";
|
|
11
2
|
import { toCapabilitySlug } from "./capability-slug.ts";
|
|
12
3
|
|
|
13
4
|
describe("toCapabilitySlug", () => {
|
|
14
5
|
test("strips the language+tier suffix from a dev deployable", () => {
|
|
15
|
-
expect(toCapabilitySlug("scala-projects-
|
|
16
|
-
expect(toCapabilitySlug("scala-ai-
|
|
6
|
+
expect(toCapabilitySlug("scala-projects-ts-dev")).toBe("scala-projects");
|
|
7
|
+
expect(toCapabilitySlug("scala-ai-ts-dev")).toBe("scala-ai");
|
|
17
8
|
expect(toCapabilitySlug("scala-image-optimizer-rust-dev")).toBe(
|
|
18
9
|
"scala-image-optimizer",
|
|
19
10
|
);
|
|
20
11
|
});
|
|
21
12
|
|
|
22
13
|
test("strips the language+tier suffix from a prod deployable", () => {
|
|
23
|
-
expect(toCapabilitySlug("scala-projects-
|
|
14
|
+
expect(toCapabilitySlug("scala-projects-ts-prod")).toBe("scala-projects");
|
|
24
15
|
expect(toCapabilitySlug("scala-messaging-service-rust-prod")).toBe(
|
|
25
16
|
"scala-messaging-service",
|
|
26
17
|
);
|
|
27
18
|
});
|
|
28
19
|
|
|
20
|
+
test("strips the retired bun spelling to the same capability", () => {
|
|
21
|
+
// The fleet was renamed under -bun before the operator ruling of
|
|
22
|
+
// 2026-09-08 fixed the language segment at ts; rows or supervised
|
|
23
|
+
// names still carrying it converge rather than fail the join.
|
|
24
|
+
expect(toCapabilitySlug("scala-projects-bun-dev")).toBe("scala-projects");
|
|
25
|
+
expect(toCapabilitySlug("scala-ai-bun-prod")).toBe("scala-ai");
|
|
26
|
+
});
|
|
27
|
+
|
|
29
28
|
test("returns an already-capability slug unchanged", () => {
|
|
30
29
|
// The prod lane is still bare while the tier migration is in flight, so
|
|
31
30
|
// the SAME function must be correct before and after the rename lands.
|
|
@@ -35,11 +34,11 @@ describe("toCapabilitySlug", () => {
|
|
|
35
34
|
|
|
36
35
|
test("both lanes of one application normalize to the same identity", () => {
|
|
37
36
|
// This is the property the page_route join depends on.
|
|
38
|
-
expect(toCapabilitySlug("scala-projects-
|
|
37
|
+
expect(toCapabilitySlug("scala-projects-ts-dev")).toBe(
|
|
39
38
|
toCapabilitySlug("scala-projects"),
|
|
40
39
|
);
|
|
41
|
-
expect(toCapabilitySlug("scala-quiz-
|
|
42
|
-
toCapabilitySlug("scala-quiz-
|
|
40
|
+
expect(toCapabilitySlug("scala-quiz-ts-dev")).toBe(
|
|
41
|
+
toCapabilitySlug("scala-quiz-ts-prod"),
|
|
43
42
|
);
|
|
44
43
|
});
|
|
45
44
|
|
package/src/capability-slug.ts
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* Deployable slug -> capability slug.
|
|
7
7
|
*
|
|
8
8
|
* A DEPLOYABLE is named `<capability>-<language>-<tier>`
|
|
9
|
-
* (`deployables-carry-language-and-tier
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* (`deployables-carry-language-and-tier`, as amended by the operator ruling of
|
|
10
|
+
* 2026-09-08: "so actually the apps are ts, not bun" — the language segment
|
|
11
|
+
* spells the LANGUAGE, so Bun-launched services are `ts`): `scala-projects-ts-dev`
|
|
12
|
+
* and `scala-projects-ts-prod` are two DEPLOYMENTS of one APPLICATION. The
|
|
13
|
+
* ecosystem generator derives that name per lane, so one service arrives here
|
|
14
|
+
* under a DIFFERENT identity in each lane.
|
|
13
15
|
*
|
|
14
16
|
* A `page_route` row describes the APPLICATION url space, which is the same
|
|
15
17
|
* in both lanes, so it carries the CAPABILITY name and there is exactly one
|
|
@@ -26,13 +28,17 @@
|
|
|
26
28
|
* The suffix grammar is a CLOSED SET defined by doctrine and emitted by the
|
|
27
29
|
* generator, so this is a parse of a documented contract rather than a
|
|
28
30
|
* pattern heuristic. A slug that does not end in one is already a capability
|
|
29
|
-
* name and is returned unchanged
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* name and is returned unchanged.
|
|
32
|
+
*
|
|
33
|
+
* `bun` REMAINS IN THE SET AS RETIRED SPELLING TOLERANCE, mirroring the
|
|
34
|
+
* generator side (`ecosystem/deployable_identity.rs capability_of` strips
|
|
35
|
+
* `-ts`, `-bun` and `-rust`): the fleet was renamed under `-bun` and rows or
|
|
36
|
+
* supervised names still carrying it must converge to the same capability
|
|
37
|
+
* rather than fail the join during the migration window.
|
|
32
38
|
*/
|
|
33
39
|
|
|
34
|
-
/** Language segment of a deployable name. */
|
|
35
|
-
const LANGUAGES = ["bun", "rust"] as const;
|
|
40
|
+
/** Language segment of a deployable name. `bun` is the retired spelling. */
|
|
41
|
+
const LANGUAGES = ["ts", "bun", "rust"] as const;
|
|
36
42
|
|
|
37
43
|
/** Tier segment of a deployable name. */
|
|
38
44
|
const TIERS = ["dev", "prod"] as const;
|
|
@@ -43,8 +49,9 @@ type Tier = (typeof TIERS)[number];
|
|
|
43
49
|
/**
|
|
44
50
|
* The capability half of a deployable slug.
|
|
45
51
|
*
|
|
46
|
-
* `scala-projects-
|
|
47
|
-
* `scala-projects-
|
|
52
|
+
* `scala-projects-ts-dev` -> `scala-projects`
|
|
53
|
+
* `scala-projects-ts-prod` -> `scala-projects`
|
|
54
|
+
* `scala-projects-bun-dev` -> `scala-projects` (retired spelling)
|
|
48
55
|
* `scala-projects` -> `scala-projects` (already a capability name)
|
|
49
56
|
*/
|
|
50
57
|
export function toCapabilitySlug(slug: string): string {
|