@fedify/init 2.4.0-dev.1740 → 2.4.0-dev.1765
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/README.md +2 -1
- package/dist/command.d.ts +3 -3
- package/dist/const.js +2 -1
- package/dist/deno.js +1 -1
- package/dist/json/deps.js +12 -12
- package/dist/json/deps.json +15 -15
- package/dist/json/kv.js +1 -1
- package/dist/json/kv.json +1 -1
- package/dist/json/mq.js +1 -1
- package/dist/json/mq.json +1 -1
- package/dist/templates/sveltekit/hooks.server.ts.tpl +7 -0
- package/dist/test/lookup.js +2 -1
- package/dist/test/port.js +2 -2
- package/dist/webframeworks/mod.js +3 -1
- package/dist/webframeworks/sveltekit.js +77 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Supported options
|
|
|
26
26
|
The initializer supports the following project configurations:
|
|
27
27
|
|
|
28
28
|
- **Web frameworks**: Bare-bones, [Astro], [Elysia], [Express], [Hono],
|
|
29
|
-
[Next.js], [Nitro], [Nuxt], [SolidStart]
|
|
29
|
+
[Next.js], [Nitro], [Nuxt], [SolidStart], [SvelteKit]
|
|
30
30
|
- **Package managers**: Deno, pnpm, Bun, Yarn, npm
|
|
31
31
|
- **Key-value stores**: In-Memory, Deno KV, Redis, PostgreSQL
|
|
32
32
|
- **Message queues**: In-Process, Deno KV, Redis, PostgreSQL, AMQP
|
|
@@ -39,6 +39,7 @@ The initializer supports the following project configurations:
|
|
|
39
39
|
[Nitro]: https://nitro.build/
|
|
40
40
|
[Nuxt]: https://nuxt.com/
|
|
41
41
|
[SolidStart]: https://start.solidjs.com/
|
|
42
|
+
[SvelteKit]: https://svelte.dev/
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
Installation
|
package/dist/command.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { InferValue } from "@optique/core";
|
|
|
9
9
|
*/
|
|
10
10
|
declare const initOptions: _$_optique_core0.Parser<"sync", {
|
|
11
11
|
readonly dir: string | undefined;
|
|
12
|
-
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "nuxt" | "solidstart" | undefined;
|
|
12
|
+
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "nuxt" | "solidstart" | "sveltekit" | undefined;
|
|
13
13
|
readonly packageManager: "deno" | "pnpm" | "bun" | "yarn" | "npm" | undefined;
|
|
14
14
|
readonly kvStore: "postgres" | "mysql" | "in-memory" | "redis" | "denokv" | undefined;
|
|
15
15
|
readonly messageQueue: "postgres" | "mysql" | "redis" | "denokv" | "in-process" | "amqp" | undefined;
|
|
@@ -18,7 +18,7 @@ declare const initOptions: _$_optique_core0.Parser<"sync", {
|
|
|
18
18
|
readonly skipInstall: boolean;
|
|
19
19
|
}, {
|
|
20
20
|
readonly dir: [_$_optique_core0.ValueParserResult<string> | undefined] | undefined;
|
|
21
|
-
readonly webFramework: [_$_optique_core0.ValueParserResult<"bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "nuxt" | "solidstart"> | undefined] | undefined;
|
|
21
|
+
readonly webFramework: [_$_optique_core0.ValueParserResult<"bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "nuxt" | "solidstart" | "sveltekit"> | undefined] | undefined;
|
|
22
22
|
readonly packageManager: [_$_optique_core0.ValueParserResult<"deno" | "pnpm" | "bun" | "yarn" | "npm"> | undefined] | undefined;
|
|
23
23
|
readonly kvStore: [_$_optique_core0.ValueParserResult<"postgres" | "mysql" | "in-memory" | "redis" | "denokv"> | undefined] | undefined;
|
|
24
24
|
readonly messageQueue: [_$_optique_core0.ValueParserResult<"postgres" | "mysql" | "redis" | "denokv" | "in-process" | "amqp"> | undefined] | undefined;
|
|
@@ -31,7 +31,7 @@ declare const initOptions: _$_optique_core0.Parser<"sync", {
|
|
|
31
31
|
*/
|
|
32
32
|
declare const initCommand: _$_optique_core0.Parser<"sync", {
|
|
33
33
|
readonly dir: string | undefined;
|
|
34
|
-
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "nuxt" | "solidstart" | undefined;
|
|
34
|
+
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "nuxt" | "solidstart" | "sveltekit" | undefined;
|
|
35
35
|
readonly packageManager: "deno" | "pnpm" | "bun" | "yarn" | "npm" | undefined;
|
|
36
36
|
readonly kvStore: "postgres" | "mysql" | "in-memory" | "redis" | "denokv" | undefined;
|
|
37
37
|
readonly messageQueue: "postgres" | "mysql" | "redis" | "denokv" | "in-process" | "amqp" | undefined;
|
package/dist/const.js
CHANGED
package/dist/deno.js
CHANGED
package/dist/json/deps.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
//#region src/json/deps.json
|
|
2
2
|
var _hongminhee_x_forwarded_fetch = "^0.2.0";
|
|
3
|
-
var _hono_hono = "^4.12.
|
|
4
|
-
var _logtape_logtape = "^2.
|
|
3
|
+
var _hono_hono = "^4.12.33";
|
|
4
|
+
var _logtape_logtape = "^2.3.0";
|
|
5
5
|
var _std_dotenv = "^0.225.7";
|
|
6
|
-
var npm__astrojs_node = "^11.0.
|
|
6
|
+
var npm__astrojs_node = "^11.0.3";
|
|
7
7
|
var npm__deno_astro_adapter = "^0.6.0";
|
|
8
8
|
var npm__dotenvx_dotenvx = "^1.75.1";
|
|
9
9
|
var npm__elysiajs_node = "^1.4.5";
|
|
10
10
|
var npm__hono_node_server = "^1.19.12";
|
|
11
|
-
var npm__sinclair_typebox = "^0.34.
|
|
11
|
+
var npm__sinclair_typebox = "^0.34.52";
|
|
12
12
|
var npm__solidjs_router = "^0.16.1";
|
|
13
13
|
var npm__solidjs_start = "^1.3.2";
|
|
14
14
|
var npm__types_bun = "^1.3.14";
|
|
@@ -16,18 +16,18 @@ var npm__types_express = "^4.17.21";
|
|
|
16
16
|
var npm__types_node_20 = "^20.11.2";
|
|
17
17
|
var npm__types_node_22 = "^22.17.0";
|
|
18
18
|
var npm__types_node_25 = "^25.5.0";
|
|
19
|
-
var npm_astro = "^7.
|
|
20
|
-
var npm_create_astro = "^5.2.
|
|
19
|
+
var npm_astro = "^7.1.6";
|
|
20
|
+
var npm_create_astro = "^5.2.3";
|
|
21
21
|
var npm_elysia = "^1.4.29";
|
|
22
22
|
var npm_express = "^5.2.1";
|
|
23
|
-
var npm_hono = "^4.12.
|
|
23
|
+
var npm_hono = "^4.12.33";
|
|
24
24
|
var npm_openapi_types = "^12.1.3";
|
|
25
|
-
var npm_oxfmt = "^0.
|
|
26
|
-
var npm_oxlint = "^1.
|
|
27
|
-
var npm_prettier = "^3.
|
|
25
|
+
var npm_oxfmt = "^0.61.0";
|
|
26
|
+
var npm_oxlint = "^1.76.0";
|
|
27
|
+
var npm_prettier = "^3.9.6";
|
|
28
28
|
var npm_prettier_plugin_astro = "^0.14.1";
|
|
29
|
-
var npm_solid_js = "^1.9.
|
|
30
|
-
var npm_tsx = "^4.
|
|
29
|
+
var npm_solid_js = "^1.9.14";
|
|
30
|
+
var npm_tsx = "^4.23.1";
|
|
31
31
|
var npm_typescript = "^5.9.3";
|
|
32
32
|
var npm_vinxi = "^0.5.11";
|
|
33
33
|
var npm_x_forwarded_fetch = "^0.2.0";
|
package/dist/json/deps.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@hongminhee/x-forwarded-fetch": "^0.2.0",
|
|
3
|
-
"@hono/hono": "^4.12.
|
|
4
|
-
"@logtape/logtape": "^2.
|
|
3
|
+
"@hono/hono": "^4.12.33",
|
|
4
|
+
"@logtape/logtape": "^2.3.0",
|
|
5
5
|
"@std/dotenv": "^0.225.7",
|
|
6
|
-
"npm:@astrojs/node": "^11.0.
|
|
6
|
+
"npm:@astrojs/node": "^11.0.3",
|
|
7
7
|
"npm:@deno/astro-adapter": "^0.6.0",
|
|
8
8
|
"npm:@dotenvx/dotenvx": "^1.75.1",
|
|
9
9
|
"npm:@elysiajs/node": "^1.4.5",
|
|
10
10
|
"npm:@hono/node-server": "^1.19.12",
|
|
11
|
-
"npm:@nuxt/kit": "^4.
|
|
12
|
-
"npm:@sinclair/typebox": "^0.34.
|
|
11
|
+
"npm:@nuxt/kit": "^4.5.1",
|
|
12
|
+
"npm:@sinclair/typebox": "^0.34.52",
|
|
13
13
|
"npm:@solidjs/router": "^0.16.1",
|
|
14
14
|
"npm:@solidjs/start": "^1.3.2",
|
|
15
15
|
"npm:@types/bun": "^1.3.14",
|
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
"npm:@types/node@20": "^20.11.2",
|
|
18
18
|
"npm:@types/node@22": "^22.17.0",
|
|
19
19
|
"npm:@types/node@25": "^25.5.0",
|
|
20
|
-
"npm:astro": "^7.
|
|
21
|
-
"npm:create-astro": "^5.2.
|
|
20
|
+
"npm:astro": "^7.1.6",
|
|
21
|
+
"npm:create-astro": "^5.2.3",
|
|
22
22
|
"npm:elysia": "^1.4.29",
|
|
23
23
|
"npm:express": "^5.2.1",
|
|
24
24
|
"npm:h3": "^1.15.0",
|
|
25
|
-
"npm:hono": "^4.12.
|
|
26
|
-
"npm:nuxi": "^3.
|
|
27
|
-
"npm:nuxt": "^4.
|
|
25
|
+
"npm:hono": "^4.12.33",
|
|
26
|
+
"npm:nuxi": "^3.37.0",
|
|
27
|
+
"npm:nuxt": "^4.5.1",
|
|
28
28
|
"npm:openapi-types": "^12.1.3",
|
|
29
|
-
"npm:oxfmt": "^0.
|
|
30
|
-
"npm:oxlint": "^1.
|
|
31
|
-
"npm:prettier": "^3.
|
|
29
|
+
"npm:oxfmt": "^0.61.0",
|
|
30
|
+
"npm:oxlint": "^1.76.0",
|
|
31
|
+
"npm:prettier": "^3.9.6",
|
|
32
32
|
"npm:prettier-plugin-astro": "^0.14.1",
|
|
33
|
-
"npm:solid-js": "^1.9.
|
|
34
|
-
"npm:tsx": "^4.
|
|
33
|
+
"npm:solid-js": "^1.9.14",
|
|
34
|
+
"npm:tsx": "^4.23.1",
|
|
35
35
|
"npm:typescript": "^5.9.3",
|
|
36
36
|
"npm:vinxi": "^0.5.11",
|
|
37
37
|
"npm:x-forwarded-fetch": "^0.2.0"
|
package/dist/json/kv.js
CHANGED
package/dist/json/kv.json
CHANGED
package/dist/json/mq.js
CHANGED
|
@@ -55,7 +55,7 @@ var mq_default = {
|
|
|
55
55
|
"yarn",
|
|
56
56
|
"pnpm"
|
|
57
57
|
],
|
|
58
|
-
"dependencies": { "npm:mysql2": "^3.
|
|
58
|
+
"dependencies": { "npm:mysql2": "^3.23.2" },
|
|
59
59
|
"imports": {
|
|
60
60
|
"@fedify/mysql": { "MysqlMessageQueue": "MysqlMessageQueue" },
|
|
61
61
|
"mysql2/promise": { "default": "mysql" }
|
package/dist/json/mq.json
CHANGED
package/dist/test/lookup.js
CHANGED
|
@@ -13,7 +13,8 @@ const BANNED_LOOKUP_REASONS = {
|
|
|
13
13
|
"next,*,*,*": "Next.js doesn't support remote packages",
|
|
14
14
|
"solidstart,deno,*,*": "Error occurred while loading submodules in Deno",
|
|
15
15
|
"astro,deno,*,*": "Astro doesn't support remote packages in Deno",
|
|
16
|
-
"nuxt,deno,*,*": "Nuxt doesn't support remote packages in Deno"
|
|
16
|
+
"nuxt,deno,*,*": "Nuxt doesn't support remote packages in Deno",
|
|
17
|
+
"sveltekit,deno,*,*": "SvelteKit doesn't support remote packages in Deno"
|
|
17
18
|
};
|
|
18
19
|
const BANNED_LOOKUP_CASES = Object.keys(BANNED_LOOKUP_REASONS).map((key) => key.split(","));
|
|
19
20
|
/**
|
package/dist/test/port.js
CHANGED
|
@@ -108,8 +108,8 @@ async function replacePortInApp(dir, wf, defaultPort, newPort) {
|
|
|
108
108
|
await writeFile(filePath, (await readFile(filePath, "utf8")).replaceAll(String(defaultPort), String(newPort)));
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (wf === "astro") {
|
|
112
|
-
const configPath = join(dir, "astro.config.ts");
|
|
111
|
+
if (wf === "astro" || wf === "sveltekit") {
|
|
112
|
+
const configPath = join(dir, wf === "astro" ? "astro.config.ts" : "vite.config.ts");
|
|
113
113
|
await writeFile(configPath, (await readFile(configPath, "utf8")).replace("defineConfig({", `defineConfig({\n server: { port: ${newPort} },`));
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
@@ -7,6 +7,7 @@ import nextDescription from "./next.js";
|
|
|
7
7
|
import nitroDescription from "./nitro.js";
|
|
8
8
|
import nuxtDescription from "./nuxt.js";
|
|
9
9
|
import solidstartDescription from "./solidstart.js";
|
|
10
|
+
import sveltekitDescription from "./sveltekit.js";
|
|
10
11
|
//#region src/webframeworks/mod.ts
|
|
11
12
|
/**
|
|
12
13
|
* Registry of all supported web framework configurations.
|
|
@@ -24,7 +25,8 @@ const webFrameworks = {
|
|
|
24
25
|
next: nextDescription,
|
|
25
26
|
nitro: nitroDescription,
|
|
26
27
|
nuxt: nuxtDescription,
|
|
27
|
-
solidstart: solidstartDescription
|
|
28
|
+
solidstart: solidstartDescription,
|
|
29
|
+
sveltekit: sveltekitDescription
|
|
28
30
|
};
|
|
29
31
|
//#endregion
|
|
30
32
|
export { webFrameworks as default };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
|
+
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
+
import { "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@types/node@25" as npm__types_node_25, "npm:typescript" as npm_typescript } from "../json/deps.js";
|
|
4
|
+
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
|
+
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
|
|
6
|
+
//#region src/webframeworks/sveltekit.ts
|
|
7
|
+
const sveltekitDescription = {
|
|
8
|
+
label: "SvelteKit",
|
|
9
|
+
packageManagers: PACKAGE_MANAGER,
|
|
10
|
+
defaultPort: 5173,
|
|
11
|
+
init: async ({ packageManager: pm, testMode }) => ({
|
|
12
|
+
command: Array.from(getInitCommand(pm)),
|
|
13
|
+
dependencies: {
|
|
14
|
+
"@fedify/sveltekit": PACKAGE_VERSION,
|
|
15
|
+
...pm === "deno" ? defaultDenoDependencies : {}
|
|
16
|
+
},
|
|
17
|
+
devDependencies: {
|
|
18
|
+
...defaultDevDependencies,
|
|
19
|
+
"typescript": npm_typescript,
|
|
20
|
+
"@types/node": npm__types_node_25,
|
|
21
|
+
...pmToRt(pm) === "deno" ? {} : { "@dotenvx/dotenvx": npm__dotenvx_dotenvx }
|
|
22
|
+
},
|
|
23
|
+
federationFile: "src/lib/federation.ts",
|
|
24
|
+
loggingFile: "src/lib/logging.ts",
|
|
25
|
+
env: testMode ? { HOST: "127.0.0.1" } : {},
|
|
26
|
+
files: { "src/hooks.server.ts": await readTemplate("sveltekit/hooks.server.ts") },
|
|
27
|
+
tasks: pmToRt(pm) === "deno" ? {} : { ...TASKS },
|
|
28
|
+
instruction: getInstruction(pm, 5173)
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Returns the shell command array to scaffold a new SvelteKit project
|
|
33
|
+
* in the current directory using the given package manager.
|
|
34
|
+
*/
|
|
35
|
+
function* getInitCommand(pm) {
|
|
36
|
+
yield* getSvelteKitInitCommand(pm);
|
|
37
|
+
yield* [
|
|
38
|
+
".",
|
|
39
|
+
"--template",
|
|
40
|
+
"minimal",
|
|
41
|
+
"--types",
|
|
42
|
+
"ts",
|
|
43
|
+
"--no-add-ons",
|
|
44
|
+
"--no-dir-check",
|
|
45
|
+
"--no-download-check",
|
|
46
|
+
"--install",
|
|
47
|
+
pm
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
const getSvelteKitInitCommand = (pm) => pm === "bun" ? [
|
|
51
|
+
"bunx",
|
|
52
|
+
"sv",
|
|
53
|
+
"create"
|
|
54
|
+
] : pm === "deno" ? [
|
|
55
|
+
"deno",
|
|
56
|
+
"run",
|
|
57
|
+
"-A",
|
|
58
|
+
"npm:sv",
|
|
59
|
+
"create"
|
|
60
|
+
] : pm === "npm" ? [
|
|
61
|
+
"npx",
|
|
62
|
+
"sv",
|
|
63
|
+
"create"
|
|
64
|
+
] : [
|
|
65
|
+
pm,
|
|
66
|
+
"dlx",
|
|
67
|
+
"sv",
|
|
68
|
+
"create"
|
|
69
|
+
];
|
|
70
|
+
const TASKS = {
|
|
71
|
+
"dev": "dotenvx run -- vite dev",
|
|
72
|
+
"build": "dotenvx run -- vite build",
|
|
73
|
+
"preview": "dotenvx run -- vite preview",
|
|
74
|
+
...nodeBunDevToolTasks
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { sveltekitDescription as default };
|