@fedify/init 2.2.0-dev.635 → 2.2.0-dev.652
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
package/dist/action/configs.js
CHANGED
|
@@ -4,10 +4,10 @@ import vscode_settings_for_deno_default from "../json/vscode-settings-for-deno.j
|
|
|
4
4
|
import vscode_settings_default from "../json/vscode-settings.js";
|
|
5
5
|
import { getPackagesPath } from "./const.js";
|
|
6
6
|
import { getDependencies, getDevDependencies, joinDepsReg } from "./deps.js";
|
|
7
|
-
import { execFileSync } from "node:child_process";
|
|
8
7
|
import { getLogger } from "@logtape/logtape";
|
|
9
8
|
import { realpathSync } from "node:fs";
|
|
10
9
|
import { join, relative } from "node:path";
|
|
10
|
+
import { execFileSync } from "node:child_process";
|
|
11
11
|
import { always, cases, concat, filter, head, isArray, isEmpty, isNull, isString, keys, map, pick, pipe, prop, toArray, uniq, unless, when, zip } from "@fxts/core/index.js";
|
|
12
12
|
//#region src/action/configs.ts
|
|
13
13
|
const logger = getLogger([
|
package/dist/action/deps.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { merge, replace } from "../utils.js";
|
|
2
2
|
import { PACKAGE_VERSION } from "../lib.js";
|
|
3
|
+
import { _logtape_logtape } from "../json/deps.js";
|
|
3
4
|
import { getPackagesPath } from "./const.js";
|
|
4
5
|
import { isDeno } from "./utils.js";
|
|
5
6
|
import { always, entries, filter, fromEntries, map, pipe, when } from "@fxts/core";
|
|
@@ -16,7 +17,7 @@ import { join as join$1 } from "node:path";
|
|
|
16
17
|
const getDependencies = ({ initializer, kv, mq, testMode, packageManager }) => pipe({
|
|
17
18
|
"@fedify/fedify": PACKAGE_VERSION,
|
|
18
19
|
"@fedify/vocab": PACKAGE_VERSION,
|
|
19
|
-
"@logtape/logtape":
|
|
20
|
+
"@logtape/logtape": _logtape_logtape
|
|
20
21
|
}, merge(initializer.dependencies), merge(kv.dependencies), merge(mq.dependencies), when(always(testMode), isDeno({ packageManager }) ? removeFedifyDeps : addLocalFedifyDeps), normalizePackageNames(packageManager));
|
|
21
22
|
const removeFedifyDeps = (deps) => pipe(deps, entries, filter(([name]) => !name.includes("@fedify")), fromEntries);
|
|
22
23
|
const addLocalFedifyDeps = (deps) => pipe(deps, entries, map(when(([name]) => name.includes("@fedify/"), ([name, _version]) => [name, convertFedifyToLocal(name)])), fromEntries);
|
|
@@ -29,7 +30,7 @@ const convertFedifyToLocal = (name) => pipe(name, replace("@fedify/", ""), (pkg)
|
|
|
29
30
|
* and message queue descriptions
|
|
30
31
|
* @returns A record of devDependencies with their versions
|
|
31
32
|
*/
|
|
32
|
-
const getDevDependencies = ({ initializer, kv, mq, packageManager, testMode }) => pipe(
|
|
33
|
+
const getDevDependencies = ({ initializer, kv, mq, packageManager, testMode }) => pipe(initializer.devDependencies, merge(kv.devDependencies), merge(mq.devDependencies), when(always(testMode), isDeno({ packageManager }) ? removeFedifyDeps : addLocalFedifyDeps), normalizePackageNames(packageManager));
|
|
33
34
|
/**
|
|
34
35
|
* Joins package names with their versions for installation dependencies.
|
|
35
36
|
* For Deno, it prefixes packages with 'jsr:'
|
package/dist/action/mod.js
CHANGED
|
@@ -3,10 +3,8 @@ import askOptions from "../ask/mod.js";
|
|
|
3
3
|
import { makeDirIfHyd } from "./dir.js";
|
|
4
4
|
import { drawDinosaur, noticeHowToRun, noticeOptions, noticePrecommand } from "./notice.js";
|
|
5
5
|
import recommendConfigEnv from "./env.js";
|
|
6
|
-
import installDependencies from "./
|
|
7
|
-
import { hasCommand, isDry } from "./utils.js";
|
|
6
|
+
import { hasCommand, installDependencies, isDry, runPrecommand } from "./utils.js";
|
|
8
7
|
import { patchFiles, recommendPatchFiles } from "./patch.js";
|
|
9
|
-
import runPrecommand from "./precommand.js";
|
|
10
8
|
import recommendDependencies from "./recommend.js";
|
|
11
9
|
import setData from "./set.js";
|
|
12
10
|
import { pipe, tap, unless, when } from "@fxts/core";
|
package/dist/action/notice.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { colors, printMessage } from "../utils.js";
|
|
2
|
-
import { text } from "@optique/core";
|
|
3
2
|
import { flow } from "es-toolkit";
|
|
3
|
+
import { text } from "@optique/core";
|
|
4
4
|
//#region src/action/notice.ts
|
|
5
5
|
/** Prints the Feddy ASCII art banner to stderr. */
|
|
6
6
|
function drawDinosaur() {
|
package/dist/action/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import $ from "@david/dax";
|
|
1
2
|
import { join } from "node:path";
|
|
2
3
|
//#region src/action/utils.ts
|
|
3
4
|
/** Returns `true` if the current run is in dry-run mode. */
|
|
@@ -48,5 +49,25 @@ function stringifyEnvs(object) {
|
|
|
48
49
|
}
|
|
49
50
|
return lines.join("\n");
|
|
50
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Runs `<packageManager> install` in the project directory to install all
|
|
54
|
+
* dependencies. Logs an error message if the installation fails.
|
|
55
|
+
*/
|
|
56
|
+
const installDependencies = ({ packageManager, dir }) => $`${packageManager} install`.cwd(dir).spawn();
|
|
57
|
+
/**
|
|
58
|
+
* Runs the precommand specified in the initializer to set up the project.
|
|
59
|
+
*
|
|
60
|
+
* @param data - The initialization command data containing the initializer command and directory
|
|
61
|
+
* @returns A promise that resolves when the precommand has been executed
|
|
62
|
+
*/
|
|
63
|
+
const runPrecommand = async ({ initializer: { command }, dir }) => await Array.fromAsync(splitOnOperator(command), (cmd) => $`${cmd}`.cwd(dir).spawn());
|
|
64
|
+
function* splitOnOperator(command) {
|
|
65
|
+
let current = [];
|
|
66
|
+
for (const arg of command) if (arg === "&&") {
|
|
67
|
+
if (current.length > 0) yield current;
|
|
68
|
+
current = [];
|
|
69
|
+
} else current.push(arg);
|
|
70
|
+
if (current.length > 0) yield current;
|
|
71
|
+
}
|
|
51
72
|
//#endregion
|
|
52
|
-
export { hasCommand, isDeno, isDry, joinDir, stringifyEnvs };
|
|
73
|
+
export { hasCommand, installDependencies, isDeno, isDry, joinDir, runPrecommand, stringifyEnvs };
|
package/dist/ask/dir.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getCwd, getOsType
|
|
1
|
+
import { getCwd, getOsType } from "../utils.js";
|
|
2
2
|
import { isDirectoryEmpty, logger } from "../lib.js";
|
|
3
3
|
import { identity, pipe, when } from "@fxts/core";
|
|
4
|
+
import $ from "@david/dax";
|
|
4
5
|
import { input } from "@inquirer/prompts";
|
|
5
6
|
import { message } from "@optique/core/message";
|
|
6
7
|
import { printError } from "@optique/run";
|
|
@@ -42,7 +43,7 @@ const askMoveToTrash = (dir) => toggle.default({
|
|
|
42
43
|
If you choose "No", you should choose another directory.`,
|
|
43
44
|
default: false
|
|
44
45
|
});
|
|
45
|
-
const moveToTrash = (dir) => () => pipe(getOsType(), getTrashCommand, (fn) => fn(dir), (cmd) =>
|
|
46
|
+
const moveToTrash = (dir) => () => pipe(getOsType(), getTrashCommand, (fn) => fn(dir), (cmd) => $`${cmd}`.spawn(), () => true).catch((e) => {
|
|
46
47
|
logger.error(e);
|
|
47
48
|
printError(message`Failed to move ${dir} to trash.
|
|
48
49
|
Please move it manually.`);
|
package/dist/command.d.ts
CHANGED
|
@@ -9,14 +9,14 @@ import { InferValue } from "@optique/core";
|
|
|
9
9
|
*/
|
|
10
10
|
declare const initOptions: _$_optique_core0.Parser<"sync", {
|
|
11
11
|
readonly dir: string;
|
|
12
|
-
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express";
|
|
12
|
+
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "solidstart";
|
|
13
13
|
readonly packageManager: "deno" | "pnpm" | "bun" | "yarn" | "npm";
|
|
14
14
|
readonly kvStore: "postgres" | "mysql" | "in-memory" | "redis" | "denokv";
|
|
15
15
|
readonly messageQueue: "postgres" | "mysql" | "redis" | "denokv" | "in-process" | "amqp";
|
|
16
16
|
readonly dryRun: boolean;
|
|
17
17
|
}, {
|
|
18
18
|
readonly dir: [_$_optique_core0.ValueParserResult<string>];
|
|
19
|
-
readonly webFramework: [_$_optique_core0.ValueParserResult<"bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express">];
|
|
19
|
+
readonly webFramework: [_$_optique_core0.ValueParserResult<"bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "solidstart">];
|
|
20
20
|
readonly packageManager: [_$_optique_core0.ValueParserResult<"deno" | "pnpm" | "bun" | "yarn" | "npm">];
|
|
21
21
|
readonly kvStore: [_$_optique_core0.ValueParserResult<"postgres" | "mysql" | "in-memory" | "redis" | "denokv">];
|
|
22
22
|
readonly messageQueue: [_$_optique_core0.ValueParserResult<"postgres" | "mysql" | "redis" | "denokv" | "in-process" | "amqp">];
|
|
@@ -27,7 +27,7 @@ declare const initOptions: _$_optique_core0.Parser<"sync", {
|
|
|
27
27
|
*/
|
|
28
28
|
declare const initCommand: _$_optique_core0.Parser<"sync", {
|
|
29
29
|
readonly dir: string;
|
|
30
|
-
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express";
|
|
30
|
+
readonly webFramework: "bare-bones" | "hono" | "nitro" | "next" | "elysia" | "astro" | "express" | "solidstart";
|
|
31
31
|
readonly packageManager: "deno" | "pnpm" | "bun" | "yarn" | "npm";
|
|
32
32
|
readonly kvStore: "postgres" | "mysql" | "in-memory" | "redis" | "denokv";
|
|
33
33
|
readonly messageQueue: "postgres" | "mysql" | "redis" | "denokv" | "in-process" | "amqp";
|
package/dist/const.js
CHANGED
package/dist/deno.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/json/deps.json
|
|
2
|
+
var _hongminhee_x_forwarded_fetch = "^0.2.0";
|
|
3
|
+
var _hono_hono = "^4.12.9";
|
|
4
|
+
var _logtape_logtape = "^2.0.5";
|
|
5
|
+
var _std_dotenv = "^0.225.6";
|
|
6
|
+
var npm__astrojs_node = "^10.0.4";
|
|
7
|
+
var npm__biomejs_biome = "^2.4.9";
|
|
8
|
+
var npm__deno_astro_adapter = "^0.3.2";
|
|
9
|
+
var npm__dotenvx_dotenvx = "^1.59.1";
|
|
10
|
+
var npm__elysiajs_node = "^1.4.5";
|
|
11
|
+
var npm__hono_node_server = "^1.19.12";
|
|
12
|
+
var npm__sinclair_typebox = "^0.34.49";
|
|
13
|
+
var npm__solidjs_router = "^0.16.1";
|
|
14
|
+
var npm__solidjs_start = "^1.3.2";
|
|
15
|
+
var npm__types_bun = "^1.3.11";
|
|
16
|
+
var npm__types_express = "^4.17.21";
|
|
17
|
+
var npm__types_node_20 = "^20.11.2";
|
|
18
|
+
var npm__types_node_22 = "^22.17.0";
|
|
19
|
+
var npm__types_node_25 = "^25.5.0";
|
|
20
|
+
var npm_elysia = "^1.4.28";
|
|
21
|
+
var npm_eslint = "^9.0.0";
|
|
22
|
+
var npm_express = "^5.2.1";
|
|
23
|
+
var npm_hono = "^4.12.9";
|
|
24
|
+
var npm_openapi_types = "^12.1.3";
|
|
25
|
+
var npm_solid_js = "^1.9.12";
|
|
26
|
+
var npm_tsx = "^4.21.0";
|
|
27
|
+
var npm_typescript = "^5.9.3";
|
|
28
|
+
var npm_vinxi = "^0.5.11";
|
|
29
|
+
var npm_x_forwarded_fetch = "^0.2.0";
|
|
30
|
+
//#endregion
|
|
31
|
+
export { _hongminhee_x_forwarded_fetch, _hono_hono, _logtape_logtape, _std_dotenv, npm__astrojs_node, npm__biomejs_biome, 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_elysia, npm_eslint, npm_express, npm_hono, npm_openapi_types, npm_solid_js, npm_tsx, npm_typescript, npm_vinxi, npm_x_forwarded_fetch };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@hongminhee/x-forwarded-fetch": "^0.2.0",
|
|
3
|
+
"@hono/hono": "^4.12.9",
|
|
4
|
+
"@logtape/logtape": "^2.0.5",
|
|
5
|
+
"@std/dotenv": "^0.225.6",
|
|
6
|
+
"npm:@astrojs/node": "^10.0.4",
|
|
7
|
+
"npm:@biomejs/biome": "^2.4.9",
|
|
8
|
+
"npm:@deno/astro-adapter": "^0.3.2",
|
|
9
|
+
"npm:@dotenvx/dotenvx": "^1.59.1",
|
|
10
|
+
"npm:@elysiajs/node": "^1.4.5",
|
|
11
|
+
"npm:@hono/node-server": "^1.19.12",
|
|
12
|
+
"npm:@sinclair/typebox": "^0.34.49",
|
|
13
|
+
"npm:@solidjs/router": "^0.16.1",
|
|
14
|
+
"npm:@solidjs/start": "^1.3.2",
|
|
15
|
+
"npm:@types/bun": "^1.3.11",
|
|
16
|
+
"npm:@types/express": "^4.17.21",
|
|
17
|
+
"npm:@types/node@20": "^20.11.2",
|
|
18
|
+
"npm:@types/node@22": "^22.17.0",
|
|
19
|
+
"npm:@types/node@25": "^25.5.0",
|
|
20
|
+
"npm:astro": "^6.1.1",
|
|
21
|
+
"npm:elysia": "^1.4.28",
|
|
22
|
+
"npm:eslint": "^9.0.0",
|
|
23
|
+
"npm:express": "^5.2.1",
|
|
24
|
+
"npm:hono": "^4.12.9",
|
|
25
|
+
"npm:openapi-types": "^12.1.3",
|
|
26
|
+
"npm:solid-js": "^1.9.12",
|
|
27
|
+
"npm:tsx": "^4.21.0",
|
|
28
|
+
"npm:typescript": "^5.9.3",
|
|
29
|
+
"npm:vinxi": "^0.5.11",
|
|
30
|
+
"npm:x-forwarded-fetch": "^0.2.0"
|
|
31
|
+
}
|
package/dist/json/kv.js
CHANGED
|
@@ -21,7 +21,7 @@ var kv_default = {
|
|
|
21
21
|
"yarn",
|
|
22
22
|
"pnpm"
|
|
23
23
|
],
|
|
24
|
-
"dependencies": { "npm:ioredis": "^5.
|
|
24
|
+
"dependencies": { "npm:ioredis": "^5.10.1" },
|
|
25
25
|
"imports": {
|
|
26
26
|
"@fedify/redis": { "RedisKvStore": "RedisKvStore" },
|
|
27
27
|
"ioredis": { "Redis": "Redis" }
|
|
@@ -38,7 +38,7 @@ var kv_default = {
|
|
|
38
38
|
"yarn",
|
|
39
39
|
"pnpm"
|
|
40
40
|
],
|
|
41
|
-
"dependencies": { "npm:postgres": "^3.4.
|
|
41
|
+
"dependencies": { "npm:postgres": "^3.4.8" },
|
|
42
42
|
"imports": {
|
|
43
43
|
"@fedify/postgres": { "PostgresKvStore": "PostgresKvStore" },
|
|
44
44
|
"postgres": { "default": "postgres" }
|
|
@@ -55,7 +55,7 @@ var kv_default = {
|
|
|
55
55
|
"yarn",
|
|
56
56
|
"pnpm"
|
|
57
57
|
],
|
|
58
|
-
"dependencies": { "npm:mysql2": "^3.
|
|
58
|
+
"dependencies": { "npm:mysql2": "^3.20.0" },
|
|
59
59
|
"imports": {
|
|
60
60
|
"@fedify/mysql": { "MysqlKvStore": "MysqlKvStore" },
|
|
61
61
|
"mysql2/promise": { "default": "mysql" }
|
package/dist/json/kv.json
CHANGED
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"in-memory": {
|
|
3
3
|
"label": "In-Memory",
|
|
4
|
-
"packageManagers": [
|
|
4
|
+
"packageManagers": [
|
|
5
|
+
"deno",
|
|
6
|
+
"bun",
|
|
7
|
+
"npm",
|
|
8
|
+
"yarn",
|
|
9
|
+
"pnpm"
|
|
10
|
+
],
|
|
5
11
|
"imports": {
|
|
6
|
-
"@fedify/fedify": {
|
|
12
|
+
"@fedify/fedify": {
|
|
13
|
+
"MemoryKvStore": "MemoryKvStore"
|
|
14
|
+
}
|
|
7
15
|
},
|
|
8
16
|
"object": "new MemoryKvStore()"
|
|
9
17
|
},
|
|
10
18
|
"redis": {
|
|
11
19
|
"label": "Redis",
|
|
12
|
-
"packageManagers": [
|
|
20
|
+
"packageManagers": [
|
|
21
|
+
"deno",
|
|
22
|
+
"bun",
|
|
23
|
+
"npm",
|
|
24
|
+
"yarn",
|
|
25
|
+
"pnpm"
|
|
26
|
+
],
|
|
13
27
|
"dependencies": {
|
|
14
|
-
"npm:ioredis": "^5.
|
|
28
|
+
"npm:ioredis": "^5.10.1"
|
|
15
29
|
},
|
|
16
30
|
"imports": {
|
|
17
|
-
"@fedify/redis": {
|
|
18
|
-
|
|
31
|
+
"@fedify/redis": {
|
|
32
|
+
"RedisKvStore": "RedisKvStore"
|
|
33
|
+
},
|
|
34
|
+
"ioredis": {
|
|
35
|
+
"Redis": "Redis"
|
|
36
|
+
}
|
|
19
37
|
},
|
|
20
38
|
"object": "new RedisKvStore(new Redis(process.env.REDIS_URL))",
|
|
21
39
|
"env": {
|
|
@@ -24,13 +42,23 @@
|
|
|
24
42
|
},
|
|
25
43
|
"postgres": {
|
|
26
44
|
"label": "PostgreSQL",
|
|
27
|
-
"packageManagers": [
|
|
45
|
+
"packageManagers": [
|
|
46
|
+
"deno",
|
|
47
|
+
"bun",
|
|
48
|
+
"npm",
|
|
49
|
+
"yarn",
|
|
50
|
+
"pnpm"
|
|
51
|
+
],
|
|
28
52
|
"dependencies": {
|
|
29
|
-
"npm:postgres": "^3.4.
|
|
53
|
+
"npm:postgres": "^3.4.8"
|
|
30
54
|
},
|
|
31
55
|
"imports": {
|
|
32
|
-
"@fedify/postgres": {
|
|
33
|
-
|
|
56
|
+
"@fedify/postgres": {
|
|
57
|
+
"PostgresKvStore": "PostgresKvStore"
|
|
58
|
+
},
|
|
59
|
+
"postgres": {
|
|
60
|
+
"default": "postgres"
|
|
61
|
+
}
|
|
34
62
|
},
|
|
35
63
|
"object": "new PostgresKvStore(postgres(process.env.POSTGRES_URL))",
|
|
36
64
|
"env": {
|
|
@@ -39,13 +67,23 @@
|
|
|
39
67
|
},
|
|
40
68
|
"mysql": {
|
|
41
69
|
"label": "MySQL/MariaDB",
|
|
42
|
-
"packageManagers": [
|
|
70
|
+
"packageManagers": [
|
|
71
|
+
"deno",
|
|
72
|
+
"bun",
|
|
73
|
+
"npm",
|
|
74
|
+
"yarn",
|
|
75
|
+
"pnpm"
|
|
76
|
+
],
|
|
43
77
|
"dependencies": {
|
|
44
|
-
"npm:mysql2": "^3.
|
|
78
|
+
"npm:mysql2": "^3.20.0"
|
|
45
79
|
},
|
|
46
80
|
"imports": {
|
|
47
|
-
"@fedify/mysql": {
|
|
48
|
-
|
|
81
|
+
"@fedify/mysql": {
|
|
82
|
+
"MysqlKvStore": "MysqlKvStore"
|
|
83
|
+
},
|
|
84
|
+
"mysql2/promise": {
|
|
85
|
+
"default": "mysql"
|
|
86
|
+
}
|
|
49
87
|
},
|
|
50
88
|
"object": "new MysqlKvStore(mysql.createPool(process.env.MYSQL_URL))",
|
|
51
89
|
"env": {
|
|
@@ -54,9 +92,17 @@
|
|
|
54
92
|
},
|
|
55
93
|
"denokv": {
|
|
56
94
|
"label": "Deno KV",
|
|
57
|
-
"packageManagers": [
|
|
58
|
-
|
|
95
|
+
"packageManagers": [
|
|
96
|
+
"deno"
|
|
97
|
+
],
|
|
98
|
+
"imports": {
|
|
99
|
+
"@fedify/denokv": {
|
|
100
|
+
"DenoKvStore": "DenoKvStore"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
59
103
|
"object": "new DenoKvStore(await Deno.openKv())",
|
|
60
|
-
"denoUnstable": [
|
|
104
|
+
"denoUnstable": [
|
|
105
|
+
"kv"
|
|
106
|
+
]
|
|
61
107
|
}
|
|
62
108
|
}
|
package/dist/json/mq.js
CHANGED
|
@@ -21,7 +21,7 @@ var mq_default = {
|
|
|
21
21
|
"yarn",
|
|
22
22
|
"pnpm"
|
|
23
23
|
],
|
|
24
|
-
"dependencies": { "npm:ioredis": "^5.
|
|
24
|
+
"dependencies": { "npm:ioredis": "^5.10.1" },
|
|
25
25
|
"imports": {
|
|
26
26
|
"@fedify/redis": { "RedisMessageQueue": "RedisMessageQueue" },
|
|
27
27
|
"ioredis": { "Redis": "Redis" }
|
|
@@ -38,7 +38,7 @@ var mq_default = {
|
|
|
38
38
|
"yarn",
|
|
39
39
|
"pnpm"
|
|
40
40
|
],
|
|
41
|
-
"dependencies": { "npm:postgres": "^3.4.
|
|
41
|
+
"dependencies": { "npm:postgres": "^3.4.8" },
|
|
42
42
|
"imports": {
|
|
43
43
|
"@fedify/postgres": { "PostgresMessageQueue": "PostgresMessageQueue" },
|
|
44
44
|
"postgres": { "default": "postgres" }
|
|
@@ -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.20.0" },
|
|
59
59
|
"imports": {
|
|
60
60
|
"@fedify/mysql": { "MysqlMessageQueue": "MysqlMessageQueue" },
|
|
61
61
|
"mysql2/promise": { "default": "mysql" }
|
|
@@ -72,8 +72,8 @@ var mq_default = {
|
|
|
72
72
|
"yarn",
|
|
73
73
|
"pnpm"
|
|
74
74
|
],
|
|
75
|
-
"dependencies": { "npm:amqplib": "^0.10.
|
|
76
|
-
"devDependencies": { "npm:@types/amqplib": "^0.10.
|
|
75
|
+
"dependencies": { "npm:amqplib": "^0.10.9" },
|
|
76
|
+
"devDependencies": { "npm:@types/amqplib": "^0.10.8" },
|
|
77
77
|
"imports": {
|
|
78
78
|
"@fedify/amqp": { "AmqpMessageQueue": "AmqpMessageQueue" },
|
|
79
79
|
"amqplib": { "connect": "connect" }
|
package/dist/json/mq.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"pnpm"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"npm:ioredis": "^5.
|
|
28
|
+
"npm:ioredis": "^5.10.1"
|
|
29
29
|
},
|
|
30
30
|
"imports": {
|
|
31
31
|
"@fedify/redis": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"pnpm"
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"npm:postgres": "^3.4.
|
|
53
|
+
"npm:postgres": "^3.4.8"
|
|
54
54
|
},
|
|
55
55
|
"imports": {
|
|
56
56
|
"@fedify/postgres": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"pnpm"
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"npm:mysql2": "^3.
|
|
78
|
+
"npm:mysql2": "^3.20.0"
|
|
79
79
|
},
|
|
80
80
|
"imports": {
|
|
81
81
|
"@fedify/mysql": {
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"pnpm"
|
|
101
101
|
],
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"npm:amqplib": "^0.10.
|
|
103
|
+
"npm:amqplib": "^0.10.9"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"npm:@types/amqplib": "^0.10.
|
|
106
|
+
"npm:@types/amqplib": "^0.10.8"
|
|
107
107
|
},
|
|
108
108
|
"imports": {
|
|
109
109
|
"@fedify/amqp": {
|
package/dist/lib.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { isNotFoundError, runSubCommand } from "./utils.js";
|
|
2
1
|
import { version } from "./deno.js";
|
|
3
2
|
import kv_default from "./json/kv.js";
|
|
4
3
|
import mq_default from "./json/mq.js";
|
|
5
4
|
import pm_default from "./json/pm.js";
|
|
6
5
|
import rt_default from "./json/rt.js";
|
|
6
|
+
import { isNotFoundError } from "./utils.js";
|
|
7
7
|
import { entries, evolve, fromEntries, isObject, map, negate, pipe, throwIf } from "@fxts/core";
|
|
8
8
|
import process from "node:process";
|
|
9
|
-
import
|
|
9
|
+
import $ from "@david/dax";
|
|
10
10
|
import { getLogger } from "@logtape/logtape";
|
|
11
|
+
import { toMerged } from "es-toolkit";
|
|
11
12
|
import { readFileSync } from "node:fs";
|
|
12
13
|
import { mkdir, readdir, writeFile } from "node:fs/promises";
|
|
13
14
|
import { dirname, join as join$1 } from "node:path";
|
|
@@ -20,7 +21,7 @@ const logger = getLogger([
|
|
|
20
21
|
"cli",
|
|
21
22
|
"init"
|
|
22
23
|
]);
|
|
23
|
-
const addFedifyDeps = (json) => Object.fromEntries(Object.entries(json).map(([key, value]) => [key, toMerged(value, { dependencies: {
|
|
24
|
+
const addFedifyDeps = (json) => Object.fromEntries(Object.entries(json).map(([key, value]) => [key, toMerged(value, { dependencies: { ...!NO_INTEGRATIONS.includes(key) && { [`@fedify/${key}`]: PACKAGE_VERSION } } })]));
|
|
24
25
|
const NO_INTEGRATIONS = [
|
|
25
26
|
"in-memory",
|
|
26
27
|
"in-process",
|
|
@@ -88,11 +89,7 @@ const readTemplate = async (templatePath) => {
|
|
|
88
89
|
const getDevCommand = (pm) => pm === "deno" ? "deno task dev" : pm === "bun" ? "bun dev" : `${pm} run dev`;
|
|
89
90
|
async function isCommandAvailable({ checkCommand, outputPattern }) {
|
|
90
91
|
try {
|
|
91
|
-
const { stdout } = await
|
|
92
|
-
null,
|
|
93
|
-
"pipe",
|
|
94
|
-
null
|
|
95
|
-
] });
|
|
92
|
+
const { stdout } = await $`${checkCommand}`.stdout("piped").spawn();
|
|
96
93
|
logger.debug("The stdout of the command {command} is: {stdout}", {
|
|
97
94
|
command: checkCommand,
|
|
98
95
|
stdout
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Router } from "@solidjs/router";
|
|
2
|
+
import { FileRoutes } from "@solidjs/start/router";
|
|
3
|
+
import { Suspense } from "solid-js";
|
|
4
|
+
|
|
5
|
+
export default function App() {
|
|
6
|
+
return (
|
|
7
|
+
<Router root={(props) => <Suspense>{props.children}</Suspense>}>
|
|
8
|
+
<FileRoutes />
|
|
9
|
+
</Router>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @refresh reload
|
|
2
|
+
import { createHandler, StartServer } from "@solidjs/start/server";
|
|
3
|
+
|
|
4
|
+
export default createHandler(() => (
|
|
5
|
+
<StartServer
|
|
6
|
+
document={({ assets, children, scripts }) => (
|
|
7
|
+
<html lang="en">
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="utf-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
|
+
{assets}
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="app">{children}</div>
|
|
15
|
+
{scripts}
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
18
|
+
)}
|
|
19
|
+
/>
|
|
20
|
+
));
|
package/dist/test/create.js
CHANGED
|
@@ -1,43 +1,29 @@
|
|
|
1
|
-
import { CommandError, printErrorMessage, printMessage, product, runSubCommand } from "../utils.js";
|
|
2
1
|
import pm_default from "../json/pm.js";
|
|
2
|
+
import { printErrorMessage, printMessage, product } from "../utils.js";
|
|
3
3
|
import { kvStores, messageQueues } from "../lib.js";
|
|
4
4
|
import webFrameworks from "../webframeworks/mod.js";
|
|
5
5
|
import { filter, isEmpty, pipe, toArray } from "@fxts/core";
|
|
6
6
|
import process from "node:process";
|
|
7
|
-
import
|
|
7
|
+
import $ from "@david/dax";
|
|
8
8
|
import { appendFile, mkdir } from "node:fs/promises";
|
|
9
9
|
import { join as join$1, sep } from "node:path";
|
|
10
|
+
import { values } from "@optique/core";
|
|
10
11
|
//#region src/test/create.ts
|
|
11
12
|
const BANNED_PMS = ["bun", "yarn"];
|
|
12
13
|
const createTestApp = (testDirPrefix, dry) => async (options) => {
|
|
13
14
|
const testDir = join$1(testDirPrefix, ...options);
|
|
14
15
|
const vals = values(testDir.split(sep).slice(-4));
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
stdio: [
|
|
19
|
-
"ignore",
|
|
20
|
-
"pipe",
|
|
21
|
-
"pipe"
|
|
22
|
-
]
|
|
23
|
-
}));
|
|
16
|
+
const result = await $`${toArray(genInitCommand(testDir, dry, options))}`.cwd(join$1(import.meta.dirname, "..", "..")).stdin("null").stdout("piped").stderr("piped").noThrow().spawn();
|
|
17
|
+
await saveOutputs(testDir, result);
|
|
18
|
+
if (result.code === 0) {
|
|
24
19
|
printMessage` Pass: ${vals}`;
|
|
25
20
|
return testDir;
|
|
26
|
-
} catch (error) {
|
|
27
|
-
if (error instanceof CommandError) await saveOutputs(testDir, {
|
|
28
|
-
stdout: error.stdout,
|
|
29
|
-
stderr: error.stderr
|
|
30
|
-
});
|
|
31
|
-
else await saveOutputs(testDir, {
|
|
32
|
-
stdout: "",
|
|
33
|
-
stderr: error instanceof Error ? error.message : String(error)
|
|
34
|
-
});
|
|
35
|
-
printMessage` Fail: ${vals}`;
|
|
36
|
-
printMessage` Check out these files for more details:
|
|
37
|
-
${join$1(testDir, "out.txt")} and
|
|
38
|
-
${join$1(testDir, "err.txt")}\n`;
|
|
39
|
-
return "";
|
|
40
21
|
}
|
|
22
|
+
printMessage` Fail: ${vals}`;
|
|
23
|
+
printMessage` Check out these files for more details: \
|
|
24
|
+
${join$1(testDir, "out.txt")} and \
|
|
25
|
+
${join$1(testDir, "err.txt")}\n`;
|
|
26
|
+
return "";
|
|
41
27
|
};
|
|
42
28
|
function* genInitCommand(testDir, dry, [webFramework, packageManager, kvStore, messageQueue]) {
|
|
43
29
|
yield "deno";
|