From a0c3d637057b9480d4e0ad67d7818bcf81f17101 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 19 Sep 2023 11:44:22 +0100 Subject: [PATCH] 2023-09-19T10:44:22.908Z --- .../package.json | 12 ++++++++++++ .../pnpm-lock.yaml | 16 ++++++++++++++++ .../src/index.ts | 5 +++++ .../tsconfig.json | 15 +++++++++++++++ ...175-types-that-ship-with-libraries.problem.ts | 0 ...75-types-that-ship-with-libraries.solution.ts | 0 .../package.json | 12 ++++++++++++ .../pnpm-lock.yaml | 16 ++++++++++++++++ .../src/index.ts | 5 +++++ .../src/zod.d.ts | 3 +++ .../tsconfig.json | 15 +++++++++++++++ ...r-overriding-third-party-libraries.problem.ts | 0 ...-overriding-third-party-libraries.solution.ts | 0 13 files changed, 99 insertions(+) create mode 100644 src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/package.json create mode 100644 src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/pnpm-lock.yaml create mode 100644 src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/src/index.ts create mode 100644 src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/tsconfig.json delete mode 100644 src/065-types-you-dont-control/175-types-that-ship-with-libraries.problem.ts delete mode 100644 src/065-types-you-dont-control/175-types-that-ship-with-libraries.solution.ts create mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/package.json create mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/pnpm-lock.yaml create mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/index.ts create mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/zod.d.ts create mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/tsconfig.json delete mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.problem.ts delete mode 100644 src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.solution.ts diff --git a/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/package.json b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/package.json new file mode 100644 index 0000000..81adb14 --- /dev/null +++ b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/package.json @@ -0,0 +1,12 @@ +{ + "name": "exercise", + "version": "1.0.0", + "main": "index.js", + "type": "module", + "scripts": { + "dev": "tsc --watch" + }, + "dependencies": { + "zod": "^3.22.2" + } +} diff --git a/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/pnpm-lock.yaml b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/pnpm-lock.yaml new file mode 100644 index 0000000..4b49f50 --- /dev/null +++ b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/pnpm-lock.yaml @@ -0,0 +1,16 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + zod: + specifier: ^3.22.2 + version: 3.22.2 + +packages: + + /zod@3.22.2: + resolution: {integrity: sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==} + dev: false diff --git a/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/src/index.ts b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/src/index.ts new file mode 100644 index 0000000..1ca2bec --- /dev/null +++ b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/src/index.ts @@ -0,0 +1,5 @@ +import { z } from "zod"; + +const user = z.object({ + name: z.string(), +}); diff --git a/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/tsconfig.json b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/tsconfig.json new file mode 100644 index 0000000..6670f99 --- /dev/null +++ b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.explainer/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "skipLibCheck": true, + "isolatedModules": true, + "moduleDetection": "force", + "verbatimModuleSyntax": true + }, +} \ No newline at end of file diff --git a/src/065-types-you-dont-control/175-types-that-ship-with-libraries.problem.ts b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.problem.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/065-types-you-dont-control/175-types-that-ship-with-libraries.solution.ts b/src/065-types-you-dont-control/175-types-that-ship-with-libraries.solution.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/package.json b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/package.json new file mode 100644 index 0000000..81adb14 --- /dev/null +++ b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/package.json @@ -0,0 +1,12 @@ +{ + "name": "exercise", + "version": "1.0.0", + "main": "index.js", + "type": "module", + "scripts": { + "dev": "tsc --watch" + }, + "dependencies": { + "zod": "^3.22.2" + } +} diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/pnpm-lock.yaml b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/pnpm-lock.yaml new file mode 100644 index 0000000..4b49f50 --- /dev/null +++ b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/pnpm-lock.yaml @@ -0,0 +1,16 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + zod: + specifier: ^3.22.2 + version: 3.22.2 + +packages: + + /zod@3.22.2: + resolution: {integrity: sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==} + dev: false diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/index.ts b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/index.ts new file mode 100644 index 0000000..1ca2bec --- /dev/null +++ b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/index.ts @@ -0,0 +1,5 @@ +import { z } from "zod"; + +const user = z.object({ + name: z.string(), +}); diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/zod.d.ts b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/zod.d.ts new file mode 100644 index 0000000..a90d59d --- /dev/null +++ b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/src/zod.d.ts @@ -0,0 +1,3 @@ +declare module "zod" { + const z: any; +} diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/tsconfig.json b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/tsconfig.json new file mode 100644 index 0000000..6670f99 --- /dev/null +++ b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.explainer/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "skipLibCheck": true, + "isolatedModules": true, + "moduleDetection": "force", + "verbatimModuleSyntax": true + }, +} \ No newline at end of file diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.problem.ts b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.problem.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.solution.ts b/src/065-types-you-dont-control/176-declare-module-for-overriding-third-party-libraries.solution.ts deleted file mode 100644 index e69de29..0000000