@batijs/cli 0.0.448 → 0.0.449

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 (85) hide show
  1. package/dist/boilerplates/@batijs/auth0/files/$.env.js +1 -1
  2. package/dist/boilerplates/@batijs/auth0/files/$README.md.js +1 -1
  3. package/dist/boilerplates/@batijs/authjs/files/$package.json.js +1 -1
  4. package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -1
  5. package/dist/boilerplates/@batijs/aws/files/$package.json.js +1 -1
  6. package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
  7. package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
  8. package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +2 -3
  9. package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +1 -1
  10. package/dist/boilerplates/@batijs/cloudflare/files/$vite.config.ts.js +4 -4
  11. package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
  12. package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
  13. package/dist/boilerplates/@batijs/d1/files/$README.md.js +1 -1
  14. package/dist/boilerplates/@batijs/d1/files/$package.json.js +1 -1
  15. package/dist/boilerplates/@batijs/d1/files/$tsconfig.json.js +1 -1
  16. package/dist/boilerplates/@batijs/d1/files/$wrangler.toml.js +1 -1
  17. package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -1
  18. package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
  19. package/dist/boilerplates/@batijs/drizzle/files/$README.md.js +1 -1
  20. package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +1 -1
  21. package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
  22. package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
  23. package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
  24. package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
  25. package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -1
  26. package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
  27. package/dist/boilerplates/@batijs/hono/files/$vite.config.ts.js +1 -1
  28. package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
  29. package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -1
  30. package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
  31. package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -1
  32. package/dist/boilerplates/@batijs/prettier/files/.prettierrc +3 -0
  33. package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
  34. package/dist/boilerplates/@batijs/prisma/files/$README.md.js +1 -1
  35. package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
  36. package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
  37. package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
  38. package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
  39. package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +2 -4
  40. package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +1 -1
  41. package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
  42. package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
  43. package/dist/boilerplates/@batijs/sentry/files/$package.json.js +1 -1
  44. package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
  45. package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
  46. package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
  47. package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +1 -1
  48. package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
  49. package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
  50. package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
  51. package/dist/boilerplates/@batijs/shared/files/vite.config.ts +4 -15
  52. package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -2
  53. package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
  54. package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
  55. package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
  56. package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
  57. package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +1 -1
  58. package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
  59. package/dist/boilerplates/@batijs/sqlite/files/$README.md.js +1 -1
  60. package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +1 -1
  61. package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
  62. package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
  63. package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
  64. package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
  65. package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
  66. package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +2 -2
  67. package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -1
  68. package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
  69. package/dist/boilerplates/@batijs/vercel/files/$tsconfig.json.js +1 -1
  70. package/dist/boilerplates/@batijs/vercel/files/$vite.config.ts.js +1 -1
  71. package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
  72. package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
  73. package/dist/boilerplates/@batijs/vue/files/$package.json.js +1 -1
  74. package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -1
  75. package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +1 -1
  76. package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +1 -1
  77. package/dist/boilerplates/boilerplates.json +0 -12
  78. package/dist/{chunk-2HJGZ6VH.js → chunk-E3EWYO5M.js} +12316 -12316
  79. package/dist/index.js +10 -32
  80. package/package.json +5 -5
  81. package/dist/boilerplates/@batijs/hattip/files/$package.json.js +0 -121
  82. package/dist/boilerplates/@batijs/hattip/files/entry_aws_lambda.ts +0 -37
  83. package/dist/boilerplates/@batijs/hattip/files/hattip-entry.ts +0 -77
  84. package/dist/boilerplates/@batijs/hattip/types/entry_aws_lambda.d.ts +0 -2
  85. package/dist/boilerplates/@batijs/hattip/types/hattip-entry.d.ts +0 -6
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  cst,
10
10
  export_which,
11
11
  wds
12
- } from "./chunk-2HJGZ6VH.js";
12
+ } from "./chunk-E3EWYO5M.js";
13
13
  import "./chunk-V7W2TXCE.js";
14
14
  import {
15
15
  __commonJS,
@@ -13808,7 +13808,7 @@ Please report this issue to https://github.com/vikejs/bati`
13808
13808
  }
