@fedify/init 2.4.0-dev.1668 → 2.4.0-dev.1727
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 +8 -5
- package/dist/action/configs.js +1 -1
- package/dist/action/deps.js +1 -1
- package/dist/action/mod.d.ts +1 -1
- package/dist/action/patch.js +1 -1
- package/dist/action/templates.js +1 -1
- package/dist/deno.js +1 -1
- package/dist/json/deps.js +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/test/create.js +7 -12
- package/dist/test/lookup.js +1 -1
- package/dist/test/port.js +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/utils.js +8 -2
- package/dist/webframeworks/astro.js +1 -1
- package/dist/webframeworks/bare-bones.js +1 -1
- package/dist/webframeworks/const.js +1 -1
- package/dist/webframeworks/elysia.js +1 -1
- package/dist/webframeworks/express.js +1 -1
- package/dist/webframeworks/hono.js +1 -1
- package/dist/webframeworks/next.js +1 -1
- package/dist/webframeworks/nuxt.js +1 -1
- package/dist/webframeworks/solidstart.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,17 +25,20 @@ Supported options
|
|
|
25
25
|
|
|
26
26
|
The initializer supports the following project configurations:
|
|
27
27
|
|
|
28
|
-
- **Web frameworks**: Bare-bones, [
|
|
29
|
-
[
|
|
28
|
+
- **Web frameworks**: Bare-bones, [Astro], [Elysia], [Express], [Hono],
|
|
29
|
+
[Next.js], [Nitro], [Nuxt], [SolidStart]
|
|
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
|
|
33
33
|
|
|
34
|
-
[
|
|
35
|
-
[Nitro]: https://nitro.build/
|
|
36
|
-
[Next.js]: https://nextjs.org/
|
|
34
|
+
[Astro]: https://astro.build/
|
|
37
35
|
[Elysia]: https://elysiajs.com/
|
|
38
36
|
[Express]: https://expressjs.com/
|
|
37
|
+
[Hono]: https://hono.dev/
|
|
38
|
+
[Next.js]: https://nextjs.org/
|
|
39
|
+
[Nitro]: https://nitro.build/
|
|
40
|
+
[Nuxt]: https://nuxt.com/
|
|
41
|
+
[SolidStart]: https://start.solidjs.com/
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
Installation
|
package/dist/action/configs.js
CHANGED
|
@@ -119,7 +119,7 @@ const loadVscodeExtensions = (data) => ({
|
|
|
119
119
|
});
|
|
120
120
|
const withFormatIgnorePatterns = (config, data) => ({
|
|
121
121
|
...config,
|
|
122
|
-
ignorePatterns: [
|
|
122
|
+
ignorePatterns: [.../* @__PURE__ */ new Set([...config.ignorePatterns ?? [], ...data.initializer.format?.ignorePatterns ?? []])].sort()
|
|
123
123
|
});
|
|
124
124
|
function getVscodeSettingsForPrettier() {
|
|
125
125
|
const { "oxc.fmt.configPath": _configPath, ...settings } = vscode_settings_default;
|
package/dist/action/deps.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { merge, replace } from "../utils.js";
|
|
2
2
|
import { PACKAGE_VERSION } from "../lib.js";
|
|
3
|
-
import { _logtape_logtape, _std_dotenv } from "../json/deps.js";
|
|
3
|
+
import { "@logtape/logtape" as _logtape_logtape, "@std/dotenv" as _std_dotenv } from "../json/deps.js";
|
|
4
4
|
import { getPackagesPath } from "./const.js";
|
|
5
5
|
import { isDeno, needsDenoDotenv } from "./utils.js";
|
|
6
6
|
import { always, entries, filter, fromEntries, map, pipe, when } from "@fxts/core";
|
package/dist/action/mod.d.ts
CHANGED
package/dist/action/patch.js
CHANGED
|
@@ -233,4 +233,4 @@ const appendText = (prev, data) => prev ? `${prev}\n${data}` : data;
|
|
|
233
233
|
*/
|
|
234
234
|
const readFileIfExists = (path) => readFile(path, "utf8").catch(pipeLazy(tap(throwUnlessNotExists), always("")));
|
|
235
235
|
//#endregion
|
|
236
|
-
export { assertNoGeneratedFileConflicts, patchFiles, recommendPatchFiles };
|
|
236
|
+
export { GeneratedFileConflictError, assertNoGeneratedFileConflicts, getJsonsCacheKey, patchFiles, recommendPatchFiles };
|
package/dist/action/templates.js
CHANGED
|
@@ -75,4 +75,4 @@ const ENV_REG_EXP = /process\.env\.(\w+)/g;
|
|
|
75
75
|
*/
|
|
76
76
|
const convertEnv = (obj, pm) => pm === "deno" && ENV_REG_EXP.test(obj) ? obj.replaceAll(ENV_REG_EXP, (_, g1) => `Deno.env.get("${g1}")`) : obj;
|
|
77
77
|
//#endregion
|
|
78
|
-
export { getImports, loadFederation, loadLogging };
|
|
78
|
+
export { convertEnv, getAlias, getImports, loadFederation, loadLogging };
|
package/dist/deno.js
CHANGED
package/dist/json/deps.js
CHANGED
|
@@ -32,4 +32,4 @@ var npm_typescript = "^5.9.3";
|
|
|
32
32
|
var npm_vinxi = "^0.5.11";
|
|
33
33
|
var npm_x_forwarded_fetch = "^0.2.0";
|
|
34
34
|
//#endregion
|
|
35
|
-
export { _hongminhee_x_forwarded_fetch, _hono_hono, _logtape_logtape, _std_dotenv, npm__astrojs_node, npm__deno_astro_adapter, npm__dotenvx_dotenvx, npm__elysiajs_node, npm__hono_node_server, npm__sinclair_typebox, npm__solidjs_router, npm__solidjs_start, npm__types_bun, npm__types_express, npm__types_node_20, npm__types_node_22, npm__types_node_25, npm_astro, npm_create_astro, npm_elysia, npm_express, npm_hono, npm_openapi_types, npm_oxfmt, npm_oxlint, npm_prettier, npm_prettier_plugin_astro, npm_solid_js, npm_tsx, npm_typescript, npm_vinxi, npm_x_forwarded_fetch };
|
|
35
|
+
export { _hongminhee_x_forwarded_fetch as "@hongminhee/x-forwarded-fetch", _hono_hono as "@hono/hono", _logtape_logtape as "@logtape/logtape", _std_dotenv as "@std/dotenv", npm__astrojs_node as "npm:@astrojs/node", npm__deno_astro_adapter as "npm:@deno/astro-adapter", npm__dotenvx_dotenvx as "npm:@dotenvx/dotenvx", npm__elysiajs_node as "npm:@elysiajs/node", npm__hono_node_server as "npm:@hono/node-server", npm__sinclair_typebox as "npm:@sinclair/typebox", npm__solidjs_router as "npm:@solidjs/router", npm__solidjs_start as "npm:@solidjs/start", npm__types_bun as "npm:@types/bun", npm__types_express as "npm:@types/express", npm__types_node_20 as "npm:@types/node@20", npm__types_node_22 as "npm:@types/node@22", npm__types_node_25 as "npm:@types/node@25", npm_astro as "npm:astro", npm_create_astro as "npm:create-astro", npm_elysia as "npm:elysia", npm_express as "npm:express", npm_hono as "npm:hono", npm_openapi_types as "npm:openapi-types", npm_oxfmt as "npm:oxfmt", npm_oxlint as "npm:oxlint", npm_prettier as "npm:prettier", npm_prettier_plugin_astro as "npm:prettier-plugin-astro", npm_solid_js as "npm:solid-js", npm_tsx as "npm:tsx", npm_typescript as "npm:typescript", npm_vinxi as "npm:vinxi", npm_x_forwarded_fetch as "npm:x-forwarded-fetch" };
|
package/dist/mod.d.ts
CHANGED
package/dist/test/create.js
CHANGED
|
@@ -74,26 +74,21 @@ const saveOutputs = async (dirPath, { stdout, stderr }) => {
|
|
|
74
74
|
if (stderr) await appendFile(join$1(dirPath, "err.txt"), stderr + "\n", "utf8");
|
|
75
75
|
};
|
|
76
76
|
async function validateDevToolScripts(dir, options) {
|
|
77
|
-
const [
|
|
77
|
+
const [_, packageManager] = options;
|
|
78
78
|
if (packageManager === "deno") return true;
|
|
79
79
|
if (!await hasInstalledNodeDependencies(dir)) return true;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
]}`.cwd(dir).stdin("null").stdout("piped").stderr("piped").noThrow().spawn();
|
|
86
|
-
await saveOutputs(dir, format);
|
|
87
|
-
if (format.code !== 0) return false;
|
|
88
|
-
}
|
|
89
|
-
for (const script of ["format:check", "lint"]) {
|
|
80
|
+
for (const script of [
|
|
81
|
+
"format",
|
|
82
|
+
"format:check",
|
|
83
|
+
"lint"
|
|
84
|
+
]) {
|
|
90
85
|
const result = await $`${[
|
|
91
86
|
packageManager,
|
|
92
87
|
"run",
|
|
93
88
|
script
|
|
94
89
|
]}`.cwd(dir).stdin("null").stdout("piped").stderr("piped").noThrow().spawn();
|
|
95
90
|
await saveOutputs(dir, result);
|
|
96
|
-
if (result.code !== 0)
|
|
91
|
+
if (result.code !== 0) printMessage` Warning: ${script} failed, continuing anyway.`;
|
|
97
92
|
}
|
|
98
93
|
return true;
|
|
99
94
|
}
|
package/dist/test/lookup.js
CHANGED
package/dist/test/port.js
CHANGED
|
@@ -90,7 +90,7 @@ const ENTRY_FILES = {
|
|
|
90
90
|
hono: "src/index.ts",
|
|
91
91
|
elysia: "src/index.ts"
|
|
92
92
|
};
|
|
93
|
-
const WF_READ_PORT_FROM_ENV = new Set([
|
|
93
|
+
const WF_READ_PORT_FROM_ENV = /* @__PURE__ */ new Set([
|
|
94
94
|
"nuxt",
|
|
95
95
|
"nitro",
|
|
96
96
|
"solidstart"
|
|
@@ -127,4 +127,4 @@ async function ensurePortReleased(port) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
|
-
export { ensurePortReleased, killProcessOnPort, replacePortInApp, reservePort };
|
|
130
|
+
export { ensurePortReleased, isPortInUse, killProcessOnPort, replacePortInApp, reservePort, waitForPortRelease };
|
package/dist/types.d.ts
CHANGED
|
@@ -125,4 +125,4 @@ interface InitCommandData extends InitCommandOptions {
|
|
|
125
125
|
readonly env: Record<string, string>;
|
|
126
126
|
}
|
|
127
127
|
//#endregion
|
|
128
|
-
export { InitCommandData };
|
|
128
|
+
export { InitCommandData, InitCommandOptions, KvStoreDescription, MessageQueueDescription, PackageManager, WebFrameworkInitializer };
|
package/dist/utils.js
CHANGED
|
@@ -5,8 +5,14 @@ import { flow, toMerged } from "es-toolkit";
|
|
|
5
5
|
import { message } from "@optique/core";
|
|
6
6
|
import { Chalk } from "chalk";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
|
+
//#region src/utils.ts
|
|
9
|
+
/**
|
|
10
|
+
* Whether terminal color output is enabled.
|
|
11
|
+
* `true` when stdout is a TTY and the `NO_COLOR` environment variable is not set.
|
|
12
|
+
*/
|
|
13
|
+
const colorEnabled = process.stdout.isTTY && !("NO_COLOR" in process.env && process.env.NO_COLOR !== "");
|
|
8
14
|
/** Chalk instance configured based on {@link colorEnabled}. */
|
|
9
|
-
const colors = new Chalk(
|
|
15
|
+
const colors = new Chalk(colorEnabled ? {} : { level: 0 });
|
|
10
16
|
/** Type guard that checks whether a value is a `Promise`. */
|
|
11
17
|
const isPromise = (value) => value instanceof Promise;
|
|
12
18
|
/**
|
|
@@ -160,4 +166,4 @@ const printMessage = flow(message, print);
|
|
|
160
166
|
/** Prints a formatted error message to stderr using `@optique/run`'s `printError`. */
|
|
161
167
|
const printErrorMessage = flow(message, printError);
|
|
162
168
|
//#endregion
|
|
163
|
-
export { CommandError, colors, formatJson, getCwd, getOsType, isNotFoundError, merge$1 as merge, notEmpty, printErrorMessage, printMessage, product, replace, runSubCommand, set };
|
|
169
|
+
export { CommandError, colorEnabled, colors, formatJson, getCwd, getOsType, isNotFoundError, isPromise, merge$1 as merge, notEmpty, printErrorMessage, printMessage, product, replace, runSubCommand, set };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
-
import { _logtape_logtape, npm__astrojs_node, npm__deno_astro_adapter, npm__dotenvx_dotenvx, npm__types_node_22, npm_astro, npm_create_astro, npm_oxlint, npm_prettier, npm_prettier_plugin_astro, npm_typescript } from "../json/deps.js";
|
|
3
|
+
import { "@logtape/logtape" as _logtape_logtape, "npm:@astrojs/node" as npm__astrojs_node, "npm:@deno/astro-adapter" as npm__deno_astro_adapter, "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@types/node@22" as npm__types_node_22, "npm:astro" as npm_astro, "npm:create-astro" as npm_create_astro, "npm:oxlint" as npm_oxlint, "npm:prettier" as npm_prettier, "npm:prettier-plugin-astro" as npm_prettier_plugin_astro, "npm:typescript" as npm_typescript } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, pmToRt } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/astro.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
-
import { _hongminhee_x_forwarded_fetch, 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
|
+
import { "@hongminhee/x-forwarded-fetch" as _hongminhee_x_forwarded_fetch, "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@hono/node-server" as npm__hono_node_server, "npm:@types/bun" as npm__types_bun, "npm:@types/node@25" as npm__types_node_25, "npm:tsx" as npm_tsx, "npm:x-forwarded-fetch" as npm_x_forwarded_fetch } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/bare-bones.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PACKAGE_VERSION } from "../lib.js";
|
|
2
|
-
import { npm_oxfmt, npm_oxlint } from "../json/deps.js";
|
|
2
|
+
import { "npm:oxfmt" as npm_oxfmt, "npm:oxlint" as npm_oxlint } from "../json/deps.js";
|
|
3
3
|
//#region src/webframeworks/const.ts
|
|
4
4
|
const defaultDevDependencies = {
|
|
5
5
|
"@fedify/lint": PACKAGE_VERSION,
|
|
@@ -1,6 +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__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
|
+
import { "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@elysiajs/node" as npm__elysiajs_node, "npm:@sinclair/typebox" as npm__sinclair_typebox, "npm:@types/bun" as npm__types_bun, "npm:@types/node@25" as npm__types_node_25, "npm:elysia" as npm_elysia, "npm:openapi-types" as npm_openapi_types, "npm:tsx" as npm_tsx, "npm:typescript" as npm_typescript } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/elysia.ts
|
|
@@ -1,6 +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
|
+
import { "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@types/bun" as npm__types_bun, "npm:@types/express" as npm__types_express, "npm:express" as npm_express, "npm:tsx" as npm_tsx } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/express.ts
|
|
@@ -1,7 +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, npm__dotenvx_dotenvx, npm__hono_node_server, npm__types_bun, npm_hono, npm_tsx, npm_x_forwarded_fetch } from "../json/deps.js";
|
|
4
|
+
import { "@hongminhee/x-forwarded-fetch" as _hongminhee_x_forwarded_fetch, "@hono/hono" as _hono_hono, "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@hono/node-server" as npm__hono_node_server, "npm:@types/bun" as npm__types_bun, "npm:hono" as npm_hono, "npm:tsx" as npm_tsx, "npm:x-forwarded-fetch" as npm_x_forwarded_fetch } from "../json/deps.js";
|
|
5
5
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
6
6
|
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
|
|
7
7
|
import { pipe } from "@fxts/core";
|
|
@@ -1,6 +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
|
+
import { "npm:@types/node@20" as npm__types_node_20 } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, getNodeBunDevToolTasks } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/next.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, readTemplate } from "../lib.js";
|
|
2
2
|
import { PACKAGE_MANAGER } from "../const.js";
|
|
3
|
-
import { npm__types_node_25, npm_typescript } from "../json/deps.js";
|
|
3
|
+
import { "npm:@types/node@25" as npm__types_node_25, "npm:typescript" as npm_typescript } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, getNodeBunDevToolTasks } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/nuxt.ts
|
|
@@ -1,6 +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__solidjs_router, npm__solidjs_start, npm__types_node_22, npm_solid_js, npm_typescript, npm_vinxi } from "../json/deps.js";
|
|
3
|
+
import { "npm:@dotenvx/dotenvx" as npm__dotenvx_dotenvx, "npm:@solidjs/router" as npm__solidjs_router, "npm:@solidjs/start" as npm__solidjs_start, "npm:@types/node@22" as npm__types_node_22, "npm:solid-js" as npm_solid_js, "npm:typescript" as npm_typescript, "npm:vinxi" as npm_vinxi } from "../json/deps.js";
|
|
4
4
|
import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
|
|
5
5
|
import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
|
|
6
6
|
//#region src/webframeworks/solidstart.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/init",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.1727+1eadcb04",
|
|
4
4
|
"description": "Project initializer for Fedify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fedify",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@david/dax": "npm:dax@^0.46.1",
|
|
49
|
-
"@fxts/core": "^1.
|
|
49
|
+
"@fxts/core": "^1.21.1",
|
|
50
50
|
"@inquirer/prompts": "^7.8.4",
|
|
51
51
|
"@logtape/logtape": "^2.2.0",
|
|
52
52
|
"@optique/core": "^1.1.0",
|