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

V2 - New preset v2-mst-aptd-gcms-lcz-sty with hybrid SSG/SSR instead of SSR-only (based on v1-ssr-mst-aptd-gcms-lcz-sty) #68

Open
wants to merge 459 commits into
base: v1-ssr-mst-aptd-gcms-lcz-sty
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 212 commits
Commits
Show all changes
459 commits
Select commit Hold shift + click to select a range
f158733
Add fetchJSON utility, based on best-practices from Vercel (SWR offic…
Vadorequest Jun 2, 2020
94b63b9
Misc - Avoid using getValueFallback (not necessary)
Vadorequest Jun 2, 2020
628f205
Remove record utility (not used anymore)
Vadorequest Jun 2, 2020
119a4a2
Fix forgotten import
Vadorequest Jun 2, 2020
2888c12
Remove @types/lodash.filter (buggy with TS types, was supposed to hav…
Vadorequest Jun 3, 2020
388db28
Fix "TypeError: Cannot destructure property 'message' of 'error' as i…
Vadorequest Jun 3, 2020
0c3fe60
Make getExamplesCommonServerSideProps and getCommonServerSideProps re…
Vadorequest Jun 3, 2020
bd308fe
Rename StaticParams to CommonServerSideParams + use CommonServerSideP…
Vadorequest Jun 3, 2020
0fd1aae
Re-implement the previously deleted "record" utility, removed useless…
Vadorequest Jun 3, 2020
de94348
Add "fetch" polyfill from 'next' + make jest load ENV vars from .env*…
Vadorequest Jun 4, 2020
0ceea3f
Add test to verify a global fetch object is available (from 'next' po…
Vadorequest Jun 4, 2020
de99345
Misc remove dead code
Vadorequest Jun 4, 2020
221549c
Fix TS error
Vadorequest Jun 4, 2020
9893a52
Misc reorder imports and config of HOCs in next.config.js
Vadorequest Jun 5, 2020
1ed2c6a
Fix "Error: Network error: Only absolute URLs are supported" when run…
Vadorequest Jun 5, 2020
bb4abf8
Add TS support for jest-extended
Vadorequest Jun 5, 2020
aa2a4fa
Ignore .next folder for test suite (jest)
Vadorequest Jun 4, 2020
7352dcd
Add jest-expect-message to Jest config, to allow to write debug messa…
Vadorequest Jun 5, 2020
9da75b0
Add unit test meant to test ENV variables are properly configured
Vadorequest Jun 5, 2020
354d57b
Add IS_SERVER_INITIAL_BUILD env var to be able to know when pages are…
Vadorequest Jun 5, 2020
b548a2f
Add muteConsole/unmuteConsole global functions for test environment
Vadorequest Jun 5, 2020
d0edd79
Preload font correctly (#97)
Vadorequest Jun 5, 2020
54b654a
Replace all occurrences of "export declare type" by "export type"
Vadorequest Jun 5, 2020
8c4bbf5
Code Climate test coverage integration using GitHub Actions (#102)
Demmonius Jun 8, 2020
7d3c58c
Add jest-runner-groups to run tests by group (#91) (modified)
Vadorequest Jun 8, 2020
94ae2f9
Avoid GHA failure when too many commits are pushed (moving HEAD was l…
Demmonius Jun 8, 2020
da53222
Update implementation of SSR pages, use language from query if availa…
Vadorequest Jun 10, 2020
1ada961
Misc doc pageTemplateSSR
Vadorequest Jun 10, 2020
e386fcc
Add "yarn start:tunnel" script using ngrok to create a local tunnel q…
Vadorequest Jun 10, 2020
8a5b579
Disable outdated-browser-rework completely (for now, until we impleme…
Vadorequest Jun 10, 2020
7c97621
Refactor language button in footer as a dedicated I18nBtnChangeLocale…
Vadorequest Jun 11, 2020
878bd71
Fix/improve footer styling
Vadorequest Jun 11, 2020
352f0a0
Improve UI of I18nBtnChangeLocale
Vadorequest Jun 11, 2020
674fab7
Attempt not to replace IS_SERVER_INITIAL_BUILD at build time to avoid…
Vadorequest Jun 11, 2020
4c91f65
Add doc to better explain what webpack "definitions" plugin does to a…
Vadorequest Jun 11, 2020
c643d49
Improve I18nBtnChangeLocale UI
Vadorequest Jun 11, 2020
cf24852
Improve i18nRedirect (now handles query parameters as well, they were…
Vadorequest Jun 11, 2020
fcdee9f
Remove unused big image
Vadorequest Jun 11, 2020
07f47b3
Fix Theme used by I18nBtnChangeLocale (wrong one from other preset)
Vadorequest Jun 11, 2020
5f5feb5
Apply differences between gcms and at presets manually (through diff)
Vadorequest Jun 11, 2020
98f6db3
Add hybridCache implementation from "-at" preset (unused in this pres…
Vadorequest Jun 11, 2020
6693698
Apply missing differences (TS type + ProductRow.tsx) between gcms and…
Vadorequest Jun 11, 2020
64614ce
CI - Automatically run LightHouse (on PR commits) (#103)
Demmonius Jun 12, 2020
556caf3
Add script to force deploy using fake commit
Vadorequest Jun 12, 2020
1f1654b
Should fix domain name issues
Demmonius Jun 12, 2020
c9b2339
Upgrade now CLI to latest version (fixes "now alias" command)
Vadorequest Jun 12, 2020
3ceba93
Cleanup .vercel directory when running "yarn now:cleanup" (so that lo…
Vadorequest Jun 12, 2020
895bc7f
Add option to preview a page as "full page" (including Nav/Footer) ev…
Vadorequest Jun 12, 2020
fa5f1a2
Fix - GHA are not triggered in case of merge (#109)
Demmonius Jun 16, 2020
d7a0c62
Using default github token
Demmonius Jun 16, 2020
281c254
Only using token provide by github
Demmonius Jun 16, 2020
0397fe1
Add Markdown support (#113)
Vadorequest Jun 16, 2020
cdc0e57
Remove unnecessary `GITHUB_CI_PR_COMMENT` and use default `GITHUB_TOK…
Demmonius Jun 16, 2020
770b166
Automatically run E2E tests suite when manually deploying on producti…
Vadorequest Jun 18, 2020
416a9fd
Fix yarn scripts (:full had been removed but forgotten to use the pro…
Vadorequest Jun 22, 2020
d4c5e2f
Add "appName" to sentry tags
Vadorequest Jun 24, 2020
a5727f2
Add "name" to status API response
Vadorequest Jun 24, 2020
4d1a0f2
Allow custom i18n translations per customer (#118)
Vadorequest Jun 25, 2020
97621d4
Misc - Use logger instead of console
Vadorequest Jul 6, 2020
07c491a
Misc - Doc about preview mode security
Vadorequest Jul 6, 2020
0739929
Fix hybrid cache no ttl (#123)
Vadorequest Jul 11, 2020
4e3155e
Add useCustomer hook to access customer data (#124)
Vadorequest Jul 12, 2020
093c755
Improve E2E tests (#125)
Vadorequest Jul 12, 2020
9323a5a
Run lighthouse on /en instead of / (base url) (#127)
Vadorequest Jul 12, 2020
c1965eb
Make stopPreviewMode/startPreviewMode forward query parameters
Vadorequest Jun 12, 2020
d53b89c
Update hooks examples (#126)
Vadorequest Jul 12, 2020
429b68f
Change publication workflow (staging = preview env) (#129)
Vadorequest Jul 16, 2020
a0cca3d
Docs update "just-the-docs" theme 0.3.0 (#132)
Vadorequest Jul 16, 2020
2ec0cac
I18nLink now forwards query params (they were silently ignored before…
Vadorequest Jul 19, 2020
f2118e2
GDPR - Disable Google Click ID being used by default (#138)
Vadorequest Jul 20, 2020
3b1c475
Remove our own LightHouse comment and use the native comment (#139)
Vadorequest Jul 26, 2020
5520d99
Improve LightHouse reports (#141)
Vadorequest Jul 27, 2020
34476d6
GDPR - Add cookie consent UI (#140) (adapted)
Vadorequest Jul 27, 2020
4a71bb9
Ignore cypress folder for CodeClimate code quality analysis
Vadorequest Jul 28, 2020
33c7e9d
Update CodeClimate "main" branch for Github Actions CI
Vadorequest Jul 28, 2020
653206f
Fix CodeClimate coverage tests by running tests without integration (…
Vadorequest Jul 28, 2020
08dcd6d
Use :any to avoid TS issue with upcoming https://github.com/UnlyEd/ne…
Vadorequest Aug 25, 2020
bd448ee
Fix i18n link (#148)
Vadorequest Aug 25, 2020
1d659a0
Misc separator in example between links (readability)
Vadorequest Sep 2, 2020
462faa7
Attempt to fix Vercel auto-aliasing - Shouldn't use "https://" for ho…
Vadorequest Sep 2, 2020
3dc2e77
Misc typo
Vadorequest Sep 3, 2020
4882d26
Add uuid package and related types (#158)
Vadorequest Sep 5, 2020
9e99898
Bugfix 157 e2e failing (#159)
Vadorequest Sep 6, 2020
cf312a7
Docs - Fix custom CSS not being applied on preset
Vadorequest Sep 6, 2020
1b01c9d
Upgrade to Next.js 9.5.4-canary.4 (#161)
Vadorequest Sep 7, 2020
cd4bced
Upgrade deps (#165)
Vadorequest Sep 8, 2020
41445c5
Upgrade to [email protected]
Vadorequest Sep 9, 2020
4984f89
Add jsLibraryMappings (WebStorm)
Vadorequest Sep 9, 2020
7a1d12a
Add helpful scripts to analyse NRN own dependencies usage (#82)
Vadorequest Sep 14, 2020
85aeedd
Fix text align in <Code> component - See https://github.com/rajinwond…
Vadorequest Sep 19, 2020
90c4b4e
Added csstype for better typing experience (#172)
samuelcastro Sep 25, 2020
bf393d3
Optional catch-all routes (manually imported from #162)
Vadorequest Oct 8, 2020
e689daf
Specify logEvent type (TS)
Vadorequest Oct 13, 2020
ddc57c6
Add additional default tags to sentry (customer, version, buildId)
Vadorequest Oct 13, 2020
bf8598d
Auto-track user in Sentry (universally)
Vadorequest Oct 13, 2020
bc497d9
Rename NEXT_PUBLIC_BUILD_TIME > NEXT_PUBLIC_APP_BUILD_TIME + rename N…
Vadorequest Oct 13, 2020
f4868ed
Add NEXT_PUBLIC_APP_NAME_VERSION
Vadorequest Oct 13, 2020
8724205
Add configureSentryI18n to init lang/locale automatically for all pages
Vadorequest Oct 13, 2020
d500c3d
Rename UniversalGlobalStyles > MultiversalGlobalStyles
Vadorequest Oct 13, 2020
e80a845
Misc reformat code
Vadorequest Oct 13, 2020
170a3eb
Massive code reformat
Vadorequest Oct 13, 2020
e9c9afe
Manual & remote (HTTP) deployments through GitHub UI/API (#147)
Demmonius Oct 17, 2020
dccc001
Improve GHA (#180)
Vadorequest Oct 18, 2020
fb9da29
GHA - Protect staging workflow from commenting the PR when there is n…
Vadorequest Oct 21, 2020
654cb95
Misc
Vadorequest Oct 21, 2020
4299c08
Auto-alias custom domains (#185)
Vadorequest Oct 21, 2020
3fdcd21
Misc space
Vadorequest Oct 21, 2020
6e65926
Improve CC config (100 lines is too few for React functions, annoying…
Vadorequest Oct 21, 2020
7b9a370
Change PreviewModeBanner.tsx look depending on whether preview is ena…
Vadorequest Oct 21, 2020
99daa87
Fix GHA - Use custom domain aliases configured in production yaml fil…
Vadorequest Oct 22, 2020
3dd17be
[GHA] Add generic "deploy:customer" scripts, which simplifies GHA CI/…
Vadorequest Oct 27, 2020
0806fd9
Upgrade `v2-mst-aptd-gcms-lcz-sty` preset to Next.js 10 (#190)
Vadorequest Oct 30, 2020
25a4219
Add react and Next.js codemod utility scripts - See https://nextjs.or…
Vadorequest Oct 30, 2020
b5b59df
Refactor Font-Awesome icons (for `v2-mst-aptd-gcms-lcz-sty` preset) (…
Vadorequest Oct 30, 2020
40d6999
Update cypress-io/github-action from v1 to v2 to fix CI/CD due to ::s…
Vadorequest Nov 21, 2020
ed696a8
Migrate "now" to "vercel" (#210)
Vadorequest Nov 21, 2020
a87b55e
Use NOW_REGION instead of VERCEL_REGION env variable
Vadorequest Nov 21, 2020
e668f9c
Rename Zeit to Vercel (#213) (modified)
Vadorequest Nov 21, 2020
b45c1a6
Improve LightHouse performances (#214) (modified)
Vadorequest Nov 21, 2020
95d5570
Migrate demo to GraphCMS v2 API (#216)
Vadorequest Nov 25, 2020
8d6d5d4
Fix auto-aliasing, was mistakenly using the same alias as v2 airtable…
Vadorequest Nov 25, 2020
ae108d6
Trigger Vercel deployment through NRN API endpoint using GitHub "work…
Demmonius Nov 27, 2020
f466621
Fix dispatch? (#218)
Vadorequest Nov 27, 2020
cc9037e
Fix API `startVercelDeployment` (#219)
Vadorequest Nov 27, 2020
5c13197
Fix link to changelog
Vadorequest Dec 18, 2020
58d85d8
Add an action that releases automatically when a change lands on the …
Vadorequest Dec 19, 2020
b3703c4
Don't use increment + don't use prerelease but releases instead
Vadorequest Dec 19, 2020
1093980
(MAJOR) Fake major version to reach v2 + use version based on branch …
Vadorequest Dec 19, 2020
9fd127f
Provide in api/status the git commit metadata (SHA/branch/tag) used t…
Demmonius Dec 19, 2020
6b4006e
Sync production/staging deployment files (a few forgotten things fixe…
Vadorequest Dec 19, 2020
94d618b
Await Vercel deployment to be ready before running E2E (#221)
Demmonius Dec 19, 2020
5ad05e8
Overall improvements and new features (GraphCMS) (#231)
Vadorequest Dec 20, 2020
4c08b5d
Provide git tags and release about deployed commit (#228)
Demmonius Dec 20, 2020
363590b
Fix auto-releasing (#232)
Vadorequest Dec 20, 2020
a3747c7
Enable auto-git-release GHA on master/main by default, improves DX wh…
Vadorequest Dec 21, 2020
2d29e8e
Add utility scripts for bumping major/minor version manually without …
Vadorequest Dec 21, 2020
b2a2625
Use "v" prefix for tag/releases
Vadorequest Dec 21, 2020
c6cc3b3
Apply default to GIT_COMMIT_TAGS
Vadorequest Dec 21, 2020
1fe9110
DevOps - Resolve app version from git tags, instead of package.json (…
Vadorequest Dec 21, 2020
2d1aa53
Invoke custom webhook url once a Vercel deployment is "completed" (#235)
Demmonius Dec 30, 2020
38713b4
Handle GitHub private repositories (#236)
Vadorequest Dec 30, 2020
ab06f8e
Fix test by using null if NEXT_PUBLIC_APP_BUILD_TIME is undefined
Vadorequest Dec 30, 2020
1ab103b
Fix stage provided when invoking webhook callback in production
Vadorequest Dec 30, 2020
9eec0b3
Fix "await-for-vercel-deployment" step (#237)
Vadorequest Jan 4, 2021
5d62759
Documentation update for `v2-mst-aptd-at-lcz-sty` (#240)
Vadorequest Jan 9, 2021
5529728
Remove WORKFLOW_DISPATCH.md + add ISSUE_TEMPLATE
Vadorequest Jan 9, 2021
842d181
Implement restore-variable to clean our actions (#239)
Demmonius Jan 11, 2021
a5da6f3
Deps - Upgrade `v2-mst-aptd-gcms-lcz-sty` packages (January 2021) (at…
Vadorequest Jan 11, 2021
a284eb4
Deps - Upgrade to Emotion v11 (from v10) [BREAKING CHANGES] (#247) (m…
Vadorequest Jan 11, 2021
7f92123
Disabling "poweredByHeader" (use boolean instead of incorrect string …
Vadorequest Jan 11, 2021
e2f2273
Silent I18nLink component (too noisy due to "Attempted to log "Warnin…
Vadorequest Jan 13, 2021
8a70a06
Improve Sentry monitoring for all pages + improve bootstrap error han…
Vadorequest Jan 13, 2021
06a3576
Improve demo about error handling
Vadorequest Jan 13, 2021
8693988
Track fileLabel for easier debugging using Sentry
Vadorequest Jan 13, 2021
bbf1958
Misc doc - Update link (workflow dispatch)
Vadorequest Jan 14, 2021
b9c8660
Fix English flag (#250)
Vadorequest Jan 16, 2021
6d1b574
Add StoryBook to `v2-mst-aptd-gcms-lcz-sty` (#258)
Vadorequest Jan 17, 2021
41a6277
Upgrade dependencies `v2-mst-aptd-gcms-lcz-sty` - 2021-01-17 (#260)
Vadorequest Jan 17, 2021
3c3d833
Upgrade Next.js framework to v10.0.5 (#261)
Vadorequest Jan 17, 2021
52d2cb0
Optimize Storybook CI/CD, by avoiding unnecessary runs (#263)
Vadorequest Jan 17, 2021
9f46048
Add "Jest" addon for Storybook (#262)
Vadorequest Jan 17, 2021
7ee6303
Remove useless file (wasn't meant to be merged, forgotten)
Vadorequest Jan 17, 2021
7fae165
Add missing command yarn e2e:sb
Vadorequest Jan 17, 2021
01dd3df
Fix regression in Animated3Dots.tsx (fill became required for no reas…
Vadorequest Jan 17, 2021
13bee76
(MAJOR) Massive folder structure refactoring (`v2-mst-aptd-gcms-lcz-s…
Vadorequest Jan 20, 2021
fa6c5aa
Move src/gql folder to src/common/gql
Vadorequest Jan 21, 2021
59c4973
Adapt ignored CC folders
Vadorequest Jan 20, 2021
63e8b35
Add links to online documentation
Vadorequest Jan 21, 2021
49b12da
[Github actions] Implement custom 'store-variables' on the production…
Demmonius Jan 22, 2021
2b20440
Fix theme (using CustomerTheme) - See https://github.com/UnlyEd/next-…
Vadorequest Jan 23, 2021
9ba1ccc
Consider v2-mst-aptd-gcms-lcz-sty as main branch - See https://github…
Vadorequest Jan 23, 2021
68195e9
Add build:local command (#281)
Vadorequest Jan 23, 2021
9a3bef8
Feature - Automatically release Vercel deployments as GitHub deployme…
Vadorequest Jan 24, 2021
471d0ed
Change GitHub deployments so they don't auto-deactivate when new ones…
Vadorequest Jan 24, 2021
fa92d68
no_override option doesn't work as expected - See https://github.com/…
Vadorequest Jan 24, 2021
d82634d
Optimize GitHub Actions triggers (#282)
Vadorequest Jan 24, 2021
34523ce
Try to use no_override: true
Vadorequest Jan 24, 2021
bb93039
Fix infinite browser redirect loop when default locale isn't allowed …
Vadorequest Jan 31, 2021
b35fe03
Disable force redirect, not reliable enough to be included by default…
Vadorequest Jan 31, 2021
c27a0e4
Misc rename page name for template page
Vadorequest Jan 31, 2021
b8ed798
Add documentation for props used by the default layout (HeadProps, La…
Vadorequest Jan 31, 2021
d9a0562
Remove CDN links (#287)
Vadorequest Feb 2, 2021
8b41aef
Fix #290 - Pre-build pages correctly (was working only for one page)
Vadorequest Feb 15, 2021
e23de5e
(MINOR) Refactoring application to use @apollo/client 3.x (from #291)…
Vadorequest Feb 22, 2021
303ac64
[GHA] Upgrade github-action-store-variable from 1.0.1 to v2.1.1 (#289)
Demmonius Feb 24, 2021
9196302
Don't export Props types from Functional Components (#300) (modified)
Vadorequest Mar 18, 2021
0adc5b1
Don't export GraphCMSAsset Props
Vadorequest Mar 18, 2021
c645037
Convert Animated3Dots to FC component
Vadorequest Mar 18, 2021
f74441e
Upgrade dependencies (Node.js 14, Next.js v10.1.2) (March 31, 2021) (…
Vadorequest Mar 31, 2021
b9fdba9
Ignore eslint @typescript-eslint/no-explicit-any (no warning)
Vadorequest Mar 31, 2021
c041726
Avoid crashing when running "next dev --port 8888" directly
Vadorequest Mar 31, 2021
5afb7f0
Add start:windows command
Vadorequest Mar 31, 2021
8f05d3f
Use GetDefaultServerSidePropsResults instead of GetCommonServerSidePr…
Vadorequest Apr 1, 2021
bcc5c6e
Deploy serverless functions to paris by default (need Enterprise plan…
Vadorequest Apr 1, 2021
e726455
Fix "?." failing on Vercel
Vadorequest Apr 1, 2021
316a03d
Upgrade marvinpinto/action-automatic-releases from v1.1.0 to v1.1.1 (…
Vadorequest Apr 17, 2021
e03b530
GHA - Replace Vercel bash deploy script by "deploy-on-vercel" github …
Demmonius May 8, 2021
ac38db0
Replace @unly/utils-simple-logger and winston by @unly/simple-logger …
Vadorequest May 8, 2021
72951d3
Upgrade to Next.js v10.2 (#313)
Vadorequest May 8, 2021
2dd5a0e
Rework of fonts (#315)
Vadorequest May 10, 2021
d1ddd27
Fix rel="alternate" - Must use absolute url (with "https://" prefix) …
Vadorequest May 11, 2021
251d6b5
Optimise cookieConsent to avoid rendering on each page transition (#319)
Vadorequest May 10, 2021
ecf0bed
Misc simplify import
Vadorequest May 12, 2021
970ec52
Upgrade dependencies (gcms) 12-05-21 (#329)
Vadorequest May 12, 2021
e902136
Reformat
Vadorequest May 12, 2021
8bc67c7
Simplify layouts (#330)
Vadorequest May 12, 2021
bf14a4b
Fix - Display deployment's aliases on PR (regression from #296) (#318)
Demmonius May 13, 2021
84cd616
Add useInterval hook
Vadorequest May 19, 2021
cd0c802
Avoid displaying an error on 404 pages
Vadorequest May 26, 2021
248c16f
Improve 404 page detection (covers more use-cases) + Don't serve page…
Vadorequest May 26, 2021
c9a2c37
Preload app-wide shared data (based on #334) (#336)
Vadorequest May 26, 2021
ec7f95a
Pre-fetch all Locize translations as app-wide static data (GCMS), bas…
Vadorequest May 26, 2021
09bf035
Enable React strict mode (#339)
Vadorequest May 27, 2021
9540ebf
Avoids crash when building app if there are any circular references
Vadorequest May 27, 2021
b31169f
Improve pre-evaluation (static prefetching) (#343)
Vadorequest May 27, 2021
a483648
Add "build:fast" command
Vadorequest May 27, 2021
bd0a27a
Mark all mutes as XXX instead of Hack (creates too much unnecessary n…
Vadorequest May 27, 2021
c7ab58b
Improve public layout by using a properly mocked Customer entity shar…
Vadorequest May 28, 2021
a48b7f6
Misc doc
Vadorequest May 28, 2021
e715d46
Return 404 when current locale isn't allowed (it's already the defaul…
Vadorequest May 28, 2021
e31e3e0
Refactor resolveSSRLocale to avoid code duplication in SSR layouts
Vadorequest May 28, 2021
0ff0e5e
Fix 404 page generation + refactor all layouts SSG/SSR (gcms preset) …
Vadorequest May 28, 2021
5a09927
Upgrade Cypress to v7 (from #327)
Vadorequest May 29, 2021
f5cce0d
Using getGraphcmsDataset to avoid code duplication and boost performa…
samuelcastro Jun 1, 2021
681b3fe
Send network speed to Amplitude analytics and Sentry (#358)
Vadorequest Jun 9, 2021
d120396
Improve HTTP headers security by default (from #364)
Vadorequest Jun 9, 2021
4600861
Add 1h caching for all static assets (only fonts were cached before)
Vadorequest Jun 9, 2021
f906c4e
Use main, footer, nav and their ARIA equivalent for better a11y (#365)
Vadorequest Jun 10, 2021
ec618be
Optimize .vercelignore configuration (from #366, modified)
Vadorequest Jun 10, 2021
2e61590
Fix usage of IS_SERVER_INITIAL_BUILD in logging + improve doc (#368)
Vadorequest Jun 10, 2021
b721e84
Upgrade next-plugin-preval to 1.2.0 (#369)
Vadorequest Jun 10, 2021
28f1896
NextJS 11 (#371)
Vadorequest Jun 15, 2021
0775900
Update the description (omg I forgot to do it for so long!)
Vadorequest Jun 15, 2021
a54e516
Fix eslint configuration (using "next" v11 plugin) + fix ESLint warnings
Vadorequest Jun 15, 2021
c0cb012
Enforce eslint stronger rules for core web vitals
Vadorequest Jun 15, 2021
c414b40
Fix eslint errors
Vadorequest Jun 15, 2021
043db6f
Remove dead code (unnecessary anymore)
Vadorequest Jun 19, 2021
82aad2f
Refactor Amplitude (browser) + add Amplitude to the server side (API)…
Vadorequest Jun 23, 2021
6a27688
Fix TS issues
Vadorequest Jun 23, 2021
9b72578
Refactor Sentry + fix Sentry usage in API endpoints (#375)
Vadorequest Jun 24, 2021
83c0c5f
Add flushSafe to avoid crashing API endpoint when flushing fails
Vadorequest Jun 24, 2021
a5ad627
Use '@sentry/node' instead of Sentry init
Vadorequest Jun 24, 2021
ed3cfdf
Fix TS issue "Type error: Module '"/vercel/path1/src/modules/core/sen…
Vadorequest Jun 24, 2021
9a4e137
Increase Sentry timeout to 5s, too many failure using 2s...
Vadorequest Jun 24, 2021
5ea63ac
Fix Sentry config on the server side (#377)
Vadorequest Jun 25, 2021
cdb9243
Add missing await/flush in API endpoints
Vadorequest Jun 25, 2021
53e51a8
Avoids capturing false-positive 404 pages when building the 404 page
Vadorequest Jun 25, 2021
e4e2e7a
[UPDATE] Github Action await-vercel (#383)
Demmonius Oct 18, 2021
06a6a37
Change app.graphcms.com to app.hygraph.com
Vadorequest Jan 23, 2023
c5d5eb9
Update Ubuntu from 18.04 to latest (currently 20.04) (#396)
Vadorequest Apr 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .env.build.example

This file was deleted.

55 changes: 55 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# See https://nextjs.org/docs/basic-features/environment-variables

# XXX Tips: How is this file meant to be used?
# This file is tracked by git and must only contains NON-SENSITIVE information, which is usually meant to be available in the browser.
# Sensitive information (server-side only) MUST be written in ".env.development.local" file instead (which isn't tracked by git).

# XXX Tips: When is this file being used?
# This file is used only during development (localhost).
# For staging/production stages, the app relies on "now.{NEXT_PUBLIC_CUSTOMER_REF}.{NEXT_PUBLIC_APP_STAGE}.yml:build.env".

# XXX Tips: What's the difference between env vars starting with "NEXT_PUBLIC_" and the others?
# All env variables that DON'T start with "NEXT_PUBLIC_" MUST be manually exposed by ./next.config.js for the project to work locally
# "NEXT_PUBLIC_" has a semantic purpose. If you mean to use a variable on the browser, then you should use "NEXT_PUBLIC_".
# Any non-sensitive env variable should start with "NEXT_PUBLIC_".
# Sensitive information MUST NOT start with "NEXT_PUBLIC_".
# You must be careful to use sensitive information only on the server-side, because if you use them on the browser or getInitialProps, they'll be leaked, even if the variable doesn't start with "NEXT_PUBLIC_".
# Any change to this file needs a server restart to be applied.

# The stage is "how" the application is running.
# It can be either "development", "staging" or "production".
# This value is also set in each "now.*.json" files, so that other stages use their own value.
# Tip: This value must not be changed.
# Tip: You may override it from ".env.development.local" if you want to simulate another stage, locally.
NEXT_PUBLIC_APP_STAGE=development

# The name of the NRN preset being used.
# Used by the demo to redirect to the preset branch/documentation.
NEXT_PUBLIC_NRN_PRESET=v2-mst-aptd-gcms-lcz-sty

# The customer that is being used.
# Tip: You may override it from ".env.development.local" if you want to simulate another customer, locally.
NEXT_PUBLIC_CUSTOMER_REF=customer1

# Locize project ID, can be found in the project "settings" page
# Used to fetch the i18n translations
# Tip: The value being used below is valid, so that you can run the demo locally without having to create your own Locize account, but you cannot make any change
NEXT_PUBLIC_LOCIZE_PROJECT_ID=658fc999-dfa8-4307-b9d7-b4870ad5b968

# Amplitude API key, can be found under "Manage Data > Project name > Project settings > API Key"
# Used to send analytics usage
# Tip: The value being used below is valid, so that you can run the demo locally without having to create your own Amplitude account, but you cannot access the data
NEXT_PUBLIC_AMPLITUDE_API_KEY=5ea02d86a6840c165fcc01377131fa13

# GraphQL API endpoint (using GraphCMS vendor)
# Used to fetch content from GraphCMS
# Tip: The value being used below is valid, so that you can run the demo locally without having to create your own GraphCMS account
# XXX We only use one stage ("master") due to the free plan's limitation, but using two stages is more secure for enterprise-grade apps
GRAPHQL_API_ENDPOINT=https://api-euwest.graphcms.com/v1/ck73ixhlv09yt01dv2ga1bkbp/master

# GraphQL API key (using GraphCMS vendor), can be found under "Settings > Auth token"
# Used to fetch content from GraphCMS, this token only has read-only permissions to avoid data tempering (especially since we made it public within NRN)
# This variable is only used server-side
# Tip: The value being used below is valid, so that you can run the demo locally without having to create your own GraphCMS account
# XXX For the purpose of this demo, we're tracking this in git, but unless you're building an open API you'll want to move it to ".env.development.local" (especially if this is your "master" token)
GRAPHQL_API_KEY=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImdjbXMtbWFpbi1wcm9kdWN0aW9uIn0.eyJ2ZXJzaW9uIjoyLCJ0b2tlbklkIjoiMGEyZWYwZWYtYmY4Ny00ZmVlLTkzYmQtMzBkMzIzYzAwODM4IiwiaWF0IjoxNTgyNzQ2MDc1LCJpc3MiOiJodHRwczovL21hbmFnZW1lbnQuZ3JhcGhjbXMuY29tLyJ9.wE-IDwFnCNpwUj5AMeGsbf2CGcTgkT1KkE9_l6s-bU03sckdDgV2LXCHH5Fb8XwJGAkoeD5bK9yDnY6oNapiusvg4xRqY-hkRxgh8lB_lTXXpIka6HhjIJz1RQO_dObNGFqr41dKihseBqN5Ce4AJvQBIHyJasKX63xe2eEzdUnWfuNUmrG_XStRu1-xDKKp7vFVox272rr-LqgwRymF3eYcw7J-IAag4qpztoU6zNhKJNYzQKdMMejvMDNg34bHNp4TRIbIUIYpytkwCaAb5TsH98xEiFziU5rUr4EYToSltgE46VnqX2npm56qK-AGp5zauMZgvA20Djtb7BuYqGAqCdOHEQtjjyVLufCu6Y72i9gNQqFQ-WGQ6AFN84KT7BJgRoTruduYG9VhGMOR59HR3jG2QIWXOCt55aI9YwAGNQii0b_QqaoSO08Pb_Ooji5abFLISs70jQb-z1QcnvHIzHnsKqymEWwZhbkxpwf8bv8C6-8k4JGB5YdVj3T_0XQ-OCyvWQIGwVxKysLj8HBeVvXOKUyz7p-thOHbO4qSaRaV7w6_Yy2XtdwBlkIiTTqLezN34vCnsyhZ7N1IgLzp0bwNCyCoPOFs5Q9Ccw7hwJRP3kDT2cW4COJWVt-V5YF_9nnlZN8JjcIgv7FMZKoKRHi004vSosPYGd-v3Uw
31 changes: 31 additions & 0 deletions .env.development.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# XXX Template example
# This file is an example, meant to be duplicated as ".env.development.local" for local override

# See https://nextjs.org/docs/basic-features/environment-variables

# XXX Tips: How is this file meant to be used?
# This file is NOT tracked by git and can contain sensitive information, or override variables from ".env.development".

# XXX Tips: When is this file being used?
# This file is used only during development (localhost).
# For staging/production stages, the app relies on "now.{NEXT_PUBLIC_CUSTOMER_REF}.{NEXT_PUBLIC_APP_STAGE}.yml:build.env".

# XXX Tips: What's the difference between env vars starting with "NEXT_PUBLIC_" and the others?
# All env variables that DON'T start with "NEXT_PUBLIC_" MUST be manually exposed by ./next.config.js for the project to work locally
# "NEXT_PUBLIC_" has a semantic purpose. If you mean to use a variable on the browser, then you should use "NEXT_PUBLIC_".
# Any non-sensitive env variable should start with "NEXT_PUBLIC_".
# Sensitive information MUST NOT start with "NEXT_PUBLIC_".
# You must be careful to use sensitive information only on the server-side, because if you use them on the browser or getInitialProps, they'll be leaked, even if the variable doesn't start with "NEXT_PUBLIC_".
# Any change to this file needs a server restart to be applied.

# Locize API key, can be found under "Your project > Settings > Api Keys" at https://www.locize.app/?ref=unly-nrn
# Used to automatically save missing translations when working locally
# Optional - If not set, the app will work anyway, it just won't create new keys automatically
# Example (fake value): 615384ff-0f39-4c7b-89ca-9b0acbfd0869
LOCIZE_API_KEY=

# Sentry DSN, can be found under "Your project > Client Keys (DSN)" at https://sentry.io/settings/YOUR_ORG/projects/YOUR_PROJECT/keys/
# Used to send monitoring events (errors, etc.)
# Optional - If not set, the app will work anyway, it just won't send any event
# Example (fake value): https://[email protected]/1234567
SENTRY_DSN=
6 changes: 2 additions & 4 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ rules: # See https://eslint.org/docs/rules
strict: 'off'
no-console: 1 # Shouldn't use "console", but "logger" instead
allowArrowFunctions: 0
no-unused-vars:
- warn # Warn otherwise it false-positive with needed React imports
- args: none # Allow to declare unused variables in function arguments, meant to be used later
no-unused-vars: 0 # Disabled, already handled by @typescript-eslint/no-unused-vars
import/prefer-default-export: 0 # When there is only a single export from a module, don't enforce a default export, but rather let developer choose what's best
no-else-return: 0 # Don't enforce, let developer choose. Sometimes we like to specifically use "return" for the sake of comprehensibility and avoid ambiguity
no-underscore-dangle: 0 # Allow _ before/after variables and functions, convention for something meant to be "private"
Expand Down Expand Up @@ -78,7 +76,7 @@ rules: # See https://eslint.org/docs/rules
react-hooks/exhaustive-deps: warn
react/jsx-no-target-blank: warn # Not using "noreferrer" is not a security risk, but "noopener" should always be used indeed
react/prop-types: warn # Should be handled with TS instead
react/no-unescaped-entities: warn # Causes text mismatch when enabled
react/no-unescaped-entities: 0 # Causes text mismatch when enabled
jsx-a11y/anchor-is-valid: warn
linebreak-style:
- error
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-zeit-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
# Configures the deployment environment, install dependencies (like node, npm, etc.) that are requirements for the upcoming jobs
# Ex: Necessary to run `yarn deploy`
setup-environment:
name: Setup deployment environment (Ubuntu 18.04 - Node 10.x)
name: Setup deployment environment (Ubuntu 18.04 - Node 12.x)
runs-on: ubuntu-18.04
steps:
- name: Installing node.js
uses: actions/setup-node@v1 # Used to install node environment - XXX https://github.com/actions/setup-node
with:
node-version: '10.x' # Use the same node.js version as the one Zeit's uses (currently node10.x)
node-version: '12.x' # Use the same node.js version as the one Zeit's uses (currently node12.x)

# Starts a Zeit deployment, using the production configuration file of the default institution
# The default institution is the one defined in the `now.json` file (which is a symlink to the actual file)
Expand All @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v1 # Get last commit pushed - XXX See https://github.com/actions/checkout
- name: Deploying on Zeit
run: yarn deploy:$(cat now.json | jq -r '.build.env.CUSTOMER_REF'):production --token $ZEIT_TOKEN
run: yarn deploy:$(cat now.json | jq -r '.build.env.NEXT_PUBLIC_CUSTOMER_REF'):production --token $ZEIT_TOKEN
env:
ZEIT_TOKEN: ${{ secrets.ZEIT_TOKEN }} # Passing github's secret to the worker

Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/deploy-zeit-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
# Configures the deployment environment, install dependencies (like node, npm, etc.) that are requirements for the upcoming jobs
# Ex: Necessary to run `yarn deploy`
setup-environment:
name: Setup deployment environment (Ubuntu 18.04 - Node 10.x)
name: Setup deployment environment (Ubuntu 18.04 - Node 12.x)
runs-on: ubuntu-18.04
steps:
- name: Installing node.js
uses: actions/setup-node@v1 # Used to install node environment - XXX https://github.com/actions/setup-node
with:
node-version: '10.x' # Use the same node.js version as the one Zeit's uses (currently node10.x)
node-version: '12.x' # Use the same node.js version as the one Zeit's uses (currently node12.x)

# Starts a Zeit deployment, using the staging configuration file of the default institution
# The default institution is the one defined in the `now.json` file (which is a symlink to the actual file)
Expand All @@ -36,7 +36,7 @@ jobs:
# - Set deployment url to show on PR message
# - Create alias and link it
run: |
ZEIT_DEPLOYMENT_OUTPUT=`yarn deploy:$(cat now.json | jq -r '.build.env.CUSTOMER_REF') --token $ZEIT_TOKEN`
ZEIT_DEPLOYMENT_OUTPUT=`yarn deploy:$(cat now.json | jq -r '.build.env.NEXT_PUBLIC_CUSTOMER_REF') --token $ZEIT_TOKEN`

ZEIT_DEPLOYMENT_URL=`echo $ZEIT_DEPLOYMENT_OUTPUT | egrep -o 'https?://[^ ]+.now.sh'`
echo "::set-env name=ZEIT_DEPLOYMENT_URL::$ZEIT_DEPLOYMENT_URL"
Expand All @@ -46,13 +46,19 @@ jobs:
else
ZEIT_DEPLOYMENT_ALIAS=$(cat now.json | jq -r '.name')-${CURRENT_BRANCH##*/}
fi

# Zeit alias only allows 53 characters in the domain name, so we only keep the first 46 characters (because Zeit needs 7 chars for ".now.sh" at the end of the domain name)
# Also, in order to remove forbidden characters, we create a sequence from ascii numbers using ranges of numbers (we forbid characters by using `seq X Y` and we add others by using ';').
# All special characters are converted to `-` (using `tr $0 $1` where $0 is replaced by $1), and only 0-9 and a-Z chars are kept intact.
# We then use `awk` to convert "ascii numbers" back into actual characters.
# You can find the numbers equivalence by tapping `man ascii` and look at the "decimal" set.
ZEIT_DEPLOYMENT_ALIAS=$(echo $ZEIT_DEPLOYMENT_ALIAS | head -c 46 | tr "`(seq 0 47 ; seq 58 64 ; seq 91 96 && seq 123 127) | awk '{printf("%c",$1)}'`" -).now.sh

# Zeit alias only allows 53 characters in the domain name, so we only keep the first 45 (45 = 53 - 7 - 1) characters (because Zeit needs 7 chars for ".now.sh" at the end of the domain name, and count starts at 1, not 0)
# Also, in order to remove forbidden characters, we transform every characters which are not a "alnum" and \n or \r into '-'

ZEIT_DEPLOYMENT_ALIAS=$(echo $ZEIT_DEPLOYMENT_ALIAS | head -c 45 | tr -c '[:alnum:]\r\n' - | tr '[:upper:]' '[:lower:]')

# Recursively remove any trailing dash ('-')
while [[ "$ZEIT_DEPLOYMENT_ALIAS" == *- ]]
do
ZEIT_DEPLOYMENT_ALIAS=${ZEIT_DEPLOYMENT_ALIAS::-1}
done

ZEIT_DEPLOYMENT_ALIAS=$ZEIT_DEPLOYMENT_ALIAS.now.sh
echo "::set-env name=ZEIT_DEPLOYMENT_ALIAS::https://$ZEIT_DEPLOYMENT_ALIAS"

npx now alias $ZEIT_DEPLOYMENT_URL https://$ZEIT_DEPLOYMENT_ALIAS --token $ZEIT_TOKEN
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ fabric.properties
*.iml
modules.xml
.idea/misc.xml
.idea/codeStyles
*.ipr
vcs.xml

Expand Down Expand Up @@ -118,9 +119,10 @@ coverage/
/.next/
/out/

# misc
.env*
!.env.build.example
# Next.js environment variables - See https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables
.env.build
.env*.local
!.env*.example

# debug
npm-debug.log*
Expand Down
4 changes: 4 additions & 0 deletions .nowignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ README.md
schema.graphql
yarn.lock
yarn-error.log

# Avoid tests being deployed as Vercel Serverless Functions (increases bundle size, and count towards limits)
src/pages/api/*.test.ts
src/pages/api/**/*.test.ts
2 changes: 1 addition & 1 deletion cypress/config-customer1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "https://nrn-v1-ssr-mst-aptd-gcms-lcz-sty-c1.now.sh/",
"baseUrl": "https://nrn-v2-mst-aptd-gcms-lcz-sty-c1.now.sh/",
"projectId": "4dvdog",
"screenshotsFolder": "cypress/screenshots/customer1",
"videosFolder": "cypress/videos/customer1",
Expand Down
2 changes: 1 addition & 1 deletion cypress/config-customer2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "https://nrn-v1-ssr-mst-aptd-gcms-lcz-sty-c2.now.sh/",
"baseUrl": "https://nrn-v2-mst-aptd-gcms-lcz-sty-c2.now.sh/",
"projectId": "4dvdog",
"screenshotsFolder": "cypress/screenshots/customer2",
"videosFolder": "cypress/videos/customer2",
Expand Down
9 changes: 6 additions & 3 deletions cypress/integration/app/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ describe('Index page', () => {
* Navbar section
*/
it('should have 5 links in the navigation bar', () => {
cy.get('#nav a.nav-link').should('have.length', 5);
cy.get('#nav .navbar-nav > .nav-item').should('have.length', 5);
});

it('should have a link in the navbar that redirects to the examples page', () => {
cy.url().should('eq', `${baseUrl}/`);
cy.url().should('eq', `${baseUrl}/en`);
cy.get('#nav-link-examples')
.should('have.text', 'Examples')
.click();
cy.url().should('eq', `${baseUrl}/examples`);
cy.get('#nav-link-examples-static-i-18-n')
.should('have.text', 'Static i18n')
.click();
cy.url().should('eq', `${baseUrl}/en/examples/built-in-features/static-i18n`);
});
});
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_site
.sass-cache
.jekyll-metadata
25 changes: 25 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: default
nav_exclude: true
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
27 changes: 27 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# XXX This file is only used when working on your local machine, in development
# Run `yarn doc:start` to start the development server
# Read ./CONTRIBUTING.md for further instructions

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# If you have any plugins, put them here!
group :jekyll_plugins do
gem 'just-the-docs' # XXX Our Jekyll theme - See https://pmarsceill.github.io/just-the-docs/
gem "github-pages" # XXX Necessary to reproduce the behaviour of GitHub Pages - When this is loaded, "jekyll" must not be bundled because it's included within
gem 'jemoji' # XXX GitHub-flavored Emoji plugin for Jekyll - See https://github.com/jekyll/jemoji
end

# ------- WINDOWS SUPPORT ---------

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?

Loading