From bbe32e4022cd3c7586604a8655d2328cd58e9edf Mon Sep 17 00:00:00 2001 From: Erin Millard Date: Tue, 7 May 2024 23:08:53 +1000 Subject: [PATCH] Add package quality tools --- .attw.json | 3 +++ .size-limit.cjs | 6 ++++++ Makefile | 10 ++++++++-- package.json | 5 +++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .attw.json create mode 100644 .size-limit.cjs diff --git a/.attw.json b/.attw.json new file mode 100644 index 0000000..ac25798 --- /dev/null +++ b/.attw.json @@ -0,0 +1,3 @@ +{ + "ignoreRules": ["cjs-resolves-to-esm"] +} diff --git a/.size-limit.cjs b/.size-limit.cjs new file mode 100644 index 0000000..5d3bbb0 --- /dev/null +++ b/.size-limit.cjs @@ -0,0 +1,6 @@ +module.exports = [ + { + path: "artifacts/dist/index.js", + limit: "1.3 kB", + }, +]; diff --git a/Makefile b/Makefile index b3cc099..d51b380 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,18 @@ -export NODE_OPTIONS := --experimental-vm-modules --redirect-warnings=artifacts/node-warnings - CHANGELOG_TAG_URL_PREFIX := https://github.com/ezzatron/nvector-js/releases/tag/ +JS_ARETHETYPESWRONG_REQ += artifacts/dist +JS_PUBLINT_REQ += artifacts/dist +JS_SIZE_LIMIT_REQ += artifacts/dist +JS_SKYPACK_PACKAGE_CHECK_REQ += artifacts/dist + ################################################################################ -include .makefiles/Makefile -include .makefiles/pkg/js/v1/Makefile -include .makefiles/pkg/js/v1/with-npm.mk +-include .makefiles/pkg/js/v1/with-arethetypeswrong.mk +-include .makefiles/pkg/js/v1/with-publint.mk +-include .makefiles/pkg/js/v1/with-skypack-package-check.mk -include .makefiles/pkg/js/v1/with-tsc.mk -include .makefiles/pkg/changelog/v1/Makefile diff --git a/package.json b/package.json index e207668..f6dffb7 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,10 @@ "prepublishOnly": "tsc -p tsconfig.build.json" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.15.3", "@fast-check/vitest": "^0.1.0", + "@size-limit/preset-small-lib": "^11.1.2", + "@skypack/package-check": "^0.2.2", "@types/ws": "^8.5.5", "@typescript-eslint/eslint-plugin": "^7.0.0", "@typescript-eslint/parser": "^7.0.0", @@ -52,6 +55,8 @@ "eslint-plugin-vitest": "^0.4.1", "prettier": "^3.0.3", "prettier-plugin-organize-imports": "^3.2.3", + "publint": "^0.2.7", + "size-limit": "^11.1.2", "typedoc": "^0.25.13", "typescript": "^5.2.2", "vite": "^5.2.10",