Skip to content

Commit

Permalink
build: changes build to microbundle
Browse files Browse the repository at this point in the history
tsdx was failing with a typescript error but tsc passes. This seemed to be a false positive that I
could do nothing about. This is probably why useModal was left out of the build. Trying microbundle
as very easy to set up. Worked well.
  • Loading branch information
stuarthendren committed May 6, 2022
1 parent 492eb44 commit 92e1ea5
Show file tree
Hide file tree
Showing 5 changed files with 1,204 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

env:
NODE_VERSION: 16
NODE_VERSION: 14

jobs:
build:
Expand Down
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"license": "MIT",
"private": false,
"repository": "git://github.com/commitd/hooks.git",
"main": "dist/index.js",
"source": "src/index.ts",
"main": "dist/hooks.js",
"umd:main": "dist/hooks.umd.js",
"module": "dist/hooks.esm.js",
"typings": "dist/index.d.ts",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand All @@ -20,8 +23,8 @@
"scripts": {
"clean": "shx rm -rf dist",
"commit": "cz",
"start": "tsdx watch",
"build": "tsdx build",
"start": "microbundle watch",
"build": "yarn clean ; microbundle",
"test": "tsdx test",
"lint": "tsdx lint",
"size": "size-limit",
Expand All @@ -32,7 +35,7 @@
"format:check": "prettier --check '**/{src,test,stories}/**/{*.js,*.ts,*.tsx,*.json,*.md,*.mdx}'",
"deploy-storybook": "storybook-to-ghpages",
"generate": "plop --plopfile ./generators/plopfile.js",
"prepare": "husky install && tsdx build",
"postinstall": "husky install",
"semantic-release": "semantic-release"
},
"peerDependencies": {
Expand All @@ -48,10 +51,9 @@
"semi": false,
"singleQuote": true
},
"module": "dist/hooks.esm.js",
"size-limit": [
{
"path": "dist/hooks.cjs.production.min.js",
"path": "dist/hooks.js",
"limit": "10 KB"
},
{
Expand Down Expand Up @@ -119,6 +121,7 @@
"eslint-plugin-storybook": "^0.5.10",
"husky": "^7.0.4",
"jest-sonar-reporter": "^2.0.0",
"microbundle": "^0.15.0",
"plop": "^2.7.4",
"prettier": "^2.1.2",
"prettier-plugin-organize-imports": "^2.3.4",
Expand All @@ -132,8 +135,8 @@
"storybook-dark-mode": "^1.0.9",
"swr": "^0.3.8",
"tsdx": "^0.14.1",
"tslib": "^2.3.1",
"typescript": "^4.6.3"
"tslib": "^2.4.0",
"typescript": "^4.6.4"
},
"dependencies": {}
}
}
2 changes: 1 addition & 1 deletion src/usePoll/usePoll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function usePoll(
}, [callback])

useEffect(() => {
let id: NodeJS.Timeout | null = null
let id: ReturnType<typeof setTimeout> | null = null

function call() {
const current = savedCallback.current
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src", "types"],
"exclude": ["**/*.stories.tsx"],
"exclude": ["**/*.stories.tsx", "**/*.test.ts"],
"compilerOptions": {
"module": "esnext",
"module": "ESnext",
"target": "ESnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
// output .d.ts declaration files for consumers
Expand Down
Loading

0 comments on commit 92e1ea5

Please sign in to comment.