From b53c4562630ba79a5167368f1a8a64831f612f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Eberhardt?= Date: Fri, 12 Jul 2019 23:25:23 +0200 Subject: [PATCH 1/6] Add modules and types in package.json --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index a12a1f84..011fda5a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "*.d.ts", "preact/" ], + "module": "index.js", + "types": "index.d.ts", "scripts": { "test": "jest --verbose --coverage", "size": "size-limit", From 400f6d6c9bb88a43206a31e0930180029c83a2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Eberhardt?= Date: Fri, 12 Jul 2019 23:25:39 +0200 Subject: [PATCH 2/6] Add package.json for wouter/preact --- .gitignore | 1 + preact/package.json | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 preact/package.json diff --git a/.gitignore b/.gitignore index bcde5e00..32874273 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ coverage/ preact/* !preact/react-deps.js !preact/index.d.ts +!preact/package.json diff --git a/preact/package.json b/preact/package.json new file mode 100644 index 00000000..5b771688 --- /dev/null +++ b/preact/package.json @@ -0,0 +1,13 @@ +{ + "name": "wouter-preact", + "version": "2.1.1", + "private": true, + "description": "A minimalistic routing for Preact. Nothing extra, just HOOKS.", + "module": "index.js", + "types": "index.d.ts", + "license": "ISC", + "peerDependencies": { + "wouter": "^2.1.1", + "preact": "^10.0.0-alpha.0" + } +} From 751b32b66d8955ba4e6dfe6c859c93e4e9eb2a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Eberhardt?= Date: Sat, 13 Jul 2019 12:21:23 +0200 Subject: [PATCH 3/6] Extract Babel config --- babel.config.js | 11 +++++++++++ package.json | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 babel.config.js diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..964f3f46 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,11 @@ +module.exports = function(api) { +api.cache(true); + + const presets = ["@babel/preset-env"]; + const plugins = ["@babel/plugin-transform-react-jsx"]; + + return { + presets, + plugins + }; +}; diff --git a/package.json b/package.json index 011fda5a..4909c077 100644 --- a/package.json +++ b/package.json @@ -38,14 +38,6 @@ "limit": "247 B" } ], - "babel": { - "presets": [ - "@babel/preset-env" - ], - "plugins": [ - "@babel/plugin-transform-react-jsx" - ] - }, "eslintConfig": { "extends": "eslint:recommended", "parserOptions": { From 3f449934126c528ca1d2c163b33c18f39bb43444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Eberhardt?= Date: Sat, 13 Jul 2019 12:21:36 +0200 Subject: [PATCH 4/6] Update Preact version --- preact/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preact/package.json b/preact/package.json index 5b771688..b09c47b9 100644 --- a/preact/package.json +++ b/preact/package.json @@ -8,6 +8,6 @@ "license": "ISC", "peerDependencies": { "wouter": "^2.1.1", - "preact": "^10.0.0-alpha.0" + "preact": "^10.0.0-rc.0" } } From 4c44d7c271c43bb5c0c4bf2c6f660ad885d4a160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Eberhardt?= Date: Sat, 13 Jul 2019 13:27:25 +0200 Subject: [PATCH 5/6] Fix indentation --- babel.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 964f3f46..490e6cb2 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,5 @@ module.exports = function(api) { -api.cache(true); + api.cache(true); const presets = ["@babel/preset-env"]; const plugins = ["@babel/plugin-transform-react-jsx"]; From d2c3c1b906b3f3ddcc60ac1a2ad29a3fdd31144a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Eberhardt?= Date: Sat, 13 Jul 2019 13:59:18 +0200 Subject: [PATCH 6/6] Simplify code --- babel.config.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/babel.config.js b/babel.config.js index 490e6cb2..0c8778b0 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,11 +1,8 @@ module.exports = function(api) { api.cache(true); - const presets = ["@babel/preset-env"]; - const plugins = ["@babel/plugin-transform-react-jsx"]; - return { - presets, - plugins + presets: ["@babel/preset-env"], + plugins: ["@babel/plugin-transform-react-jsx"], }; };