Skip to content

Commit 34f5b8b

Browse files
committed
chore: Declare "files" field in package.json
1 parent bf0ff95 commit 34f5b8b

8 files changed

+19
-7
lines changed

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
## [2.0.0](https://github.com/manferlo81/rollup-plugin-strip-shebang/compare/v1.2.10...v2.0.0) (2024-08-22)
66

7-
87
### ⚠ BREAKING CHANGES
98

109
* stripShebang and types are now exported as named exports (no default export)

bundlib.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { config } from 'bundlib';
33
export default config({
44
esModule: true,
55
interop: true,
6-
project: 'tsconfig-build.json',
6+
project: './tsconfig-build.json',
77
});

eslint.config.mjs

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ const typescriptPluginConfig = config(
3535
typescriptConfigs.strictTypeChecked,
3636
typescriptConfigs.stylisticTypeChecked,
3737
{ languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname } } },
38+
normalizeRulesConfig('@typescript-eslint', {
39+
'restrict-template-expressions': {
40+
allowNever: true,
41+
allowNumber: false,
42+
allowBoolean: false,
43+
allowNullish: false,
44+
allowArray: false,
45+
allowRegExp: false,
46+
allowAny: false,
47+
},
48+
}),
3849
{
3950
...typescriptConfigs.disableTypeChecked,
4051
files: ['**/*.{js,mjs,cjs}'],

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
"jsnext:main": "./dist/strip-shebang.mjs",
2525
"types": "./dist/types/index.d.ts",
2626
"typings": "./dist/types/index.d.ts",
27-
"bundlib": "bundlib.config.mjs",
27+
"files": [
28+
"dist"
29+
],
30+
"bundlib": "./bundlib.config.mjs",
2831
"scripts": {
2932
"clean:cache": "rimraf --glob node_modules/.cache/{bundlib,jest}",
3033
"clean:build": "rimraf dist coverage",

src/capture.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function processCaptureOption(option?: CaptureOption): CaptureShebangFunc
99
if (typeof option === 'function') return option;
1010

1111
// throw if option is not an object at this point
12-
if (typeof option !== 'object') throw new TypeError(`${option as unknown as string} is not a function nor an object`);
12+
if (typeof option !== 'object') throw new TypeError(`${option} is not a function nor an object`);
1313

1414
// return capture function from object
1515
return (captured) => {

src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export interface StripShebangOptions {
88
readonly include?: FilterPattern;
99
readonly exclude?: FilterPattern;
1010
readonly capture?: CaptureOption;
11-
readonly sourcemap?: boolean;
11+
readonly sourcemap?: boolean | null;
1212
}

tsconfig-build.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src/**/*.ts"
4+
"src"
55
]
66
}

tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"src"
2323
],
2424
"exclude": [
25-
"node_modules",
2625
"dist",
2726
"coverage"
2827
]

0 commit comments

Comments
 (0)