@fedify/init 2.2.0-dev.635 → 2.2.0-dev.638
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action/configs.js +1 -1
- package/dist/action/deps.js +3 -2
- package/dist/action/mod.js +1 -3
- package/dist/action/notice.js +1 -1
- package/dist/action/utils.js +22 -1
- package/dist/ask/dir.js +3 -2
- package/dist/command.d.ts +3 -3
- package/dist/const.js +2 -1
- package/dist/deno.js +1 -1
- package/dist/json/deps.js +31 -0
- package/dist/json/deps.json +31 -0
- package/dist/json/kv.js +3 -3
- package/dist/json/kv.json +63 -17
- package/dist/json/mq.js +5 -5
- package/dist/json/mq.json +5 -5
- package/dist/lib.js +5 -8
- package/dist/templates/solidstart/app.config.ts.tpl +8 -0
- package/dist/templates/solidstart/src/app.tsx.tpl +11 -0
- package/dist/templates/solidstart/src/entry-client.tsx.tpl +4 -0
- package/dist/templates/solidstart/src/entry-server.tsx.tpl +20 -0
- package/dist/templates/solidstart/src/middleware/index.ts.tpl +4 -0
- package/dist/templates/solidstart/src/routes/index.tsx.tpl +10 -0
- package/dist/test/create.js +11 -25
- package/dist/test/lookup.js +60 -134
- package/dist/test/mod.js +2 -1
- package/dist/test/port.js +128 -0
- package/dist/test/run.js +1 -1
- package/dist/test/server.js +137 -0
- package/dist/utils.d.ts +1 -3
- package/dist/utils.js +2 -78
- package/dist/webframeworks/astro.js +6 -4
- package/dist/webframeworks/bare-bones.js +9 -8
- package/dist/webframeworks/const.js +3 -1
- package/dist/webframeworks/elysia.js +11 -10
- package/dist/webframeworks/express.js +6 -5
- package/dist/webframeworks/hono.js +12 -11
- package/dist/webframeworks/mod.js +3 -1
- package/dist/webframeworks/next.js +2 -1
- package/dist/webframeworks/solidstart.js +70 -0
- package/package.json +2 -1
- package/dist/action/install.js +0 -18
- package/dist/action/precommand.js +0 -22
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
+
import { _hongminhee_x_forwarded_fetch, _std_dotenv, npm__dotenvx_dotenvx, npm__hono_node_server, npm__types_bun, npm__types_node_25, npm_tsx, npm_x_forwarded_fetch } from "../json/deps.js";
|
|
3
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
4
5
|
import { getInstruction, packageManagerToRuntime } from "./utils.js";
|
|
5
6
|
//#region src/webframeworks/bare-bones.ts
|
|
@@ -10,17 +11,17 @@ const bareBonesDescription = {
|
|
|
10
11
|
init: async ({ packageManager: pm }) => ({
|
|
11
12
|
dependencies: pm === "deno" ? {
|
|
12
13
|
...defaultDenoDependencies,
|
|
13
|
-
"@std/dotenv":
|
|
14
|
-
"@hongminhee/x-forwarded-fetch":
|
|
15
|
-
} : pm === "bun" ? { "npm:x-forwarded-fetch":
|
|
16
|
-
"npm:@dotenvx/dotenvx":
|
|
17
|
-
"npm:@hono/node-server":
|
|
18
|
-
"npm:tsx":
|
|
19
|
-
"npm:x-forwarded-fetch":
|
|
14
|
+
"@std/dotenv": _std_dotenv,
|
|
15
|
+
"@hongminhee/x-forwarded-fetch": _hongminhee_x_forwarded_fetch
|
|
16
|
+
} : pm === "bun" ? { "npm:x-forwarded-fetch": npm_x_forwarded_fetch } : {
|
|
17
|
+
"npm:@dotenvx/dotenvx": npm__dotenvx_dotenvx,
|
|
18
|
+
"npm:@hono/node-server": npm__hono_node_server,
|
|
19
|
+
"npm:tsx": npm_tsx,
|
|
20
|
+
"npm:x-forwarded-fetch": npm_x_forwarded_fetch
|
|
20
21
|
},
|
|
21
22
|
devDependencies: {
|
|
22
23
|
...defaultDevDependencies,
|
|
23
|
-
...pm === "bun" ? { "@types/bun":
|
|
24
|
+
...pm === "bun" ? { "@types/bun": npm__types_bun } : { "@types/node": npm__types_node_25 }
|
|
24
25
|
},
|
|
25
26
|
federationFile: "src/federation.ts",
|
|
26
27
|
loggingFile: "src/logging.ts",
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { PACKAGE_VERSION } from "../lib.js";
|
|
2
|
+
import { npm__biomejs_biome, npm_eslint } from "../json/deps.js";
|
|
2
3
|
//#region src/webframeworks/const.ts
|
|
3
4
|
const defaultDevDependencies = {
|
|
4
5
|
"@fedify/lint": PACKAGE_VERSION,
|
|
5
|
-
"eslint":
|
|
6
|
+
"eslint": npm_eslint,
|
|
7
|
+
"@biomejs/biome": npm__biomejs_biome
|
|
6
8
|
};
|
|
7
9
|
const defaultDenoDependencies = { "@fedify/lint": PACKAGE_VERSION };
|
|
8
10
|
//#endregion
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
+
import { npm__elysiajs_node, npm__sinclair_typebox, npm__types_bun, npm__types_node_25, npm_elysia, npm_openapi_types, npm_tsx, npm_typescript } from "../json/deps.js";
|
|
3
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
4
5
|
import { getInstruction, packageManagerToRuntime } from "./utils.js";
|
|
5
6
|
//#region src/webframeworks/elysia.ts
|
|
@@ -10,25 +11,25 @@ const elysiaDescription = {
|
|
|
10
11
|
init: async ({ projectName, packageManager: pm }) => ({
|
|
11
12
|
dependencies: pm === "deno" ? {
|
|
12
13
|
...defaultDenoDependencies,
|
|
13
|
-
elysia:
|
|
14
|
+
elysia: `npm:elysia@${npm_elysia}`,
|
|
14
15
|
"@fedify/elysia": PACKAGE_VERSION
|
|
15
16
|
} : pm === "bun" ? {
|
|
16
|
-
elysia:
|
|
17
|
+
elysia: npm_elysia,
|
|
17
18
|
"@fedify/elysia": PACKAGE_VERSION
|
|
18
19
|
} : {
|
|
19
|
-
elysia:
|
|
20
|
-
"@elysiajs/node":
|
|
20
|
+
elysia: npm_elysia,
|
|
21
|
+
"@elysiajs/node": npm__elysiajs_node,
|
|
21
22
|
"@fedify/elysia": PACKAGE_VERSION,
|
|
22
23
|
...pm === "pnpm" ? {
|
|
23
|
-
"@sinclair/typebox":
|
|
24
|
-
"openapi-types":
|
|
24
|
+
"@sinclair/typebox": npm__sinclair_typebox,
|
|
25
|
+
"openapi-types": npm_openapi_types
|
|
25
26
|
} : {}
|
|
26
27
|
},
|
|
27
28
|
devDependencies: {
|
|
28
|
-
...pm === "bun" ? { "@types/bun":
|
|
29
|
-
tsx:
|
|
30
|
-
"@types/node":
|
|
31
|
-
typescript:
|
|
29
|
+
...pm === "bun" ? { "@types/bun": npm__types_bun } : {
|
|
30
|
+
tsx: npm_tsx,
|
|
31
|
+
"@types/node": npm__types_node_25,
|
|
32
|
+
typescript: npm_typescript
|
|
32
33
|
},
|
|
33
34
|
...defaultDevDependencies
|
|
34
35
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
+
import { npm__dotenvx_dotenvx, npm__types_bun, npm__types_express, npm_express, npm_tsx } from "../json/deps.js";
|
|
3
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
4
5
|
import { getInstruction } from "./utils.js";
|
|
5
6
|
//#region src/webframeworks/express.ts
|
|
@@ -9,17 +10,17 @@ const expressDescription = {
|
|
|
9
10
|
defaultPort: 8e3,
|
|
10
11
|
init: async ({ projectName, packageManager: pm }) => ({
|
|
11
12
|
dependencies: {
|
|
12
|
-
"npm:express":
|
|
13
|
+
"npm:express": npm_express,
|
|
13
14
|
"@fedify/express": PACKAGE_VERSION,
|
|
14
15
|
...pm !== "deno" && pm !== "bun" ? {
|
|
15
|
-
"@dotenvx/dotenvx":
|
|
16
|
-
tsx:
|
|
16
|
+
"@dotenvx/dotenvx": npm__dotenvx_dotenvx,
|
|
17
|
+
tsx: npm_tsx
|
|
17
18
|
} : {},
|
|
18
19
|
...pm === "deno" ? defaultDenoDependencies : {}
|
|
19
20
|
},
|
|
20
21
|
devDependencies: {
|
|
21
|
-
"@types/express":
|
|
22
|
-
...pm === "bun" ? { "@types/bun":
|
|
22
|
+
"@types/express": npm__types_express,
|
|
23
|
+
...pm === "bun" ? { "@types/bun": npm__types_bun } : {},
|
|
23
24
|
...defaultDevDependencies
|
|
24
25
|
},
|
|
25
26
|
federationFile: "src/federation.ts",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { replace } from "../utils.js";
|
|
2
2
|
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
3
3
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
4
|
+
import { _hongminhee_x_forwarded_fetch, _hono_hono, _std_dotenv, npm__dotenvx_dotenvx, npm__hono_node_server, npm__types_bun, npm_hono, npm_tsx, npm_x_forwarded_fetch } from "../json/deps.js";
|
|
4
5
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
6
|
import { getInstruction, packageManagerToRuntime } from "./utils.js";
|
|
6
7
|
import { pipe } from "@fxts/core";
|
|
@@ -12,25 +13,25 @@ const honoDescription = {
|
|
|
12
13
|
init: async ({ projectName, packageManager: pm }) => ({
|
|
13
14
|
dependencies: pm === "deno" ? {
|
|
14
15
|
...defaultDenoDependencies,
|
|
15
|
-
"@std/dotenv":
|
|
16
|
-
"@hono/hono":
|
|
17
|
-
"@hongminhee/x-forwarded-fetch":
|
|
16
|
+
"@std/dotenv": _std_dotenv,
|
|
17
|
+
"@hono/hono": _hono_hono,
|
|
18
|
+
"@hongminhee/x-forwarded-fetch": _hongminhee_x_forwarded_fetch,
|
|
18
19
|
"@fedify/hono": PACKAGE_VERSION
|
|
19
20
|
} : pm === "bun" ? {
|
|
20
|
-
hono:
|
|
21
|
-
"x-forwarded-fetch":
|
|
21
|
+
hono: npm_hono,
|
|
22
|
+
"x-forwarded-fetch": npm_x_forwarded_fetch,
|
|
22
23
|
"@fedify/hono": PACKAGE_VERSION
|
|
23
24
|
} : {
|
|
24
|
-
"@dotenvx/dotenvx":
|
|
25
|
-
hono:
|
|
26
|
-
"@hono/node-server":
|
|
27
|
-
tsx:
|
|
28
|
-
"x-forwarded-fetch":
|
|
25
|
+
"@dotenvx/dotenvx": npm__dotenvx_dotenvx,
|
|
26
|
+
hono: npm_hono,
|
|
27
|
+
"@hono/node-server": npm__hono_node_server,
|
|
28
|
+
tsx: npm_tsx,
|
|
29
|
+
"x-forwarded-fetch": npm_x_forwarded_fetch,
|
|
29
30
|
"@fedify/hono": PACKAGE_VERSION
|
|
30
31
|
},
|
|
31
32
|
devDependencies: {
|
|
32
33
|
...defaultDevDependencies,
|
|
33
|
-
...pm === "bun" ? { "@types/bun":
|
|
34
|
+
...pm === "bun" ? { "@types/bun": npm__types_bun } : {}
|
|
34
35
|
},
|
|
35
36
|
federationFile: "src/federation.ts",
|
|
36
37
|
loggingFile: "src/logging.ts",
|
|
@@ -5,6 +5,7 @@ import expressDescription from "./express.js";
|
|
|
5
5
|
import honoDescription from "./hono.js";
|
|
6
6
|
import nextDescription from "./next.js";
|
|
7
7
|
import nitroDescription from "./nitro.js";
|
|
8
|
+
import solidstartDescription from "./solidstart.js";
|
|
8
9
|
//#region src/webframeworks/mod.ts
|
|
9
10
|
/**
|
|
10
11
|
* Registry of all supported web framework configurations.
|
|
@@ -20,7 +21,8 @@ const webFrameworks = {
|
|
|
20
21
|
express: expressDescription,
|
|
21
22
|
hono: honoDescription,
|
|
22
23
|
next: nextDescription,
|
|
23
|
-
nitro: nitroDescription
|
|
24
|
+
nitro: nitroDescription,
|
|
25
|
+
solidstart: solidstartDescription
|
|
24
26
|
};
|
|
25
27
|
//#endregion
|
|
26
28
|
export { webFrameworks as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
+
import { npm__types_node_20 } from "../json/deps.js";
|
|
3
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
4
5
|
import { getInstruction } from "./utils.js";
|
|
5
6
|
//#region src/webframeworks/next.ts
|
|
@@ -14,7 +15,7 @@ const nextDescription = {
|
|
|
14
15
|
...pm === "deno" ? defaultDenoDependencies : {}
|
|
15
16
|
},
|
|
16
17
|
devDependencies: {
|
|
17
|
-
"@types/node":
|
|
18
|
+
"@types/node": npm__types_node_20,
|
|
18
19
|
...defaultDevDependencies
|
|
19
20
|
},
|
|
20
21
|
federationFile: "federation/index.ts",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
|
+
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
+
import { npm__solidjs_router, npm__solidjs_start, npm__types_node_22, npm_solid_js, npm_typescript, npm_vinxi } from "../json/deps.js";
|
|
4
|
+
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
|
+
import { getInstruction } from "./utils.js";
|
|
6
|
+
//#region src/webframeworks/solidstart.ts
|
|
7
|
+
const NPM_SOLIDSTART = `npm:@solidjs/start@${npm__solidjs_start}`;
|
|
8
|
+
const solidstartDescription = {
|
|
9
|
+
label: "SolidStart",
|
|
10
|
+
packageManagers: PACKAGE_MANAGER,
|
|
11
|
+
defaultPort: 3e3,
|
|
12
|
+
init: async ({ packageManager: pm }) => ({
|
|
13
|
+
dependencies: pm === "deno" ? {
|
|
14
|
+
...defaultDenoDependencies,
|
|
15
|
+
"@solidjs/router": `npm:@solidjs/router@${npm__solidjs_router}`,
|
|
16
|
+
"@solidjs/start": `${NPM_SOLIDSTART}`,
|
|
17
|
+
"@solidjs/start/client": `${NPM_SOLIDSTART}/client`,
|
|
18
|
+
"@solidjs/start/config": `${NPM_SOLIDSTART}/config`,
|
|
19
|
+
"@solidjs/start/middleware": `${NPM_SOLIDSTART}/middleware`,
|
|
20
|
+
"@solidjs/start/router": `${NPM_SOLIDSTART}/router`,
|
|
21
|
+
"@solidjs/start/server": `${NPM_SOLIDSTART}/server`,
|
|
22
|
+
"solid-js": `npm:solid-js@${npm_solid_js}`,
|
|
23
|
+
vinxi: `npm:vinxi@${npm_vinxi}`,
|
|
24
|
+
"@fedify/solidstart": PACKAGE_VERSION
|
|
25
|
+
} : {
|
|
26
|
+
"@solidjs/router": npm__solidjs_router,
|
|
27
|
+
"@solidjs/start": npm__solidjs_start,
|
|
28
|
+
"solid-js": npm_solid_js,
|
|
29
|
+
vinxi: npm_vinxi,
|
|
30
|
+
"@fedify/solidstart": PACKAGE_VERSION
|
|
31
|
+
},
|
|
32
|
+
devDependencies: {
|
|
33
|
+
...defaultDevDependencies,
|
|
34
|
+
typescript: npm_typescript,
|
|
35
|
+
"@types/node": npm__types_node_22
|
|
36
|
+
},
|
|
37
|
+
federationFile: "src/federation.ts",
|
|
38
|
+
loggingFile: "src/logging.ts",
|
|
39
|
+
files: {
|
|
40
|
+
"app.config.ts": (await readTemplate("solidstart/app.config.ts")).replace(/\/\* preset \*\//, pm === "deno" ? "deno-server" : "node-server"),
|
|
41
|
+
"src/app.tsx": await readTemplate("solidstart/src/app.tsx"),
|
|
42
|
+
"src/entry-client.tsx": await readTemplate("solidstart/src/entry-client.tsx"),
|
|
43
|
+
"src/entry-server.tsx": await readTemplate("solidstart/src/entry-server.tsx"),
|
|
44
|
+
"src/routes/index.tsx": await readTemplate("solidstart/src/routes/index.tsx"),
|
|
45
|
+
"src/middleware/index.ts": await readTemplate("solidstart/src/middleware/index.ts"),
|
|
46
|
+
...pm !== "deno" ? { "eslint.config.ts": await readTemplate("defaults/eslint.config.ts") } : {}
|
|
47
|
+
},
|
|
48
|
+
compilerOptions: pm === "deno" ? void 0 : {
|
|
49
|
+
target: "ESNext",
|
|
50
|
+
module: "ESNext",
|
|
51
|
+
moduleResolution: "Bundler",
|
|
52
|
+
allowSyntheticDefaultImports: true,
|
|
53
|
+
esModuleInterop: true,
|
|
54
|
+
jsx: "preserve",
|
|
55
|
+
jsxImportSource: "solid-js",
|
|
56
|
+
strict: true,
|
|
57
|
+
noEmit: true,
|
|
58
|
+
skipLibCheck: true
|
|
59
|
+
},
|
|
60
|
+
tasks: {
|
|
61
|
+
dev: pm === "deno" ? "deno run -A npm:vinxi dev" : pm === "bun" ? "bunx vinxi dev" : "vinxi dev",
|
|
62
|
+
build: pm === "deno" ? "deno run -A npm:vinxi build" : pm === "bun" ? "bunx vinxi build" : "vinxi build",
|
|
63
|
+
start: pm === "deno" ? "deno run -A npm:vinxi start" : pm === "bun" ? "bunx vinxi start" : "vinxi start",
|
|
64
|
+
...pm !== "deno" ? { lint: "eslint ." } : {}
|
|
65
|
+
},
|
|
66
|
+
instruction: getInstruction(pm, 3e3)
|
|
67
|
+
})
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { solidstartDescription as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/init",
|
|
3
|
-
"version": "2.2.0-dev.
|
|
3
|
+
"version": "2.2.0-dev.638+bd60323a",
|
|
4
4
|
"description": "Project initializer for Fedify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fedify",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"README.md"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@david/dax": "npm:dax@^0.45.0",
|
|
51
52
|
"@fxts/core": "^1.20.0",
|
|
52
53
|
"@inquirer/prompts": "^7.8.4",
|
|
53
54
|
"@logtape/logtape": "^2.0.5",
|
package/dist/action/install.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CommandError, runSubCommand } from "../utils.js";
|
|
2
|
-
import { apply, pipe } from "@fxts/core";
|
|
3
|
-
//#region src/action/install.ts
|
|
4
|
-
/**
|
|
5
|
-
* Runs `<packageManager> install` in the project directory to install all
|
|
6
|
-
* dependencies. Logs an error message if the installation fails.
|
|
7
|
-
*/
|
|
8
|
-
const installDependencies = (data) => pipe(data, ({ packageManager, dir }) => [[packageManager, "install"], { cwd: dir }], apply(runSubCommand)).catch((e) => {
|
|
9
|
-
if (e instanceof CommandError) {
|
|
10
|
-
console.error(`Failed to install dependencies using ${data.packageManager}.`);
|
|
11
|
-
console.error("Command:", e.commandLine);
|
|
12
|
-
if (e.stderr) console.error("Error:", e.stderr);
|
|
13
|
-
throw e;
|
|
14
|
-
}
|
|
15
|
-
throw e;
|
|
16
|
-
});
|
|
17
|
-
//#endregion
|
|
18
|
-
export { installDependencies as default };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CommandError, exit, runSubCommand } from "../utils.js";
|
|
2
|
-
//#region src/action/precommand.ts
|
|
3
|
-
/**
|
|
4
|
-
* Runs the precommand specified in the initializer to set up the project.
|
|
5
|
-
*
|
|
6
|
-
* @param data - The initialization command data containing the initializer command and directory
|
|
7
|
-
* @returns A promise that resolves when the precommand has been executed
|
|
8
|
-
*/
|
|
9
|
-
const runPrecommand = ({ initializer: { command }, dir }) => runSubCommand(command, {
|
|
10
|
-
cwd: dir,
|
|
11
|
-
stdio: "inherit"
|
|
12
|
-
}).catch((e) => {
|
|
13
|
-
if (e instanceof CommandError) {
|
|
14
|
-
console.error("Failed to run the precommand.");
|
|
15
|
-
console.error("Command:", e.commandLine);
|
|
16
|
-
if (e.stderr) console.error("Error:", e.stderr);
|
|
17
|
-
if (e.stdout) console.error("Output:", e.stdout);
|
|
18
|
-
} else console.error("Failed to run the precommand:", e);
|
|
19
|
-
exit(1);
|
|
20
|
-
});
|
|
21
|
-
//#endregion
|
|
22
|
-
export { runPrecommand as default };
|