13809
13809
  }
13810
13810
 
13811
- // ../features/dist/chunk-MW3SDQV2.js
13811
+ // ../features/dist/chunk-KDRIUZA5.js
13812
13812
  var features = [
13813
13813
  // Vike
13814
13814
  {
@@ -14139,16 +14139,6 @@ var features = [
14139
14139
  }
14140
14140
  ]
14141
14141
  },
14142
- {
14143
- category: "Server",
14144
- label: "HatTip",
14145
- flag: "hattip",
14146
- image: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAgMjYzIDIyOCIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoyOyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZyBpZD0iSGF0VGlwTG9nbyIgdHJhbnNmb3JtPSJtYXRyaXgoMSwgMCwgMCwgMSwgMC43MTcxMDUsIDcuODg4MTU4KSI+CiAgICA8cGF0aCBkPSJNMzQuNjMsMTYyLjMxMWMtMCwwIC0xMi4xNjEsLTYxLjc4IC0xMi42NzksLTgxLjAxOGMwLC0wIDEuODkyLC01My4zNDIgNzUuMDU3LC02OC41OGMwLDAgNzkuMTcxLC0zMC4wNzYgMTA1LjUzOCwyNC4zMzZjMCwtMCAyMy4wNDMsNTcuMzIzIDI1LjM0LDc2Ljg5Yy0wLC0wIC01NC40NywzOS4wNzMgLTE5MS44MjEsNTQuMzY3bC0xLjQzNSwtNS45OTVaIiBzdHlsZT0iZmlsbDojMjMzNjNmO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPHBhdGggZD0iTTM5LjI3NywxODEuNjkybC0zLjIxMiwtMTMuMzg2YzAsMCAxMjEuOTM0LC0xMS4yMzUgMTkxLjgyMSwtNTQuMzY3bDMuODg3LDE2LjIwNGMtMCwwIC04OS4xLDU5LjYzNyAtMTkyLjQ5Niw1MS41NDlaIiBzdHlsZT0iZmlsbDojMDRiNTc4O2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgPHBhdGggZD0iTTMzLjg1MiwxNTguMDI0bDUuNDI1LDIzLjY2OGMtMCwtMCA4OS4wNTksMTEuMTM3IDE5Mi40OTYsLTUxLjU0OWwtMy44ODcsLTE2LjIwNGwyNC44ODksLTEyLjAwNmMwLDAgNy4yMzEsLTMuOTczIDQuNTI0LDcuNDgxYy0wLC0wIDEuNjM5LDU3Ljk1MyAtMTMwLjI1MSw4Ny4zMTRjLTEyNi43NTQsMjguMjE4IC0xMzEuMzg1LC0zMi41NzUgLTExNy4wOTQsLTM1LjYxM2wyMy44OTgsLTMuMDkxWiIgc3R5bGU9ImZpbGw6IzIzMzY0MDtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICA8L2c+Cjwvc3ZnPg==",
14147
- url: "https://github.com/hattipjs/hattip",
14148
- spectrum: "bleeding_edge",
14149
- tagline: "Like Express, but for the future",
14150
- repo: "hattipjs/hattip"
14151
- },
14152
14142
  // Database
