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

Upgraded all dev dependencies #38

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
45 changes: 23 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"module": "dist/lib/throttle.mjs",
"types": "dist/types/throttle.d.ts",
"scripts": {
"precommit": "lint-staged",
"prepublish": "npm run build",
"test": "yarn lint && jest --coverage --no-cache",
"test:watch": "jest --watch",
"lint": "tslint -p ./tsconfig.json",
"lint:fix": "tslint -p ./tsconfig.json --fix",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,scss,md,graphl}\" --ignore-path .gitignore",
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts",
"start": "rollup -c rollup.config.ts -w"
"build": "tsc --module commonjs && rollup -c rollup.config.ts --configPlugin typescript",
"start": "rollup -c rollup.config.ts -w --configPlugin typescript",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -53,30 +53,31 @@
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"tslint -c ./tslint.json --fix",
"git add"
"tslint -c ./tslint.json --fix"
],
"*.{json,css,scss,md,graphl,js,jsx}": [
"prettier --write",
"git add"
"prettier --write"
]
},
"devDependencies": {
"@types/jest": "^23.3.10",
"@types/node": "^10.12.18",
"husky": "^1.2.1",
"jest": "^23.6.0",
"lint-staged": "^8.1.0",
"prettier": "^1.15.3",
"rollup": "^0.68.2",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^3.0.0",
"rollup-plugin-typescript2": "^0.18.1",
"ts-jest": "^23.10.5",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.19",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"rollup": "^4.11.0",
"ts-jest": "^29.1.2",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-eslint-rules": "^5.4.0",
"typescript": "^3.2.2"
"typescript": "^5.3.3"
},
"engines": {
"node": ">=20.11.0",
"yarn": ">=1.22.0"
}
}
27 changes: 9 additions & 18 deletions rollup.config.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import commonjs from 'rollup-plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps';
import {terser} from 'rollup-plugin-terser';
import typescript from 'rollup-plugin-typescript2';

const pkg = require('./package.json');
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';

const sharedConfig = {
input: `src/throttle.ts`,
watch: {
include: 'src/**'
include: 'src/**',
},
plugins: [
// Compile TypeScript files
typescript({useTsconfigDeclarationDir: true}),
// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs(),
// Resolve source maps to the original source
sourceMaps(),
typescript(),
// Minify the output
terser()
]
terser(),
],
};

const outputs = [
{file: pkg.main, name: 'throttle', format: 'umd', sourcemap: true},
{file: pkg.module, name: 'throttle', format: 'es', sourcemap: true}
{file: 'dist/lib/throttle.js', name: 'throttle', format: 'umd', sourcemap: true},
{file: 'dist/lib/throttle.mjs', name: 'throttle', format: 'es', sourcemap: true},
];

export default outputs.map(output => ({...sharedConfig, output}));
export default outputs.map((output) => ({...sharedConfig, output}));
Loading