@fedify/init 2.3.0-dev.1377 → 2.3.0-dev.1404

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.
Files changed (51) hide show
  1. package/dist/action/cleanup.js +46 -0
  2. package/dist/action/configs.js +51 -6
  3. package/dist/action/deps.js +1 -1
  4. package/dist/action/mod.js +2 -1
  5. package/dist/action/patch.js +27 -16
  6. package/dist/action/templates.js +3 -2
  7. package/dist/deno.js +1 -1
  8. package/dist/json/deps.js +15 -13
  9. package/dist/json/deps.json +17 -15
  10. package/dist/json/kv.js +3 -3
  11. package/dist/json/kv.json +3 -3
  12. package/dist/json/mq.js +3 -3
  13. package/dist/json/mq.json +3 -3
  14. package/dist/json/oxfmt.js +16 -0
  15. package/dist/json/oxfmt.json +13 -0
  16. package/dist/json/oxlint.js +38 -0
  17. package/dist/json/oxlint.json +37 -0
  18. package/dist/json/vscode-settings.js +11 -10
  19. package/dist/json/vscode-settings.json +11 -10
  20. package/dist/templates/bare-bones/main/bun.ts.tpl +3 -3
  21. package/dist/templates/bare-bones/main/node.ts.tpl +7 -8
  22. package/dist/templates/defaults/federation.oxc.ts.tpl +22 -0
  23. package/dist/templates/defaults/federation.ts.tpl +1 -0
  24. package/dist/templates/elysia/index/bun.ts.tpl +1 -1
  25. package/dist/templates/elysia/index/node.ts.tpl +2 -2
  26. package/dist/templates/express/app.ts.tpl +0 -3
  27. package/dist/templates/hono/app.tsx.tpl +0 -3
  28. package/dist/templates/hono/index/node.ts.tpl +1 -2
  29. package/dist/templates/next/middleware.ts.tpl +3 -3
  30. package/dist/templates/nitro/nitro.config.ts.tpl +2 -2
  31. package/dist/templates/nitro/server/error.ts.tpl +1 -1
  32. package/dist/templates/nitro/server/middleware/federation.ts.tpl +2 -6
  33. package/dist/templates/nitro/server/routes/index.ts.tpl +11 -0
  34. package/dist/test/create.js +30 -1
  35. package/dist/types.d.ts +13 -0
  36. package/dist/utils.js +14 -7
  37. package/dist/webframeworks/astro.js +18 -7
  38. package/dist/webframeworks/bare-bones.js +4 -7
  39. package/dist/webframeworks/const.js +3 -3
  40. package/dist/webframeworks/elysia.js +4 -7
  41. package/dist/webframeworks/express.js +4 -5
  42. package/dist/webframeworks/hono.js +4 -5
  43. package/dist/webframeworks/next.js +9 -4
  44. package/dist/webframeworks/nitro.js +30 -3
  45. package/dist/webframeworks/nuxt.js +4 -4
  46. package/dist/webframeworks/solidstart.js +5 -5
  47. package/dist/webframeworks/utils.js +7 -1
  48. package/package.json +3 -2
  49. package/dist/json/biome.js +0 -16
  50. package/dist/json/biome.json +0 -19
  51. package/dist/templates/defaults/eslint.config.ts.tpl +0 -3
@@ -2,7 +2,7 @@ import { PACKAGE_VERSION, readTemplate } from "../lib.js";
2
2
  import { PACKAGE_MANAGER } from "../const.js";
3
3
  import { npm__types_node_20 } from "../json/deps.js";
4
4
  import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
5
- import { getInstruction } from "./utils.js";
5
+ import { getInstruction, getNodeBunDevToolTasks } from "./utils.js";
6
6
  //#region src/webframeworks/next.ts
