@bakery-framework/core 1.0.0 → 1.1.0

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 CHANGED
@@ -44,7 +44,7 @@ Pages are rendered server-side through Bakery's own `createElement`, so an app's
44
44
 
45
45
  ```json
46
46
  {
47
- "extends": "@bakery-framework/core/tsconfig.app.json",
47
+ "extends": "@bakery-framework/core/tsconfig.server.json",
48
48
  "compilerOptions": {
49
49
  "jsx": "react",
50
50
  "jsxFactory": "createElement",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakery-framework/core",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Bakery framework core: handlers, router, config, session, caches, logger, compiler.",
5
5
  "keywords": [
6
6
  "bakery",
@@ -20,7 +20,7 @@
20
20
  "url": "git+https://github.com/obillekyle/bakery.git",
21
21
  "directory": "packages/core"
22
22
  },
23
- "homepage": "https://github.com/obillekyle/bakery#readme",
23
+ "homepage": "https://bakery.okyle.dev",
24
24
  "bugs": "https://github.com/obillekyle/bakery/issues",
25
25
  "publishConfig": {
26
26
  "access": "public"
@@ -55,11 +55,15 @@
55
55
  "./router": "./src/router.ts",
56
56
  "./utils/shared-pool": "./src/utils/shared-pool.ts",
57
57
  "./global.d.ts": "./src/global.d.ts",
58
- "./core/bakery": "./src/core/bakery.ts"
58
+ "./core/bakery": "./src/core/bakery.ts",
59
+ "./tsconfig.server.json": "./tsconfig.server.json",
60
+ "./tsconfig.vue.json": "./tsconfig.vue.json"
59
61
  },
60
62
  "files": [
61
63
  "src",
62
64
  "tsconfig.app.json",
65
+ "tsconfig.server.json",
66
+ "tsconfig.vue.json",
63
67
  "!src/**/*.test.ts",
64
68
  "!src/tests"
65
69
  ],
package/tsconfig.app.json CHANGED
@@ -1,26 +1,36 @@
1
1
  {
2
2
  "$comment": [
3
- "Base tsconfig for applications built on Bakery. Extend it:",
3
+ "**Client-side code** the plain `.ts` under your source root that ends up",
4
+ "in the browser bundle. Extend it:",
4
5
  " { \"extends\": \"@bakery-framework/core/tsconfig.app.json\" }",
5
6
  "",
6
- "The JSX settings are not optional. Bakery renders JSX server-side to a",
7
- "string through its own `createElement`, so without these Bun falls back to",
8
- "the automatic runtime and every .tsx page fails with",
9
- "'Cannot find module react/jsx-dev-runtime'."
7
+ "BREAKING, 2.0.0: this file used to be the single config every app",
8
+ "extended, and it carried `bun-types` and the JSX settings. It is now the",
9
+ "*browser* half of a three-way split server code extends",
10
+ "tsconfig.server.json, Vue SFCs extend tsconfig.vue.json.",
11
+ "",
12
+ "**`types` is deliberately empty.** That is the entire reason the split",
13
+ "exists: without `bun-types` there is no `Bun` global, so `Bun.hash()` in a",
14
+ "file bound for the browser is a type error instead of a runtime one. Adding",
15
+ "bun-types back here re-opens the hole quietly.",
16
+ "",
17
+ "No JSX settings either. `.tsx` is server-rendered in Bakery and belongs to",
18
+ "tsconfig.server.json; a `.tsx` file compiled under this config would pick up",
19
+ "the automatic runtime and fail at request time while typechecking clean."
20
+ ],
21
+ "_files_note": "client/globals.d.ts declares the globals the browser runtime binds onto globalThis (request, escapeHTML, is, Try, Case, match, …). It states each as `typeof import(...)` of the isomorphic module that implements it, so the declaration cannot drift from the value. Those modules are pure by convention — no Bun, no node builtins, no DOM — which is what makes them safe to pull into a project that has no bun-types.",
22
+ "files": [
23
+ "./src/client/globals.d.ts",
24
+ "./src/shared.d.ts",
25
+ "./src/types.d.ts"
10
26
  ],
11
- "_files_note": "Paths in an extended config resolve relative to THIS file, so extending packages inherit core ambient declarations (createElement, Fragment, the JSX namespace, Bakery, AppConfig) without naming a node_modules path. shared.d.ts carries the handful of types the browser runtime needs too (MapOf, Wrapped, JsonResponse, ISFunction) and is declared there exactly once.",
12
- "files": ["./src/global.d.ts", "./src/shared.d.ts", "./src/types.d.ts"],
13
27
  "compilerOptions": {
14
28
  "lib": ["ESNext", "DOM", "DOM.Iterable"],
15
29
  "target": "ESNext",
16
30
  "module": "Preserve",
17
31
  "moduleDetection": "force",
18
32
  "moduleResolution": "bundler",
19
- "types": ["bun-types"],
20
-
21
- "jsx": "react",
22
- "jsxFactory": "createElement",
23
- "jsxFragmentFactory": "Fragment",
33
+ "types": [],
24
34
 
25
35
  "allowImportingTsExtensions": true,
26
36
  "verbatimModuleSyntax": true,
@@ -0,0 +1,41 @@
1
+ {
2
+ "$comment": [
3
+ "Server-side code: API routes, `.tsx` pages, server.config.ts, schema.ts,",
4
+ "orm/. Extend it:",
5
+ " { \"extends\": \"@bakery-framework/core/tsconfig.server.json\" }",
6
+ "",
7
+ "This is the only one of the three that gets `bun-types`, and that is the",
8
+ "point of the split: `Bun.*` is a type error in browser code, because",
9
+ "browser code cannot call it. Before the split every app extended a single",
10
+ "config and `Bun.hash()` typechecked happily inside a file destined for the",
11
+ "browser bundle, where it fails at runtime.",
12
+ "",
13
+ "The JSX settings are not optional. Bakery renders JSX server-side to a",
14
+ "string through its own `createElement`, so without these Bun falls back to",
15
+ "the automatic runtime and every .tsx page fails with",
16
+ "'Cannot find module react/jsx-dev-runtime'."
17
+ ],
18
+ "_files_note": "Paths in an extended config resolve relative to THIS file, so extending packages inherit core's server ambient declarations (createElement, Fragment, the JSX namespace, Bakery, AppConfig) without naming a node_modules path. shared.d.ts carries the handful of types the browser needs too and is declared exactly once.",
19
+ "files": ["./src/global.d.ts", "./src/shared.d.ts", "./src/types.d.ts"],
20
+ "compilerOptions": {
21
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
22
+ "target": "ESNext",
23
+ "module": "Preserve",
24
+ "moduleDetection": "force",
25
+ "moduleResolution": "bundler",
26
+ "types": ["bun-types"],
27
+
28
+ "jsx": "react",
29
+ "jsxFactory": "createElement",
30
+ "jsxFragmentFactory": "Fragment",
31
+
32
+ "allowImportingTsExtensions": true,
33
+ "verbatimModuleSyntax": true,
34
+ "noEmit": true,
35
+ "resolveJsonModule": true,
36
+ "strict": true,
37
+ "skipLibCheck": true,
38
+ "esModuleInterop": true,
39
+ "forceConsistentCasingInFileNames": true
40
+ }
41
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$comment": [
3
+ "Vue single-file components. Extend it:",
4
+ " { \"extends\": \"@bakery-framework/core/tsconfig.vue.json\" }",
5
+ "",
6
+ "SFCs get `bun-types` like server code does, because @bakery-framework/",
7
+ "plugin-vue compiles and can render them on the server — a `<script>` block",
8
+ "is not browser-only the way a plain `.ts` under the source root is.",
9
+ "",
10
+ "**`tsc` cannot parse `.vue`.** This config is for `vue-tsc`, which wraps tsc",
11
+ "and understands SFCs. Pointing plain `tsc` at a project whose `include`",
12
+ "matches `**/*.vue` gets you either silence or a parse error, depending on",
13
+ "version — neither of which is a typecheck.",
14
+ "",
15
+ "`jsx: preserve` rather than Bakery's classic runtime: inside an SFC, JSX (if",
16
+ "used at all) belongs to Vue's own transform, not to `createElement`."
17
+ ],
18
+ "_files_note": "Server ambients, same as tsconfig.server.json — an SFC can reach Bakery, AppConfig and the JSX namespace.",
19
+ "files": ["./src/global.d.ts", "./src/shared.d.ts", "./src/types.d.ts"],
20
+ "compilerOptions": {
21
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
22
+ "target": "ESNext",
23
+ "module": "Preserve",
24
+ "moduleDetection": "force",
25
+ "moduleResolution": "bundler",
26
+ "types": ["bun-types"],
27
+
28
+ "jsx": "preserve",
29
+
30
+ "allowImportingTsExtensions": true,
31
+ "verbatimModuleSyntax": true,
32
+ "noEmit": true,
33
+ "resolveJsonModule": true,
34
+ "strict": true,
35
+ "skipLibCheck": true,
36
+ "esModuleInterop": true,
37
+ "forceConsistentCasingInFileNames": true
38
+ }
39
+ }