@faststore/core 4.1.0-dev.1 → 4.1.0-dev.11

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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.1.0-dev.0 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.1.0-dev.10 generate /home/runner/work/faststore/faststore/packages/core
3
3
  > pnpm run gen-types && pnpm run cache-graphql
4
4
 
5
5
 
6
- > @faststore/core@4.1.0-dev.0 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.1.0-dev.10 gen-types /home/runner/work/faststore/faststore/packages/core
7
7
  > node ../cli/bin/run generate-types .
8
8
 
9
9
  [STARTED] Parse Configuration
@@ -19,7 +19,7 @@
19
19
  [COMPLETED] Generate to /home/runner/work/faststore/faststore/packages/core/@generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.1.0-dev.0 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.1.0-dev.10 cache-graphql /home/runner/work/faststore/faststore/packages/core
23
23
  > node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
24
24
 
25
25
  [Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
@@ -1,13 +1,13 @@
1
1
 
2
- > @faststore/core@4.1.0-dev.0 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.1.0-dev.10 test /home/runner/work/faststore/faststore/packages/core
3
3
  > vitest run
4
4
 
5
5
 
6
6
   RUN  v4.0.7 /home/runner/work/faststore/faststore/packages/core
7
7
 
8
- ✓  node  test/utils/match-url.test.ts (10 tests) 30ms
9
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 69ms
10
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 11ms
8
+ ✓  node  test/utils/match-url.test.ts (10 tests) 15ms
9
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 32ms
10
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 27ms
11
11
  stderr | test/sdk/localization/store-url.browser.test.ts
12
12
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
13
13
  at validateCart (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/index.ts:119:27)
@@ -23,26 +23,26 @@
23
23
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:353:23)
24
24
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
25
25
 
26
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 192ms
27
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 18ms
28
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (12 tests) 27ms
29
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 31ms
30
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 12ms
31
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 87ms
32
- ✓  node  test/server/cms/global.test.ts (3 tests) 26ms
33
- ✓  node  test/server/content/service.test.ts (5 tests) 18ms
34
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 7ms
35
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 22ms
36
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 17ms
26
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 18ms
27
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 67ms
28
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 24ms
29
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (12 tests) 17ms
30
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 10ms
31
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 70ms
32
+ ✓  node  test/server/cms/global.test.ts (3 tests) 16ms
33
+ ✓  node  test/server/content/service.test.ts (5 tests) 12ms
34
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 26ms
35
+ ✓  node  test/sdk/localization/store-url.test.ts (1 test) 18ms
36
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 12ms
37
37
  ✓  node  test/pages/api/preview.test.ts (2 tests) 21ms
38
- ✓  node  test/server/cms/index.test.ts (2 tests) 11ms
39
- ✓  node  test/server/index.test.ts (7 tests) 1871ms
40
- ✓ should return a valid merged GraphQL schema  551ms
41
- ✓ should exist with its plugins  698ms
42
- ✓ should handle options and execute  588ms
38
+ ✓  node  test/server/cms/index.test.ts (2 tests) 10ms
39
+ ✓  node  test/server/index.test.ts (7 tests) 1244ms
40
+ ✓ should return a valid merged GraphQL schema  353ms
41
+ ✓ should exist with its plugins  305ms
42
+ ✓ should handle options and execute  566ms
43
43
 
44
44
   Test Files  17 passed (17)
45
45
   Tests  203 passed (203)
46
-  Start at  18:20:28
47
-  Duration  13.59s (transform 5.13s, setup 0ms, collect 16.12s, tests 2.47s, environment 7.63s, prepare 575ms)
46
+  Start at  21:21:56
47
+  Duration  11.38s (transform 5.19s, setup 0ms, collect 14.71s, tests 1.64s, environment 7.48s, prepare 532ms)
48
48
 
