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
2 changes: 1 addition & 1 deletion docs/tutorial/astro-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Select *Astro*, *bun*, *in-process*, and *in-memory* in order:
Hono
Nitro
Next.js
ElysiaJS
Elysia
❯ Astro
Express

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/microblog.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Select *Hono*, *npm*, *in-process*, and *in-memory* in order:
❯ Hono
Nitro
Next.js
ElysiaJS
Elysia
Astro
Express
Nuxt
Expand Down
2 changes: 1 addition & 1 deletion packages/init/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export interface WebFrameworkInitializer {

/**
* Describes a web framework integration (Hono, Express, Nitro, Next.js,
* ElysiaJS, Astro) and how to initialize a project with it.
* Elysia, Astro) and how to initialize a project with it.
*/
export interface WebFrameworkDescription {
/** Human-readable name of the framework (e.g., `"Hono"`, `"Next.js"`). */
Expand Down
28 changes: 27 additions & 1 deletion packages/init/src/webframeworks.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { equal, ok } from "node:assert/strict";
import { readFile } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
import astroDescription from "./webframeworks/astro.ts";
import webFrameworks from "./webframeworks/mod.ts";
import nextDescription from "./webframeworks/next.ts";
import nitroDescription from "./webframeworks/nitro.ts";
import webFrameworks from "./webframeworks/mod.ts";
import solidstartDescription from "./webframeworks/solidstart.ts";

test("Nitro template loads LogTape during server startup", async () => {
Expand Down Expand Up @@ -162,3 +165,26 @@ test("Astro Node.js and Bun templates use Prettier for Astro files", async () =>
equal(initializer.format?.tool, "prettier");
}
});

test("README.md's web framework list matches the framework registry", async () => {
const modList = Object.values(webFrameworks).map((f) => f.label);
const readmeFile = resolve(
dirname(fileURLToPath(import.meta.url)),
"..",
"README.md",
);
const readme = await readFile(readmeFile, "utf-8");
const readmeWebframeworks = readme.match(
/\*\*Web frameworks\*\*:\s*([\s\S]+?)(?=\n\s*-\s*\*\*)/,
);
ok(readmeWebframeworks);
const readmeList = readmeWebframeworks[1]
.split(/,\s*/)
.map((s) => s.trim().replace(/^\[|\]$/g, ""));
equal(modList.length, readmeList.length);
modList.sort();
readmeList.sort();
for (let i = 0; i < modList.length; i++) {
equal(modList[i], readmeList[i]);
}
});
2 changes: 1 addition & 1 deletion packages/init/src/webframeworks/elysia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { defaultDenoDependencies, defaultDevDependencies } from "./const.ts";
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.ts";

const elysiaDescription: WebFrameworkDescription = {
label: "ElysiaJS",
label: "Elysia",
packageManagers: PACKAGE_MANAGER,
defaultPort: 3000,
init: async ({ projectName, packageManager: pm }) => ({
Expand Down