From 5a3d4e7c6b8fdd9fa89509194fe40050fe628d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Krzy=C5=BCanowski?= Date: Wed, 6 Mar 2024 18:36:27 +0100 Subject: [PATCH] refactor: convert to rollup package --- package-lock.json | 1 + packages/unit-testing-config/package.json | 14 ++++++++++---- packages/unit-testing-config/rollup.config.ts | 3 +++ .../unit-testing-config/{ => src}/test-setup.tsx | 0 .../unit-testing-config/{ => src}/vitest.config.js | 0 packages/unit-testing-config/tsconfig.json | 3 +++ tsconfig.json | 11 +++++++++++ 7 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 packages/unit-testing-config/rollup.config.ts rename packages/unit-testing-config/{ => src}/test-setup.tsx (100%) rename packages/unit-testing-config/{ => src}/vitest.config.js (100%) create mode 100644 packages/unit-testing-config/tsconfig.json create mode 100644 tsconfig.json diff --git a/package-lock.json b/package-lock.json index 4475b9d..e720370 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16809,6 +16809,7 @@ "vitest": "^1.3.1" }, "devDependencies": { + "@exile-watch/rollup-config": "^0.2.2", "@exile-watch/typescript-config": "^0.3.1", "@exile-watch/writ-react": "^0.5.0", "@types/react": "^18.2.63", diff --git a/packages/unit-testing-config/package.json b/packages/unit-testing-config/package.json index 6a4239c..9af13c8 100644 --- a/packages/unit-testing-config/package.json +++ b/packages/unit-testing-config/package.json @@ -2,13 +2,18 @@ "name": "@exile-watch/unit-testing-config", "version": "0.1.0", "description": "Shared unit testing configuration for exile.watch frontend projects", - "main": "vitest.config.js", + "main": "dist/index.js", + "module": "dist/index.esm.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], "scripts": { + "_clean": "del-cli dist", + "_build": "rollup -c", + "build": "npm run _build", "typecheck": "npx tsc" }, - "files": [ - "vitest.config.js" - ], "repository": { "type": "git", "url": "git+https://github.com/exile-watch/splinters.git", @@ -25,6 +30,7 @@ "react": "^18.2.0" }, "devDependencies": { + "@exile-watch/rollup-config": "^0.2.2", "@exile-watch/typescript-config": "^0.3.1", "@exile-watch/writ-react": "^0.5.0", "@types/react": "^18.2.63", diff --git a/packages/unit-testing-config/rollup.config.ts b/packages/unit-testing-config/rollup.config.ts new file mode 100644 index 0000000..8126c0c --- /dev/null +++ b/packages/unit-testing-config/rollup.config.ts @@ -0,0 +1,3 @@ +import createRollupConfig from '@exile-watch/rollup-config' + +export default createRollupConfig() \ No newline at end of file diff --git a/packages/unit-testing-config/test-setup.tsx b/packages/unit-testing-config/src/test-setup.tsx similarity index 100% rename from packages/unit-testing-config/test-setup.tsx rename to packages/unit-testing-config/src/test-setup.tsx diff --git a/packages/unit-testing-config/vitest.config.js b/packages/unit-testing-config/src/vitest.config.js similarity index 100% rename from packages/unit-testing-config/vitest.config.js rename to packages/unit-testing-config/src/vitest.config.js diff --git a/packages/unit-testing-config/tsconfig.json b/packages/unit-testing-config/tsconfig.json new file mode 100644 index 0000000..7460ef4 --- /dev/null +++ b/packages/unit-testing-config/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.json" +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d35cbb1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@exile-watch/typescript-config/tsconfig.rollup.json", + "compilerOptions": { + "checkJs": false, + // Required for Typescript resolution to work within the NPM Workspace + // This `paths` info is inherited by all per-package tsconfigs + "paths": { + "@exile-watch/": ["./packages/*/"], + }, + }, +} \ No newline at end of file