Skip to content

Commit

Permalink
fix: build (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
pidkopajo authored Feb 25, 2021
1 parent 93311aa commit 6899305
Show file tree
Hide file tree
Showing 9 changed files with 5,500 additions and 9,109 deletions.
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.

60 changes: 38 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
{
"version": "0.1.20",
"name": "@virtuslab/formts",
"description": "TType-safe, declarative and performant React form & validation library",
"description": "Type-safe, declarative and performant React form & validation library",
"repository": "git@github.com:VirtusLab/formts.git",
"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",
"engines": {
"node": "12.18.x",
"yarn": "1.22.x"
},
"main": "dist/index.js",
"module": "dist/formts.esm.js",
"typings": "dist/index.d.ts",
"side-effects": false,
"files": [
"dist"
"dist",
"src"
],
"keywords": [
"react",
Expand All @@ -24,14 +21,13 @@
"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 +46,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.

61 changes: 29 additions & 32 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
{
// 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"],
"target": "ES5",
"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

0 comments on commit 6899305

Please sign in to comment.