├── .gitignore ├── README.md ├── api ├── client.ts ├── package.json ├── server.ts └── tsconfig.json ├── babel.config.js ├── blog ├── next-env.d.ts ├── next.config.js ├── package.json ├── pages │ └── index.tsx └── tsconfig.json ├── design ├── components.tsx ├── package.json ├── tsconfig.json └── yarn.lock ├── package.json ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Next + TypeScript + Yarn monorepo 2 | 3 | This has: 4 | 5 | * an application workspace 6 | * an API workspace 7 | * a shared component library workspace 8 | 9 | Read the [blog post about creating next typescript monorepos](https://josephluck.co.uk/blog/next-typescript-monorepo/) to learn more. 10 | -------------------------------------------------------------------------------- /api/client.ts: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { Models } from "./server"; 3 | 4 | const baseURL = "http://localhost:5000"; 5 | 6 | const instance = axios.create({ 7 | baseURL 8 | }); 9 | 10 | export const apiClient = { 11 | posts: { 12 | async getListing(): Promise { 13 | const { data } = await instance.get("/posts"); 14 | return data; 15 | } 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/api", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "files": [ 6 | "./" 7 | ], 8 | "license": "MIT", 9 | "scripts": { 10 | "start": "ts-node ./server.ts" 11 | }, 12 | "dependencies": { 13 | "@types/express": "^4.16.0", 14 | "@types/faker": "^4.1.4", 15 | "axios": "^0.18.0", 16 | "express": "^4.16.4", 17 | "faker": "^4.1.0", 18 | "ts-node": "^7.0.1", 19 | "typescript": "^3.2.2" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/server.ts: -------------------------------------------------------------------------------- 1 | import * as express from "express"; 2 | import * as faker from "faker"; 3 | 4 | export namespace Models { 5 | export interface Post { 6 | id: string; 7 | title: string; 8 | content: string; 9 | } 10 | } 11 | 12 | function randomPost(): Models.Post { 13 | return { 14 | id: faker.random.uuid(), 15 | title: faker.lorem.sentence(), 16 | content: faker.lorem.paragraphs() 17 | }; 18 | } 19 | 20 | const app = express(); 21 | 22 | app.get("/posts", (_req, res) => { 23 | const posts: Models.Post[] = Array.from({ length: 10 }).map(randomPost); 24 | res.json(posts); 25 | }); 26 | 27 | app.listen(5000); 28 | 29 | console.log("API started on port 5000"); 30 | -------------------------------------------------------------------------------- /api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | 4 | const presets = [ 5 | "next/babel", 6 | ["@babel/preset-typescript", { isTSX: true, allExtensions: true }] 7 | ]; 8 | 9 | const plugins = [["styled-components"]]; 10 | 11 | return { 12 | presets, 13 | plugins 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /blog/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /blog/next.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const withPlugins = require("next-compose-plugins"); 3 | const withCustomBabelConfig = require("next-plugin-custom-babel-config"); 4 | const withTranspileModules = require("next-transpile-modules"); 5 | 6 | function withCustomWebpack(config = {}) { 7 | const { webpack } = config; 8 | 9 | config.webpack = (config, ...rest) => { 10 | const babelRule = config.module.rules.find((rule) => 11 | rule.use && Array.isArray(rule.use) 12 | ? rule.use.find((u) => u.loader === "next-babel-loader") 13 | : rule.use.loader === "next-babel-loader" 14 | ); 15 | if (babelRule) { 16 | babelRule.include.push(path.resolve("../")); 17 | } 18 | 19 | return webpack(config, ...rest); 20 | }; 21 | 22 | return config; 23 | } 24 | 25 | const plugins = [ 26 | [withTranspileModules, { transpileModules: ["@acme"] }], 27 | [ 28 | withCustomBabelConfig, 29 | { babelConfigFile: path.resolve("../babel.config.js") }, 30 | ], 31 | [withCustomWebpack], 32 | ]; 33 | 34 | const config = {}; 35 | 36 | module.exports = withPlugins(plugins, config); 37 | -------------------------------------------------------------------------------- /blog/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/blog", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "scripts": { 7 | "dev": "next", 8 | "build": "next build" 9 | }, 10 | "dependencies": { 11 | "@acme/api": "*", 12 | "@acme/design": "*", 13 | "@types/next": "^7.0.5", 14 | "@types/react": "^16.7.18", 15 | "@types/react-dom": "^16.0.11", 16 | "babel-plugin-styled-components": "^1.10.0", 17 | "next": "^9.4.0", 18 | "next-compose-plugins": "^2.2.0", 19 | "next-plugin-custom-babel-config": "^1.0.2", 20 | "next-transpile-modules": "^3.0.0", 21 | "react": "16.8", 22 | "react-dom": "^16.7.0", 23 | "rexreplace": "^4.1.1", 24 | "ts-node": "^7.0.1", 25 | "typescript": "^3.2.2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /blog/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import Link from "next/link"; 3 | import { Models } from "@acme/api/server"; 4 | import { apiClient } from "@acme/api/client"; 5 | import { Layout } from "@acme/design/components"; 6 | import { NextPage } from "next"; 7 | 8 | interface Props { 9 | posts: Models.Post[]; 10 | } 11 | 12 | const BlogIndex: NextPage = ({ posts }) => { 13 | return ( 14 | 15 |
    16 | {posts.map(post => ( 17 |
  • 18 | 19 | {post.title} 20 | 21 |
  • 22 | ))} 23 |
24 |
25 | ); 26 | }; 27 | 28 | BlogIndex.getInitialProps = async () => { 29 | const posts = await apiClient.posts.getListing(); 30 | return { posts }; 31 | }; 32 | 33 | export default BlogIndex; 34 | -------------------------------------------------------------------------------- /blog/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "baseUrl": "../", 5 | "rootDir": ".", 6 | "lib": [ 7 | "dom", 8 | "es7" 9 | ], 10 | "skipLibCheck": true, 11 | "strict": false, 12 | "forceConsistentCasingInFileNames": true, 13 | "noEmit": true, 14 | "esModuleInterop": true, 15 | "module": "esnext", 16 | "resolveJsonModule": true, 17 | "isolatedModules": true, 18 | "jsx": "preserve" 19 | }, 20 | "exclude": [ 21 | "node_modules" 22 | ], 23 | "include": [ 24 | "next-env.d.ts", 25 | "**/*.ts", 26 | "**/*.tsx" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /design/components.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import styled from "styled-components"; 3 | 4 | const Heading = styled.h1` 5 | font-size: 2rem; 6 | line-height: 2.4rem; 7 | margin: 0 0 1rem; 8 | `; 9 | 10 | const Main = styled.main` 11 | padding: 1rem; 12 | `; 13 | 14 | export function Layout({ children }: { children: React.ReactNode }) { 15 | return ( 16 |
17 | Acme's blog 18 | {children} 19 |
20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /design/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/design", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "files": [ 6 | "./" 7 | ], 8 | "license": "MIT", 9 | "dependencies": { 10 | "@types/react": "^16.7.18", 11 | "@types/react-dom": "^16.0.11", 12 | "@types/styled-components": "^4.1.4", 13 | "react": "^16.7.0", 14 | "react-dom": "^16.7.0", 15 | "styled-components": "^4.1.3", 16 | "typescript": "^3.2.2" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /design/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "react" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /design/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/helper-annotate-as-pure@^7.0.0": 6 | version "7.0.0" 7 | resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" 8 | integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== 9 | dependencies: 10 | "@babel/types" "^7.0.0" 11 | 12 | "@babel/helper-module-imports@^7.0.0": 13 | version "7.0.0" 14 | resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" 15 | integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== 16 | dependencies: 17 | "@babel/types" "^7.0.0" 18 | 19 | "@babel/types@^7.0.0": 20 | version "7.2.2" 21 | resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" 22 | integrity sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg== 23 | dependencies: 24 | esutils "^2.0.2" 25 | lodash "^4.17.10" 26 | to-fast-properties "^2.0.0" 27 | 28 | "@emotion/is-prop-valid@^0.7.3": 29 | version "0.7.3" 30 | resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.7.3.tgz#a6bf4fa5387cbba59d44e698a4680f481a8da6cc" 31 | integrity sha512-uxJqm/sqwXw3YPA5GXX365OBcJGFtxUVkB6WyezqFHlNe9jqUWH5ur2O2M8dGBz61kn1g3ZBlzUunFQXQIClhA== 32 | dependencies: 33 | "@emotion/memoize" "0.7.1" 34 | 35 | "@emotion/memoize@0.7.1": 36 | version "0.7.1" 37 | resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.1.tgz#e93c13942592cf5ef01aa8297444dc192beee52f" 38 | integrity sha512-Qv4LTqO11jepd5Qmlp3M1YEjBumoTHcHFdgPTQ+sFlIL5myi/7xu/POwP7IRu6odBdmLXdtIs1D6TuW6kbwbbg== 39 | 40 | "@emotion/unitless@^0.7.0": 41 | version "0.7.3" 42 | resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.3.tgz#6310a047f12d21a1036fb031317219892440416f" 43 | integrity sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg== 44 | 45 | "@types/node@*": 46 | version "10.12.18" 47 | resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" 48 | integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== 49 | 50 | "@types/prop-types@*": 51 | version "15.5.8" 52 | resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.8.tgz#8ae4e0ea205fe95c3901a5a1df7f66495e3a56ce" 53 | integrity sha512-3AQoUxQcQtLHsK25wtTWIoIpgYjH3vSDroZOUr7PpCHw/jLY1RB9z9E8dBT/OSmwStVgkRNvdh+ZHNiomRieaw== 54 | 55 | "@types/react-dom@^16.0.11": 56 | version "16.0.11" 57 | resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.11.tgz#bd10ccb0d9260343f4b9a49d4f7a8330a5c1f081" 58 | integrity sha512-x6zUx9/42B5Kl2Vl9HlopV8JF64wLpX3c+Pst9kc1HgzrsH+mkehe/zmHMQTplIrR48H2gpU7ZqurQolYu8XBA== 59 | dependencies: 60 | "@types/react" "*" 61 | 62 | "@types/react@*", "@types/react@^16.7.18": 63 | version "16.7.18" 64 | resolved "https://registry.yarnpkg.com/@types/react/-/react-16.7.18.tgz#f4ce0d539a893dd61e36cd11ae3a5e54f5a48337" 65 | integrity sha512-Tx4uu3ppK53/iHk6VpamMP3f3ahfDLEVt3ZQc8TFm30a1H3v9lMsCntBREswZIW/SKrvJjkb3Hq8UwO6GREBng== 66 | dependencies: 67 | "@types/prop-types" "*" 68 | csstype "^2.2.0" 69 | 70 | "@types/styled-components@^4.1.4": 71 | version "4.1.4" 72 | resolved "https://registry.yarnpkg.com/@types/styled-components/-/styled-components-4.1.4.tgz#c6915ccee4413da2e1e81b4df9d7ea5b97eb56aa" 73 | integrity sha512-zEj6BptOBBxob0hnNdr/qiXZjlC8EUVl7GDN1z+kp58zLtDBjbrbo+1yjL2Gi64IjhFaF7Qz4MbsDdbBuUa83A== 74 | dependencies: 75 | "@types/node" "*" 76 | "@types/react" "*" 77 | csstype "^2.2.0" 78 | 79 | asap@~2.0.3: 80 | version "2.0.6" 81 | resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" 82 | integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= 83 | 84 | "babel-plugin-styled-components@>= 1": 85 | version "1.10.0" 86 | resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.0.tgz#ff1f42ad2cc78c21f26b62266b8f564dbc862939" 87 | integrity sha512-sQVKG8irFXx14ZfaK1bBePirfkacl3j8nZwSZK+ZjsbnadRHKQTbhXbe/RB1vT6Vgkz45E+V95LBq4KqdhZUNw== 88 | dependencies: 89 | "@babel/helper-annotate-as-pure" "^7.0.0" 90 | "@babel/helper-module-imports" "^7.0.0" 91 | babel-plugin-syntax-jsx "^6.18.0" 92 | lodash "^4.17.10" 93 | 94 | babel-plugin-syntax-jsx@^6.18.0: 95 | version "6.18.0" 96 | resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" 97 | integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= 98 | 99 | core-js@^1.0.0: 100 | version "1.2.7" 101 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" 102 | integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= 103 | 104 | css-color-keywords@^1.0.0: 105 | version "1.0.0" 106 | resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" 107 | integrity sha1-/qJhbcZ2spYmhrOvjb2+GAskTgU= 108 | 109 | css-to-react-native@^2.2.2: 110 | version "2.2.2" 111 | resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.2.2.tgz#c077d0f7bf3e6c915a539e7325821c9dd01f9965" 112 | integrity sha512-w99Fzop1FO8XKm0VpbQp3y5mnTnaS+rtCvS+ylSEOK76YXO5zoHQx/QMB1N54Cp+Ya9jB9922EHrh14ld4xmmw== 113 | dependencies: 114 | css-color-keywords "^1.0.0" 115 | fbjs "^0.8.5" 116 | postcss-value-parser "^3.3.0" 117 | 118 | csstype@^2.2.0: 119 | version "2.5.8" 120 | resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.5.8.tgz#4ce5aa16ea0d562ef9105fa3ae2676f199586a35" 121 | integrity sha512-r4DbsyNJ7slwBSKoGesxDubRWJ71ghG8W2+1HcsDlAo12KGca9dDLv0u98tfdFw7ldBdoA7XmCnI6Q8LpAJXaQ== 122 | 123 | encoding@^0.1.11: 124 | version "0.1.12" 125 | resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" 126 | integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= 127 | dependencies: 128 | iconv-lite "~0.4.13" 129 | 130 | esutils@^2.0.2: 131 | version "2.0.2" 132 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" 133 | integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= 134 | 135 | fbjs@^0.8.5: 136 | version "0.8.17" 137 | resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" 138 | integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= 139 | dependencies: 140 | core-js "^1.0.0" 141 | isomorphic-fetch "^2.1.1" 142 | loose-envify "^1.0.0" 143 | object-assign "^4.1.0" 144 | promise "^7.1.1" 145 | setimmediate "^1.0.5" 146 | ua-parser-js "^0.7.18" 147 | 148 | has-flag@^3.0.0: 149 | version "3.0.0" 150 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 151 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 152 | 153 | iconv-lite@~0.4.13: 154 | version "0.4.24" 155 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" 156 | integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== 157 | dependencies: 158 | safer-buffer ">= 2.1.2 < 3" 159 | 160 | is-stream@^1.0.1: 161 | version "1.1.0" 162 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 163 | integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= 164 | 165 | isomorphic-fetch@^2.1.1: 166 | version "2.2.1" 167 | resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" 168 | integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= 169 | dependencies: 170 | node-fetch "^1.0.1" 171 | whatwg-fetch ">=0.10.0" 172 | 173 | "js-tokens@^3.0.0 || ^4.0.0": 174 | version "4.0.0" 175 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" 176 | integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== 177 | 178 | lodash@^4.17.10: 179 | version "4.17.11" 180 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" 181 | integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== 182 | 183 | loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: 184 | version "1.4.0" 185 | resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" 186 | integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== 187 | dependencies: 188 | js-tokens "^3.0.0 || ^4.0.0" 189 | 190 | memoize-one@^4.0.0: 191 | version "4.1.0" 192 | resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-4.1.0.tgz#a2387c58c03fff27ca390c31b764a79addf3f906" 193 | integrity sha512-2GApq0yI/b22J2j9rhbrAlsHb0Qcz+7yWxeLG8h+95sl1XPUgeLimQSOdur4Vw7cUhrBHwaUZxWFZueojqNRzA== 194 | 195 | node-fetch@^1.0.1: 196 | version "1.7.3" 197 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" 198 | integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== 199 | dependencies: 200 | encoding "^0.1.11" 201 | is-stream "^1.0.1" 202 | 203 | object-assign@^4.1.0, object-assign@^4.1.1: 204 | version "4.1.1" 205 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 206 | integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= 207 | 208 | postcss-value-parser@^3.3.0: 209 | version "3.3.1" 210 | resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" 211 | integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== 212 | 213 | promise@^7.1.1: 214 | version "7.3.1" 215 | resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" 216 | integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== 217 | dependencies: 218 | asap "~2.0.3" 219 | 220 | prop-types@^15.5.4, prop-types@^15.6.2: 221 | version "15.6.2" 222 | resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" 223 | integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== 224 | dependencies: 225 | loose-envify "^1.3.1" 226 | object-assign "^4.1.1" 227 | 228 | react-dom@^16.7.0: 229 | version "16.7.0" 230 | resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.7.0.tgz#a17b2a7ca89ee7390bc1ed5eb81783c7461748b8" 231 | integrity sha512-D0Ufv1ExCAmF38P2Uh1lwpminZFRXEINJe53zRAbm4KPwSyd6DY/uDoS0Blj9jvPpn1+wivKpZYc8aAAN/nAkg== 232 | dependencies: 233 | loose-envify "^1.1.0" 234 | object-assign "^4.1.1" 235 | prop-types "^15.6.2" 236 | scheduler "^0.12.0" 237 | 238 | react-is@^16.6.0: 239 | version "16.7.0" 240 | resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz#c1bd21c64f1f1364c6f70695ec02d69392f41bfa" 241 | integrity sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g== 242 | 243 | react@^16.7.0: 244 | version "16.7.0" 245 | resolved "https://registry.yarnpkg.com/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381" 246 | integrity sha512-StCz3QY8lxTb5cl2HJxjwLFOXPIFQp+p+hxQfc8WE0QiLfCtIlKj8/+5tjjKm8uSTlAW+fCPaavGFS06V9Ar3A== 247 | dependencies: 248 | loose-envify "^1.1.0" 249 | object-assign "^4.1.1" 250 | prop-types "^15.6.2" 251 | scheduler "^0.12.0" 252 | 253 | "safer-buffer@>= 2.1.2 < 3": 254 | version "2.1.2" 255 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 256 | integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== 257 | 258 | scheduler@^0.12.0: 259 | version "0.12.0" 260 | resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.12.0.tgz#8ab17699939c0aedc5a196a657743c496538647b" 261 | integrity sha512-t7MBR28Akcp4Jm+QoR63XgAi9YgCUmgvDHqf5otgAj4QvdoBE4ImCX0ffehefePPG+aitiYHp0g/mW6s4Tp+dw== 262 | dependencies: 263 | loose-envify "^1.1.0" 264 | object-assign "^4.1.1" 265 | 266 | setimmediate@^1.0.5: 267 | version "1.0.5" 268 | resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" 269 | integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= 270 | 271 | styled-components@^4.1.3: 272 | version "4.1.3" 273 | resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.1.3.tgz#4472447208e618b57e84deaaeb6acd34a5e0fe9b" 274 | integrity sha512-0quV4KnSfvq5iMtT0RzpMGl/Dg3XIxIxOl9eJpiqiq4SrAmR1l1DLzNpMzoy3DyzdXVDMJS2HzROnXscWA3SEw== 275 | dependencies: 276 | "@babel/helper-module-imports" "^7.0.0" 277 | "@emotion/is-prop-valid" "^0.7.3" 278 | "@emotion/unitless" "^0.7.0" 279 | babel-plugin-styled-components ">= 1" 280 | css-to-react-native "^2.2.2" 281 | memoize-one "^4.0.0" 282 | prop-types "^15.5.4" 283 | react-is "^16.6.0" 284 | stylis "^3.5.0" 285 | stylis-rule-sheet "^0.0.10" 286 | supports-color "^5.5.0" 287 | 288 | stylis-rule-sheet@^0.0.10: 289 | version "0.0.10" 290 | resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430" 291 | integrity sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw== 292 | 293 | stylis@^3.5.0: 294 | version "3.5.4" 295 | resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe" 296 | integrity sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q== 297 | 298 | supports-color@^5.5.0: 299 | version "5.5.0" 300 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 301 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 302 | dependencies: 303 | has-flag "^3.0.0" 304 | 305 | to-fast-properties@^2.0.0: 306 | version "2.0.0" 307 | resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" 308 | integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= 309 | 310 | typescript@^3.2.2: 311 | version "3.2.2" 312 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" 313 | integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg== 314 | 315 | ua-parser-js@^0.7.18: 316 | version "0.7.19" 317 | resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" 318 | integrity sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ== 319 | 320 | whatwg-fetch@>=0.10.0: 321 | version "3.0.0" 322 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" 323 | integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== 324 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "acme", 3 | "version": "1.0.0", 4 | "description": "An example of a next.js monorepo with typescript", 5 | "main": " ", 6 | "repository": "git@github.com:josephluck/next-typescript-monorepo.git", 7 | "author": "Joseph Luck", 8 | "license": "MIT", 9 | "private": true, 10 | "scripts": { 11 | "postinstall": "rexreplace \"followSymlinks: false\" \"followSymlinks: true\" ./node_modules/watchpack/lib/DirectoryWatcher.js -V" 12 | }, 13 | "devDependencies": { 14 | "rexreplace": "^4.1.1" 15 | }, 16 | "workspaces": [ 17 | "blog", 18 | "design", 19 | "api" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "target": "es5", 5 | "module": "commonjs", 6 | "jsx": "react", 7 | "allowJs": true, 8 | "moduleResolution": "node", 9 | "allowSyntheticDefaultImports": true, 10 | "sourceMap": true, 11 | "lib": ["dom", "es7"] 12 | } 13 | } 14 | --------------------------------------------------------------------------------