@geonosis/oxlint-plugin-biological-architecture 0.3.0 → 0.5.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.
Files changed (30) hide show
  1. package/README.md +34 -0
  2. package/corpus/.oxlintrc.json +8 -0
  3. package/corpus/atoms/bad-aliased-import.tsx +4 -0
  4. package/corpus/atoms/nested/bad-relative-climb.tsx +4 -0
  5. package/corpus/features/invoice/cells/bad-aliased-cross-feature-cell.tsx +3 -0
  6. package/corpus/features/invoice/cells/bad-aliased-cross-feature-organelle.tsx +11 -0
  7. package/corpus/features/invoice/cells/bad-aliased-cross-feature-tissue.tsx +3 -0
  8. package/corpus/features/invoice/cells/bad-relative-cross-feature-cell.tsx +3 -0
  9. package/corpus/features/invoice/cells/bad-relative-cross-feature-organelle.tsx +12 -0
  10. package/corpus/features/invoice/cells/bad-relative-cross-feature-store.tsx +9 -0
  11. package/corpus/features/invoice/cells/bad-relative-cross-feature-tissue.tsx +3 -0
  12. package/corpus/features/invoice/cells/good-own-organelle.tsx +10 -0
  13. package/corpus/features/invoice/cells/good-relative-own-store.tsx +8 -0
  14. package/corpus/features/invoice/cells/good-shared-organelle.tsx +10 -0
  15. package/corpus/features/invoice/compounds/bad-aliased-cross-feature-store.tsx +3 -0
  16. package/corpus/features/invoice/compounds/bad-relative-cross-feature-store.tsx +5 -0
  17. package/corpus/features/invoice/organelles/bad-aliased-cross-feature-organelle.tsx +10 -0
  18. package/corpus/features/invoice/organelles/bad-relative-cross-feature-organelle.tsx +11 -0
  19. package/corpus/features/invoice/organelles/good-relative-same-feature-organelle.tsx +11 -0
  20. package/corpus/features/invoice/tissues/bad-aliased-cross-feature-organelle.tsx +3 -0
  21. package/corpus/features/invoice/tissues/bad-aliased-cross-feature-store.tsx +3 -0
  22. package/corpus/features/invoice/tissues/bad-relative-cross-feature-organelle.tsx +3 -0
  23. package/corpus/features/invoice/tissues/bad-relative-cross-feature-store.tsx +3 -0
  24. package/corpus/manifest.json +1 -0
  25. package/corpus/molecules/bad-aliased-cell-import.tsx +3 -0
  26. package/corpus/molecules/nested/bad-relative-climb.tsx +3 -0
  27. package/dist/{chunk-55NK7NJN.js → chunk-RQQKQPIU.js} +1 -0
  28. package/dist/index.js +349 -534
  29. package/dist/presets.js +1 -1
  30. package/package.json +2 -2
package/README.md CHANGED
@@ -135,6 +135,7 @@ months. Carry these across, or turn the rule off:
135
135
  | --- | --- | --- |
136
136
  | `no-brand-names` | `{ brands, allowedSubstrings }` | refuses the run |
137
137
  | `organelle-dependency` | `{ sharedFeatures }` | only `shared` crosses a feature boundary |
138
+ | `cell-no-cross-feature-organelles` | `{ sharedFeatures }` | only `shared` crosses a feature boundary |
138
139
  | `documents-share-one-table` | `{ perKindTables }` | refuses the run |
139
140
  | `document-sagas-are-generic` | `{ perKindPrefixes }` | refuses the run |
140
141
  | `step-opens-its-own-cell` | `{ engine, within, wrapper }` | refuses the run |
@@ -153,6 +154,39 @@ Two more facts a fork's config will trip on:
153
154
  namespace is the plugin's identity, not the package's, so renaming or re-scoping the package does
154
155
  not rename a single rule id in a single consumer config.
155
156
 
157
+ ### Last step of every bump — verify the loaded version, per workspace
158
+
159
+ **Declared is not loaded.** oxlint resolves a `jsPlugins` specifier from the CONFIG FILE's
160
+ directory, so a nested `apps/<ws>/node_modules/@geonosis/…` left behind at the old version means
161
+ oxlint runs the OLD plugin while every `package.json` and the lockfile say the new one. bun leaves
162
+ a nested copy when a per-workspace `bun add` runs and the root already has one; one consumer measured
163
+ a whole bug report against 0.3.0 that way, on a repo pinned to 0.4.0.
164
+
165
+ The check that is true on every package manager is the one that asks the resolver, from **each
166
+ workspace directory** — this is what oxlint would load:
167
+
168
+ ```bash
169
+ node --input-type=module -e \
170
+ 'const p = (await import("@geonosis/oxlint-plugin-biological-architecture")).default; console.log(p.meta.version)'
171
+ ```
172
+
173
+ It must print the pinned version. Every published version of this plugin carries `meta.version`, so
174
+ there is no version of it this check cannot read.
175
+
176
+ Then find the stray copy, and mind that the answer is package-manager-specific:
177
+
178
+ - **bun / npm** — real directories, so counting them is meaningful:
179
+ ```bash
180
+ find . -path "*@geonosis/oxlint-plugin-biological-architecture/package.json" -not -path "*/.git/*"
181
+ ```
182
+ More than one is the bug. Fix with
183
+ `rm -rf apps/*/node_modules/@geonosis packages/*/node_modules/@geonosis && bun install` — no flags,
184
+ and never `--ignore-scripts` over the whole tree.
185
+ - **pnpm** — `node_modules/@geonosis/*` are SYMLINKS into `.pnpm/`, which keeps every version ever
186
+ installed. The same `find` answers 7 on a tree that is perfectly correct, and 0 if you exclude
187
+ `.pnpm`. Read the links instead: `ls -l node_modules/@geonosis` in each workspace, and check the
188
+ version in the target path.
189
+
156
190
  ## Where to read on
