Skip to content

Commit

Permalink
fix: dtslint adaptations (#447)
Browse files Browse the repository at this point in the history
The .npmignore file from DefinitelyTyped which is required to be present
and to have exactly the same content in order to have the dtslint check
succeed did prevent some files from being included in the npm release
3.0.0.
  • Loading branch information
akudev authored Apr 25, 2024
1 parent 650b103 commit 944411c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/dts-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"scripts": {
"clean": "del-cli -f dist",
"copy-files": "copyfiles -V -u 1 \"src/**/*.json\" \"src/**/core-preamble.d.ts\" \"src/**/dtslintConfig/.npmignore\" \"src/**/dtslintConfig/openui5-tests.ts\" \"src/**/dtslintConfig/.eslintrc.json\" \"src/**/dtslintConfig/forDefinitelyTypedDir/.eslintrc.cjs\" \"src/**/api-json.d.ts\" dist/",
"copy-files": "copyfiles -V -u 1 \"src/**/*.json\" \"src/**/core-preamble.d.ts\" \"src/**/dtslintConfig/.npm___ignore\" \"src/**/dtslintConfig/openui5-tests.ts\" \"src/**/dtslintConfig/.eslintrc.json\" \"src/**/dtslintConfig/forDefinitelyTypedDir/.eslintrc.cjs\" \"src/**/api-json.d.ts\" dist/",
"prebuild": "npm-run-all clean copy-files",
"build": "tsc",
"postbuild": "npm-run-all build-api-types clean-implementation-types",
Expand Down
6 changes: 3 additions & 3 deletions packages/dts-generator/src/checkDtslint/check-dtslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ if (!fs.existsSync(tempDir)) {
fs.unlinkSync(path.join(tempDir, file));
}
}
// fill it with the config files required for dtslint
// fill it with the config files required for dtslint (dtslint is very strict about checking its environment and even the content of the files it expects)
[
"tsconfig.json",
".eslintrc.json",
"package.json",
".npmignore",
".npm___ignore", // renamed to avoid it being used when npm releases the dts-generator package
"openui5-tests.ts",
].forEach((file) => {
fs.copyFileSync(
new URL("dtslintConfig/" + file, import.meta.url),
path.join(tempDir, file),
path.join(tempDir, file === ".npm___ignore" ? ".npmignore" : file),
);
});
fs.copyFileSync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"private": true,
"name": "@types/openui5",
"version": "1.120.9999",
"nonNpm": true,
"nonNpmDescription": "openui5",
"projects": [
"https://github.com/SAP/openui5"
],
Expand Down

0 comments on commit 944411c

Please sign in to comment.