From 5aaf737803f65356722b59e66440ce5a63564603 Mon Sep 17 00:00:00 2001 From: Tomer Aberbach Date: Sun, 23 Jun 2024 15:38:22 -0400 Subject: [PATCH 1/2] feat: add cjs --- package.json | 16 +++++-- pnpm-lock.yaml | 115 +++---------------------------------------------- 2 files changed, 19 insertions(+), 112 deletions(-) diff --git a/package.json b/package.json index a3da2a2..ccdd47a 100644 --- a/package.json +++ b/package.json @@ -27,15 +27,23 @@ "engines": { "node": ">= 18" }, - "exports": "./src/index.js", - "module": "./src/index.js", - "types": "./src/index.d.ts", + "exports": { + "types": "./dist/index.d.ts", + "require": "./dist/index.cjs", + "import": "./dist/index.js" + }, + "types": "./dist/index.d.ts", + "main": "./dist/index.cjs", + "module": "./dist/index.js", "scripts": { "prepare": "tomer install", "format": "tomer format", "lint": "tomer lint", "typecheck": "tomer typecheck", - "test": "tomer test" + "test": "tomer test", + "build": "tomer build", + "clean": "tomer clean dist", + "prepublishOnly": "tomer build" }, "prettier": "tomer/prettier-config", "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80bd5bf..9c45f40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 3.3.2 tomer: specifier: ^3.2.4 - version: 3.2.4(@jest/expect@29.7.0)(@testing-library/dom@10.1.0)(@types/babel__core@7.20.5)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(prettier@3.3.2)(typescript@5.5.2) + version: 3.2.4(@jest/expect@29.7.0)(@types/babel__core@7.20.5)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(prettier@3.3.2)(typescript@5.5.2) typescript: specifier: ^5.5.2 version: 5.5.2 @@ -1727,13 +1727,6 @@ packages: integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==, } - '@testing-library/dom@10.1.0': - resolution: - { - integrity: sha512-wdsYKy5zupPyLCW2Je5DLHSxSfbIp6h80WoHOQc+RPtmPGA52O9x5MJEkv92Sjonpq+poOAtUKhh1kBGAXBrNA==, - } - engines: { node: '>=18' } - '@tomer/eslint-config@1.6.0': resolution: { @@ -1790,12 +1783,6 @@ packages: integrity: sha512-0IKu9GHYF1NGTJiYgfWwqnOQSlnE9V9R7YohHNNf0/fj/SyOZWzdd06JFr0fLpg1Mqw0kGbYg8w5xdkSqLKM9g==, } - '@types/aria-query@5.0.4': - resolution: - { - integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==, - } - '@types/babel__core@7.20.5': resolution: { @@ -2295,12 +2282,6 @@ packages: integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==, } - aria-query@5.3.0: - resolution: - { - integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==, - } - array-buffer-byte-length@1.0.1: resolution: { @@ -2996,13 +2977,6 @@ packages: } engines: { node: '>=0.4.0' } - dequal@2.0.3: - resolution: - { - integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==, - } - engines: { node: '>=6' } - detect-newline@3.1.0: resolution: { @@ -3045,12 +3019,6 @@ packages: } engines: { node: '>=6.0.0' } - dom-accessibility-api@0.5.16: - resolution: - { - integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==, - } - domexception@4.0.0: resolution: { @@ -5092,13 +5060,6 @@ packages: integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==, } - lz-string@1.5.0: - resolution: - { - integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==, - } - hasBin: true - magic-string@0.30.10: resolution: { @@ -5250,12 +5211,6 @@ packages: integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==, } - ms@2.1.3: - resolution: - { - integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==, - } - natural-compare@1.4.0: resolution: { @@ -5660,13 +5615,6 @@ packages: } engines: { node: '>=6' } - pretty-format@27.5.1: - resolution: - { - integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==, - } - engines: { node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0 } - pretty-format@29.7.0: resolution: { @@ -5730,12 +5678,6 @@ packages: integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==, } - react-is@17.0.2: - resolution: - { - integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==, - } - react-is@18.3.1: resolution: { @@ -8947,19 +8889,7 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 - '@testing-library/dom@10.1.0': - dependencies: - '@babel/code-frame': 7.24.7 - '@babel/runtime': 7.24.7 - '@types/aria-query': 5.0.4 - aria-query: 5.3.0 - chalk: 4.1.2 - dom-accessibility-api: 0.5.16 - lz-string: 1.5.0 - pretty-format: 27.5.1 - optional: true - - '@tomer/eslint-config@1.6.0(@testing-library/dom@10.1.0)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(typescript@5.5.2)': + '@tomer/eslint-config@1.6.0(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(typescript@5.5.2)': dependencies: '@babel/core': 7.24.6 '@babel/eslint-parser': 7.24.6(@babel/core@7.24.6)(eslint@8.57.0) @@ -8971,7 +8901,7 @@ snapshots: eslint-plugin-compat: 4.2.0(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0) eslint-plugin-jest: 28.6.0(@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(typescript@5.5.2) - eslint-plugin-jest-dom: 5.4.0(@testing-library/dom@10.1.0)(eslint@8.57.0) + eslint-plugin-jest-dom: 5.4.0(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) eslint-plugin-markdown: 5.0.0(eslint@8.57.0) eslint-plugin-react: 7.34.3(eslint@8.57.0) @@ -9011,9 +8941,6 @@ snapshots: '@tsconfig/recommended@1.0.6': {} - '@types/aria-query@5.0.4': - optional: true - '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.24.7 @@ -9364,11 +9291,6 @@ snapshots: dependencies: deep-equal: 2.2.3 - aria-query@5.3.0: - dependencies: - dequal: 2.0.3 - optional: true - array-buffer-byte-length@1.0.1: dependencies: call-bind: 1.0.7 @@ -9804,7 +9726,7 @@ snapshots: debug@3.2.7: dependencies: - ms: 2.1.3 + ms: 2.1.2 debug@4.3.5: dependencies: @@ -9864,9 +9786,6 @@ snapshots: delayed-stream@1.0.0: {} - dequal@2.0.3: - optional: true - detect-newline@3.1.0: {} diff-sequences@29.6.3: {} @@ -9886,9 +9805,6 @@ snapshots: dependencies: esutils: 2.0.3 - dom-accessibility-api@0.5.16: - optional: true - domexception@4.0.0: dependencies: webidl-conversions: 7.0.0 @@ -10110,13 +10026,11 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest-dom@5.4.0(@testing-library/dom@10.1.0)(eslint@8.57.0): + eslint-plugin-jest-dom@5.4.0(eslint@8.57.0): dependencies: '@babel/runtime': 7.24.7 eslint: 8.57.0 requireindex: 1.2.0 - optionalDependencies: - '@testing-library/dom': 10.1.0 eslint-plugin-jest@28.6.0(@typescript-eslint/eslint-plugin@7.13.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(typescript@5.5.2))(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(typescript@5.5.2): dependencies: @@ -11427,9 +11341,6 @@ snapshots: dependencies: yallist: 3.1.1 - lz-string@1.5.0: - optional: true - magic-string@0.30.10: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -11512,8 +11423,6 @@ snapshots: ms@2.1.2: {} - ms@2.1.3: {} - natural-compare@1.4.0: {} node-int64@0.4.0: {} @@ -11734,13 +11643,6 @@ snapshots: pretty-bytes@5.6.0: {} - pretty-format@27.5.1: - dependencies: - ansi-regex: 5.0.1 - ansi-styles: 5.2.0 - react-is: 17.0.2 - optional: true - pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 @@ -11774,9 +11676,6 @@ snapshots: react-is@16.13.1: {} - react-is@17.0.2: - optional: true - react-is@18.3.1: {} read-package-up@11.0.0: @@ -12214,7 +12113,7 @@ snapshots: dependencies: is-number: 7.0.0 - tomer@3.2.4(@jest/expect@29.7.0)(@testing-library/dom@10.1.0)(@types/babel__core@7.20.5)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(prettier@3.3.2)(typescript@5.5.2): + tomer@3.2.4(@jest/expect@29.7.0)(@types/babel__core@7.20.5)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(prettier@3.3.2)(typescript@5.5.2): dependencies: '@babel/core': 7.24.7 '@babel/preset-env': 7.24.7(@babel/core@7.24.7) @@ -12230,7 +12129,7 @@ snapshots: '@rollup/plugin-json': 6.1.0(rollup@4.18.0) '@rollup/plugin-node-resolve': 15.2.3(rollup@4.18.0) '@rollup/plugin-terser': 0.4.4(rollup@4.18.0) - '@tomer/eslint-config': 1.6.0(@testing-library/dom@10.1.0)(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(typescript@5.5.2) + '@tomer/eslint-config': 1.6.0(eslint@8.57.0)(jest@29.7.0(@types/node@20.14.8)(ts-node@10.9.2(@types/node@20.14.8)(typescript@5.5.2)))(typescript@5.5.2) '@tomer/prettier-config': 2.1.0(prettier@3.3.2) '@tsconfig/recommended': 1.0.6 '@types/node': 20.14.8 From 719b52b2a8b9e4cd73f73576481ecb09aef29879 Mon Sep 17 00:00:00 2001 From: Tomer Aberbach Date: Sun, 23 Jun 2024 18:20:48 -0400 Subject: [PATCH 2/2] fix: files array --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ccdd47a..8d050f0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "license": "Apache 2.0", "files": [ - "src" + "dist" ], "type": "module", "engines": {