@bakery-framework/core 2.0.0-rc.2 → 2.0.0-rc.4

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/core/index.ts +22 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakery-framework/core",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.4",
4
4
  "description": "Bakery framework core: handlers, router, config, session, caches, logger, compiler.",
5
5
  "keywords": [
6
6
  "bakery",
package/src/core/index.ts CHANGED
@@ -1,3 +1,25 @@
1
+ /**
2
+ * The ambients travel with the import.
3
+ *
4
+ * Erased at runtime: a type-only import with no bindings adds no module
5
+ * edge, only the declarations. What it buys is that anything importing from
6
+ * `@bakery-framework/core` gets the `Request` augmentation (`session`,
7
+ * `startNs`), `Bakery`, `AppConfig` and the JSX namespace, without the
8
+ * consuming tsconfig having to name `global.d.ts` in `files`.
9
+ *
10
+ * Before this, `getRequest().session` was an error in any project that did
11
+ * not, which is most of them: the ambients reach an app through the `files`
12
+ * list of `tsconfig.server.json`, and that list is replaced wholesale the
13
+ * moment an app writes its own `files`, or bypassed entirely when an editor
14
+ * resolves a `.vue` file to a project that does not include it. Shipping
15
+ * `getRequest()` while leaving its return type dependent on that wiring
16
+ * fixed how to reach the request and left what it is unresolved.
17
+ *
18
+ * `plugin-vue/src/vue.d.ts` has used exactly this line for the same reason.
19
+ */
20
+ import type {} from '../global.d.ts'
21
+ import type {} from '../shared.d.ts'
22
+ import type {} from '../types.d.ts'
1
23
  import { Logger, log } from '../logger'
2
24
  import { definePlugin as _definePlugin } from '../plugins/types'
3
25
  import { Case, is, Math2, match, Try } from '../utils/common'