Skip to content

Commit e706434

Browse files
committed
docs: align modernization developer guidance
Objective: remediate documentation and DX smells from the adversarial proof audit. Rationale: CONTRIBUTING still told developers to use Node 16+, omitted the pinned pnpm/Corepack path, described Vitest as the dominant runner, and did not mention the new pnpm verify command. The Flatbread package README linked to the old playground path and contained a broken fieldNameTransform example. Migration notes: contributor guidance now reflects Node 20.19+, pnpm 10.33.x, root AVA plus package-local Vitest behavior, Prettier as the enforced lint gate, and pnpm verify for local CI parity. Rollback: revert this commit to restore the prior docs only. No runtime code or package metadata changes are included. Change-Id: I37b2abadd3433fb0d2145c2db64b4a0b9730f917
1 parent b8b896f commit e706434

3 files changed

Lines changed: 43 additions & 9 deletions

File tree

CONTRIBUTING.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Thanks for your interest in contributing! This guide covers local development an
44

55
## Prerequisites
66

7-
- Node 16+
8-
- pnpm
7+
- Node 20.19+
8+
- pnpm 10.33.x via Corepack (`corepack enable && corepack prepare pnpm@10.33.0 --activate`)
99
- Clean git working tree (commit/stash your work first)
1010

1111
## Local development
@@ -14,6 +14,7 @@ Thanks for your interest in contributing! This guide covers local development an
1414
- Build all packages: `pnpm build`
1515
- Run dev across packages: `pnpm dev`
1616
- Work in examples (Next.js preferred): `pnpm play`
17+
- Check local CI parity before opening a PR: `pnpm verify`
1718

1819
## Working on a package
1920

@@ -42,12 +43,19 @@ pnpm build
4243

4344
- Keep PRs small and focused; link related issues.
4445
- Ensure CI passes all checks.
46+
- Run `pnpm verify` locally when your change touches source, tests, package metadata, or CI.
4547
- Add test coverage for both positive and negative cases:
4648
- Positive: expected success paths and typical inputs.
4749
- Negative: invalid inputs, edge cases, and error handling/failure modes.
48-
- Place tests in the relevant package and use its existing runner/config (Vitest in most packages; some legacy tests use Ava).
50+
- Place tests in the relevant package and use its existing runner/config.
51+
- Root `pnpm test` builds the workspace, runs the AVA suite configured by `ava.config.js`, then runs the package-local Vitest suites.
52+
- Vitest is currently used by `@flatbread/codegen` and `@flatbread/utils`.
53+
- Most other packages are covered by the root AVA suite or do not yet expose a package-local `test` script.
54+
- `pnpm lint` is the enforced Prettier formatting gate. `pnpm lint:eslint` is an optional/manual root ESLint check until the linting stack is modernized.
4955
- Helpful commands:
50-
- All packages: `pnpm -r test`
56+
- Local CI parity: `pnpm verify`
57+
- Root test suite: `pnpm test`
58+
- Package-local test scripts where present: `pnpm -r --if-present test`
5159
- Single package: `pnpm -F <package-name> test`
5260
- Watch (where supported): `pnpm -F <package-name> test:watch`
5361

docs/tooling-modernization.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,29 @@ Rollback:
7575
- Revert `.github/workflows/pipeline.yml`. The local scripts from the previous
7676
entry remain independently useful.
7777

78-
### 3. Decision record and deferred follow-ups
78+
### 3. Config hygiene from adversarial audit
79+
80+
Objective:
81+
82+
- Remove pnpm configuration that package manifests cannot enforce.
83+
- Make workspace path aliases and example package metadata explicit.
84+
85+
Rationale:
86+
87+
- `pnpm.peerDependencyRules` only applies from the workspace root, so package
88+
local copies in `@flatbread/codegen` and `flatbread` created warning noise
89+
without changing install behavior.
90+
- The Next.js example invoked the `flatbread` CLI without declaring the
91+
workspace dependency it relies on.
92+
- Root path aliases should cover workspace packages consistently for editor and
93+
package-local TS config consumers.
94+
95+
Rollback:
96+
97+
- Revert the config hygiene commit to restore the previous package metadata,
98+
path aliases, and lockfile entries.
99+
100+
### 4. Decision record and deferred follow-ups
79101

80102
Objective:
81103

@@ -127,6 +149,7 @@ Recommended future pilot:
127149
Measured locally in this cloud workspace:
128150

129151
- Proof audit DAG: 5/5 tasks completed in about 1 minute 9 seconds.
152+
- Adversarial follow-up DAG: 5/5 tasks completed in about 55 seconds.
130153
- Updated `@flatbread/codegen` + `@flatbread/utils` builds completed in about
131154
4 seconds after the package-local TS configs were added.
132155
- `pnpm typecheck` for the current proof pilot completed in about 2.5 seconds.
@@ -144,7 +167,8 @@ CI impact must be measured from GitHub Actions after merge or on the draft PR:
144167
## Deferred recommendations
145168

146169
- Migrate or remove dormant root ESLint in a dedicated linting PR.
147-
- Unify AVA and Vitest, or document why both remain necessary.
170+
- Unify AVA and Vitest after deciding whether package-local tests should all
171+
move to Vitest, or keep both with the contributor guide's current split.
148172
- Add package-level `typecheck` scripts and move toward project references or a
149173
monorepo `tsc -b` flow.
150174
- Add coverage collection and thresholds around critical paths after test runner
@@ -153,3 +177,5 @@ CI impact must be measured from GitHub Actions after merge or on the draft PR:
153177
Express-GraphQL separately from this tooling stack.
154178
- Confirm whether `@nrwl/workspace` is still used; remove it in its own PR if
155179
it is dead weight.
180+
- Resolve the existing SvelteKit route data typing issue, then add
181+
`svelte-check` to CI.

packages/flatbread/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
Eat your relational markdown data _and query it, too,_ with [GraphQL](https://graphql.org/) inside damn near any framework (statement awaiting peer-review).
2020

21-
If it runs ES Modules + Node 16+, it's down to clown.
21+
For contributing to this monorepo, use Node 20.19+ with pnpm 10.33.x. Runtime support for published packages is tracked by each package's own metadata.
2222

2323
Born out of a desire to [Gridsome](https://gridsome.org/) (or [Gatsby](https://www.gatsbyjs.com/)) anything, this project harnesses a plugin architecture to be easily customizable to fit your use cases.
2424

@@ -251,7 +251,7 @@ Limits the number of returned entries to the specified amount. Accepts an intege
251251

252252
## Query within your app ❓❓
253253

254-
[Check out the example integrations](https://github.com/FlatbreadLabs/flatbread/tree/main/playground) of using Flatbread with frameworks like SvelteKit and Next.js.
254+
[Check out the example integrations](https://github.com/FlatbreadLabs/flatbread/tree/main/examples) of using Flatbread with frameworks like SvelteKit and Next.js.
255255

256256
## Field overrides
257257

@@ -304,7 +304,7 @@ Accepts a function which takes in field names and transforms them for the GraphQ
304304
{
305305
...
306306
// replace all spaces in field names with an underscore
307-
fieldNameTransform: (fieldName) => field.name.replace(/\s/g,'_')
307+
fieldNameTransform: (fieldName) => fieldName.replace(/\s/g, '_')
308308
...
309309
}
310310
```

0 commit comments

Comments
 (0)