157
191
 
158
192
  - `RULES.md` — every rule, its preset, which source tree it came from, and how each divergence was
@@ -11,6 +11,14 @@
11
11
  "biological-architecture/atom-no-deps": "error",
12
12
  "biological-architecture/cell-must-be-stateful": "error",
13
13
  "biological-architecture/cell-must-not-compose-cell": "error",
14
+ "biological-architecture/cell-no-cross-feature-organelles": [
15
+ "error",
16
+ {
17
+ "sharedFeatures": [
18
+ "shared"
19
+ ]
20
+ }
21
+ ],
14
22
  "biological-architecture/cell-no-tissues": "error",
15
23
  "biological-architecture/cells-folder-index-is-barrel": "error",
16
24
  "biological-architecture/compound-must-be-stateless": "error",
@@ -0,0 +1,4 @@
1
+ // The same breach through the bundler alias — the spelling the corpus never carried for this rule.
2
+ import { Field } from '@kit/ui/molecules/field'
3
+
4
+ export const BadAliasedImport = Field
@@ -0,0 +1,4 @@
1
+ // A climb, not a sibling: the source names the tier only two directories up.
2
+ import { Field } from '../../molecules/field'
3
+
4
+ export const BadRelativeClimb = Field
@@ -0,0 +1,3 @@
1
+ import { BillingEditor } from '@/features/billing/cells/billing-editor'
2
+
3
+ export const BadAliasedCrossFeatureCell = BillingEditor
@@ -0,0 +1,11 @@
1
+ // The same breach spelled through the bundler alias. Where the import LANDS is the fact; the two
2
+ // spellings must read alike.
3
+ import { useState } from 'react'
4
+
5
+ import { BillingTotals } from '@/features/billing/organelles/billing-totals'
6
+
7
+ export function BadAliasedCrossFeatureOrganelle() {
8
+ const [open] = useState(false)
9
+
10
+ return <section>{open ? <BillingTotals /> : null}</section>
11
+ }
@@ -0,0 +1,3 @@
1
+ import { BillingPage } from '@/features/billing/tissues/billing-page'
2
+
3
+ export const BadAliasedCrossFeatureTissue = BillingPage
@@ -0,0 +1,3 @@
1
+ import { BillingEditor } from '../../billing/cells/billing-editor'
2
+
3
+ export const BadRelativeCrossFeatureCell = BillingEditor
@@ -0,0 +1,12 @@
1
+ // A cell climbing out of its feature into ANOTHER feature's organelle — the state compartment of a
2
+ // feature this one does not own. organelle-dependency polices organelles/ and no-cross-feature-stores
3
+ // polices stores, so until cell-no-cross-feature-organelles nothing here fired at all.
4
+ import { useState } from 'react'
5
+
6
+ import { BillingTotals } from '../../billing/organelles/billing-totals'
7
+
8
+ export function BadRelativeCrossFeatureOrganelle() {
9
+ const [open] = useState(false)
10
+
11
+ return <section>{open ? <BillingTotals /> : null}</section>
12
+ }
@@ -0,0 +1,9 @@
1
+ // The same breach as bad-cross-feature-store.tsx, written the way a file two directories away
2
+ // writes it. The source names no feature until it is resolved against THIS file — which is exactly
3
+ // what no-cross-feature-stores used to be blind to.
4
+ import { useBillingStore } from '../../billing/stores/billing-store'
5
+
6
+ export function BadRelativeCrossFeatureStore() {
7
+ const total = useBillingStore((state) => state.total)
8
+ return <span>{total}</span>
9
+ }
@@ -0,0 +1,3 @@
1
+ import { BillingPage } from '../../billing/tissues/billing-page'
2
+
3
+ export const BadRelativeCrossFeatureTissue = BillingPage
@@ -0,0 +1,10 @@
1
+ // A cell hosting its OWN feature's organelle — the whole point of a cell.
2
+ import { useState } from 'react'
3
+
4
+ import { InvoiceLines } from '../organelles/invoice-lines'
5
+
6
+ export function GoodOwnOrganelle() {
7
+ const [open] = useState(false)
8
+
9
+ return <section>{open ? <InvoiceLines /> : null}</section>
10
+ }
@@ -0,0 +1,8 @@
1
+ // A relative import of this feature's OWN store — allowed, and it must stay allowed once relative
2
+ // sources are resolved.
3
+ import { useInvoiceStore } from '../stores/invoice-store'
4
+
5
+ export function GoodRelativeOwnStore() {
6
+ const total = useInvoiceStore((state) => state.total)
7
+ return <span>{total}</span>
8
+ }
@@ -0,0 +1,10 @@
1
+ // The shared feature is infrastructure every feature may read, which is what sharedFeatures names.
2
+ import { useState } from 'react'
3
+
4
+ import { SaveIndicator } from '@/features/shared/organelles/save-indicator'
5
+
6
+ export function GoodSharedOrganelle() {
7
+ const [open] = useState(false)
8
+
9
+ return <section>{open ? <SaveIndicator /> : null}</section>
10
+ }
@@ -0,0 +1,3 @@
1
+ import { useBillingStore } from '@/features/billing/stores/billing-store'
2
+
3
+ export const BadAliasedCrossFeatureStore = useBillingStore
@@ -0,0 +1,5 @@
1
+ // A compound climbing into another feature's store. The string names no feature until it is
2
+ // resolved against this file.
3
+ import { useBillingStore } from '../../billing/stores/billing-store'
4
+
5
+ export const BadRelativeCrossFeatureStore = useBillingStore
@@ -0,0 +1,10 @@
1
+ // The aliased twin of bad-relative-cross-feature-organelle.tsx: one breach, two spellings.
2
+ import { BillingTotals } from '@/features/billing/organelles/billing-totals'
3
+
4
+ export function BadAliasedCrossFeatureOrganelle() {
5
+ return (
6
+ <section>
7
+ <BillingTotals />
8
+ </section>
9
+ )
10
+ }
@@ -0,0 +1,11 @@
1
+ // A relative climb out of this feature into ANOTHER feature's organelle. organelle-dependency must
2
+ // fire: where the import LANDS is the fact, not how it was spelled.
3
+ import { BillingTotals } from '../../billing/organelles/billing-totals'
4
+
5
+ export function BadRelativeCrossFeatureOrganelle() {
6
+ return (
7
+ <section>
8
+ <BillingTotals />
9
+ </section>
10
+ )
11
+ }
@@ -0,0 +1,11 @@
1
+ // A sub-organelle in the SAME feature — the nucleolus in the nucleus. Allowed, and it must stay
2
+ // allowed once relative sources are resolved.
3
+ import { InvoiceLines } from './invoice-lines'
4
+
5
+ export function GoodRelativeSameFeatureOrganelle() {
6
+ return (
7
+ <section>
8
+ <InvoiceLines />
9
+ </section>
10
+ )
11
+ }
@@ -0,0 +1,3 @@
1
+ import { BillingTotals } from '@/features/billing/organelles/billing-totals'
2
+
3
+ export const BadAliasedCrossFeatureOrganelle = BillingTotals
@@ -0,0 +1,3 @@
1
+ import { useBillingStore } from '@/features/billing/stores/billing-store'
2
+
3
+ export const BadAliasedCrossFeatureStore = useBillingStore
@@ -0,0 +1,3 @@
1
+ import { BillingTotals } from '../../billing/organelles/billing-totals'
2
+
3
+ export const BadRelativeCrossFeatureOrganelle = BillingTotals
@@ -0,0 +1,3 @@
1
+ import { useBillingStore } from '../../billing/stores/billing-store'
2
+
3
+ export const BadRelativeCrossFeatureStore = useBillingStore
@@ -4,6 +4,7 @@
4
4
  "biological-architecture/atom-no-deps",
5
5
  "biological-architecture/cell-must-be-stateful",
6
6
  "biological-architecture/cell-must-not-compose-cell",
7
+ "biological-architecture/cell-no-cross-feature-organelles",
7
8
  "biological-architecture/cell-no-tissues",
8
9
  "biological-architecture/cells-folder-index-is-barrel",
9
10
  "biological-architecture/compound-must-be-stateless",
@@ -0,0 +1,3 @@
1
+ import { ProductCell } from '@kit/ui/cells/product'
2
+
3
+ export const BadAliasedCellImport = ProductCell
@@ -0,0 +1,3 @@
1
+ import { ProductCell } from '../../cells/product'
2
+
3
+ export const BadRelativeClimb = ProductCell
@@ -3,6 +3,7 @@ var FRONTEND = [
3
3
  "atom-no-deps",
4
4
  "cell-must-be-stateful",
5
5
  "cell-must-not-compose-cell",
6
+ "cell-no-cross-feature-organelles",
6
7
  "cell-no-tissues",
7
8
  "cells-folder-index-is-barrel",
8
9
  "compound-must-be-stateless",