From 587dc422b0ce9787efd4c07ec2949d1f95e0166b Mon Sep 17 00:00:00 2001 From: Taylor Bantle Date: Mon, 4 Dec 2023 16:55:38 -0800 Subject: [PATCH] More fixes --- .gitignore | 2 +- package.json | 4 ---- packages/hooks/package.json | 6 +++--- packages/hooks/rollup.config.js | 5 ++--- packages/hooks/tsconfig.json | 2 +- yarn.lock | 18 ++---------------- 6 files changed, 9 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index c9075ddf..712d064b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ node_modules # build -lib/ +types/ cjs/ dist/ esm/ diff --git a/package.json b/package.json index c491ada1..2869d358 100644 --- a/package.json +++ b/package.json @@ -12,15 +12,11 @@ "lint": "yarn workspace @dolthub/react-hooks lint", "prettier": "yarn workspace @dolthub/react-hooks prettier" }, - "dependencies": { - "react": "^18.2.0" - }, "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-typescript": "^11.1.5", "@types/eslint": "^8", - "@types/react": "^18.2.40", "@types/rollup-plugin-peer-deps-external": "^2", "@typescript-eslint/eslint-plugin": "^6.13.2", "@typescript-eslint/parser": "^6.13.2", diff --git a/packages/hooks/package.json b/packages/hooks/package.json index 2730c05c..e38321bc 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -12,13 +12,14 @@ "scripts": { "compile": "tsc -b", "build": "rollup -c --bundleConfigAsCjs", + "build:watch": "rollup -c --bundleConfigAsCjs --watch", "lint": "eslint --cache --ext .ts,.js,.tsx,.jsx src", "prettier": "prettier --check 'src/**/*.{js,ts}'", "prettier-fix": "prettier --write 'src/**/*.{js,ts}'" }, "peerDependencies": { - "react": "*", - "react-dom": "*" + "@types/react": ">=18.2", + "react": ">=18.2" }, "devDependencies": { "@babel/preset-react": "^7.23.3", @@ -28,7 +29,6 @@ "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-typescript": "^11.1.5", "@types/eslint": "^8", - "@types/react": "^18.2.40", "@types/react-dom": "^18", "@types/rollup-plugin-peer-deps-external": "^2", "@typescript-eslint/eslint-plugin": "^6.13.2", diff --git a/packages/hooks/rollup.config.js b/packages/hooks/rollup.config.js index 57d5c9b6..1369b7c3 100644 --- a/packages/hooks/rollup.config.js +++ b/packages/hooks/rollup.config.js @@ -11,13 +11,12 @@ const packageJson = require("./package.json"); export default [ { input: "src/index.ts", - external: ["react", "react-dom"], + external: ["react"], output: [ { file: packageJson.main, format: "cjs", sourcemap: true, - name: "react-ts-lib", }, { file: packageJson.module, @@ -40,7 +39,7 @@ export default [ ], }, { - input: "dist/esm/types/index.d.ts", + input: "types/index.d.ts", output: [{ file: "dist/index.d.ts", format: "esm" }], external: [/\.css$/], plugins: [dts()], diff --git a/packages/hooks/tsconfig.json b/packages/hooks/tsconfig.json index 7b4893d9..4ac5f616 100644 --- a/packages/hooks/tsconfig.json +++ b/packages/hooks/tsconfig.json @@ -1,6 +1,6 @@ { "include": ["./src"], - "exclude": ["./lib", "./esm", "./cjs"], + "exclude": ["./types", "./esm", "./cjs"], "compilerOptions": { "rootDir": "src", "baseUrl": ".", diff --git a/yarn.lock b/yarn.lock index 1b36a652..82ba6bd7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1484,7 +1484,6 @@ __metadata: "@rollup/plugin-node-resolve": "npm:^15.2.3" "@rollup/plugin-typescript": "npm:^11.1.5" "@types/eslint": "npm:^8" - "@types/react": "npm:^18.2.40" "@types/react-dom": "npm:^18" "@types/rollup-plugin-peer-deps-external": "npm:^2" "@typescript-eslint/eslint-plugin": "npm:^6.13.2" @@ -1501,8 +1500,8 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:^5.3.2" peerDependencies: - react: "*" - react-dom: "*" + "@types/react": ">=18.2" + react: ">=18.2" languageName: unknown linkType: soft @@ -2326,17 +2325,6 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.2.40": - version: 18.2.41 - resolution: "@types/react@npm:18.2.41" - dependencies: - "@types/prop-types": "npm:*" - "@types/scheduler": "npm:*" - csstype: "npm:^3.0.2" - checksum: 5cc72491ce8be95e7bbedd8bf039ca971772ecd22d989feb045af7e73247c7e6cff25a2f1c2200be461fb2f6b5aacef739e1ba9fd83c744209dfd3ce8aa75afe - languageName: node - linkType: hard - "@types/resolve@npm:1.20.2": version: 1.20.2 resolution: "@types/resolve@npm:1.20.2" @@ -7084,7 +7072,6 @@ __metadata: "@rollup/plugin-node-resolve": "npm:^15.2.3" "@rollup/plugin-typescript": "npm:^11.1.5" "@types/eslint": "npm:^8" - "@types/react": "npm:^18.2.40" "@types/rollup-plugin-peer-deps-external": "npm:^2" "@typescript-eslint/eslint-plugin": "npm:^6.13.2" "@typescript-eslint/parser": "npm:^6.13.2" @@ -7097,7 +7084,6 @@ __metadata: eslint-plugin-react: "npm:^7.33.2" eslint-plugin-react-hooks: "npm:^4.6.0" prettier: "npm:^3.1.0" - react: "npm:^18.2.0" rollup: "npm:^4.6.1" rollup-plugin-peer-deps-external: "npm:^2.2.4" rollup-plugin-postcss: "npm:^4.0.2"