Skip to content

Commit

Permalink
chore: move usehooks files to packages/usehooks-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
juliencrn committed Jun 6, 2023
1 parent fafcee5 commit c4e2ae5
Show file tree
Hide file tree
Showing 139 changed files with 138 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/usehooks-ts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["custom"],
"overrides": [
// Track tree-shaking potential error in the lib
{
"files": ["./src/**/!(*.test|*.spec).ts"],
"plugins": ["tree-shaking"],
"rules": {
"tree-shaking/no-side-effects-in-initialization": 2
}
}
]
}
18 changes: 18 additions & 0 deletions packages/usehooks-ts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const ignoreDirs = ['dist/', 'node_modules/', 'scripts/']

/** @type {Config.InitialOptions} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
verbose: false,
silent: true,
transform: {
'^.+\\.[t]sx?$': `ts-jest`,
},
transformIgnorePatterns: ['<rootDir>/node_modules/'],
testPathIgnorePatterns: ignoreDirs,
coveragePathIgnorePatterns: ignoreDirs,
coverageDirectory: '<rootDir>/coverage/',
testMatch: ['<rootDir>/src/**/*.test.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}
73 changes: 73 additions & 0 deletions packages/usehooks-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "usehooks-ts",
"private": false,
"version": "2.9.1",
"description": "React hook library, ready to use, written in Typescript.",
"author": "Julien CARON <[email protected]>",
"homepage": "https://usehooks-ts.com",
"keywords": [
"typescript",
"react",
"hooks"
],
"license": "MIT",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"exports": {
".": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
}
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "pnpm test:watch",
"build": "pnpm build:cjs && pnpm build:esm",
"build:cjs": "tsc -p tsconfig.build.json --module commonjs --outDir dist/cjs --target es5",
"build:esm": "tsc -p tsconfig.build.json --module esNext --outDir dist/esm --target es6",
"test": "jest",
"test:watch": "pnpm test -- --watch --silent",
"clean": "rimraf -rf ./dist .turbo",
"lint": "eslint '**/*.{js,jsx,ts,tsx}'",
"types-check": "tsc --noEmit"
},
"devDependencies": {
"@testing-library/react": "^12.1.2",
"@testing-library/react-hooks": "^7.0.2",
"@types/jest": "^29.0.3",
"@types/node": "^18.7.18",
"@types/react": "17.0.0",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"date-fns": "^2.29.3",
"eslint": "^8.9.0",
"eslint-config-custom": "*",
"eslint-plugin-tree-shaking": "^1.10.0",
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.0.3",
"react": "17.0.2",
"react-dom": "17.0.2",
"rimraf": "^3.0.2",
"ts-jest": "^29.0.1",
"ts-node": "^10.2.1",
"typescript": "^4.8.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"engines": {
"node": ">=16.15.0"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/juliencrn/usehooks-ts"
},
"bugs": {
"url": "https://github.com/juliencrn/usehooks-ts/issues"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/usehooks-ts/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",

"compilerOptions": {
"rootDir": "./src",
"moduleResolution": "node",
"isolatedModules": true,
// Needed for CommonJS modules
"allowSyntheticDefaultImports": true
},

"include": ["./src/**/*"],
"exclude": ["./src/**/*.test.ts", "./src/**/*.mdx", "./src/**/*.demo.tsx"]
}
20 changes: 20 additions & 0 deletions packages/usehooks-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"pretty": true,
"skipLibCheck": true,
"removeComments": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"strict": true,
"lib": [
"ESNEXT",
"DOM"
]
},
"exclude": [
"node_modules",
"dist",
]
}

0 comments on commit c4e2ae5

Please sign in to comment.