From fe85c7339a8a10ad492e1bc3b06a9a3a686de9b9 Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Mon, 3 Oct 2022 23:37:43 +0100 Subject: [PATCH 1/2] docs(changeset): fix importing @onehop/js in Node in ESM environments (conditional exports) --- .changeset/early-countries-drum.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/early-countries-drum.md diff --git a/.changeset/early-countries-drum.md b/.changeset/early-countries-drum.md new file mode 100644 index 00000000..255e7ed0 --- /dev/null +++ b/.changeset/early-countries-drum.md @@ -0,0 +1,5 @@ +--- +'@onehop/js': patch +--- + +fix importing @onehop/js in Node in ESM environments (conditional exports) From fac050907dfd63fbea02a084821fff0c84c4b971 Mon Sep 17 00:00:00 2001 From: Alistair Smith Date: Mon, 3 Oct 2022 23:37:45 +0100 Subject: [PATCH 2/2] fix: node import/require in exports --- package.json | 5 ++++- prettier/.prettierignore | 7 +++++++ prettier/.prettierrc | 11 +++++++++++ utils/zod/package.json | 8 ++++---- 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 prettier/.prettierignore create mode 100644 prettier/.prettierrc diff --git a/package.json b/package.json index a668698f..cc77725b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,10 @@ "module": "./dist/index.js", "exports": { ".": { - "node": "./dist/node/index.js", + "node": { + "import": "./dist/node/index.js", + "require": "./dist/node/index.cjs" + }, "browser": "./dist/index.js", "import": "./dist/index.js", "require": "./dist/index.cjs" diff --git a/prettier/.prettierignore b/prettier/.prettierignore new file mode 100644 index 00000000..e74ed0f7 --- /dev/null +++ b/prettier/.prettierignore @@ -0,0 +1,7 @@ +.next +dist +build +out +node_modules +.yarn +.git diff --git a/prettier/.prettierrc b/prettier/.prettierrc new file mode 100644 index 00000000..2d39c48c --- /dev/null +++ b/prettier/.prettierrc @@ -0,0 +1,11 @@ +{ + "$schema": "http://json.schemastore.org/prettierrc", + "singleQuote": true, + "semi": true, + "printWidth": 120, + "trailingComma": "all", + "arrowParens": "avoid", + "bracketSpacing": false, + "useTabs": true, + "quoteProps": "consistent" +} diff --git a/utils/zod/package.json b/utils/zod/package.json index 7b295fa4..77e83aee 100644 --- a/utils/zod/package.json +++ b/utils/zod/package.json @@ -1,5 +1,5 @@ { - "main": "../../dist/utils/zod/index.js", - "module": "../../dist/utils/zod/index.mjs", - "types": "../../dist/utils/zod/index.d.ts" -} \ No newline at end of file + "main": "../../dist/utils/zod/index.js", + "module": "../../dist/utils/zod/index.mjs", + "types": "../../dist/utils/zod/index.d.ts" +}