@faststore/core 4.1.0 → 4.1.1-dev.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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.1.0-dev.1 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.1.0 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.1 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.1.0 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.1 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.1.0 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.1 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.1.0 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/localization/bindingPaths.test.ts (71 tests) 75ms
9
8
  ✓  node  test/utils/match-url.test.ts (10 tests) 46ms
10
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 28ms
9
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 135ms
10
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 25ms
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)
@@ -15,7 +15,6 @@
15
15
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:353:23)
16
16
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
17
17
 
18
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 56ms
19
18
  stderr | test/sdk/localization/store-url.browser.test.ts
20
19
  Error in optimistic validation: ReferenceError: Cannot access '__vite_ssr_import_4__' before initialization
21
20
  at getSettings (/home/runner/work/faststore/faststore/packages/core/src/sdk/localization/useLocalizationConfig.tsx:126:45)
@@ -24,25 +23,26 @@
24
23
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:353:23)
25
24
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
26
25
 
27
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 15ms
28
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 116ms
29
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (12 tests) 24ms
30
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 15ms
31
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 86ms
32
- ✓  node  test/server/cms/global.test.ts (3 tests) 17ms
33
- ✓  node  test/server/content/service.test.ts (5 tests) 27ms
34
- ✓  node  test/sdk/localization/store-url.test.ts (1 test) 11ms
35
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 31ms
36
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 14ms
37
- ✓  node  test/pages/api/preview.test.ts (2 tests) 20ms
38
- ✓  node  test/server/cms/index.test.ts (2 tests) 13ms
39
- ✓  node  test/server/index.test.ts (7 tests) 1609ms
40
- ✓ should return a valid merged GraphQL schema  419ms
41
- ✓ should exist with its plugins  325ms
42
- ✓ should handle options and execute  833ms
26
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 18ms
27
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 46ms
28
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (12 tests) 28ms
29
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 143ms
30
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 8ms
31
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 122ms
32
+ ✓  node  test/server/cms/global.test.ts (3 tests) 9ms
33
+ ✓  node  test/server/content/service.test.ts (5 tests) 11ms
34
+ ✓  node  test/sdk/localization/store-url.test.ts (1 test) 18ms
35
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 24ms
36
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 15ms
37
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 23ms
38
+ ✓  node  test/server/cms/index.test.ts (2 tests) 14ms
39
+ ✓  node  test/server/index.test.ts (7 tests) 2005ms
40
+ ✓ should return a valid merged GraphQL schema  454ms
41
+ ✓ should exist with its plugins  661ms
42
+ ✓ should handle options and execute  873ms
43
43
 
44
44
   Test Files  17 passed (17)
45
45
   Tests  203 passed (203)
46
-  Start at  21:20:00
47
-  Duration  13.13s (transform 5.18s, setup 0ms, collect 15.74s, tests 2.20s, environment 7.60s, prepare 650ms)
46
+  Start at  20:15:35
47
+  Duration  15.13s (transform 6.49s, setup 0ms, collect 17.30s, tests 2.69s, environment 9.54s, prepare 716ms)
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,12 +3,48 @@
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.1-dev.0](https://github.com/vtex/faststore/compare/v4.1.0...v4.1.1-dev.0) (2026-05-15)
7
+
8
+ **Note:** Version bump only for package @faststore/core
9
+
6
10
  # 4.1.0 (2026-05-11)
7
11
 
8
12
  ### Features
9
13
 
10
14
  - 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)
11
15
 
16
+ # [4.1.0-dev.8](https://github.com/vtex/faststore/compare/v4.1.0-dev.7...v4.1.0-dev.8) (2026-05-15)
17
+
18
+ **Note:** Version bump only for package @faststore/core
19
+
20
+ # [4.1.0-dev.7](https://github.com/vtex/faststore/compare/v4.1.0-dev.6...v4.1.0-dev.7) (2026-05-15)
21
+
22
+ **Note:** Version bump only for package @faststore/core
23
+
24
+ # [4.1.0-dev.6](https://github.com/vtex/faststore/compare/v4.1.0-dev.5...v4.1.0-dev.6) (2026-05-14)
25
+
26
+ **Note:** Version bump only for package @faststore/core
27
+
28
+ # [4.1.0-dev.5](https://github.com/vtex/faststore/compare/v4.1.0-dev.4...v4.1.0-dev.5) (2026-05-14)
29
+
30
+ ### Bug Fixes
31
+
32
+ - 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)
33
+
34
+ # [4.1.0-dev.4](https://github.com/vtex/faststore/compare/v4.1.0-dev.3...v4.1.0-dev.4) (2026-05-13)
35
+
36
+ **Note:** Version bump only for package @faststore/core
37
+
38
+ # [4.1.0-dev.3](https://github.com/vtex/faststore/compare/v4.1.0-dev.2...v4.1.0-dev.3) (2026-05-13)
39
+
40
+ **Note:** Version bump only for package @faststore/core
41
+
42
+ # [4.1.0-dev.2](https://github.com/vtex/faststore/compare/v4.1.0-dev.1...v4.1.0-dev.2) (2026-05-12)
43
+
44
+ ### Bug Fixes
45
+
46
+ - allow_all_components for CMS ([#3312](https://github.com/vtex/faststore/issues/3312)) ([eadeaa3](https://github.com/vtex/faststore/commit/eadeaa36782b40be0fe7fb16604f7a5bc3da2b79))
47
+
12
48
  # [4.1.0-dev.1](https://github.com/vtex/faststore/compare/v4.1.0-dev.0...v4.1.0-dev.1) (2026-05-11)
13
49
 
14
50
  **Note:** Version bump only for package @faststore/core