From a91bb5b3aaca707cf26184043c39c346db7b8bf5 Mon Sep 17 00:00:00 2001 From: cultron Date: Sun, 19 Jul 2026 10:50:40 -0500 Subject: [PATCH] fix: point typescript scaffold back at the v1 service template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Published @apso/cli clones service-template-ts, whose package.json declares @apso/crud* as file:../ monorepo paths. Those packages are not on npm (E404), so a real user's scaffolded service cannot npm install, build, or deploy — the core new-user flow is broken (launch blocker B4). Revert the typescript target to the v1 service-template (published @nestjsx/crud deps, installs clean), which is also what the generators still emit imports for. The test now imports TEMPLATE_REPOS from src so any future URL drift fails CI. Switch back to service-template-ts only after @apso/crud* are published and the template's deps are converted to npm version refs (documented V2 migration). Merging to main auto-publishes via the onPushToMain workflow. Co-Authored-By: Claude Fable 5 --- src/lib/utils/template.ts | 9 ++++++++- test/commands/server/new.test.ts | 12 +++++------- 2 files changed, 13 insertions(+), 8 deletions(-) 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" ); });