Skip to content

Commit

Permalink
fix: change in tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
lac617a committed Aug 29, 2024
1 parent c06253b commit 3f78173
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 11 deletions.
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"private": false,
"name": "create-context-safe",
"license": "MIT",
"version": "1.0.2",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"version": "1.0.3",
"type":"module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"description": "create-context-safe is a React library that ensures that your components always have safe access to the appropriate context. It simplifies the creation and use of contexts, ensuring that any attempt to use a context outside its bounds results in a clear, easy-to-debug error.",
"author": {
"name": "Dominyel Rivera - Yoydev",
Expand All @@ -32,12 +33,21 @@
"url": "https://github.com/lac617a/react-context-safe/issues"
},
"scripts": {
"build": "tsc ./src/index.ts",
"build": "tsc",
"test": "jest",
"prettier": "prettier --write .",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"test:coverage": "jest --coverage",
"prepublish": "yarn build"
"prepublish": "yarn build",
"compile": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json"
},
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"default": "./dist/esm/index.js"
}
},
"peerDependencies": {
"react": ">= 16.8.0",
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"module": "commonjs"
}
}
7 changes: 7 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/esm",
"module": "esnext"
}
}
7 changes: 2 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
// Default
"target": "ES5",
"noImplicitAny": true,
"noImplicitAny": false,
"lib": ["ES2015", "DOM"],
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
Expand All @@ -12,17 +12,14 @@
// Added
"jsx": "react",
"module": "ESNext",
"declaration": true,
"declarationDir": "types",
"sourceMap": true,
"outDir": "dist",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"emitDeclarationOnly": true
},
"exclude": [
"**/coverage/*",
"**/node_modules/*",
"**/__tests__/*",
"**/dist/*",
"**/*.d.ts",
"**/*.test.ts",
Expand Down
9 changes: 9 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/types",
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "./dist/types"
}
}

0 comments on commit 3f78173

Please sign in to comment.