Skip to content

Commit ddfdb4b

Browse files
committed
docs: name only the auto-imports and packages that exist
Two bits of documentation that told readers to write code which cannot run. **AGENTS.md listed 13 auto-imports that are not auto-imported.** Of the 24 names it gave as available in a template with no import - `ref`, `computed`, `reactive`, `watch`, `watchEffect`, `useColorMode`, `useLocalStorage`, `useCounter`, `useIntersectionObserver`, `useScroll`, `useMouse`, `useParallax` and `usePreferredReducedMotion` - none are in `browser-auto-imports.json` or in the generated `browser-auto-imports.d.ts`. Both agree on 83 names and neither contains them. This is the first file an agent reads here, and `ref` is the one it reaches for by habit. The file already carries a scar from this exact failure: it notes the count said "200+ composables" for a long time, "which was not a stale count but a wrong one". The count was then fixed and the names were not. It now lists all 27 `use*` composables in full - a half-remembered name is the whole problem - and says plainly which reactivity names are NOT available and that stx's `state` / `derived` / `effect` are what a template actually uses. **Eight component docs told readers to install a package that 404s.** `npm install @stacksjs/popover` and seven like it; only `@stacksjs/stepper` of the nine resolves. Those components ship in `@stacksjs/components`, which is published and whose tarball carries `Dialog`, `Combobox`, `Dropdown` and the rest. Checked every one against the registry rather than assuming. `agents-md-auto-imports.test.ts` checks every name the file claims against the manifest. It splits claims from the correction by POSITION, not by an exclusion list: the first version excluded the not-auto-imported names by name, which made it blind to exactly those - putting `useScroll` back in the positive list passed. Verified the second version fails on that.
1 parent 7bbc804 commit ddfdb4b

10 files changed

Lines changed: 167 additions & 81 deletions

File tree

AGENTS.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,20 @@ count: `storage/framework/browser-auto-imports.json` and the generated
168168
`storage/framework/types/browser-auto-imports.d.ts` agree on 83, and a name
169169
that is not in them needs an import however familiar it looks.
170170

171-
- STX reactivity and the composables among them: `ref`, `computed`, `watch`, `reactive`,
172-
`watchEffect`, `useFetch`, `useDark` / `useColorMode`, `useStorage`, `useLocalStorage`, `useToggle`,
173-
`useCounter`, `useIntersectionObserver`, `useScroll`, `useMouse`, `useParallax`,
174-
`usePreferredReducedMotion`, plus utilities (`debounce`, `throttle`, `sleep`, `clamp`), `useAuth`,
175-
and the Stripe helpers (`loadCardElement`, `confirmPayment`, ...).
171+
- The 27 `use*` composables, in full, because a half-remembered name is the whole
172+
problem: `useAbs`, `useAuth`, `useAverage`, `useCeil`, `useClamp`, `useDark`,
173+
`useDateFormat`, `useFetch`, `useFloor`, `useForm`, `useGitStore`, `useMax`, `useMin`,
174+
`useNow`, `useOnline`, `usePaymentStore`, `usePrecision`, `usePreferredDark`,
175+
`useQueueStore`, `useRound`, `useScrollLock`, `useStorage`, `useSum`, `useTimeoutFn`,
176+
`useToggle`, `useTrunc`, `useUserStore`.
177+
- Utilities (`debounce`, `throttle`, `clamp`, `delay`, `dateFormat`, `format`, ...) and the
178+
Stripe helpers (`loadCardElement`, `confirmPayment`, `confirmCardPayment`, ...).
179+
- **NOT** `ref`, `computed`, `reactive`, `watch` or `watchEffect`. This list named all five
180+
for a long time, along with `useColorMode`, `useLocalStorage`, `useCounter`,
181+
`useIntersectionObserver`, `useScroll`, `useMouse`, `useParallax` and
182+
`usePreferredReducedMotion` - 13 of the 24 names it gave. None of them are in either
183+
manifest. Reactivity in a template comes from stx's own `state` / `derived` / `effect`
184+
(see `stacks-stx`), and everything else here needs an import.
176185
- Your components under `resources/components/` (write `<Card />` directly, resolved by the stx
177186
plugin) and your functions under `resources/functions/` (e.g. `increment`, `toggleDark`).
178187

