Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/lib/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import shell from "shelljs";
import { TargetLanguage } from "../types";

export const TEMPLATE_REPOS: Record<TargetLanguage, string> = {
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",
};
Expand Down
12 changes: 5 additions & 7 deletions test/commands/server/new.test.ts
Original file line number Diff line number Diff line change
@@ -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-]*$/;
Expand Down Expand Up @@ -105,15 +106,12 @@ describe("server new command", () => {
});

describe("TEMPLATE_REPOS mapping", () => {
const TEMPLATE_REPOS: Record<string, string> = {
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"
);
});

Expand Down
Loading