@faststore/core 0.3.11 → 0.3.13

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 (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -4
  3. package/cypress/global.js +1 -1
  4. package/cypress/integration/a11y.test.js +1 -1
  5. package/cypress/integration/analytics.test.js +1 -1
  6. package/cypress/integration/cart.test.js +1 -1
  7. package/cypress/integration/performance.test.js +1 -1
  8. package/cypress/integration/plp.test.js +1 -1
  9. package/cypress/integration/search.test.js +1 -1
  10. package/cypress/integration/seo.test.js +1 -1
  11. package/{store.config.js → faststore.config.js} +0 -0
  12. package/lighthouserc.js +1 -1
  13. package/package.json +1 -1
  14. package/src/components/ThirdPartyScripts/ThirdPartyScripts.tsx +2 -2
  15. package/src/components/product/ProductGrid/ProductGrid.stories.mdx +0 -1
  16. package/src/components/search/Filter/Facets.stories.mdx +0 -2
  17. package/src/components/search/Filter/Filter.stories.mdx +0 -2
  18. package/src/components/search/Filter/FilterSlider.stories.mdx +0 -2
  19. package/src/components/search/SearchProductCard/SearchProductCard.stories.mdx +0 -1
  20. package/src/components/ui/SlideOver/SlideOver.stories.mdx +0 -2
  21. package/src/pages/[...slug].tsx +1 -1
  22. package/src/pages/[slug]/p.tsx +1 -1
  23. package/src/pages/account.tsx +1 -1
  24. package/src/pages/checkout.tsx +1 -1
  25. package/src/pages/index.tsx +1 -1
  26. package/src/pages/login.tsx +1 -1
  27. package/src/pages/s.tsx +1 -1
  28. package/src/sdk/analytics/index.tsx +1 -1
  29. package/src/sdk/analytics/platform/vtex/search.ts +1 -1
  30. package/src/sdk/cart/useCheckoutButton.ts +2 -4
  31. package/src/sdk/session/index.ts +5 -6
  32. package/src/server/cms.ts +1 -1
  33. package/src/server/index.ts +1 -1
  34. package/src/stories/customizing.stories.mdx +1 -1
  35. package/src/stories/midnight.stories.mdx +1 -1
  36. package/src/stories/soft-blue.stories.mdx +1 -1
  37. package/tsconfig.json +5 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Conventional Changelog](https://github.com/conventional-changelog/conventional-changelog),
6
6
  and this project adheres to [Calendar Versioning](https://calver.org/).
7
7
 
8
+ ### [0.3.13](https://github.com/vtex-sites/nextjs.store/compare/0.3.12...0.3.13) (2022-12-19)
9
+
10
+
11
+ ### Chores
12
+
13
+ * using faststore.config avoid store.config ([#330](https://github.com/vtex-sites/nextjs.store/issues/330)) ([6f8ef30](https://github.com/vtex-sites/nextjs.store/commit/6f8ef30ec7c6a32ce29088fa7e506cc3b6b429bc))
14
+
15
+ ### [0.3.12](https://github.com/vtex-sites/nextjs.store/compare/0.3.11...0.3.12) (2022-12-19)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * next tsconfig ([#329](https://github.com/vtex-sites/nextjs.store/issues/329)) ([d2b4fc5](https://github.com/vtex-sites/nextjs.store/commit/d2b4fc5f33c5613eefa151088a7e8a9a899b6d24))
21
+
8
22
  ### [0.3.11](https://github.com/vtex-sites/nextjs.store/compare/0.3.10...0.3.11) (2022-12-19)
9
23
 
10
24
 
package/README.md CHANGED
@@ -43,7 +43,7 @@ As of Sep, 2022, this starter is still far from covering most basic cases found
43
43
  yarn
44
44
  ```
45
45
 
46
- 2. **Setup store.config.js**
46
+ 2. **Setup faststore.config.js**
47
47
 
48
48
  Choose the ecommerce platform provider of your choice in the `store.config` file and set the corresponding options. For instance, to connect to the VTEX platform on the store `fashioneurope`:
49
49
 
@@ -94,7 +94,7 @@ A quick look at the top-level files and directories you'll see in a NextJS proje
94
94
  └── yarn.lock
95
95
  ├── package.json
96
96
  ├── tsconfig.json
97
- ├── store.config.js
97
+ ├── faststore.config.js
98
98
  ├── README.md
99
99
  ├── CHANGELOG.md
100
100
  ├── __generated__
@@ -124,7 +124,7 @@ A quick look at the top-level files and directories you'll see in a NextJS proje
124
124
 
125
125
  9. **`tsconfig.json`**: The configuration file for the typescript compiler. This will statically analyze your code for errors and bugs before releasing them into production
126
126
 
127
- 10. **`store.config.js`**: Configure your e-commerce platform, default sales channel etc.
127
+ 10. **`faststore.config.js`**: Configure your e-commerce platform, default sales channel etc.
128
128
 
129
129
  11. **`README.md`**: A text file containing useful reference information about your project.
130
130
 
@@ -405,7 +405,7 @@ The page rendered with CMS is:
405
405
 
406
406
  ### CMS configs
407
407
 
408
- It's possible to change the CMS tenant and workspace at `store.config.js`.
408
+ It's possible to change the CMS tenant and workspace at `faststore.config.js`.
409
409
 
410
410
  ## 🎓 Learning the Frameworks
411
411
 
package/cypress/global.js CHANGED
@@ -1,4 +1,4 @@
1
- import storeConfig from '../store.config'
1
+ import storeConfig from '../faststore.config'
2
2
 
3
3
  export const { pages } = storeConfig.cypress
4
4
 
@@ -4,7 +4,7 @@
4
4
  * Cypress tests for a11y (accessibility)
5
5
  */
6
6
 
7
- import { cypress } from '../../store.config'
7
+ import { cypress } from '../../faststore.config'
8
8
 
9
9
  const { pages } = cypress
10
10
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { options } from '../global'
8
- import { cypress } from '../../store.config'
8
+ import { cypress } from '../../faststore.config'
9
9
 
10
10
  const { pages } = cypress
11
11
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { options } from '../global'
8
- import { cypress } from '../../store.config'
8
+ import { cypress } from '../../faststore.config'
9
9
 
10
10
  const { pages } = cypress
11
11
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { options } from '../global'
8
- import { cypress } from '../../store.config'
8
+ import { cypress } from '../../faststore.config'
9
9
 
10
10
  const { pages } = cypress
11
11
 
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { options } from '../global'
9
- import { cypress } from '../../store.config'
9
+ import { cypress } from '../../faststore.config'
10
10
 
11
11
  const { pages } = cypress
12
12
 
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { options } from '../global'
8
- import { cypress } from '../../store.config'
8
+ import { cypress } from '../../faststore.config'
9
9
 
10
10
  const { pages } = cypress
11
11
 
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { options } from '../global'
10
- import { cypress, storeUrl } from '../../store.config'
10
+ import { cypress, storeUrl } from '../../faststore.config'
11
11
 
12
12
  const { pages } = cypress
13
13
 
File without changes
package/lighthouserc.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const lhConfig = require('@faststore/lighthouse').default
2
2
 
3
- const { lighthouse: lh } = require('./store.config')
3
+ const { lighthouse: lh } = require('./faststore.config')
4
4
 
5
5
  module.exports = lhConfig({
6
6
  urls: Object.values(lh.pages),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "license": "MIT",
5
5
  "browserslist": "supports es6-module and not dead",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  import { Partytown } from '@builder.io/partytown/react'
2
2
 
3
- import storeConfig from '../../../store.config'
3
+ import storeConfig from '../../../faststore.config'
4
4
  import GoogleTagManager from './GoogleTagManager'
5
5
  import VTEX from './vtex'
6
6
 
@@ -13,7 +13,7 @@ const includeVTEX = storeConfig.platform === 'vtex'
13
13
 
14
14
  if (process.env.NODE_ENV === 'development' && !includeGTM) {
15
15
  console.warn(
16
- 'No GTM container id found. Check the analytics section on your store.config.js file for enhanced observability of your store.'
16
+ 'No GTM container id found. Check the analytics section on your faststore.config.js file for enhanced observability of your store.'
17
17
  )
18
18
  }
19
19
 
@@ -1,6 +1,5 @@
1
1
  import { Meta, Canvas, Story, ArgsTable } from '@storybook/addon-docs'
2
2
  import { SearchProvider } from '@faststore/sdk'
3
- import storeConfig from 'store.config'
4
3
  import Sentinel from 'src/sdk/search/Sentinel'
5
4
  import { productGridItems } from 'src/../.storybook/mocks'
6
5
 
@@ -1,8 +1,6 @@
1
1
  import { SearchProvider } from '@faststore/sdk'
2
2
  import { useSearch } from '@faststore/sdk'
3
3
 
4
- import storeConfig from 'store.config'
5
-
6
4
  import UIProvider, { useUI } from 'src/sdk/ui/Provider'
7
5
  import { validateSession } from 'src/sdk/session'
8
6
  import { useFilter } from './useFilter'
@@ -1,8 +1,6 @@
1
1
  import { SearchProvider } from '@faststore/sdk'
2
2
  import { useSearch } from '@faststore/sdk'
3
3
 
4
- import storeConfig from 'store.config'
5
-
6
4
  import UIProvider, { useUI } from 'src/sdk/ui/Provider'
7
5
  import { validateSession } from 'src/sdk/session'
8
6
  import { useFilter } from './useFilter'
@@ -1,8 +1,6 @@
1
1
  import { SearchProvider } from '@faststore/sdk'
2
2
  import { useSearch } from '@faststore/sdk'
3
3
 
4
- import storeConfig from 'store.config'
5
-
6
4
  import UIProvider, { useUI } from 'src/sdk/ui/Provider'
7
5
  import { validateSession } from 'src/sdk/session'
8
6
  import { useFilter } from './useFilter'
@@ -1,6 +1,5 @@
1
1
  import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs'
2
2
  import { SearchInputProvider } from 'src/sdk/search/useSearchInput'
3
- import storeConfig from 'store.config'
4
3
  import {
5
4
  TokenTable,
6
5
  TokenRow,
@@ -14,8 +14,6 @@ import CartSidebar from 'src/components/cart/CartSidebar'
14
14
  import { cartItem } from 'src/../.storybook/mocks/cart-sidebar'
15
15
  import { facets as facetsMock } from 'src/../.storybook/mocks/filter-slider'
16
16
 
17
- import storeConfig from 'store.config'
18
-
19
17
  import { validateSession } from 'src/sdk/session'
20
18
  import { useFilter } from 'src/components/search/Filter/useFilter'
21
19
 
@@ -26,7 +26,7 @@ import type {
26
26
  ServerCollectionPageQueryQueryVariables,
27
27
  } from '@generated/graphql'
28
28
 
29
- import storeConfig from '../../store.config'
29
+ import storeConfig from '../../faststore.config'
30
30
 
31
31
  type Props = ServerCollectionPageQueryQuery
32
32
 
@@ -20,7 +20,7 @@ import { execute } from 'src/server'
20
20
  import type { PDPContentType } from 'src/server/cms'
21
21
  import { getPage } from 'src/server/cms'
22
22
 
23
- import storeConfig from '../../../store.config'
23
+ import storeConfig from '../../../faststore.config'
24
24
 
25
25
  /**
26
26
  * Sections: Components imported from each store's custom components and '../components/sections' only.
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react'
2
2
  import { NextSeo } from 'next-seo'
3
3
 
4
- import storeConfig from '../../store.config'
4
+ import storeConfig from '../../faststore.config'
5
5
 
6
6
  function Page() {
7
7
  useEffect(() => {
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react'
2
2
  import { NextSeo } from 'next-seo'
3
3
 
4
- import storeConfig from '../../store.config'
4
+ import storeConfig from '../../faststore.config'
5
5
 
6
6
  function Page() {
7
7
  useEffect(() => {
@@ -15,7 +15,7 @@ import { mark } from 'src/sdk/tests/mark'
15
15
  import type { PageContentType } from 'src/server/cms'
16
16
  import { getPage } from 'src/server/cms'
17
17
 
18
- import storeConfig from '../../store.config'
18
+ import storeConfig from '../../faststore.config'
19
19
 
20
20
  /* A list of components that can be used in the CMS. */
21
21
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from 'react'
2
2
  import { NextSeo } from 'next-seo'
3
3
 
4
- import storeConfig from '../../store.config'
4
+ import storeConfig from '../../faststore.config'
5
5
 
6
6
  function Page() {
7
7
  useEffect(() => {
package/src/pages/s.tsx CHANGED
@@ -11,7 +11,7 @@ import { ITEMS_PER_PAGE } from 'src/constants'
11
11
  import { useApplySearchState } from 'src/sdk/search/state'
12
12
  import { mark } from 'src/sdk/tests/mark'
13
13
 
14
- import storeConfig from '../../store.config'
14
+ import storeConfig from '../../faststore.config'
15
15
 
16
16
  const useSearchParams = () => {
17
17
  const [params, setParams] = useState<SearchState | null>(null)
@@ -1,7 +1,7 @@
1
1
  import type { AnalyticsEvent } from '@faststore/sdk'
2
2
  import { useAnalyticsEvent } from '@faststore/sdk'
3
3
 
4
- import storeConfig from '../../../store.config'
4
+ import storeConfig from '../../../faststore.config'
5
5
 
6
6
  if (typeof window !== 'undefined') {
7
7
  window.dataLayer = window.dataLayer ?? []
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { AnalyticsEvent } from '@faststore/sdk'
5
5
 
6
- import config from '../../../../../store.config'
6
+ import config from '../../../../../faststore.config'
7
7
  import type { SearchSelectItemEvent } from '../../types'
8
8
 
9
9
  const THIRTY_MINUTES_S = 30 * 60
@@ -1,7 +1,5 @@
1
+ import storeConfig from '../../../faststore.config'
1
2
  import { useCart } from './index'
2
- import * as storeConfig from '../../../store.config'
3
-
4
- const { checkoutUrl } = storeConfig
5
3
 
6
4
  export const useCheckoutButton = () => {
7
5
  const { isValidating, id } = useCart()
@@ -10,7 +8,7 @@ export const useCheckoutButton = () => {
10
8
  e.preventDefault()
11
9
 
12
10
  if (!isValidating && id) {
13
- window.location.href = `${checkoutUrl}?orderFormId=${id}`
11
+ window.location.href = `${storeConfig.checkoutUrl}?orderFormId=${id}`
14
12
  }
15
13
  }
16
14
 
@@ -1,17 +1,16 @@
1
1
  import { gql } from '@faststore/graphql-utils'
2
+ import type { Session } from '@faststore/sdk'
2
3
  import { createSessionStore } from '@faststore/sdk'
3
4
  import { useMemo } from 'react'
4
- import type { Session } from '@faststore/sdk'
5
-
6
- import storeConfig from 'store.config'
7
5
 
8
- import { cartStore } from '../cart'
9
- import { request } from '../graphql/request'
10
- import { createValidationStore, useStore } from '../useStore'
11
6
  import type {
12
7
  ValidateSessionMutation,
13
8
  ValidateSessionMutationVariables,
14
9
  } from '../../../@generated/graphql/index'
10
+ import storeConfig from '../../../faststore.config'
11
+ import { cartStore } from '../cart'
12
+ import { request } from '../graphql/request'
13
+ import { createValidationStore, useStore } from '../useStore'
15
14
 
16
15
  export const mutation = gql`
17
16
  mutation ValidateSession($session: IStoreSession!, $search: String!) {
package/src/server/cms.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import ClientCMS from '@vtex/client-cms'
2
2
  import type { ContentData, Locator } from '@vtex/client-cms'
3
3
 
4
- import config from '../../store.config'
4
+ import config from '../../faststore.config'
5
5
 
6
6
  export const clientCMS = new ClientCMS({
7
7
  workspace: config.api.workspace,
@@ -14,7 +14,7 @@ import { GraphQLError } from 'graphql'
14
14
  import type { Maybe, Options as APIOptions, CacheControl } from '@faststore/api'
15
15
 
16
16
  import persisted from '../../@generated/graphql/persisted.json'
17
- import storeConfig from '../../store.config'
17
+ import storeConfig from '../../faststore.config'
18
18
 
19
19
  interface ExecuteOptions<V = Record<string, unknown>> {
20
20
  operationName: string
@@ -103,7 +103,7 @@ Its presets are defined on `src/styles/global/tokens.scss` and it's separated in
103
103
  import '../styles/themes/my-theme.scss'
104
104
  ```
105
105
 
106
- 3. Go to `store.config.js` and change the `theme` to your file's name:
106
+ 3. Go to `faststore.config.js` and change the `theme` to your file's name:
107
107
 
108
108
  ```js
109
109
  // Theming
@@ -32,7 +32,7 @@ A darkmode theme created for testing purposes.
32
32
  import '../styles/themes/midnight.scss'
33
33
  ```
34
34
 
35
- 2. Go to `store.config.js` and change the `theme` to your file's name:
35
+ 2. Go to `faststore.config.js` and change the `theme` to your file's name:
36
36
 
37
37
  ```js
38
38
  // Theming
@@ -32,7 +32,7 @@ A basic theme created for testing purposes.
32
32
  import '../styles/themes/soft-blue.scss'
33
33
  ```
34
34
 
35
- 2. Go to `store.config.js` and change the `theme` to your file's name:
35
+ 2. Go to `faststore.config.js` and change the `theme` to your file's name:
36
36
 
37
37
  ```js
38
38
  // Theming
package/tsconfig.json CHANGED
@@ -17,7 +17,11 @@
17
17
  "forceConsistentCasingInFileNames": true,
18
18
  "strict": false,
19
19
  "incremental": true,
20
- "isolatedModules": true
20
+ "isolatedModules": true,
21
+ "target": "es5",
22
+ "lib": ["dom", "dom.iterable", "esnext"],
23
+ "skipLibCheck": true,
24
+ "esModuleInterop": true
21
25
  },
22
26
  "include": ["*.d.ts", "src/**/*.ts", "src/**/*.tsx", "@generated/**/*.ts"],
23
27
  "exclude": ["node_modules", "public"]