docs/guide/components/combobox.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ A modern, accessible combobox component for STX applications.
2424
::: code-group
2525

2626
```sh [npm]
27-
npm install @stacksjs/combobox
27+
npm install @stacksjs/components
2828
```
2929

3030
```sh [bun]
31-
bun install @stacksjs/combobox
32-
# bun add @stacksjs/combobox
33-
# bun i @stacksjs/combobox
31+
bun install @stacksjs/components
32+
# bun add @stacksjs/components
33+
# bun i @stacksjs/components
3434
```
3535

3636
```sh [pnpm]
37-
pnpm add @stacksjs/combobox
38-
# pnpm i @stacksjs/combobox
37+
pnpm add @stacksjs/components
38+
# pnpm i @stacksjs/components
3939
```
4040

4141
```sh [yarn]
42-
yarn add @stacksjs/combobox
43-
# yarn i -d @stacksjs/combobox
42+
yarn add @stacksjs/components
43+
# yarn i -d @stacksjs/components
4444
```
4545

4646
:::
@@ -59,7 +59,7 @@ import {
5959
ComboboxButton,
6060
ComboboxOptions,
6161
ComboboxOption
62-
} from '@stacksjs/combobox'
62+
} from '@stacksjs/components'
6363
6464
const selected = ref(null)
6565
const query = ref('')

docs/guide/components/dialog.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ A modern, accessible dialog component for STX applications.
2424
::: code-group
2525

2626
```sh [npm]
27-
npm install @stacksjs/dialog
27+
npm install @stacksjs/components
2828
```
2929

3030
```sh [bun]
31-
bun install @stacksjs/dialog
32-
# bun add @stacksjs/dialog
33-
# bun i @stacksjs/dialog
31+
bun install @stacksjs/components
32+
# bun add @stacksjs/components
33+
# bun i @stacksjs/components
3434
```
3535

3636
```sh [pnpm]
37-
pnpm add @stacksjs/dialog
38-
# pnpm i @stacksjs/dialog
37+
pnpm add @stacksjs/components
38+
# pnpm i @stacksjs/components
3939
```
4040

4141
```sh [yarn]
42-
yarn add @stacksjs/dialog
43-
# yarn i -d @stacksjs/dialog
42+
yarn add @stacksjs/components
43+
# yarn i -d @stacksjs/components
4444
```
4545

4646
:::
@@ -53,7 +53,7 @@ The dialog component is composed of two main components that work together to cr
5353
```html
5454
<script>
5555
import { ref } from '@stacksjs/stx'
56-
import { Dialog, DialogPanel } from '@stacksjs/dialog'
56+
import { Dialog, DialogPanel } from '@stacksjs/components'
5757
5858
const visible = ref(false)
5959
@@ -161,7 +161,7 @@ The dialog component follows WAI-ARIA guidelines and includes the following feat
161161
The dialog component includes full TypeScript support:
162162

163163
```ts
164-
import type { DialogProps } from '@stacksjs/dialog'
164+
import type { DialogProps } from '@stacksjs/components'
165165
import { ref } from '@stacksjs/stx'
166166

167167
const visible = ref<boolean>(false)

docs/guide/components/dropdown.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ A modern, accessible dropdown component for STX applications.
2525
::: code-group
2626

2727
```sh [npm]
28-
npm install @stacksjs/dropdown
28+
npm install @stacksjs/components
2929
```
3030

3131
```sh [bun]
32-
bun install @stacksjs/dropdown
33-
# bun add @stacksjs/dropdown
34-
# bun i @stacksjs/dropdown
32+
bun install @stacksjs/components
33+
# bun add @stacksjs/components
34+
# bun i @stacksjs/components
3535
```
3636

3737
```sh [pnpm]
38-
pnpm add @stacksjs/dropdown
39-
# pnpm i @stacksjs/dropdown
38+
pnpm add @stacksjs/components
39+
# pnpm i @stacksjs/components
4040
```
4141

4242
```sh [yarn]
43-
yarn add @stacksjs/dropdown
44-
# yarn i -d @stacksjs/dropdown
43+
yarn add @stacksjs/components
44+
# yarn i -d @stacksjs/components
4545
```
4646

