Skip to content

Commit

Permalink
feat(chore): replace rollup with tsup, include sources
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSemenov committed Dec 25, 2021
1 parent 5fe04da commit 4051bd6
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 144 deletions.
2 changes: 0 additions & 2 deletions .taprc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ node-arg:
[
"-r",
"esbuild-runner/register",
"-r",
"tsconfig-paths/register",
]
3 changes: 3 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"*.{js,ts}": "eslint --fix",
}
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@
"author": "Ilya Semenov",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"source": "src/index.ts",
"files": [
"dist"
"dist",
"src",
"!**/*.test.*"
],
"scripts": {
"test": "tap 'src/**/*.test.ts'",
"build": "rollup -c",
"prepack": "yarn build",
"test": "tap 'tests/**/*.test.ts'",
"build": "tsup",
"prepack": "npm run build",
"lint": "eslint --fix '**/*.{js,ts}'",
"prepare": "husky install"
},
"lint-staged": {
"*.{js,ts}": "eslint --fix"
},
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@tsconfig/node14": "^1.0.1",
"@types/tap": "^15.0.5",
"@types/uuid": "^8.3.3",
"@typescript-eslint/eslint-plugin": "^5.8.0",
Expand All @@ -40,12 +42,8 @@
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "^2.1.2",
"rollup": "^2.33.1",
"rollup-plugin-cleaner": "^1.0.0",
"rollup-plugin-dts": "^4.1.0",
"rollup-plugin-esbuild": "^4.7.2",
"tap": "^15.1.5",
"tsconfig-paths": "^3.9.0",
"tsup": "^5.11.9",
"typescript": "^4.0.5"
},
"peerDependencies": {
Expand Down
21 changes: 0 additions & 21 deletions rollup.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/tests/stub.test.ts

This file was deleted.

4 changes: 4 additions & 0 deletions tests/stub.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Scene } from "grammy-scenes"
import tap from "tap"

tap.same(new Scene("foo").name, "foo")
14 changes: 6 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"extends": "@tsconfig/node14",
"include": ["src", "tests"],
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,
"lib": ["ES2020"]
},
"include": ["src"]
"paths": {
"grammy-scenes": ["./src"]
}
}
}
9 changes: 9 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "tsup"

export default defineConfig({
clean: true,
entry: ["src/index.ts"],
format: ["cjs", "esm"],
sourcemap: true,
dts: true,
})
Loading

0 comments on commit 4051bd6

Please sign in to comment.