├── .env.example ├── .nvmrc ├── .watchmanconfig ├── .yarnrc ├── commitlint.config.js ├── src ├── styles │ └── globals.css ├── pages │ ├── about.tsx │ ├── api │ │ └── graphql.ts │ ├── index.tsx │ ├── post │ │ └── [id].tsx │ └── _app.tsx ├── components │ ├── Nav.tsx │ ├── LayoutComponents.test.tsx │ ├── LayoutComponents.stories.tsx │ ├── BlogPostPreview.tsx │ ├── BlogPost.tsx │ ├── ErrorBoundary.tsx │ ├── FancyBlogPostPreview.tsx │ ├── RelayMatchContainer.tsx │ ├── LayoutComponents.tsx │ └── BlogPosts.tsx └── lib │ ├── relay │ ├── getServerSideProps.ts │ ├── sharedTypes.d.ts │ ├── environment.ts │ └── network.ts │ ├── cors.ts │ ├── blogPosts.ts │ ├── moduleLoader.ts │ └── graphql.ts ├── cypress ├── support │ ├── e2e.ts │ └── commands.ts ├── fixtures │ └── example.json ├── e2e │ └── smoke.cy.ts ├── .eslintrc.js └── tsconfig.json ├── .husky └── commit-msg ├── mocks ├── server.ts ├── data │ ├── crux-google-com-not-found.json │ ├── crux-google-com-unauthorized.json │ └── crux-google-com-success.json ├── index.ts └── README.md ├── postcss.config.js ├── public └── fonts │ └── inter │ ├── Inter-roman.var.woff2 │ └── Inter-italic.var.woff2 ├── .prettierrc.js ├── next-env.d.ts ├── .storybook ├── preview.js ├── main.js └── preview-head.html ├── relay.config.json ├── .eslintignore ├── .prettierignore ├── .stylelintignore ├── schema └── printSchema.ts ├── .stylelintrc.js ├── jest.setup.js ├── tailwind.config.js ├── next.config.js ├── jest.config.js ├── .gitignore ├── cypress.config.ts ├── .vscode └── settings.json ├── tsconfig.json ├── README.md ├── .eslintrc.js ├── .github └── workflows │ └── ci.yml ├── package.json └── patches └── @types+react-relay+13.0.2.patch /.env.example: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16.14.0 -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- 1 | save-prefix "" 2 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /src/styles/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /cypress/support/e2e.ts: -------------------------------------------------------------------------------- 1 | import '@testing-library/cypress/add-commands'; 2 | import './commands'; 3 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn commitlint --edit "${1}" 5 | -------------------------------------------------------------------------------- /mocks/server.ts: -------------------------------------------------------------------------------- 1 | import { setupServer } from 'msw/node'; 2 | 3 | export const server = setupServer(); 4 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /public/fonts/inter/Inter-roman.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sync/data-driven-dependencies-ts/main/public/fonts/inter/Inter-roman.var.woff2 -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | trailingComma: 'all', 4 | bracketSpacing: true, 5 | endOfLine: 'auto', 6 | }; 7 | -------------------------------------------------------------------------------- /public/fonts/inter/Inter-italic.var.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sync/data-driven-dependencies-ts/main/public/fonts/inter/Inter-italic.var.woff2 -------------------------------------------------------------------------------- /mocks/data/crux-google-com-not-found.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": { 3 | "code": 404, 4 | "message": "chrome ux report data not found", 5 | "status": "NOT_FOUND" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /mocks/data/crux-google-com-unauthorized.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": { 3 | "code": 403, 4 | "message": "The request is missing a valid API key.", 5 | "status": "PERMISSION_DENIED" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } 6 | -------------------------------------------------------------------------------- /cypress/e2e/smoke.cy.ts: -------------------------------------------------------------------------------- 1 | describe('smoke tests', () => { 2 | it('should allow you to register and login', () => { 3 | cy.visit('/'); 4 | 5 | cy.findByRole('heading', { name: /blog posts/i }); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /.storybook/preview.js: -------------------------------------------------------------------------------- 1 | import '../src/styles/globals.css'; 2 | 3 | export const parameters = { 4 | actions: { argTypesRegex: '^on[A-Z].*' }, 5 | controls: { 6 | matchers: { 7 | color: /(background|color)$/i, 8 | date: /Date$/, 9 | }, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /mocks/index.ts: -------------------------------------------------------------------------------- 1 | import { server } from './server'; 2 | 3 | server.listen({ onUnhandledRequest: 'warn' }); 4 | // eslint-disable-next-line no-console 5 | console.info('🔶 Mock server running'); 6 | 7 | process.once('SIGINT', () => server.close()); 8 | process.once('SIGTERM', () => server.close()); 9 | -------------------------------------------------------------------------------- /relay.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "src": "src", 3 | "schema": "./schema/schema.graphql", 4 | "artifactDirectory": "src/__generated__", 5 | "excludes": ["**/.next/**", "**/node_modules/**", "**/schema/**"], 6 | "language": "typescript", 7 | "persistConfig": { 8 | "file": "./queryMap.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | out 3 | .next 4 | .vscode 5 | coverage 6 | .DS_Store 7 | yarn-debug.log* 8 | yarn-error.log* 9 | .vercel 10 | storybook-static 11 | README.md 12 | TEST-NOTES.md 13 | tsconfig.tsbuildinfo 14 | /cypress/screenshots 15 | /cypress/videos 16 | __generated__/ 17 | schema.graphql 18 | queryMap.json -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | out 3 | .next 4 | .vscode 5 | coverage 6 | .DS_Store 7 | yarn-debug.log* 8 | yarn-error.log* 9 | .vercel 10 | storybook-static 11 | README.md 12 | TEST-NOTES.md 13 | tsconfig.tsbuildinfo 14 | /cypress/screenshots 15 | /cypress/videos 16 | __generated__/ 17 | schema.graphql 18 | queryMap.json -------------------------------------------------------------------------------- /src/pages/about.tsx: -------------------------------------------------------------------------------- 1 | import { Content } from '../components/LayoutComponents'; 2 | import Nav from '../components/Nav'; 3 | 4 | export default function About() { 5 | return ( 6 | <> 7 |