4747
:::
@@ -59,7 +59,7 @@ import {
5959
DropdownButton,
6060
DropdownItems,
6161
DropdownItem,
62-
} from '@stacksjs/dropdown'
62+
} from '@stacksjs/components'
6363
</script>
6464

6565
<template>
@@ -187,7 +187,7 @@ The dropdown component follows WAI-ARIA guidelines and includes the following fe
187187
The dropdown component includes full TypeScript support:
188188

189189
```ts
190-
import type { DropdownItemProps } from '@stacksjs/dropdown'
190+
import type { DropdownItemProps } from '@stacksjs/components'
191191
import { ref } from '@stacksjs/stx'
192192

193193
interface MenuItem {

docs/guide/components/listbox.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ A modern, accessible listbox component for STX applications.
2323
::: code-group
2424

2525
```sh [npm]
26-
npm install @stacksjs/listbox
26+
npm install @stacksjs/components
2727
```
2828

2929
```sh [bun]
30-
bun install @stacksjs/listbox
31-
# bun add @stacksjs/listbox
32-
# bun i @stacksjs/listbox
30+
bun install @stacksjs/components
31+
# bun add @stacksjs/components
32+
# bun i @stacksjs/components
3333
```
3434

3535
```sh [pnpm]
36-
pnpm add @stacksjs/listbox
37-
# pnpm i @stacksjs/listbox
36+
pnpm add @stacksjs/components
37+
# pnpm i @stacksjs/components
3838
```
3939

4040
```sh [yarn]
41-
yarn add @stacksjs/listbox
42-
# yarn i -d @stacksjs/listbox
41+
yarn add @stacksjs/components
42+
# yarn i -d @stacksjs/components
4343
```
4444

4545
:::
@@ -57,7 +57,7 @@ import {
5757
ListboxButton,
5858
ListboxOptions,
5959
ListboxOption,
60-
} from '@stacksjs/listbox'
60+
} from '@stacksjs/components'
6161
6262
const people = [
6363
{ id: 1, name: 'Durward Reynolds', unavailable: false },

docs/guide/components/notification.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ A modern, accessible notification component for STX applications.
2424
::: code-group
2525

2626
```sh [npm]
27-
npm install @stacksjs/notification
27+
npm install @stacksjs/components
2828
```
2929

3030
```sh [bun]
31-
bun install @stacksjs/notification
32-
# bun add @stacksjs/notification
33-
# bun i @stacksjs/notification
31+
bun install @stacksjs/components
32+
# bun add @stacksjs/components
33+
# bun i @stacksjs/components
3434
```
3535

3636
```sh [pnpm]
37-
pnpm add @stacksjs/notification
38-
# pnpm i @stacksjs/notification
37+
pnpm add @stacksjs/components
38+
# pnpm i @stacksjs/components
3939
```
4040

4141
```sh [yarn]
42-
yarn add @stacksjs/notification
43-
# yarn i -d @stacksjs/notification
42+
yarn add @stacksjs/components
43+
# yarn i -d @stacksjs/components
4444
```
4545

4646
:::
@@ -53,7 +53,7 @@ The notification component can be easily integrated into your STX application:
5353
```html
5454
<script>
5555
import { ref } from '@stacksjs/stx'
56-
import { Notification } from '@stacksjs/notification'
56+
import { Notification } from '@stacksjs/components'
5757
5858
const position = ref('top-right')
5959
const expand = ref(false)
@@ -142,7 +142,7 @@ The notification component follows WAI-ARIA guidelines and includes:
142142
The notification component includes full TypeScript support:
143143

