├── .eslintignore ├── COURSE_FILES ├── 09-internal-dependents │ ├── data │ │ ├── .babelrc │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── channels.ts │ │ │ ├── messages.ts │ │ │ └── teams.ts │ │ ├── .eslintrc │ │ ├── tests │ │ │ ├── tsconfig.json │ │ │ ├── channel.test.ts │ │ │ └── teams.test.ts │ │ ├── tsconfig.json │ │ └── package.json │ └── ui │ │ ├── .eslintrc │ │ ├── assets │ │ ├── img │ │ │ ├── boss.jpg │ │ │ ├── cat.jpg │ │ │ ├── js.png │ │ │ ├── maru.jpg │ │ │ ├── node.png │ │ │ ├── thor.jpg │ │ │ ├── ts.png │ │ │ ├── clippy.png │ │ │ ├── jquery.png │ │ │ ├── lisa.jpeg │ │ │ ├── mike.jpeg │ │ │ ├── angry-cat.jpg │ │ │ ├── avengers.jpg │ │ │ ├── desk_flip.jpg │ │ │ ├── dilbert.jpg │ │ │ ├── drstrange.jpg │ │ │ ├── ironman.jpg │ │ │ ├── linkedin.png │ │ │ ├── microsoft.png │ │ │ ├── office97.png │ │ │ └── colonel-meow.jpg │ │ └── app.css │ │ ├── .babelrc │ │ ├── tests │ │ ├── components │ │ │ ├── __snapshots__ │ │ │ │ ├── Channel.test.tsx.snap │ │ │ │ ├── ChannelHeader.test.tsx.snap │ │ │ │ ├── ChannelMessage.test.tsx.snap │ │ │ │ ├── TeamSelector.test.tsx.snap │ │ │ │ ├── ChannelFooter.test.tsx.snap │ │ │ │ └── TeamSidebar.test.tsx.snap │ │ │ ├── ChannelHeader.test.tsx │ │ │ ├── ChannelFooter.test.tsx │ │ │ ├── ChannelMessage.test.tsx │ │ │ ├── Channel.test.tsx │ │ │ ├── TeamSidebar.test.tsx │ │ │ └── TeamSelector.test.tsx │ │ └── tsconfig.json │ │ ├── src │ │ ├── components │ │ │ ├── Loading.tsx │ │ │ ├── Channel │ │ │ │ ├── Header.tsx │ │ │ │ ├── Message.tsx │ │ │ │ └── Footer.tsx │ │ │ ├── TeamSidebar │ │ │ │ └── ChannelLink.tsx │ │ │ ├── SelectedTeam.tsx │ │ │ ├── TeamSelector │ │ │ │ └── TeamLink.tsx │ │ │ ├── Team.tsx │ │ │ ├── SelectedChannel.tsx │ │ │ ├── TeamSelector.tsx │ │ │ ├── Channel.tsx │ │ │ └── TeamSidebar.tsx │ │ ├── index.ts │ │ └── App.tsx │ │ ├── tsconfig.json │ │ ├── index.html │ │ ├── API_EXAMPLES.http │ │ ├── package.json │ │ ├── server │ │ ├── server.js │ │ └── api-server.js │ │ └── db.json ├── 06-scripty │ └── scripts │ │ ├── packages │ │ ├── test.sh │ │ ├── build.sh │ │ └── lint.sh │ │ └── workspace │ │ ├── build.sh │ │ ├── test.sh │ │ ├── clean.sh │ │ └── lint.sh ├── 07-commitlint-and-changelogs │ └── commitlint.config.js ├── 11-api-report │ ├── scripts │ │ └── packages │ │ │ └── api-report.sh │ ├── packages │ │ └── PKG │ │ │ └── api-extractor.json │ └── api-extractor-base.json ├── 05-lerna │ └── lerna.json ├── 02-second-package │ └── utils │ │ ├── tests │ │ ├── tsconfig.json │ │ ├── date.test.ts │ │ ├── http-error.test.ts │ │ ├── error.test.ts │ │ └── deferred.test.ts │ │ ├── package.json │ │ ├── src │ │ ├── index.ts │ │ ├── date.ts │ │ ├── error.ts │ │ ├── deferred.ts │ │ ├── api.ts │ │ ├── http-error.ts │ │ └── networking.ts │ │ └── tsconfig.json ├── 01-yarn-workspaces │ └── types │ │ ├── tests │ │ ├── tsconfig.json │ │ └── type-guard.test.ts │ │ ├── package.json │ │ ├── tsconfig.json │ │ └── src │ │ ├── index.ts │ │ ├── types.ts │ │ └── type-guards.ts ├── 12-api-docs │ └── scripts │ │ └── workspace │ │ └── api-docs.sh └── 04-linting │ └── .eslintrc ├── .vscode └── settings.json ├── yarn.lock ├── notes ├── README.md ├── img │ └── dherman-monorepo-1.png ├── 12-api-docs.md ├── 07-changelogs.md ├── 11-api-report.md ├── 10-independent-versioning.md ├── 08-publishing-and-versioning.md ├── 09-internal-dependencies.md ├── 00-intro.md ├── 05-lerna.md ├── 04-linting.md ├── 03-tests.md ├── 06-scripty.md ├── 01-yarn-workspaces.md └── 02-composite-project.md ├── .github ├── crush-pics │ └── config.json └── workflows │ ├── optimize-images.yml │ ├── auto-merge.yml │ ├── ts-nightly-tests.yml │ ├── node.js.yml │ ├── node.js-solution.yml │ └── codeql-analysis.yml ├── tsconfig.json ├── package.json ├── LICENSE ├── .gitignore └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | packages/*/tests/*.ts -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/data/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.babelrc" 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "api-extractor*.json": "jsonc" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | -------------------------------------------------------------------------------- /notes/README.md: -------------------------------------------------------------------------------- 1 | # JS/TS Monorepos: Course Notes 2 | 3 | Please begin reading at [`00-intro.md`](./00-intro.md) 4 | -------------------------------------------------------------------------------- /notes/img/dherman-monorepo-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/notes/img/dherman-monorepo-1.png -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/packages/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 🎯 TEST: $(pwd) ━━━━━━━━━━━━━━━━━━━" 3 | yarn jest -------------------------------------------------------------------------------- /COURSE_FILES/07-commitlint-and-changelogs/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ["@commitlint/config-lerna-scopes"] }; 2 | -------------------------------------------------------------------------------- /.github/crush-pics/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "compression_mode": "balanced", 3 | "compression_level": 85, 4 | "strip_tags": false 5 | } 6 | -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/packages/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 📦 Building $(pwd) ━━━━━━━━━━━━━━━━━━━" 3 | yarn tsc -b -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/data/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./channels"; 2 | export * from "./messages"; 3 | export * from "./teams"; 4 | -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/workspace/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 📦 Building Workspace ━━━━━━━━━━━━━━━━━━━" 3 | yarn tsc -b packages -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/workspace/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 🎯 TEST: $(pwd) ━━━━━━━━━━━━━━━━━━━" 3 | yarn lerna run test --stream -------------------------------------------------------------------------------- /notes/12-api-docs.md: -------------------------------------------------------------------------------- 1 |

2 | ◀ Back: API Report 3 |

4 | 5 | --- 6 | 7 | # API Documentation 8 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/data/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.eslintrc", 3 | "parserOptions": { 4 | "project": "tsconfig.json" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../.eslintrc", 3 | "parserOptions": { 4 | "project": "tsconfig.json" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/packages/lint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 🕵️‍♀️ LINT: eslint src --ext ts,js,tsx,jsx ━━━━━━━" 3 | yarn eslint src --ext ts,js,tsx,jsx -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/boss.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/boss.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/cat.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/js.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/js.png -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/maru.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/maru.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/node.png -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/thor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/thor.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/ts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/ts.png -------------------------------------------------------------------------------- /COURSE_FILES/11-api-report/scripts/packages/api-report.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 🧩 API REPORT: $(pwd) ━━━━━━━━━━━━━━━━━━━━━" 3 | yarn api-extractor run --local 4 | -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/workspace/clean.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 🧹 CLEAN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" 3 | yarn lerna run clean --concurrency 4 4 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/clippy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/clippy.png -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/jquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/jquery.png -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/lisa.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/lisa.jpeg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/mike.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/mike.jpeg -------------------------------------------------------------------------------- /COURSE_FILES/06-scripty/scripts/workspace/lint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "┏━━━ 🕵️‍♀️ LINT: eslint src --ext ts,js,tsx,jsx ━━━━━━━" 3 | yarn lerna run lint --stream --concurrency 1 -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/angry-cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/angry-cat.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/avengers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/avengers.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/desk_flip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/desk_flip.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/dilbert.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/dilbert.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/drstrange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/drstrange.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/ironman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/ironman.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/linkedin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/linkedin.png -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/microsoft.png -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/office97.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/office97.png -------------------------------------------------------------------------------- /COURSE_FILES/05-lerna/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["packages/*"], 3 | "npmClient": "yarn", 4 | "version": "0.0.1", 5 | "useWorkspaces": true, 6 | "nohoist": ["parcel-bundler"] 7 | } 8 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/assets/img/colonel-meow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mike-north/js-ts-monorepos/HEAD/COURSE_FILES/09-internal-dependents/ui/assets/img/colonel-meow.jpg -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@babel/preset-env", { "targets": { "node": "10" } }], 4 | "@babel/preset-react", 5 | "@babel/preset-typescript" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["DOM", "ES2018"], 4 | "types": ["jest"], 5 | "baseUrl": "..", 6 | "noEmit": true 7 | }, 8 | "include": ["."] 9 | } 10 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@shlack/utils", 3 | "version": "0.0.1", 4 | "main": "dist/index.js", 5 | "types": "dist/index.d.ts", 6 | "publishConfig": { 7 | "access": "public" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/tests/components/__snapshots__/Channel.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Link changes the class when hovered 1`] = ` 4 |

5 | Loading messages 6 | ... 7 |

8 | `; 9 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "references": [{ "path": ".." }], 3 | "compilerOptions": { 4 | "types": ["jest"], 5 | "baseUrl": "..", 6 | "jsx": "react", 7 | "noEmit": true 8 | }, 9 | "include": ["."] 10 | } 11 | -------------------------------------------------------------------------------- /notes/07-changelogs.md: -------------------------------------------------------------------------------- 1 |

2 | ◀ Back: Scripty 3 |

4 | 5 | --- 6 | 7 | # Changelogs 8 | 9 | --- 10 | 11 |

12 | Next: Publishing and Versioning ▶ 13 |

14 | -------------------------------------------------------------------------------- /notes/11-api-report.md: -------------------------------------------------------------------------------- 1 |

2 | ◀ Back: Independent Versioning 3 |

4 | 5 | --- 6 | 7 | # API Report 8 | 9 | --- 10 | 11 |

12 | Next: API Docs ▶ 13 |

14 | -------------------------------------------------------------------------------- /COURSE_FILES/11-api-report/packages/PKG/api-extractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", 3 | "mainEntryPointFilePath": "/dist/index.d.ts", 4 | "extends": "../../api-extractor-base.json" 5 | } 6 | -------------------------------------------------------------------------------- /COURSE_FILES/01-yarn-workspaces/types/tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "references": [{ "path": "..", "name": "@shlack/types" }], 3 | "compilerOptions": { 4 | "lib": ["DOM", "ES2018"], 5 | "types": ["jest"], 6 | "baseUrl": "..", 7 | "noEmit": true 8 | }, 9 | "include": ["."] 10 | } 11 | -------------------------------------------------------------------------------- /notes/10-independent-versioning.md: -------------------------------------------------------------------------------- 1 |

2 | ◀ Back: Internal Dependencies 3 |

4 | 5 | --- 6 | 7 | # Independent Versioning 8 | 9 | --- 10 | 11 |

12 | Next: API Report ▶ 13 |

14 | -------------------------------------------------------------------------------- /notes/08-publishing-and-versioning.md: -------------------------------------------------------------------------------- 1 |

2 | ◀ Back: Changelogs 3 |

4 | 5 | --- 6 | 7 | # Publishing and Versioning 8 | 9 | --- 10 | 11 |

12 | Next: Internal Dependencies ▶ 13 |

14 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./api"; 2 | export * from "./date"; 3 | export { default as Deferred, RejectHandler, ResolveHandler } from "./deferred"; 4 | export * from "./networking"; 5 | export * from "./error"; 6 | export { default as HTTPError, HTTPErrorKind } from "./http-error"; 7 | -------------------------------------------------------------------------------- /notes/09-internal-dependencies.md: -------------------------------------------------------------------------------- 1 |

2 | ◀ Back: Publishing and Versioning 3 |

4 | 5 | --- 6 | 7 | # Internal Dependencies 8 | 9 | --- 10 | 11 |

12 | Next: Independent Versioning ▶ 13 |

14 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/data/tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "references": [{ "path": ".." }], 3 | "compilerOptions": { 4 | "lib": ["ES2018"], 5 | "types": ["jest"], 6 | "baseUrl": "..", 7 | "noEmit": true, 8 | "paths": { "@shlack/data": [".."] } 9 | }, 10 | "include": ["."] 11 | } 12 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/data/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.settings.json", 3 | "references": [{ "path": "../types" }, { "path": "../utils" }], 4 | "compilerOptions": { 5 | "composite": true, 6 | "outDir": "dist", 7 | "rootDir": "src" 8 | }, 9 | "include": ["src"] 10 | } 11 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/src/date.ts: -------------------------------------------------------------------------------- 1 | import { format } from "date-fns"; 2 | 3 | /** 4 | * Format a timestamp as a string 5 | * @param date - the date value to format 6 | * @public 7 | */ 8 | export function formatTimestamp(date: Date): string { 9 | return format(date, "MMM dd, yyyy HH:MM:SS a"); 10 | } 11 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/src/components/Loading.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | const Loading: React.FunctionComponent<{ message: string }> = ({ 4 | message = "Loading...", 5 | children, 6 | }) => ( 7 |

8 | {message}... 9 | {children} 10 |

11 | ); 12 | export default Loading; 13 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/tests/date.test.ts: -------------------------------------------------------------------------------- 1 | import { formatTimestamp } from "@shlack/utils"; 2 | 3 | describe("formatTimestamp() tests", function () { 4 | let x = 4; 5 | test("01-01-2020", () => { 6 | expect(formatTimestamp(new Date("01-01-2020"))).toBe( 7 | "Jan 01, 2020 00:01:00 AM" 8 | ); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJS", 4 | "composite": true, 5 | "target": "ES2018", 6 | "strict": true, 7 | "noUnusedLocals": true, 8 | "noUnusedParameters": true, 9 | "noImplicitReturns": true, 10 | "declaration": true 11 | }, 12 | "exclude": ["**/node_modules/**", "COURSE_FILES/**"] 13 | } 14 | -------------------------------------------------------------------------------- /COURSE_FILES/01-yarn-workspaces/types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@shlack/types", 3 | "version": "0.0.1", 4 | "main": "dist/index.js", 5 | "types": "dist/index.d.ts", 6 | "publishConfig": { 7 | "access": "public" 8 | }, 9 | "scripts": { 10 | "build": "tsc -b ." 11 | }, 12 | "devDependencies": { 13 | "typescript": "^4.0.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJS", 4 | "types": [], 5 | "sourceMap": true, 6 | "target": "ES2018", 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "noImplicitReturns": true, 11 | "declaration": true 12 | }, 13 | "include": ["src"] 14 | } 15 | -------------------------------------------------------------------------------- /COURSE_FILES/02-second-package/utils/tests/http-error.test.ts: -------------------------------------------------------------------------------- 1 | import { HTTPError, HTTPErrorKind } from "@shlack/utils"; 2 | 3 | describe("HTTPError tests", function () { 4 | test("creation", () => { 5 | const e = new HTTPError( 6 | { status: 404, statusText: "Not Found" }, 7 | "Mock error for testing" 8 | ); 9 | expect(e.kind).toBe(HTTPErrorKind.Client); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.settings.json", 3 | "references": [ 4 | { "path": "../types" }, 5 | { "path": "../utils" }, 6 | { "path": "../data" } 7 | ], 8 | "compilerOptions": { 9 | "composite": true, 10 | "outDir": "dist", 11 | "rootDir": "src", 12 | "jsx": "react" 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /COURSE_FILES/01-yarn-workspaces/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "CommonJS", 4 | "types": [], 5 | "sourceMap": true, 6 | "target": "ES2018", 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "noImplicitReturns": true, 11 | "declaration": true, 12 | "outDir": "dist", 13 | "rootDir": "src" 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js-ts-monotrepos", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "repository": "git@github.com:mike-north/js-ts-monorepos.git", 6 | "author": "Mike North ", 7 | "license": "BSD-2-Clause", 8 | "private": true, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 0" 11 | }, 12 | "volta": { 13 | "node": "16.14.2", 14 | "yarn": "1.22.18" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/tests/components/ChannelHeader.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import * as renderer from "react-test-renderer"; 3 | import Header from "../../src/components/Channel/Header"; 4 | 5 | test("Link changes the class when hovered", () => { 6 | const component = renderer.create( 7 |
8 | ); 9 | const tree = component.toJSON(); 10 | expect(tree).toMatchSnapshot(); 11 | }); 12 | -------------------------------------------------------------------------------- /COURSE_FILES/09-internal-dependents/ui/tests/components/ChannelFooter.test.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import * as renderer from "react-test-renderer"; 3 | import Footer from "../../src/components/Channel/Footer"; 4 | 5 | test("Link changes the class when hovered", () => { 6 | const component = renderer.create( 7 |