@codefast/theme 0.8.3 → 0.9.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/CHANGELOG.md +47 -0
- package/README.md +4 -3
- package/dist/appearance-context.d.ts +1 -1
- package/dist/appearance-provider.d.ts +1 -1
- package/dist/appearance-provider.js +5 -5
- package/dist/appearance-script.d.ts +1 -1
- package/dist/appearance-script.js +2 -2
- package/dist/color-scheme.d.ts +1 -1
- package/dist/color-scheme.js +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/dom.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +6 -6
- package/dist/use-appearance.d.ts +1 -1
- package/dist/use-appearance.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @codefast/theme
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#976](https://github.com/codefastlabs/codefast/pull/976) `engines.node` is now `>=24.0.0`, up from `>=22.12.0`, and Node 22 is no longer supported. Node 24.0.0 is the first
|
|
8
|
+
release with explicit resource management built in (`using`, `await using`, `DisposableStack`, `AsyncDisposableStack`,
|
|
9
|
+
`SuppressedError`) and all of ES2025, so the packages use both as the platform ships them instead of shimming them for
|
|
10
|
+
an older line, and the CI matrix runs the unit suite on 24.0.0 itself. Move to Node 24, or stay on the current minor
|
|
11
|
+
while a deployment still runs Node 22.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#977](https://github.com/codefastlabs/codefast/pull/977) The README states the browser floor: Chrome and Edge 136, Firefox 136, and Safari 18.4 or later, the first releases that
|
|
16
|
+
ship every ES2025 builtin. `@codefast/di`'s README also says what a browser program without explicit resource management
|
|
17
|
+
does: it keeps `skipLibCheck` on and calls `dispose()` instead of `await using`.
|
|
18
|
+
|
|
19
|
+
- [#965](https://github.com/codefastlabs/codefast/pull/965) `README.md` now states TypeScript 7 or later as the floor for the package's types — the one compiler every `@codefast/*`
|
|
20
|
+
package is built and checked with. No code or declaration changed.
|
|
21
|
+
|
|
22
|
+
## 0.8.4
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#892](https://github.com/codefastlabs/codefast/pull/892) [`4c97c5b`](https://github.com/codefastlabs/codefast/commit/4c97c5b8c2314f25ee9df7eac5a4b5dd723d6d90) Thanks [@thevuong](https://github.com/thevuong)! - Lower the monorepo's Node floor from 24 to 22.12, so the packages install and run on the active Node 22 LTS line.
|
|
27
|
+
|
|
28
|
+
`engines.node` becomes `>=22.12.0` across every package — the floor the shared toolchain (oxlint, Vite, Vitest, TanStack
|
|
29
|
+
Start) already requires. Development stays on the latest Node (`.node-version`) for speed, and a CI matrix exercises the
|
|
30
|
+
floor and the active LTS directly, so the floor is a contract CI proves rather than one everyone has to run.
|
|
31
|
+
`@types/node` is pinned to the floor's major (`^22`), with a workspace override holding the whole tree there so a dev
|
|
32
|
+
tool's `@types/node: "*"` peer can no longer pull a newer major and mask an API the floor lacks. The floor stays
|
|
33
|
+
mechanical, not advisory: `@codefast/di` keeps its own `Map` upsert helpers rather than the ES2025
|
|
34
|
+
`Map.prototype.getOrInsert` (which would raise the floor to 26) and its `lib` stays `ES2024`. `@codefast/cli`'s mirror
|
|
35
|
+
step now calls the `node:path` functions directly instead of aliasing them, which the floor's types correctly flag as
|
|
36
|
+
unbound methods.
|
|
37
|
+
|
|
38
|
+
The shared `@codefast/typescript-config` presets pin `lib` and `target` to `ES2024` (was `ESNext`) so the compiler's
|
|
39
|
+
ECMAScript surface matches the Node floor: an ES2025 builtin such as `Map.prototype.getOrInsert` now fails to type-check
|
|
40
|
+
rather than compiling and crashing on Node 22.12. `@codefast/di` and `@codefast/di-testing` already pinned `lib` and are
|
|
41
|
+
unchanged.
|
|
42
|
+
|
|
43
|
+
Internal subpath imports move from a `#/` prefix to a bare `#` (`#core/token`, not `#/core/token`), and the
|
|
44
|
+
`package.json#imports` keys become `#*`/`#tests/*`/`#examples/*` to match. Node's native ESM resolver rejects a
|
|
45
|
+
`#/`-prefixed specifier with `ERR_INVALID_MODULE_SPECIFIER` on the whole Node 22 line (and on Node 24 before 24.14), and
|
|
46
|
+
each package ships those specifiers verbatim inside its published `dist/*.js` for a consumer's Node to resolve — so this
|
|
47
|
+
rename is what actually lets the packages import on the new floor. Purely internal: a consumer's own import paths are
|
|
48
|
+
unchanged.
|
|
49
|
+
|
|
3
50
|
## 0.8.3
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -34,9 +34,10 @@ pnpm add @codefast/theme
|
|
|
34
34
|
# yarn add @codefast/theme
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
`react` and `react-dom` 19 or later are peer dependencies, and `@codefast/theme` requires Node.js 24 or later
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
`react` and `react-dom` 19 or later are peer dependencies, and `@codefast/theme` requires Node.js 24 or later, Chrome
|
|
38
|
+
and Edge 136, Firefox 136, or Safari 18.4 or later in the browser ([support policy](../../SUPPORT.md#browsers)), and
|
|
39
|
+
TypeScript 7 or later for its types. The package is published on 0.x and versioned on its own track: breaking changes
|
|
40
|
+
ship as minor versions, so pin the minor version when you need stability.
|
|
40
41
|
|
|
41
42
|
## Quick start
|
|
42
43
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { startTransition, useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useOptimistic, useRef, useState, useSyncExternalStore, } from "react";
|
|
3
|
-
import { appearanceSchema } from "
|
|
4
|
-
import { AppearanceContext } from "
|
|
5
|
-
import { getSystemColorScheme } from "
|
|
6
|
-
import { DEFAULT_APPEARANCE, DEFAULT_COLOR_SCHEME, MEDIA, STORAGE_KEY, SYNC_CHANNEL } from "
|
|
7
|
-
import { applyColorScheme, suppressTransitions } from "
|
|
3
|
+
import { appearanceSchema } from "#appearance";
|
|
4
|
+
import { AppearanceContext } from "#appearance-context";
|
|
5
|
+
import { getSystemColorScheme } from "#color-scheme";
|
|
6
|
+
import { DEFAULT_APPEARANCE, DEFAULT_COLOR_SCHEME, MEDIA, STORAGE_KEY, SYNC_CHANNEL } from "#constants";
|
|
7
|
+
import { applyColorScheme, suppressTransitions } from "#dom";
|
|
8
8
|
/* -----------------------------------------------------------------------------
|
|
9
9
|
* System Color Scheme Subscription
|
|
10
10
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { appearances, appearanceSchema } from "
|
|
3
|
-
import { DEFAULT_APPEARANCE, MEDIA, STORAGE_KEY } from "
|
|
2
|
+
import { appearances, appearanceSchema } from "#appearance";
|
|
3
|
+
import { DEFAULT_APPEARANCE, MEDIA, STORAGE_KEY } from "#constants";
|
|
4
4
|
/* JSON.stringify does not escape </script>, so we replace the three characters that
|
|
5
5
|
* can form a closing tag: < > /. Unicode escapes are valid JS and safe in HTML. */
|
|
6
6
|
function toScriptSafe(value) {
|
package/dist/color-scheme.d.ts
CHANGED
package/dist/color-scheme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_COLOR_SCHEME, MEDIA } from "
|
|
1
|
+
import { DEFAULT_COLOR_SCHEME, MEDIA } from "#constants";
|
|
2
2
|
// ── Color Scheme Resolution ──────────────────────────────────────────────────────────────────────────────────────────
|
|
3
3
|
/**
|
|
4
4
|
* Detects the OS color scheme preference.
|
package/dist/constants.d.ts
CHANGED
package/dist/dom.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
* - **`@codefast/theme/color-scheme` / `@codefast/theme/dom`**: `getSystemColorScheme`, `applyColorScheme`, `suppressTransitions`.
|
|
12
12
|
* - **`@codefast/theme/appearance-context`**: `AppearanceContext` for rare custom wiring.
|
|
13
13
|
*/
|
|
14
|
-
export type { Appearance, AppearanceContextValue, ColorScheme } from "
|
|
15
|
-
export { appearances, appearanceSchema } from "
|
|
16
|
-
export { DEFAULT_APPEARANCE, DEFAULT_COLOR_SCHEME } from "
|
|
17
|
-
export { AppearanceProvider } from "
|
|
18
|
-
export type { AppearanceProviderProps } from "
|
|
19
|
-
export { useAppearance } from "
|
|
20
|
-
export { AppearanceScript } from "
|
|
21
|
-
export type { AppearanceScriptProps } from "
|
|
22
|
-
export { resolveColorScheme } from "
|
|
14
|
+
export type { Appearance, AppearanceContextValue, ColorScheme } from "#appearance";
|
|
15
|
+
export { appearances, appearanceSchema } from "#appearance";
|
|
16
|
+
export { DEFAULT_APPEARANCE, DEFAULT_COLOR_SCHEME } from "#constants";
|
|
17
|
+
export { AppearanceProvider } from "#appearance-provider";
|
|
18
|
+
export type { AppearanceProviderProps } from "#appearance-provider";
|
|
19
|
+
export { useAppearance } from "#use-appearance";
|
|
20
|
+
export { AppearanceScript } from "#appearance-script";
|
|
21
|
+
export type { AppearanceScriptProps } from "#appearance-script";
|
|
22
|
+
export { resolveColorScheme } from "#color-scheme";
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
* - **`@codefast/theme/color-scheme` / `@codefast/theme/dom`**: `getSystemColorScheme`, `applyColorScheme`, `suppressTransitions`.
|
|
12
12
|
* - **`@codefast/theme/appearance-context`**: `AppearanceContext` for rare custom wiring.
|
|
13
13
|
*/
|
|
14
|
-
export { appearances, appearanceSchema } from "
|
|
14
|
+
export { appearances, appearanceSchema } from "#appearance";
|
|
15
15
|
// Constants
|
|
16
|
-
export { DEFAULT_APPEARANCE, DEFAULT_COLOR_SCHEME } from "
|
|
16
|
+
export { DEFAULT_APPEARANCE, DEFAULT_COLOR_SCHEME } from "#constants";
|
|
17
17
|
// Provider & Hook (use `@codefast/theme/appearance-context` for `AppearanceContext`)
|
|
18
|
-
export { AppearanceProvider } from "
|
|
19
|
-
export { useAppearance } from "
|
|
18
|
+
export { AppearanceProvider } from "#appearance-provider";
|
|
19
|
+
export { useAppearance } from "#use-appearance";
|
|
20
20
|
// Script (FOUC prevention)
|
|
21
|
-
export { AppearanceScript } from "
|
|
21
|
+
export { AppearanceScript } from "#appearance-script";
|
|
22
22
|
// Resolution: `getSystemColorScheme` lives under `@codefast/theme/color-scheme`
|
|
23
|
-
export { resolveColorScheme } from "
|
|
23
|
+
export { resolveColorScheme } from "#color-scheme";
|
package/dist/use-appearance.d.ts
CHANGED
package/dist/use-appearance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { use } from "react";
|
|
2
|
-
import { AppearanceContext } from "
|
|
2
|
+
import { AppearanceContext } from "#appearance-context";
|
|
3
3
|
// ── Hook ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
4
4
|
/**
|
|
5
5
|
* Hook to access appearance context.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Appearance management for React 19 with HIG-inspired vocabulary - optimistic updates, cross-tab sync, and FOUC-free SSR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dark-mode",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"module": "./dist/index.js",
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
36
|
"imports": {
|
|
37
|
-
"
|
|
37
|
+
"#*": {
|
|
38
38
|
"types": "./dist/*.d.ts",
|
|
39
39
|
"default": "./dist/*.js"
|
|
40
40
|
}
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"zod": "^4.5
|
|
85
|
+
"zod": "^4.6.5"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@types/react": ">=19.0.0",
|