From 9d30aaeca2affa153fa178234a95387013a709f6 Mon Sep 17 00:00:00 2001 From: Andreas Kunz Date: Thu, 25 Apr 2024 12:31:29 +0200 Subject: [PATCH] fix: dtslint adaptations 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. --- packages/dts-generator/package.json | 2 +- packages/dts-generator/src/checkDtslint/check-dtslint.ts | 6 +++--- .../dtslintConfig/{.npmignore => .npm___ignore} | 0 .../src/checkDtslint/dtslintConfig/package.json | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) rename packages/dts-generator/src/checkDtslint/dtslintConfig/{.npmignore => .npm___ignore} (100%) diff --git a/packages/dts-generator/package.json b/packages/dts-generator/package.json index c220440..dc05aa3 100644 --- a/packages/dts-generator/package.json +++ b/packages/dts-generator/package.json @@ -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", diff --git a/packages/dts-generator/src/checkDtslint/check-dtslint.ts b/packages/dts-generator/src/checkDtslint/check-dtslint.ts index 2944fbd..8561417 100644 --- a/packages/dts-generator/src/checkDtslint/check-dtslint.ts +++ b/packages/dts-generator/src/checkDtslint/check-dtslint.ts @@ -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( diff --git a/packages/dts-generator/src/checkDtslint/dtslintConfig/.npmignore b/packages/dts-generator/src/checkDtslint/dtslintConfig/.npm___ignore similarity index 100% rename from packages/dts-generator/src/checkDtslint/dtslintConfig/.npmignore rename to packages/dts-generator/src/checkDtslint/dtslintConfig/.npm___ignore diff --git a/packages/dts-generator/src/checkDtslint/dtslintConfig/package.json b/packages/dts-generator/src/checkDtslint/dtslintConfig/package.json index f65d187..e09f77b 100644 --- a/packages/dts-generator/src/checkDtslint/dtslintConfig/package.json +++ b/packages/dts-generator/src/checkDtslint/dtslintConfig/package.json @@ -2,6 +2,8 @@ "private": true, "name": "@types/openui5", "version": "1.120.9999", + "nonNpm": true, + "nonNpmDescription": "openui5", "projects": [ "https://github.com/SAP/openui5" ],