7
7
  const nextDescription = {
8
8
  label: "Next.js",
@@ -10,6 +10,11 @@ const nextDescription = {
10
10
  defaultPort: 3e3,
11
11
  init: async ({ packageManager: pm, skipInstall }) => ({
12
12
  command: getNextInitCommand(pm, skipInstall),
13
+ cleanupFiles: pm === "deno" ? [] : ["eslint.config.mjs"],
14
+ cleanupPackageJson: pm === "deno" ? {} : {
15
+ scripts: ["lint"],
16
+ devDependencies: ["eslint", "eslint-config-next"]
17
+ },
13
18
  dependencies: {
14
19
  "@fedify/next": PACKAGE_VERSION,
15
20
  ...pm === "deno" ? defaultDenoDependencies : {}
@@ -20,12 +25,12 @@ const nextDescription = {
20
25
  },
21
26
  federationFile: "federation/index.ts",
22
27
  loggingFile: "logging.ts",
28
+ format: { ignorePatterns: [".next/**"] },
23
29
  files: {
24
30
  "instrumentation.ts": await readTemplate("next/instrumentation.ts"),
25
- "middleware.ts": await readTemplate("next/middleware.ts"),
26
- ...pm !== "deno" && { "eslint.config.ts": await readTemplate("defaults/eslint.config.ts") }
31
+ "middleware.ts": await readTemplate("next/middleware.ts")
27
32
  },
28
- tasks: pm !== "deno" ? { "lint": "eslint ." } : {},
33
+ tasks: getNodeBunDevToolTasks(pm),
29
34
  instruction: getInstruction(pm, 3e3)
30
35
  })
31
36
  };
@@ -1,7 +1,7 @@
1
1
  import { PACKAGE_VERSION, readTemplate } from "../lib.js";
2
2
  import { PACKAGE_MANAGER } from "../const.js";
3
3
  import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
4
- import { getInstruction } from "./utils.js";
4
+ import { getInstruction, getNodeBunDevToolTasks } from "./utils.js";
5
5
  //#region src/webframeworks/nitro.ts
6
6
  const nitroDescription = {
7
7
  label: "Nitro",
@@ -9,6 +9,12 @@ const nitroDescription = {
9
9
  defaultPort: 3e3,
10
10
  init: async ({ packageManager: pm, testMode }) => ({
11
11
  command: getNitroInitCommand(pm),
12
+ cleanupFiles: pm === "deno" ? [] : ["server/routes/index.ts"],
13
+ cleanupPackageJson: pm === "deno" ? {} : { devDependencies: [
14
+ "eslint",
15
+ "eslint-config-unjs",
16
+ "prettier"
17
+ ] },
12
18
  dependencies: {
13
19
  "@fedify/h3": PACKAGE_VERSION,
14
20
  ...pm === "deno" && defaultDenoDependencies
@@ -16,15 +22,36 @@ const nitroDescription = {
16
22
  devDependencies: defaultDevDependencies,
17
23
  federationFile: "server/federation.ts",
18
24
  loggingFile: "server/logging.ts",
25
+ format: { ignorePatterns: [".output/**"] },
19
26
  env: testMode ? { HOST: "127.0.0.1" } : {},
20
27
  files: {
21
28
  "server/plugins/logging.ts": await readTemplate("nitro/server/plugins/logging.ts"),
22
29
  "server/middleware/federation.ts": await readTemplate("nitro/server/middleware/federation.ts"),
23
30
  "server/error.ts": await readTemplate("nitro/server/error.ts"),
24
31
  "nitro.config.ts": await readTemplate("nitro/nitro.config.ts"),
25
- ...pm !== "deno" && { "eslint.config.ts": await readTemplate("defaults/eslint.config.ts") }
32
+ ...pm === "deno" ? {} : { "server/routes/index.ts": await readTemplate("nitro/server/routes/index.ts") }
26
33
  },
27
- tasks: pm !== "deno" ? { "lint": "eslint ." } : {},
34
+ compilerOptions: pm === "deno" ? void 0 : {
35
+ target: "ESNext",
36
+ module: "ESNext",
37
+ moduleResolution: "Bundler",
38
+ jsx: "preserve",
39
+ jsxFactory: "h",
40
+ jsxFragmentFactory: "Fragment",
41
+ strict: true,
42
+ noEmit: true,
43
+ skipLibCheck: true,
44
+ resolveJsonModule: true,
45
+ allowSyntheticDefaultImports: true,
46
+ forceConsistentCasingInFileNames: true,
47
+ noImplicitReturns: true,
48
+ noFallthroughCasesInSwitch: true,
49
+ useUnknownInCatchVariables: true,
50
+ noUnusedLocals: true,
51
+ lib: ["ESNext", "DOM"],
52
+ baseUrl: "."
53
+ },
54
+ tasks: getNodeBunDevToolTasks(pm),
28
55
  instruction: getInstruction(pm, 3e3)
29
56
  })
30
57
  };
@@ -2,7 +2,7 @@ import { PACKAGE_VERSION, readTemplate } from "../lib.js";
2
2
  import { PACKAGE_MANAGER } from "../const.js";
3
3
  import { npm__types_node_25, npm_typescript } from "../json/deps.js";
4
4
  import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
5
- import { getInstruction } from "./utils.js";
5
+ import { getInstruction, getNodeBunDevToolTasks } from "./utils.js";
6
6
  //#region src/webframeworks/nuxt.ts
7
7
  const nuxtDescription = {
8
8
  label: "Nuxt",
@@ -19,13 +19,13 @@ const nuxtDescription = {
19
19
  federationFile: "server/federation.ts",
20
20
  loggingFile: "server/logging.ts",
21
21
  loggingTemplate: "nuxt/server/logging.ts",
22
+ format: { ignorePatterns: [".output/**"] },
22
23
  env: testMode ? { HOST: "127.0.0.1" } : {},
23
24
  files: {
24
25
  "nuxt.config.ts": await readTemplate("nuxt/nuxt.config.ts"),
25
- "server/plugins/logging.ts": await readTemplate("nuxt/server/plugins/logging.ts"),
26
- ...pm !== "deno" && { "eslint.config.ts": await readTemplate("defaults/eslint.config.ts") }
26
+ "server/plugins/logging.ts": await readTemplate("nuxt/server/plugins/logging.ts")
27
27
  },
28
- tasks: pm !== "deno" ? { "lint": "eslint ." } : {},
28
+ tasks: getNodeBunDevToolTasks(pm),
29
29
  instruction: getInstruction(pm, 3e3)
30
30
  })
31
31
  };
@@ -2,7 +2,7 @@ import { PACKAGE_VERSION, readTemplate } from "../lib.js";
2
2
  import { PACKAGE_MANAGER } from "../const.js";
3
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";
4
4
  import { defaultDenoDependencies, defaultDevDependencies } from "./const.js";
5
- import { getInstruction, pmToRt } from "./utils.js";
5
+ import { getInstruction, nodeBunDevToolTasks, pmToRt } from "./utils.js";
6
6
  //#region src/webframeworks/solidstart.ts
7
7
  const NPM_SOLIDSTART = `npm:@solidjs/start@${npm__solidjs_start}`;
8
8
  const solidstartDescription = {
@@ -18,14 +18,14 @@ const solidstartDescription = {
18
18
  },
19
19
  federationFile: "src/federation.ts",
20
20
  loggingFile: "src/logging.ts",
21
+ format: { ignorePatterns: [".solid/**", ".vinxi/**"] },
21
22
  files: {
22
23
  "app.config.ts": (await readTemplate("solidstart/app.config.ts")).replace(/\/\* preset \*\//, pm === "deno" ? "deno-server" : "node-server"),
23
24
  "src/app.tsx": await readTemplate("solidstart/src/app.tsx"),
24
25
  "src/entry-client.tsx": await readTemplate("solidstart/src/entry-client.tsx"),
25
26
  "src/entry-server.tsx": await readTemplate("solidstart/src/entry-server.tsx"),
26
27
  "src/routes/index.tsx": await readTemplate("solidstart/src/routes/index.tsx"),
27
- "src/middleware/index.ts": await readTemplate("solidstart/src/middleware/index.ts"),
28
- ...pm !== "deno" && { "eslint.config.ts": await readTemplate("defaults/eslint.config.ts") }
28
+ "src/middleware/index.ts": await readTemplate("solidstart/src/middleware/index.ts")
29
29
  },
30
30
  compilerOptions: pm === "deno" ? void 0 : {
31
31
  target: "ESNext",
@@ -76,13 +76,13 @@ const TASKS = {
76
76
  dev: "bunx vinxi dev",
77
77
  build: "bunx vinxi build",
78
78
  start: "bunx vinxi start",
79
- lint: "eslint ."
79
+ ...nodeBunDevToolTasks
80
80
  },
81
81
  node: {
82
82
  dev: "vinxi dev",
83
83
  build: "vinxi build",
84
84
  start: "dotenvx run -- vinxi start",
85
- lint: "eslint ."
85
+ ...nodeBunDevToolTasks
86
86
  }
87
87
  };
88
88
  //#endregion
@@ -1,6 +1,12 @@
1
1
  import { getDevCommand } from "../lib.js";
2
2
  import { commandLine, message } from "@optique/core/message";
3
3
  //#region src/webframeworks/utils.ts
4
+ const nodeBunDevToolTasks = {
5
+ format: "oxfmt",
6
+ "format:check": "oxfmt --check",
7
+ lint: "oxlint ."
8
+ };
9
+ const getNodeBunDevToolTasks = (pm) => pm === "deno" ? {} : nodeBunDevToolTasks;
4
10
  /**
5
11
  * Generates the post-initialization instruction message that shows
6
12
  * the user how to start the dev server and look up an actor.
@@ -26,4 +32,4 @@ Then, try to look up an actor from your server:
26
32
  */
27
33
  const pmToRt = (pm) => pm !== "deno" && pm !== "bun" ? "node" : pm;
28
34
  //#endregion
29
- export { getInstruction, pmToRt };
35
+ export { getInstruction, getNodeBunDevToolTasks, nodeBunDevToolTasks, pmToRt };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/init",
3
- "version": "2.3.0-dev.1377+2995e82c",
3
+ "version": "2.3.0-dev.1404+275c2d11",
4
4
  "description": "Project initializer for Fedify",
5
5
  "keywords": [
6
6
  "fedify",
@@ -56,7 +56,8 @@
56
56
  "@optique/run": "^1.1.0",
57
57
  "chalk": "^5.6.2",
58
58
  "es-toolkit": "1.46.1",
59
- "inquirer-toggle": "^1.0.1"
59
+ "inquirer-toggle": "^1.0.1",
60
+ "jsonc-parser": "^3.3.1"
60
61
  },
61
62
  "devDependencies": {
62
63
  "@types/node": "^22.17.0",
@@ -1,16 +0,0 @@
1
- //#region src/json/biome.json
2
- var biome_default = {
3
- $schema: "https://biomejs.dev/schemas/2.4.9/schema.json",
4
- assist: {
5
- "enabled": true,
6
- "actions": { "source": { "organizeImports": "on" } }
7
- },
8
- formatter: {
9
- "enabled": true,
10
- "indentStyle": "space",
11
- "indentWidth": 2
12
- },
13
- linter: { "enabled": false }
14
- };
15
- //#endregion
16
- export { biome_default as default };
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "https://biomejs.dev/schemas/2.4.9/schema.json",
3
- "assist": {
4
- "enabled": true,
5
- "actions": {
6
- "source": {
7
- "organizeImports": "on"
8
- }
9
- }
10
- },
11
- "formatter": {
12
- "enabled": true,
13
- "indentStyle": "space",
14
- "indentWidth": 2
15
- },
16
- "linter": {
17
- "enabled": false
18
- }
19
- }
@@ -1,3 +0,0 @@
1
- import fedifyLint from "@fedify/lint";
2
-
3
- export default fedifyLint;