Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: middleware #543

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

back max-age

a384f5a
Select commit
Loading
Failed to load commit list.
Draft

feat: middleware #543

back max-age
a384f5a
Select commit
Loading
Failed to load commit list.
VTEX Sites / Build succeeded Oct 23, 2024 in 3m 17s

Build

Build success! Check the logs bellow:

Details

[Wed Oct 23 19:15:18 UTC 2024] This is a development build.
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.94s.

yarn run v1.22.19
$ faststore build
success - Temporary folder .faststore created
success - Build time updated 2024-10-23T19:15:20.388Z
success - Starter files copied
enableMiddleware true
/shared/project/middleware.ts
success - Middleware file copied
success - Core files copied
success - custom-theme theme has been applied
success - CMS webhook URLs file created
$ na run partytown && na run generate
$ partytown copylib ./public/~partytown
Partytown lib copied to: /shared/project/.faststore/public/~partytown
$ na run generate:schema && na run generate:codegen && na run format:generated
$ tsx src/server/generator/generateGraphQLSchemaFile.ts
Schema GraphQL file generated successfully
$ graphql-codegen
[STARTED] Parse Configuration
[SUCCESS] Parse Configuration
[STARTED] Generate outputs
[STARTED] Generate to ./@generated/
[STARTED] Load GraphQL schemas
[SUCCESS] Load GraphQL schemas
[STARTED] Load GraphQL documents
[SUCCESS] Load GraphQL documents
[STARTED] Generate
[SUCCESS] Generate
[SUCCESS] Generate to ./@generated/
[SUCCESS] Generate outputs
Running lifecycle hook "afterStart" scripts...
[CLI] Loading Schemas
[CLI] Loading Documents
[CLI] Generating output
$ prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
$ next build
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
   Linting and checking validity of types ...
   Creating an optimized production build ...
   Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc.js" https://nextjs.org/docs/messages/swc-disabled
   Using external babel configuration from /shared/project/.faststore/.babelrc.js
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
 ✓ Compiled successfully
   Collecting page data ...
   Generating static pages (0/7) ...
Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.

   Generating static pages (1/7) 

   Generating static pages (3/7) 

   Generating static pages (5/7) 

 ✓ Generating static pages (7/7) 
   Finalizing page optimization ...
   Collecting build traces ...

Route (pages)                              Size     First Load JS
┌ ● /                                      1.26 kB         151 kB
├   └ css/197e314c5a03eabd.css             740 B
├   /_app                                  0 B            93.9 kB
├ ● /[...slug]                             2.8 kB          163 kB
├   └ css/e47f1a002bdcf76f.css             2.38 kB
├ ● /[slug]/p                              11.3 kB         161 kB
├   └ css/fbd711b9f5abf105.css             9.57 kB
├ ○ /404                                   1.45 kB         133 kB
├ ● /500                                   1.45 kB         133 kB
├ ● /account                               671 B           133 kB
├ λ /api/graphql                           0 B            93.9 kB
├ λ /api/health/live                       0 B            93.9 kB
├ λ /api/health/ready                      0 B            93.9 kB
├ λ /api/preview                           0 B            93.9 kB
├ ● /checkout                              656 B           133 kB
├ ● /login                                 1.56 kB         133 kB
└ ● /s                                     2.26 kB         163 kB
+ First Load JS shared by all              97 kB
  ├ chunks/framework-87222725de2ce6d0.js   45.4 kB
  ├ chunks/main-8fc4b95eb2876027.js        33.1 kB
  ├ chunks/pages/_app-3cfc64d8d24d0d61.js  12.9 kB
  ├ chunks/webpack-71b9e66099b89c5a.js     2.49 kB
  └ css/b074e3b140b1a561.css               3.08 kB

ƒ Middleware                               26 kB

λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
○  (Static)  automatically rendered as static HTML (uses no initial props)
●  (SSG)     automatically generated as static HTML + JSON (uses getStaticProps)

success - /shared/project/.faststore/.next copied to /shared/project/.next
success - /shared/project/.faststore/lighthouserc.js copied to /shared/project/lighthouserc.js
success - /shared/project/.faststore/public copied to /shared/project/public
Done in 127.96s.

[Wed Oct 23 19:17:30 UTC 2024] NGINX image Dockerfile was created!
[Wed Oct 23 19:17:30 UTC 2024] Node image Dockerfile was created!
[Wed Oct 23 19:17:36 UTC 2024] Validating NGINX configuration file syntax.
[Wed Oct 23 19:17:36 UTC 2024] NGINX config file ok.
[Wed Oct 23 19:17:36 UTC 2024] Building NGINX image.
[Wed Oct 23 19:17:39 UTC 2024] NGINX image was generated.
[Wed Oct 23 19:17:39 UTC 2024] Building Node image.
[Wed Oct 23 19:17:48 UTC 2024] Node image was generated.
[Wed Oct 23 19:17:51 UTC 2024] NGINX image was tagged as preview.
[Wed Oct 23 19:17:53 UTC 2024] Node image was tagged as preview.
[Wed Oct 23 19:17:54 UTC 2024] Deploying development preview
[Wed Oct 23 19:17:54 UTC 2024] This is a development build. Skiping production deploy.
[Wed Oct 23 19:18:06 UTC 2024] Development preview deployed
[Wed Oct 23 19:18:06 UTC 2024] Deploy completed.