144144
```ts
145-
import type { Position, Theme } from '@stacksjs/notification'
145+
import type { Position, Theme } from '@stacksjs/components'
146146

147147
const position = ref<Position>('top-right')
148148
const theme = ref<Theme>('light')

docs/guide/components/popover.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ A modern, accessible popover component for STX applications.
2525
::: code-group
2626

2727
```sh [npm]
28-
npm install @stacksjs/popover
28+
npm install @stacksjs/components
2929
```
3030

3131
```sh [bun]
32-
bun install @stacksjs/popover
33-
# bun add @stacksjs/popover
34-
# bun i @stacksjs/popover
32+
bun install @stacksjs/components
33+
# bun add @stacksjs/components
34+
# bun i @stacksjs/components
3535
```
3636

3737
```sh [pnpm]
38-
pnpm add @stacksjs/popover
39-
# pnpm i @stacksjs/popover
38+
pnpm add @stacksjs/components
39+
# pnpm i @stacksjs/components
4040
```
4141

4242
```sh [yarn]
43-
yarn add @stacksjs/popover
44-
# yarn i -d @stacksjs/popover
43+
yarn add @stacksjs/components
44+
# yarn i -d @stacksjs/components
4545
```
4646

4747
:::
@@ -58,7 +58,7 @@ import {
5858
Popover,
5959
PopoverButton,
6060
PopoverPanel,
61-
} from '@stacksjs/popover'
61+
} from '@stacksjs/components'
6262
</script>
6363

6464
<template>
@@ -167,7 +167,7 @@ The popover component follows WAI-ARIA guidelines and includes the following fea
167167
The popover component includes full TypeScript support:
168168

169169
```ts
170-
import type { PopoverSlotProps } from '@stacksjs/popover'
170+
import type { PopoverSlotProps } from '@stacksjs/components'
171171
import { ref } from '@stacksjs/stx'
172172

173173
const panelOpen = ref<boolean>(false)

docs/guide/components/radio-group.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ A modern, accessible radio group component for STX applications.
2323
::: code-group
2424

2525
```sh [npm]
26-
npm install @stacksjs/radio-group
26+
npm install @stacksjs/components
2727
```
2828

2929
```sh [bun]
30-
bun install @stacksjs/radio-group
31-
# bun add @stacksjs/radio-group
32-
# bun i @stacksjs/radio-group
30+
bun install @stacksjs/components
31+
# bun add @stacksjs/components
32+
# bun i @stacksjs/components
3333
```
3434

3535
```sh [pnpm]
36-
pnpm add @stacksjs/radio-group
37-
# pnpm i @stacksjs/radio-group
36+
pnpm add @stacksjs/components
37+
# pnpm i @stacksjs/components
3838
```
3939

4040
```sh [yarn]
41-
yarn add @stacksjs/radio-group
42-
# yarn i -d @stacksjs/radio-group
41+
yarn add @stacksjs/components
42+
# yarn i -d @stacksjs/components
4343
```
4444

4545
:::
@@ -56,7 +56,7 @@ import {
5656
RadioGroup,
5757
RadioGroupLabel,
5858
RadioGroupOption,
59-
} from '@stacksjs/radio-group'
59+
} from '@stacksjs/components'
6060
6161
const plans = [
6262
{ id: 1, name: 'Startup', price: '$29' },

docs/guide/components/switch.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ A modern, accessible toggle switch component for STX applications.
2323
::: code-group
2424

2525
```sh [npm]
26-
npm install @stacksjs/switch
26+
npm install @stacksjs/components
2727
```
2828

2929
```sh [bun]
30-
bun install @stacksjs/switch
31-
# bun add @stacksjs/switch
32-
# bun i @stacksjs/switch
30+
bun install @stacksjs/components
31+
# bun add @stacksjs/components
32+
# bun i @stacksjs/components
3333
```
3434

3535
```sh [pnpm]
36-
pnpm add @stacksjs/switch
37-
# pnpm i @stacksjs/switch
36+
pnpm add @stacksjs/components
37+
# pnpm i @stacksjs/components
3838
```
3939

4040
```sh [yarn]
41-
yarn add @stacksjs/switch
42-
# yarn i -d @stacksjs/switch
41+
yarn add @stacksjs/components
42+
# yarn i -d @stacksjs/components
4343
```
4444

4545
:::
@@ -52,7 +52,7 @@ The switch component is simple to use and highly customizable:
5252
```html
5353
<script>
5454
import { ref } from '@stacksjs/stx'
55-
import { Switch, SwitchLabel, SwitchGroup } from '@stacksjs/switch'
55+
import { Switch, SwitchLabel, SwitchGroup } from '@stacksjs/components'
5656
5757
const enabled = ref(false)
5858
</script>

0 commit comments

Comments
 (0)