diff --git a/src/lib/utils/template.ts b/src/lib/utils/template.ts index 027a320..7305d46 100644 --- a/src/lib/utils/template.ts +++ b/src/lib/utils/template.ts @@ -4,7 +4,14 @@ import shell from "shelljs"; import { TargetLanguage } from "../types"; export const TEMPLATE_REPOS: Record = { - typescript: "https://github.com/apsoai/service-template-ts.git", + // NOTE: typescript intentionally points at the v1 template (@nestjsx/crud). + // service-template-ts depends on @apso/crud* packages that are not yet + // published to npm (file:../ refs), and the generators still emit + // @nestjsx/crud imports. Do not switch back to service-template-ts until: + // 1. @apso/crud* are published to npm + // 2. service-template-ts deps are converted to npm version refs + // 3. generators are ported to the @apso/crud API + typescript: "https://github.com/apsoai/service-template.git", python: "https://github.com/apsoai/service-template-python.git", go: "https://github.com/apsoai/service-template-go.git", }; diff --git a/test/commands/server/new.test.ts b/test/commands/server/new.test.ts index 703ff73..d9d7cf5 100644 --- a/test/commands/server/new.test.ts +++ b/test/commands/server/new.test.ts @@ -1,5 +1,6 @@ import { expect } from "@jest/globals"; import * as path from "path"; +import { TEMPLATE_REPOS } from "../../../src/lib/utils/template"; // Test the PROJECT_NAME_PATTERN regex and validation logic const PROJECT_NAME_PATTERN = /^[A-Za-z][\w-]*$/; @@ -105,15 +106,12 @@ describe("server new command", () => { }); describe("TEMPLATE_REPOS mapping", () => { - const TEMPLATE_REPOS: Record = { - typescript: "https://github.com/apsoai/service-template-ts.git", - python: "https://github.com/apsoai/service-template-python.git", - go: "https://github.com/apsoai/service-template-go.git", - }; - + // Imports the real mapping from src so this test fails if the URLs drift. + // typescript must stay on the v1 template until @apso/crud* are published + // and the generators are ported (see comment in src/lib/utils/template.ts). test("should have correct URL for TypeScript", () => { expect(TEMPLATE_REPOS.typescript).toBe( - "https://github.com/apsoai/service-template-ts.git" + "https://github.com/apsoai/service-template.git" ); });