From 123e0a85c13093668e6a8913d56f7df77cafdf07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= Date: Fri, 25 Aug 2023 22:28:58 -0400 Subject: [PATCH] feat: import version from `package.json` This way we don't have to maintain the version in two places. PR: https://github.com/Topsort/analytics.js/pull/196 --- src/reporter.ts | 2 +- src/version.ts | 1 - tsconfig.json | 1 + tsconfig.types.json | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 src/version.ts diff --git a/src/reporter.ts b/src/reporter.ts index 45b5248..7aabe0f 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -1,4 +1,4 @@ -import { version } from "./version"; +import { version } from "../package.json"; import type { TopsortEvent } from "./events"; interface Config { diff --git a/src/version.ts b/src/version.ts deleted file mode 100644 index e56ccce..0000000 --- a/src/version.ts +++ /dev/null @@ -1 +0,0 @@ -export const version = "2.0.0"; diff --git a/tsconfig.json b/tsconfig.json index dbc35b8..7f04fc6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,7 @@ // Required for tslib to emit tree-shakeable code "module": "es2020", "moduleResolution": "node", + "resolveJsonModule": true, "sourceMap": true, "declaration": true, "declarationMap": false, diff --git a/tsconfig.types.json b/tsconfig.types.json index c236584..7c2bb3a 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -16,6 +16,7 @@ // Required for tslib to emit tree-shakeable code "module": "es2020", "moduleResolution": "node", + "resolveJsonModule": true, "sourceMap": true, "declaration": true, "declarationMap": false,