From 49a36f9623cb8d5578fe7cd2b83685c1531460fc Mon Sep 17 00:00:00 2001 From: Luca Barone Date: Thu, 5 Jan 2023 17:19:24 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20ts-utils=20package=20(#30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/calm-bats-visit.md | 5 +++++ packages/ts-utils/.gitignore | 3 +++ packages/ts-utils/package.json | 34 ++++++++++++++++++++++++++++++++ packages/ts-utils/src/main.ts | 1 + packages/ts-utils/tsconfig.json | 8 ++++++++ packages/ts-utils/tsup.config.ts | 8 ++++++++ 6 files changed, 59 insertions(+) create mode 100644 .changeset/calm-bats-visit.md create mode 100644 packages/ts-utils/.gitignore create mode 100644 packages/ts-utils/package.json create mode 100644 packages/ts-utils/src/main.ts create mode 100644 packages/ts-utils/tsconfig.json create mode 100644 packages/ts-utils/tsup.config.ts diff --git a/.changeset/calm-bats-visit.md b/.changeset/calm-bats-visit.md new file mode 100644 index 0000000..d64b12c --- /dev/null +++ b/.changeset/calm-bats-visit.md @@ -0,0 +1,5 @@ +--- +'@cloudwalker/ts-utils': minor +--- + +✨ Add ObjectValues type diff --git a/packages/ts-utils/.gitignore b/packages/ts-utils/.gitignore new file mode 100644 index 0000000..5a19e8a --- /dev/null +++ b/packages/ts-utils/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +coverage \ No newline at end of file diff --git a/packages/ts-utils/package.json b/packages/ts-utils/package.json new file mode 100644 index 0000000..af36557 --- /dev/null +++ b/packages/ts-utils/package.json @@ -0,0 +1,34 @@ +{ + "name": "@cloudwalker/ts-utils", + "version": "0.0.0", + "type": "module", + "scripts": { + "build": "tsup src/main.ts", + "dev": "tsup src/main.ts --watch" + }, + "files": [ + "dist/**" + ], + "main": "./dist/main.cjs", + "module": "./dist/main.js", + "types": "./dist/main.d.ts", + "exports": { + ".": { + "import": "./dist/main.js", + "require": "./dist/main.cjs" + } + }, + "sideEffects": false, + "author": { + "name": "Luca Barone", + "email": "baro.luc@gmail.com", + "url": "https://github.com/cloud-walker" + }, + "devDependencies": { + "tsup": "^6.2.3", + "typescript": "^4.8.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/ts-utils/src/main.ts b/packages/ts-utils/src/main.ts new file mode 100644 index 0000000..138b80d --- /dev/null +++ b/packages/ts-utils/src/main.ts @@ -0,0 +1 @@ +export type ObjectValues> = T[keyof T] diff --git a/packages/ts-utils/tsconfig.json b/packages/ts-utils/tsconfig.json new file mode 100644 index 0000000..f13acf3 --- /dev/null +++ b/packages/ts-utils/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "strict": true, + "module": "NodeNext", + "skipLibCheck": true + }, + "include": ["src"] +} diff --git a/packages/ts-utils/tsup.config.ts b/packages/ts-utils/tsup.config.ts new file mode 100644 index 0000000..30e5e71 --- /dev/null +++ b/packages/ts-utils/tsup.config.ts @@ -0,0 +1,8 @@ +import {defineConfig} from 'tsup' + +export default defineConfig({ + format: ['cjs', 'esm'], + dts: true, + minify: true, + sourcemap: true, +})