Skip to content
Merged
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
12 changes: 1 addition & 11 deletions src/cli/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const selectStarterOrExample = async (): Promise<string> => {
name: `Prisma Starter (Recommended)`,
value: "starter",
description:
"The Prisma Starter is pre-configured with Prisma ORM, Accelerate, and a Prisma Postgres database.",
"The Prisma Starter is pre-configured with Prisma ORM and a Prisma Postgres database.",
},
{
name: "Explore other examples",
Expand Down Expand Up @@ -50,16 +50,6 @@ const selectORMorPDP = async () => {
value: "orm",
description: "Define Prisma schema and run queries",
},
{
name: `Prisma Accelerate`,
value: "accelerate",
description: "Perform caching and connection pooling",
},
{
name: `Prisma Optimize`,
value: "optimize",
description: "Analyze and improve query performance",
},
],
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/cli/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
rootDir(path: string) {
if (!EXAMPLES_DIR_ACCEPT.includes(path)) {
throw new Error(
"Invalid template. Please choose a template from the `typescript`, `databases`, `accelerate`, or `optimize` directories in the prisma/prisma-examples repository.",
"Invalid template. Please choose a template from the `typescript` or `databases` directories in the prisma/prisma-examples repository.",
);
}
},
Expand Down
8 changes: 1 addition & 7 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,4 @@ export const EXAMPLES_REPO_TAR =
export const EXAMPLES_REPO_INTERCEPTOR =
"https://www.try-prisma-analytics.com/api/interceptor";

export const EXAMPLES_DIR_ACCEPT = [
"typescript",
"databases",
"orm",
"accelerate",
"optimize",
];
export const EXAMPLES_DIR_ACCEPT = ["typescript", "databases", "orm"];
7 changes: 1 addition & 6 deletions src/helpers/getProjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ export default async function getProjects() {
const paths = Object.keys(mergedData).map((item) => {
const folders = item.split("/");
if (folders.length >= 3) {
if (item.includes("optimize")) {
projectsWithSubfolders.push(folders[1]);
return folders.slice(0, 2).join("/");
} else {
projectsWithSubfolders.push(folders[1]);
}
projectsWithSubfolders.push(folders[1]);
}

return folders.length >= 3 ? folders.slice(0, -1).join("/") : item;
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ const main = async () => {
if (!isProjectWithSubdirectory) {
await installPackages(input.pkgMgr, `${input.path}/${input.name}`);
} else {
if (cli.args.template.includes("optimize/starter")) {
await installPackages(input.pkgMgr, `${input.path}/${input.name}`);
}

if (cli.args.template.includes("rest-nextjs-express")) {
await installPackages(
input.pkgMgr,
Expand Down
10 changes: 5 additions & 5 deletions test/helpers/getProjects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ describe("Get Projects", () => {
json: () => ({
tree: [
{
path: "accelerate",
path: "orm",
type: "tree",
},
{
path: "accelerate/package.json",
path: "orm/package.json",
type: "blob",
},
{
path: "orm",
path: "databases",
type: "tree",
},
{
path: "orm/package.json",
path: "databases/package.json",
type: "blob",
},
],
Expand All @@ -118,7 +118,7 @@ describe("Get Projects", () => {
console.log(data[0]);
expect(data[0].length).toBe(2);
expect(data[0]).toContain("orm");
expect(data[0]).toContain("accelerate");
expect(data[0]).toContain("databases");
});

it("Should return valid projects and filter bad projects", async () => {
Expand Down
Loading