Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build #70

Merged
merged 9 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
preset: "ts-jest",
testEnvironment: "node",
};
8,846 changes: 0 additions & 8,846 deletions package-lock.json

This file was deleted.

56 changes: 37 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,30 @@
"author": "Mikołaj Klaman <mklaman@virtuslab.com>",
"license": "MIT",
"private": false,
"main": "dist/main/index.js",
"module": "dist/module/index.js",
"esnext": "dist/esnext/index.js",
"typings": "dist/main/index.d.ts",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"engines": {
"node": "12.18.x",
"yarn": "1.22.x"
},
pidkopajo marked this conversation as resolved.
Show resolved Hide resolved
"files": [
"dist"
],
"keywords": [
"react",
"typescript",
"forms",
"validation"
],
"scripts": {
"clean": "rm -rf ./dist",
"clean:all": "yarn clean && rm -rf ./node_modules",
"build": "yarn build:commonjs && yarn build:module && yarn build:esnext",
"build:commonjs": "tsc -p ./tsconfig.commonjs.json",
"build:module": "tsc -p ./tsconfig.module.json",
"build:esnext": "tsc -p ./tsconfig.esnext.json",
"lint": "eslint 'src/**/*.{ts,tsx}' --fix",
"test": "jest",
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why",
"release": "standard-version --releaseCommitMessageFormat \"chore(release): {{currentTag}} [ci skip]\""
},
"husky": {
Expand All @@ -50,30 +48,50 @@
"prettier --write"
]
},
"size-limit": [
{
"path": "dist/tsdx-example.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/tsdx-example.esm.js",
"limit": "10 KB"
}
],
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@size-limit/preset-small-lib": "^4.9.2",
"@testing-library/react-hooks": "^3.4.2",
"@types/jest": "~26.0.14",
"@types/react": "^16.9.50",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"babel-jest": "26.6.3",
"conditional-type-checks": "^1.0.5",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"husky": ">=4",
"husky": "4.0.0",
"jest": "~26.4.2",
"lint-staged": ">=10",
"prettier": "^2.1.2",
"react": "^16.13.1",
"react-test-renderer": "^16.13.1",
"size-limit": "^4.9.2",
"standard-version": "^9.0.0",
"ts-jest": "~26.3.0",
"typescript": "^4.0.2",
"tsdx": "^0.14.1",
"tslib": "^2.1.0",
"typescript": "^4.0.5",
"yarn": "^1.22.5"
},
"peerDependencies": {
"react": "^16.8.0"
},
"resolutions": {
"**/typescript": "^4.0.5",
"**/@typescript-eslint/eslint-plugin": "^4.6.1",
"**/@typescript-eslint/parser": "^4.6.1"
}
}
2 changes: 1 addition & 1 deletion src/core/helpers/resolve-touched.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ const isBool = (it: unknown): it is boolean => typeof it === "boolean";
const isArray = Array.isArray;

const isRecord = (it: unknown): it is Record<string, TouchedValues<any>> =>
it && typeof it === "object" && !Array.isArray(it);
!!(it && typeof it === "object" && !Array.isArray(it))
10 changes: 0 additions & 10 deletions tsconfig.commonjs.json

This file was deleted.

10 changes: 0 additions & 10 deletions tsconfig.esnext.json

This file was deleted.

60 changes: 28 additions & 32 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src", "types"],
"compilerOptions": {
"incremental": true,
"rootDir": "src",
"moduleResolution": "node",
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
// output .d.ts declaration files for consumers
"declaration": true,
"inlineSourceMap": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"jsx": "react",

// output .js.map sourcemap files for consumers
"sourceMap": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
"rootDir": "./src",
// stricter type-checking for stronger correctness. Recommended by TS
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,

// linter checks for common issues
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": false,

"traceResolution": false,
"listEmittedFiles": false,
"listFiles": false,
"pretty": true,

"experimentalDecorators": false,
"emitDecoratorMetadata": false,

"lib": ["es2017", "dom"],
"target": "ES2017"
},
"include": ["src/**/*"],
"exclude": ["node_modules/**"],
"compileOnSave": false
// use Node's module resolution algorithm, instead of the legacy TS one
"moduleResolution": "node",
// transpile JSX to React.createElement
"jsx": "react",
// interop between ESM and CJS modules. Recommended by TS
"esModuleInterop": true,
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
"skipLibCheck": true,
// error out if import and file system have a casing mismatch. Recommended by TS
"forceConsistentCasingInFileNames": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true,
}
}
10 changes: 0 additions & 10 deletions tsconfig.module.json

This file was deleted.

Loading