@pikku/skills 0.12.19 → 0.12.21

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.
@@ -367,7 +367,7 @@ string the generated step map is keyed by — the file name, and every helper in
367
367
  are English in every project regardless of who the product is for or what
368
368
  language the team speaks. There is no setting that changes this.
369
369
 
370
- **Prose follows `locale` in `pikku.config.json`** (default `en`). That is a
370
+ **Prose follows `metaLocale` in `pikku.config.json`** (default `en`). That is a
371
371
  step's `description` and `template`, a feature's `name` and `description`, a
372
372
  scenario's `title`, and the positional step names passed to
373
373
  `scenario.given/when/then`. Read the field before you write any of them.
@@ -378,7 +378,7 @@ language. The report is the deliverable, and it is read by the team; the
378
378
  identifier is an API, and it is read by the toolchain.
379
379
 
380
380
  ```typescript
381
- // pikku.config.json: { "locale": "de" }
381
+ // pikku.config.json: { "metaLocale": "de" }
382
382
  export const buysAnApple = pikkuScenarioStep<{ qty: number }, { orderId: string }>({
383
383
  name: 'buysAnApple', // identifier — English, always
384
384
  description: 'kauft einen Apfel', // prose — follows locale
@@ -392,19 +392,19 @@ export const buysAnApple = pikkuScenarioStep<{ qty: number }, { orderId: string
392
392
  Note what does **not** change: `placeOrder` is still `placeOrder`, and the file
393
393
  is still `apple.scenario.ts`.
394
394
 
395
- A product with a non-English UI is not on its own a reason to set `locale` — that
395
+ A product with a non-English UI is not on its own a reason to set `metaLocale` — that
396
396
  is the app's language, not the team's. Ask, or leave it `en`.
397
397
 
398
- **Where a non-`en` `locale` still shows English, today.** The reporter composes a
398
+ **Where a non-`en` `metaLocale` still shows English, today.** The reporter composes a
399
399
  sentence as `<Keyword> the <actor> <template>` (`composeStepProse`), and both the
400
400
  keyword and the article `the` are English literals. The Console translates the
401
401
  Given/When/Then keywords into its own UI language; the CLI reporter does not, and
402
- nothing translates `the`. So `locale: "de"` gives you German step prose inside an
402
+ nothing translates `the`. So `metaLocale: "de"` gives you German step prose inside an
403
403
  English frame — `Given the shopper kauft 1 Äpfel`. Write templates that read
404
404
  acceptably in that frame rather than trying to defeat it. A second gap: where a
405
405
  function or scenario declares no `title`, the Console falls back to splitting the
406
406
  **identifier** into an English-looking label (`toEnglishName`), so under a
407
- non-`en` `locale` meta is worth authoring rather than leaving to the fallback.
407
+ non-`en` `metaLocale` meta is worth authoring rather than leaving to the fallback.
408
408
 
409
409
  ### `then` bindings are witnesses, not alternatives
410
410
 
@@ -606,7 +606,7 @@ await page.getByRole('button', { name: t('jobs_apply_submit'), exact: true }).cl
606
606
 
607
607
  - Type off `messages/<baseLocale>.json`, **not** the generated Paraglide output — `i18n/paraglide/` is build output, so typing against it makes the tests unbuildable until the app has been built. The JSON is the tracked source.
608
608
  - Fall back to the base locale for a key a locale has not translated. That is what Paraglide does at run time, so a helper that throws instead would disagree with the screen the test is looking at.
609
- - This is not only about locators. A copy literal passed to a **project helper** (`pick('Where would you like to work?', …)`) reaches the DOM the same way, and so does a pane name quoted back in a failure message. `pikku fabric validate` scans every string in a `*.steps.ts` / `*.scenario.ts` against the base catalogue and errors on any verbatim match, wherever it sits.
609
+ - This is not only about locators. A copy literal passed to a **project helper** (`pick('Where would you like to work?', …)`) reaches the DOM the same way, and so does a pane name quoted back in a failure message. `pikku fabric validate` scans every string in a `*.steps.ts` / `*.scenario.ts` against the base catalogue and errors on any verbatim match, wherever it sits — except comments, and the `name` / `description` / `template` declared directly on a `pikkuFeature`, `pikkuScenario` or `pikkuScenarioStep`, which are Console meta written in the project's `locale` rather than app copy.
610
610
  - A regex locator (`{ name: /^Next$/i }`) hides the literal but not the problem. `{ name: t('key'), exact: true }` is both stricter and locale-correct.
611
611
  - Strings the catalogue does not own — a test id, a fixture filename, a seeded value — stay literal. The catalogue is the test for whether something is copy.
612
612
 
@@ -709,11 +709,12 @@ frontend gets a one-click "Sign in as …" switcher over the **same** list, and
709
709
  app can be reviewed as each kind of user without anyone knowing a seed password.
710
710
 
711
711
  The sandbox dev server bakes both halves into the frontend from the declared
712
- personas: `VITE_DEV_ACTORS` (the JSON actor list) and
713
- `VITE_SCENARIO_ACTOR_SECRET`. Neither is set in a production build, so the
714
- control renders nothing there — but gate the reads on your bundler's dev flag
715
- anyway (`import.meta.env.DEV ? … : undefined`) so the secret never reaches a
716
- production bundle in the first place.
712
+ personas: `VITE_DEV_ACTORS` (the JSON actor list) and `VITE_DEV_ACTOR_SECRETS`
713
+ (`{ email: credential }`, one per persona — `SCENARIO_ACTOR_SECRET` itself never
714
+ goes in a bundle; see **pikku-better-auth**). Neither var is set in a production
715
+ build, so the control renders nothing there — but gate the reads on your
716
+ bundler's dev flag anyway (`import.meta.env.DEV ? … : undefined`) so no
717
+ credential reaches a production bundle in the first place.
717
718
 
718
719
  Do not hand-roll the switcher: `useDevActors()` (`pikku-react`, a separate install) is the logic and
719
720
  `<DevActorSwitcher />` from `@pikku/mantine/dev` is a ready rendering of it.
@@ -833,7 +834,7 @@ Services are plain objects — a Pikku function is pure business logic, so a moc
833
834
  | Assuming a clean database | There is no state reset — it may be a staging server. Scope what you create. |
834
835
  | `sleep()` before asserting | Use `expectEventually`. |
835
836
  | A step named `clicksAddToBasket` / `opensThePage` | That is an action, not an intent. Name the step for what the actor wanted; put the clicking in a utility. |
836
- | A step named `kauftEinenApfel` / a `vorgang` table | Identifiers are English in every project. The German belongs in `description` / `template`, and only when `pikku.config.json` sets `locale`. |
837
+ | A step named `kauftEinenApfel` / a `vorgang` table | Identifiers are English in every project. The German belongs in `description` / `template`, and only when `pikku.config.json` sets `metaLocale`. |
837
838
  | A browser step that assumes it is already on a page | It can then only run mid-flow. Arrive first — check the URL, navigate if needed. |
838
839
  | `getByLabel('Full Name')` in a translated app | Passes only in the base locale, and a copy edit breaks it as an unexplained timeout. Locate by message key. |
839
840
  | A `browser` binding guarding `if (!browser)` | The binding guarantees it. The guard hides the real error, which is a missing actor (`PKU677`). |