@knighted/duel 2.1.6 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -1
  2. package/package.json +16 -3
package/README.md CHANGED
@@ -14,7 +14,6 @@ Tool for building a Node.js [dual package](https://nodejs.org/api/packages.html#
14
14
  - Transforms the [differences between ES modules and CommonJS](https://nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs).
15
15
  - Works with monorepos.
16
16
 
17
-
18
17
  ## Requirements
19
18
 
20
19
  - Node >= 20.11.0
@@ -121,3 +120,7 @@ These are definitely edge cases, and would only really come up if your project m
121
120
  As far as I can tell, `duel` is one (if not the only) way to get a correct dual package build using `tsc` without requiring multiple `tsconfig.json` files or extra configuration. The TypeScript team [keep](https://github.com/microsoft/TypeScript/pull/54546) [talking](https://github.com/microsoft/TypeScript/issues/54593) about dual build support, but they continue to [refuse to rewrite specifiers](https://github.com/microsoft/TypeScript/issues/16577).
122
121
 
123
122
  Fortunately, Node.js has added `--experimental-require-module` so that you can [`require()` ES modules](https://nodejs.org/api/esm.html#require) if they don't use top level await, which sets the stage for possibly no longer requiring dual builds.
123
+
124
+ ## Documentation
125
+
126
+ - [docs/faq.md](docs/faq.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knighted/duel",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "TypeScript dual packages.",
5
5
  "type": "module",
6
6
  "main": "dist/esm/duel.js",
@@ -20,13 +20,15 @@
20
20
  },
21
21
  "engineStrict": true,
22
22
  "scripts": {
23
- "prettier": "prettier -w *.js src/*.js test/*.js",
23
+ "prettier": "prettier -w *.js *.md docs/*.md src/*.js test/*.js",
24
+ "prettier:check": "prettier --check --ignore-unknown *.js *.md docs/*.md src/*.js test/*.js",
24
25
  "lint": "eslint src/*.js test/*.js",
25
26
  "test:integration": "node --test --test-reporter=spec test/integration.js",
26
27
  "test:monorepos": "node --test --test-reporter=spec test/monorepos.js",
27
28
  "test": "c8 --reporter=text --reporter=text-summary --reporter=lcov node --test --test-reporter=spec test/integration.js test/monorepos.js",
28
29
  "build": "node src/duel.js --dirs --modules",
29
- "prepack": "npm run build"
30
+ "prepack": "npm run build",
31
+ "prepare": "husky"
30
32
  },
31
33
  "keywords": [
32
34
  "node",
@@ -71,6 +73,8 @@
71
73
  "eslint": "^9.39.1",
72
74
  "eslint-plugin-n": "^17.23.1",
73
75
  "globals": "^16.3.0",
76
+ "husky": "^9.1.7",
77
+ "lint-staged": "^16.2.7",
74
78
  "node-module-type": "^1.0.4",
75
79
  "prettier": "^3.6.2",
76
80
  "tsx": "^4.20.6",
@@ -85,6 +89,15 @@
85
89
  "glob": "^13.0.0",
86
90
  "read-package-up": "^12.0.0"
87
91
  },
92
+ "lint-staged": {
93
+ "*.{js,mjs,cjs,ts,cts,mts,jsx,tsx}": [
94
+ "eslint --max-warnings=0",
95
+ "prettier --check --ignore-unknown"
96
+ ],
97
+ "*.{md,json,yml,yaml}": [
98
+ "prettier --check --ignore-unknown"
99
+ ]
100
+ },
88
101
  "prettier": {
89
102
  "arrowParens": "avoid",
90
103
  "printWidth": 90,