package/AGENTS.md ADDED
@@ -0,0 +1,167 @@
1
+ # AGENTS.md — `@faststore/core`
2
+
3
+ > Inherits from [`/AGENTS.md`](../../AGENTS.md) (root). This file adds context specific to `@faststore/core`.
4
+
5
+ ## Purpose
6
+
7
+ `@faststore/core` is the **integration layer** that orchestrates all packages. It is a Next.js application acting as the reference implementation and starter template for FastStore stores.
8
+
9
+ ## Tech
10
+
11
+ - Next.js 16 (SSR/SSG)
12
+ - React 18.2
13
+ - GraphQL via `@faststore/api`
14
+ - SCSS Modules for component styles
15
+
16
+ ## Key Directories
17
+
18
+ - `src/components/` — application components grouped by domain (`account`, `cart`, `cms`, `localization`, `navigation`, `product`, `region`, `search`, `sections`, `templates`, `ui`)
19
+ - `src/pages/` — Next.js file-based routing
20
+ - `src/sdk/` — store-level SDK logic and hooks
21
+ - `src/server/` — server-side utilities
22
+ - `src/customizations/` — store-specific overrides
23
+ - `src/experimental/` — experimental features
24
+ - `cms/faststore/` — CMS configuration (`sections.json`, `base.jsonc`, `content-types.json`)
25
+ - `@generated/` — auto-generated GraphQL types (DO NOT edit)
26
+ - `api/` — GraphQL handler setup
27
+ - `cypress/` — E2E tests
28
+
29
+ ## Key Files
30
+
31
+ - `next.config.js` — Next.js configuration
32
+ - `discovery.config.default.js` / `discovery.config.js` — store routing/discovery
33
+ - `codegen.ts` — GraphQL code generation config
34
+ - `cms/faststore/sections.json` — CMS sections definition (~2700 lines)
35
+ - `src/Layout.tsx` — main layout
36
+ - `src/constants.ts` — app constants
37
+ - `vtex.env` — platform env file
38
+ - `lighthouserc.js` — Lighthouse CI config
39
+ - `next-seo.config.ts` — SEO defaults
40
+
41
+ ## Common Patterns
42
+
43
+ ### Section/Page component with SCSS Modules
44
+
45
+ ```tsx
46
+ // src/components/sections/MySection/MySection.tsx
47
+ import styles from './my-section.module.scss'
48
+
49
+ export interface MySectionProps {
50
+ title: string
51
+ buyButton: { label: string }
52
+ }
53
+
54
+ function MySection({ title, buyButton }: MySectionProps) {
55
+ return (
56
+ <Section className={styles.section}>
57
+ {/* JSX using library components */}
58
+ </Section>
59
+ )
60
+ }
61
+
62
+ export default MySection
63
+ ```
64
+
65
+ ### Composing with library components
66
+
67
+ Import from `@faststore/ui` and alias with `UI` prefix to avoid local name collisions:
68
+
69
+ ```tsx
70
+ import {
71
+ Accordion as UIAccordion,
72
+ AccordionButton as UIAccordionButton,
73
+ AccordionItem as UIAccordionItem,
74
+ AccordionPanel as UIAccordionPanel,
75
+ } from '@faststore/ui'
76
+
77
+ function ProductDescription({ descriptionData }: Props) {
78
+ return (
79
+ <UIAccordion>
80
+ <UIAccordionItem>
81
+ <UIAccordionButton>Title</UIAccordionButton>
82
+ <UIAccordionPanel>Content</UIAccordionPanel>
83
+ </UIAccordionItem>
84
+ </UIAccordion>
85
+ )
86
+ }
87
+ ```
88
+
89
+ ### Analytics events
90
+
91
+ ```ts
92
+ import { sendAnalyticsEvent } from '@faststore/sdk'
93
+
94
+ sendAnalyticsEvent({
95
+ name: 'event_name',
96
+ params: {
97
+ /* event data */
98
+ },
99
+ })
100
+ ```
101
+
102
+ ## Common Tasks
103
+
104
+ ### Adding a section
105
+
106
+ 1. Create component under `src/components/sections/MySection/` (SCSS Modules).
107
+ 2. Compose with `@faststore/ui` components.
108
+ 3. Add the section definition to `cms/faststore/sections.json` (props, schema, defaults).
109
+ 4. Export from the section folder's `index.ts`.
110
+
111
+ ### Adding a page
112
+
113
+ 1. Create file under `src/pages/` (e.g. `product/[slug].tsx`).
114
+ 2. Use Next.js conventions (`getStaticProps`, `getServerSideProps`).
115
+ 3. Compose with sections and components.
116
+
117
+ ### Adding a store-specific UI component
118
+
119
+ 1. Place under `src/components/ui/` or `src/components/sections/`.
120
+ 2. Create `*.module.scss` alongside the component.
121
+ 3. Compose library components from `@faststore/ui`.
122
+
123
+ ### Updating styles
124
+
125
+ - For core/sections: edit the `.module.scss` next to the component.
126
+ - For library tokens: edit `packages/ui/src/styles/`.
127
+
128
+ ### Managing SVG icons
129
+
130
+ Icons are loaded from a single sprite at `public/icons.svg` via the `Icon` component from `@faststore/ui`.
131
+
132
+ 1. Open `public/icons.svg` and add a new `<symbol>` with a unique `id`
133
+ 2. Remove `fill`, `stroke-width`, `width`, `height`, and `color` attributes from the symbol so it can be styled via CSS
134
+ 3. Use the icon in any component:
135
+
136
+ ```tsx
137
+ import { Icon } from '@faststore/ui'
138
+
139
+ ;<Icon name="Bell" weight="thin" />
140
+ ```
141
+
142
+ This project uses icons from [Phosphor Icons](https://phosphoricons.com/).
143
+
144
+ ## Tests
145
+
146
+ `@faststore/core` separates tests by environment:
147
+
148
+ - **Node tests:** `*.test.{ts,tsx}` run in Node.
149
+ - **Browser tests:** `*.browser.test.{ts,tsx}` run in a browser-like environment.
150
+
151
+ Run:
152
+
153
+ ```bash
154
+ cd packages/core
155
+ pnpm test # unit + integration
156
+ pnpm test:e2e # Cypress E2E
157
+ pnpm lhci # Lighthouse performance audit
158
+ ```
159
+
160
+ ## Generated Files (DO NOT EDIT)
161
+
162
+ - `@generated/` — GraphQL types
163
+ - `dist/` — build outputs
164
+
165
+ ## Performance
166
+
167
+ `@faststore/core` MUST generate static pages using Jamstack principles for optimal TTFB and Core Web Vitals. Lighthouse CI gates apply. See root [Architectural Principles §II](../../AGENTS.md).
package/CHANGELOG.md CHANGED
@@ -3,6 +3,56 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 4.1.0-dev.11 (2026-05-15)
7
+
8
+ **Note:** Version bump only for package @faststore/core
9
+
10
+ # [4.1.0-dev.10](https://github.com/vtex/faststore/compare/v4.1.0...v4.1.0-dev.10) (2026-05-15)
11
+
12
+ **Note:** Version bump only for package @faststore/core
13
+
14
+ # [4.1.0-dev.9](https://github.com/vtex/faststore/compare/v4.1.0-dev.8...v4.1.0-dev.9) (2026-05-15)
15
+
16
+ **Note:** Version bump only for package @faststore/core
17
+
18
+ # [4.1.0-dev.8](https://github.com/vtex/faststore/compare/v4.1.0-dev.7...v4.1.0-dev.8) (2026-05-15)
19
+
20
+ **Note:** Version bump only for package @faststore/core
21
+
22
+ # [4.1.0-dev.7](https://github.com/vtex/faststore/compare/v4.1.0-dev.6...v4.1.0-dev.7) (2026-05-15)
23
+
24
+ **Note:** Version bump only for package @faststore/core
25
+
26
+ # [4.1.0-dev.6](https://github.com/vtex/faststore/compare/v4.1.0-dev.5...v4.1.0-dev.6) (2026-05-14)
27
+
28
+ **Note:** Version bump only for package @faststore/core
29
+
30
+ # [4.1.0-dev.5](https://github.com/vtex/faststore/compare/v4.1.0-dev.4...v4.1.0-dev.5) (2026-05-14)
31
+
32
+ ### Bug Fixes
33
+
34
+ - region slider section render ([#3318](https://github.com/vtex/faststore/issues/3318)) ([f9f5e0d](https://github.com/vtex/faststore/commit/f9f5e0dbd6c3e92b24a3fb1e21a95bfb1c6744f1)), closes [#2887](https://github.com/vtex/faststore/issues/2887) [#2961](https://github.com/vtex/faststore/issues/2961) [#3071](https://github.com/vtex/faststore/issues/3071)
35
+
36
+ # [4.1.0-dev.4](https://github.com/vtex/faststore/compare/v4.1.0-dev.3...v4.1.0-dev.4) (2026-05-13)
37
+
38
+ **Note:** Version bump only for package @faststore/core
39
+
40
+ # [4.1.0-dev.3](https://github.com/vtex/faststore/compare/v4.1.0-dev.2...v4.1.0-dev.3) (2026-05-13)
41
+
42
+ **Note:** Version bump only for package @faststore/core
43
+
44
+ # [4.1.0-dev.2](https://github.com/vtex/faststore/compare/v4.1.0-dev.1...v4.1.0-dev.2) (2026-05-12)
45
+
46
+ ### Bug Fixes
47
+
48
+ - allow_all_components for CMS ([#3312](https://github.com/vtex/faststore/issues/3312)) ([eadeaa3](https://github.com/vtex/faststore/commit/eadeaa36782b40be0fe7fb16604f7a5bc3da2b79))
49
+
50
+ # 4.1.0 (2026-05-11)
51
+
52
+ ### Features
53
+
54
+ - version bump 4.1.0 ([#3310](https://github.com/vtex/faststore/issues/3310)) ([1ea7bac](https://github.com/vtex/faststore/commit/1ea7bac649d783e50a9e79f8fe412009ae4a87f7)), closes [#3309](https://github.com/vtex/faststore/issues/3309) [#3308](https://github.com/vtex/faststore/issues/3308) [#3306](https://github.com/vtex/faststore/issues/3306) [#3304](https://github.com/vtex/faststore/issues/3304) [#3301](https://github.com/vtex/faststore/issues/3301)
55
+
6
56
  # [4.1.0-dev.1](https://github.com/vtex/faststore/compare/v4.1.0-dev.0...v4.1.0-dev.1) (2026-05-11)
7
57
 
8
58
  **Note:** Version bump only for package @faststore/core