14153
14143
  {
14154
14144
  category: "Database",
@@ -14390,17 +14380,13 @@ var RulesMessage = /* @__PURE__ */ ((RulesMessage2) => {
14390
14380
  RulesMessage2[RulesMessage2["ERROR_MANTINE_R_REACT"] = 6] = "ERROR_MANTINE_R_REACT";
14391
14381
  RulesMessage2[RulesMessage2["ERROR_SHADCN_R_REACT"] = 7] = "ERROR_SHADCN_R_REACT";
14392
14382
  RulesMessage2[RulesMessage2["WARN_SHADCN_R_TAILWINDCSS"] = 8] = "WARN_SHADCN_R_TAILWINDCSS";
14393
- RulesMessage2[RulesMessage2["INFO_HATTIP"] = 9] = "INFO_HATTIP";
14394
- RulesMessage2[RulesMessage2["INFO_STACKBLITZ_COMPAT"] = 10] = "INFO_STACKBLITZ_COMPAT";
14383
+ RulesMessage2[RulesMessage2["INFO_STACKBLITZ_COMPAT"] = 9] = "INFO_STACKBLITZ_COMPAT";
14395
14384
  return RulesMessage2;
14396
14385
  })(RulesMessage || {});
14397
14386
  function requires(message, ifPresent, mustAlsoInclude) {
14398
14387
  const m = Array.from(prepare(mustAlsoInclude));
14399
14388
  return (fts) => fts.has(ifPresent) && !m.every((r2) => fts.has(r2)) && message;
14400
14389
  }
14401
- function includes(message, ifPresent) {
14402
- return (fts) => fts.has(ifPresent) && message;
14403
- }
14404
14390
  function filter(message, callback) {
14405
14391
  return (fts) => callback(fts) && message;
14406
14392
  }
@@ -14417,12 +14403,11 @@ function prepare(fts) {
14417
14403
  var rules_default = [
14418
14404
  requires(0, "Auth", ["Server"]),
14419
14405
  requires(1, "compiled-css", ["react"]),
14420
- includes(9, "hattip"),
14421
14406
  requires(2, "drizzle", ["Server"]),
14422
14407
  requires(3, "Data fetching", ["Server"]),
14423
14408
  filter(4, (fts) => {
14424
14409
  if (fts.has("cloudflare")) {
14425
- if (fts.has("hono") || fts.has("hattip")) {
14410
+ if (fts.has("hono")) {
14426
14411
  return false;
14427
14412
  }
14428
14413
  return fts.has("Server");
@@ -14431,7 +14416,7 @@ var rules_default = [
14431
14416
  }),
14432
14417
  filter(5, (fts) => {
14433
14418
  if (fts.has("aws")) {
14434
- if (fts.has("hono") || fts.has("hattip")) {
14419
+ if (fts.has("hono")) {
14435
14420
  return false;
14436
14421
  }
14437
14422
  return true;
@@ -14456,7 +14441,7 @@ var rules_default = [
14456
14441
  }
14457
14442
  return false;
14458
14443
  }),
14459
- filter(10, (fts) => {
14444
+ filter(9, (fts) => {
14460
14445
  return fts.has("drizzle") || fts.has("sqlite") || fts.has("cloudflare");
14461
14446
  })
14462
14447
  ];
@@ -16929,7 +16914,7 @@ var createDefaultQueryTester = function(query, options) {
16929
16914
  // package.json
16930
16915
  var package_default = {
16931
16916
  name: "@batijs/cli",
16932
- version: "0.0.448",
16917
+ version: "0.0.449",
16933
16918
  type: "module",
16934
16919
  scripts: {
16935
16920
  "check-types": "tsc --noEmit",
@@ -16985,12 +16970,6 @@ function warning(value) {
16985
16970
  value
16986
16971
  };
16987
16972
  }
16988
- function info(value) {
16989
- return {
16990
- type: "info",
16991
- value
16992
- };
16993
- }
16994
16973
  var rulesMessages = {
16995
16974
  [RulesMessage.ERROR_AUTH_R_SERVER]: error(
16996
16975
  `A ${inverse(bold("Server"))} is required when using ${inverse(
@@ -17003,7 +16982,6 @@ var rulesMessages = {
17003
16982
  [RulesMessage.ERROR_MANTINE_R_REACT]: error(
17004
16983
  `${inverse(bold("React"))} is required when using ${inverse(bold("Mantine"))}`
17005
16984
  ),
17006
- [RulesMessage.INFO_HATTIP]: info(`${inverse(bold("HatTip"))} is an experimental project`),
17007
16985
  [RulesMessage.ERROR_DRIZZLE_R_SERVER]: error(
17008
16986
  `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Drizzle"))}`
17009
16987
  ),
@@ -17011,11 +16989,11 @@ var rulesMessages = {
17011
16989
  `A ${inverse(bold("Server"))} is required when using ${inverse(bold("Data fetching"))}`
17012
16990
  ),
17013
16991
  [RulesMessage.ERROR_CLOUDFLARE_R_COMPAT_SERVER]: error(
17014
- `${inverse(bold("Cloudflare"))} is only compatible with ${inverse(bold("Hono"))} or ${inverse(bold("HatTip"))}.
17015
- Choose one of them, or simply remove selected Server`
16992
+ `${inverse(bold("Cloudflare"))} is only compatible with ${inverse(bold("Hono"))}.
16993
+ Choose Hono or remove selected Server`
17016
16994
  ),
17017
16995
  [RulesMessage.ERROR_AWS_R_COMPAT_SERVER]: error(
17018
- `${inverse(bold("AWS"))} deployment is only compatible with ${inverse(bold("Hono"))} or ${inverse(bold("HatTip"))}. Please pick one`
16996
+ `${inverse(bold("AWS"))} deployment is only compatible with ${inverse(bold("Hono"))}`
17019
16997
  ),
17020
16998
  [RulesMessage.ERROR_SHADCN_R_REACT]: error(
17021
16999
  `${inverse(bold("shadcn/ui"))} is only compatible with ${inverse(bold("React"))}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/cli",
3
- "version": "0.0.448",
3
+ "version": "0.0.449",
4
4
  "type": "module",
5
5
  "keywords": [],
6
6
  "description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
@@ -20,12 +20,12 @@
20
20
  "typescript": "^5.8.3",
21
21
  "unplugin-purge-polyfills": "^0.1.0",
22
22
  "vite": "^6.3.5",
23
- "@batijs/build": "0.0.448",
24
- "@batijs/compile": "0.0.448"
23
+ "@batijs/build": "0.0.449",
24
+ "@batijs/compile": "0.0.449"
25
25
  },
26
26
  "dependencies": {
27
- "@batijs/core": "0.0.448",
28
- "@batijs/features": "0.0.448"
27
+ "@batijs/core": "0.0.449",
28
+ "@batijs/features": "0.0.449"
29
29
  },
30
30
  "bin": "./cli.js",
31
31
  "exports": {
@@ -1,121 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as createRequire_BATI_CLI } from 'module';
3
- const require = createRequire_BATI_CLI(import.meta.url);
4
-
5
- import {
6
- ata
7
- } from "../../../../chunk-2HJGZ6VH.js";
8
- import "../../../../chunk-V7W2TXCE.js";
9
- import "../../../../chunk-DHZ7AZKP.js";
10
-
11
- // ../../boilerplates/hattip/dist/files/$package.json.js
12
- var __create = Object.create;
13
- var __defProp = Object.defineProperty;
14
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
- var __getOwnPropNames = Object.getOwnPropertyNames;
16
- var __getProtoOf = Object.getPrototypeOf;
17
- var __hasOwnProp = Object.prototype.hasOwnProperty;
18
- var __commonJS = (cb, mod) => function __require() {
19
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
- };
21
- var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") {
23
- for (let key of __getOwnPropNames(from))
24
- if (!__hasOwnProp.call(to, key) && key !== except)
25
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
- }
27
- return to;
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
- var require_package = __commonJS({
38
- "package.json"(exports, module) {
39
- module.exports = {
40
- name: "@batijs/hattip",
41
- private: true,
42
- version: "0.0.1",
43
- description: "",
44
- type: "module",
45
- scripts: {
46
- "check-types": "tsc --noEmit",
47
- build: "bati-compile-boilerplate"
48
- },
49
- keywords: [],
50
- author: "",
51
- license: "MIT",
52
- devDependencies: {
53
- "@auth/core": "^0.39.1",
54
- "@batijs/compile": "workspace:*",
55
- "@cloudflare/workers-types": "^4.20250614.0",
56
- "@hattip/adapter-aws-lambda": "^0.0.49",
57
- "@hattip/adapter-node": "^0.0.49",
58
- "@hattip/adapter-vercel-edge": "^0.0.49",
59
- "@hattip/core": "^0.0.49",
60
- "@hattip/router": "^0.0.49",
61
- "@hattip/static": "^0.0.49",
62
- "@hattip/vite": "^0.0.49",
63
- "@hattip/walk": "^0.0.49",
64
- "@trpc/server": "^11.4.1",
65
- "@types/aws-lambda": "^8.10.149",
66
- "@types/node": "^20.19.0",
67
- "@universal-middleware/hattip": "^0.4.10",
68
- "cross-env": "^7.0.3",
69
- dotenv: "^16.5.0",
70
- hattip: "^0.0.33",
71
- telefunc: "^0.2.7",
72
- vike: "^0.4.231",
73
- vite: "^6.3.5"
74
- },
75
- dependencies: {
76
- "@batijs/core": "workspace:*"
77
- },
78
- files: [
79
- "dist/"
80
- ],
81
- bati: {
82
- if: {
83
- flag: "hattip"
84
- }
85
- },
86
- exports: {
87
- "./hattip-entry": {
88
- types: "./dist/types/hattip-entry.d.ts"
89
- },
90
- "./entry_aws_lambda": {
91
- types: "./dist/types/entry_aws_lambda.d.ts"
92
- }
93
- },
94
- typesVersions: {
95
- "*": {
96
- "hattip-entry": [
97
- "./dist/types/hattip-entry.d.ts"
98
- ],
99
- entry_aws_lambda: [
100
- "./dist/types/entry_aws_lambda.d.ts"
101
- ]
102
- }
103
- }
104
- };
105
- }
106
- });
107
- async function getPackageJson(props) {
108
- const packageJson = await ata(props, await Promise.resolve().then(() => __toESM(require_package(), 1)).then((x) => x.default));
109
- return packageJson.setScript("dev", {
110
- value: "hattip serve ./hattip-entry.ts --client",
111
- precedence: 20,
112
- warnIfReplaced: true
113
- }).setScript("build", {
114
- value: "cross-env NODE_ENV=production vike build",
115
- precedence: 20,
116
- warnIfReplaced: true
117
- }).removeScript("preview").addDevDependencies(["@hattip/vite", "@hattip/adapter-node"]).addDependencies(["@hattip/core", "@hattip/router", "hattip", "vite", "vike", "@universal-middleware/hattip"]).addDependencies(["dotenv"], props.meta.BATI.has("auth0") || props.meta.BATI.hasDatabase).addDependencies(["@hattip/adapter-vercel-edge"], props.meta.BATI.has("vercel")).addDependencies(["@hattip/adapter-aws-lambda", "@hattip/static", "@hattip/walk"], props.meta.BATI.has("aws")).addDevDependencies(["@types/aws-lambda"], props.meta.BATI.has("aws")).addDevDependencies(["cross-env"], ["build"]);
118
- }
119
- export {
120
- getPackageJson as default
121
- };
@@ -1,37 +0,0 @@
1
- /*{ @if (it.BATI.has("aws")) }*/
2
- /*
3
- entry_aws_lambda.ts
4
-
5
- This file is the entry point for AWS Lambda
6
-
7
- Notes:
8
- * The file name must not have any special characters or dots except for the extension. https://docs.aws.amazon.com/lambda/latest/api/API_CreateFunction.html#API_CreateFunction_RequestSyntax
9
-
10
- */
11
-
12
- import { existsSync } from "node:fs";
13
- import awsLambdaAdapter from "@hattip/adapter-aws-lambda";
14
- import { walk } from "@hattip/walk";
15
- import type { FileInfo } from "@hattip/walk";
16
- import { createStaticMiddleware } from "@hattip/static";
17
- import { createFileReader } from "@hattip/static/fs";
18
- import hattipHandler from "@batijs/hattip/hattip-entry";
19
- import type { Handler, APIGatewayProxyResultV2, APIGatewayProxyEventV2 } from "aws-lambda";
20
-
21
- const root = new URL("./dist/client", import.meta.url);
22
- const staticRootExists = existsSync(root);
23
- const files = staticRootExists ? walk(root) : new Map<string, FileInfo>();
24
- const staticMiddleware = staticRootExists
25
- ? createStaticMiddleware(files, createFileReader(root), {
26
- urlRoot: "/",
27
- })
28
- : undefined;
29
-
30
- const awsHandler = awsLambdaAdapter((ctx) => {
31
- if (hattipHandler === undefined) throw new Error("hattipHandler is undefined");
32
- if (staticMiddleware === undefined) return hattipHandler(ctx);
33
- return staticMiddleware(ctx) || hattipHandler(ctx);
34
- });
35
-
36
- export const handler: Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2> = awsHandler;
37
- /*{ /if }*/
@@ -1,77 +0,0 @@
1
- // BATI.has("auth0") || BATI.hasDatabase
2
- import "dotenv/config";
3
- import { authjsHandler, authjsSessionMiddleware } from "@batijs/authjs/server/authjs-handler";
4
- import { createTodoHandler } from "@batijs/shared-server/server/create-todo-handler";
5
- import { vikeHandler } from "@batijs/shared-server/server/vike-handler";
6
- import { telefuncHandler } from "@batijs/telefunc/server/telefunc-handler";
7
- import { tsRestHandler } from "@batijs/ts-rest/server/ts-rest-handler";
8
- import type { HattipHandler } from "@hattip/core";
9
- import { createRouter } from "@hattip/router";
10
- import vercelAdapter from "@hattip/adapter-vercel-edge";
11
- import { createHandler, createMiddleware } from "@universal-middleware/hattip";
12
- import { dbMiddleware } from "@batijs/shared-db/server/db-middleware";
13
- import { trpcHandler } from "@batijs/trpc/server/trpc-handler";
14
-
15
- const router = createRouter();
16
-
17
- if (BATI.hasDatabase) {
18
- /**
19
- * Make database available in Context as `context.db`
20
- */
21
- router.use(createMiddleware(dbMiddleware)());
22
- }
23
-
24
- if (BATI.has("telefunc")) {
25
- /**
26
- * Telefunc route
27
- *
28
- * @link {@see https://telefunc.com}
29
- **/
30
- router.post("/_telefunc", createHandler(telefuncHandler)());
31
- }
32
-
33
- if (BATI.has("trpc")) {
34
- /**
35
- * tRPC route
36
- *
37
- * @link {@see https://trpc.io/docs/server/adapters/fetch}
38
- **/
39
- router.use("/api/trpc/*", createHandler(trpcHandler)("/api/trpc"));
40
- }
41
-
42
- if (BATI.has("ts-rest")) {
43
- router.use("/api/*", createMiddleware(tsRestHandler)());
44
- }
45
-
46
- if (BATI.has("authjs") || BATI.has("auth0")) {
47
- /**
48
- * Append Auth.js session to context
49
- **/
50
- router.use(createMiddleware(authjsSessionMiddleware)());
51
-
52
- /**
53
- * Auth.js route
54
- * @link {@see https://authjs.dev/getting-started/installation}
55
- **/
56
- router.use("/api/auth/*", createHandler(authjsHandler)());
57
- }
58
-
59
- if (!BATI.has("telefunc") && !BATI.has("trpc") && !BATI.has("ts-rest")) {
60
- router.post("/api/todo/create", createHandler(createTodoHandler)());
61
- }
62
-
63
- /**
64
- * Vike route
65
- *
66
- * @link {@see https://vike.dev}
67
- **/
68
- router.use(createHandler(vikeHandler)());
69
-
70
- const handler: HattipHandler = router.buildHandler();
71
-
72
- //# BATI.has("vercel")
73
- export const GET = vercelAdapter(handler);
74
- //# BATI.has("vercel")
75
- export const POST = vercelAdapter(handler);
76
-
77
- export default BATI.has("vercel") ? (process.env.NODE_ENV === "production" ? undefined : handler) : handler;
@@ -1,2 +0,0 @@
1
- import type { Handler, APIGatewayProxyResultV2, APIGatewayProxyEventV2 } from "aws-lambda";
2
- export declare const handler: Handler<APIGatewayProxyEventV2, APIGatewayProxyResultV2>;
@@ -1,6 +0,0 @@
1
- import "dotenv/config";
2
- import type { HattipHandler } from "@hattip/core";
3
- export declare const GET: import("@hattip/adapter-vercel-edge").VercelEdgeFunction;
4
- export declare const POST: import("@hattip/adapter-vercel-edge").VercelEdgeFunction;
5
- declare const _default: HattipHandler | undefined;
6
- export default _default;