From 6d1672cf3ca0522d9807c11544d17e4598cf8113 Mon Sep 17 00:00:00 2001 From: Mallik Cheripally Date: Thu, 8 Aug 2024 11:30:11 +0530 Subject: [PATCH] refactor: update build output directory and dependencies Modified build output directory from 'lib' to 'dist' and updated dependencies for testing and other packages. Adjusted paths in tsconfig.json and added new libraries including Testing Library and Jest packages. --- package.json | 17 ++++++++++++----- tsconfig.json | 14 +++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 9e07658..af67019 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,12 @@ "name": "react-refocus", "version": "0.0.1-alpha.2", "description": "A focus management library for React applications", - "main": "lib/index.js", - "module": "lib/index.js", - "types": "lib/index.d.ts", + "type": "module", + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", "files": [ - "lib/**/*" + "dist/**/*" ], "scripts": { "build": "webpack --mode production", @@ -36,6 +37,10 @@ "@babel/preset-env": "^7.14.0", "@babel/preset-react": "^7.13.13", "@babel/preset-typescript": "^7.13.0", + "@testing-library/dom": "^10.4.0", + "@testing-library/jest-dom": "^6.4.8", + "@testing-library/react": "^16.0.0", + "@types/jest": "^29.5.12", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^7.13.1", @@ -49,13 +54,15 @@ "eslint-plugin-react": "^7.34.3", "eslint-plugin-react-hooks": "^4.6.2", "globals": "^15.6.0", - "jest": "^26.6.3", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "mini-css-extract-plugin": "^1.6.0", "prettier": "^3.3.2", "react": "^18.0.0", "react-dom": "^18.0.0", "standard-version": "^9.5.0", "terser-webpack-plugin": "^5.1.2", + "ts-jest": "^29.2.4", "ts-loader": "^9.2.3", "typescript": "^5.5.2", "webpack": "^5.36.2", diff --git a/tsconfig.json b/tsconfig.json index a401ab4..c8c8f1f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,19 +13,15 @@ "resolveJsonModule": true, "isolatedModules": true, "declaration": true, - "declarationDir": "./lib", - "outDir": "./lib", + "declarationDir": "./dist", + "outDir": "./dist", "jsx": "react-jsx", "jsxImportSource": "@emotion/react", - "baseUrl": ".", + "baseUrl": "./src", "paths": { - "components/*": ["src/components/*"], - "hooks/*": ["src/hooks/*"], - "utils/*": ["src/utils/*"], - "styles/*": ["src/styles/*"], - "context/*": ["src/context/*"] + "@/*": ["*"] } }, - "include": ["src"], + "include": ["src/**/*"], "exclude": ["node_modules", "lib"] }