@qoretechnologies/reqore 0.78.13-pr.723.g088eea5 → 0.78.13-pr.723.g11cb7ba
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/.claude/CLAUDE.md +14 -15
- package/package.json +1 -1
- package/vitest.config.ts +12 -10
package/.claude/CLAUDE.md
CHANGED
|
@@ -207,21 +207,20 @@ release on npm.
|
|
|
207
207
|
and that on Linux they do in this one. On a Mac that shows scrollbars only while scrolling they
|
|
208
208
|
take no room, so this project checks nothing there: run it on Linux (CI, or the Playwright image
|
|
209
209
|
in a container) to see it fail.
|
|
210
|
-
- **POSIX-locale stories:** a
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
second time in the `storybook-posix-locale` project,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
container) to see it fail.
|
|
210
|
+
- **POSIX-locale stories:** a Chromium that takes its language from the POSIX locale (`LC_ALL`, then
|
|
211
|
+
`LANG`: C, C.UTF-8, POSIX, or none, as in most Linux containers) reports `navigator.language` as
|
|
212
|
+
`en-US@posix`, which is no BCP 47 tag, and `Intl` throws on it. Not every build takes it from the
|
|
213
|
+
platform: the arm64 Linux one does, but the amd64 Linux one the CI runs reports `en-US` whatever
|
|
214
|
+
the locale or `--lang` says, as a Mac's takes the system's. So the other story projects never see
|
|
215
|
+
it, and a story tagged `posix-locale` runs a second time in the `storybook-posix-locale` project,
|
|
216
|
+
whose browser context is given that language itself (Playwright's `locale: 'en-US@posix'`,
|
|
217
|
+
`POSIX_LANGUAGE`): Chromium then reports it as it is, and Intl's default locale follows, on every
|
|
218
|
+
platform. Tag a story `posix-locale` when what it draws hands the browser's language (or a locale
|
|
219
|
+
a host passes) to `Intl` or a date library, as `ReqoreDatePicker` does (its stories are tagged in
|
|
220
|
+
their meta). Pass a locale on through `resolveLocale` / `toLanguageTag` (`src/helpers/locale.ts`),
|
|
221
|
+
never raw. A touch story is not run there. Write the tag in the story file, as `touch` is written:
|
|
222
|
+
the projects read it from the source. The project has no qlip plugin, so it makes no captures.
|
|
223
|
+
`.storybook/vitest.setup.ts` checks that its browser reports `en-US@posix`, on every platform.
|
|
225
224
|
- **No layout change inside a ResizeObserver callback:** a story fails when the browser reports
|
|
226
225
|
"ResizeObserver loop completed with undelivered notifications" (`.storybook/vitest.setup.ts`). It
|
|
227
226
|
means a resize callback changed the layout it observes in the same frame, often by setting state
|
package/package.json
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -6,6 +6,7 @@ import path from 'node:path';
|
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { configDefaults, defineConfig, mergeConfig } from 'vitest/config';
|
|
8
8
|
import type { BrowserCommand } from 'vitest/node';
|
|
9
|
+
import { POSIX_LANGUAGE } from './src/stories/utils/posixLocale';
|
|
9
10
|
import viteConfig from './vite.config';
|
|
10
11
|
|
|
11
12
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -80,23 +81,24 @@ const storyBrowser = (kind: 'desktop' | 'phone' | 'scrollbars' | 'posix-locale'
|
|
|
80
81
|
// leave room for one (a field measured while it draws one, qorus#646) is only seen there. A Mac
|
|
81
82
|
// that shows its scrollbars as it scrolls draws them over the content, so there they take no room.
|
|
82
83
|
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
84
|
+
// A Chromium that takes its language from the POSIX locale (LC_ALL, then LANG: C, C.UTF-8, POSIX
|
|
85
|
+
// or none, as in most Linux containers) reports `navigator.language` as `en-US@posix`, which is
|
|
86
|
+
// no BCP 47 tag: `Intl` throws on it (qorus#646). Not every build does: the arm64 Linux one does,
|
|
87
|
+
// and the amd64 Linux one the CI runs reports `en-US` whatever the locale or `--lang` says, as a
|
|
88
|
+
// Mac's takes the system's. So the `posix-locale` project does not ask the platform for it: its
|
|
89
|
+
// context is given the language itself (`locale`), which Chromium then reports as it is, Intl's
|
|
90
|
+
// default locale following it, on every platform and build.
|
|
89
91
|
provider: playwright({
|
|
90
92
|
...(kind === 'scrollbars'
|
|
91
93
|
? { launchOptions: { ignoreDefaultArgs: ['--hide-scrollbars'] } }
|
|
92
94
|
: {}),
|
|
93
|
-
...(kind === 'posix-locale'
|
|
94
|
-
? { launchOptions: { env: { ...process.env, LANG: 'C.UTF-8', LC_ALL: 'C.UTF-8' } } }
|
|
95
|
-
: {}),
|
|
96
95
|
contextOptions:
|
|
97
96
|
kind === 'phone'
|
|
98
97
|
? { viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true }
|
|
99
|
-
: {
|
|
98
|
+
: {
|
|
99
|
+
viewport: { width: 1920, height: 1080 },
|
|
100
|
+
...(kind === 'posix-locale' ? { locale: POSIX_LANGUAGE } : {}),
|
|
101
|
+
},
|
|
100
102
|
}),
|
|
101
103
|
/* Asks for reduced motion (`prefers-reduced-motion: reduce`) or stops asking, in the page the stories run in.
|
|
102
104
|
Reqore honours it: its springs settle at once and its transitions take no time. The contrast gate asks for it
|