-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exclude feathers error declaration and explicitly add ws package
fix ignore defitnition fix docker
- Loading branch information
1 parent
4f46ca6
commit b5c18df
Showing
4 changed files
with
74 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
ignore the typescript error in the feathersjs ts declarations | ||
using "skipLibCheck": true in tsconfig.json is not wanted for a single declaration error | ||
references: | ||
https://github.com/feathersjs/feathers/discussions/3351 | ||
https://github.com/microsoft/TypeScript/issues/38538 | ||
usage: node add-ts-nocheck.js in package.json scripts | ||
*/ | ||
const fs = require('fs'); | ||
|
||
const ADDED_STR = '// @ts-nocheck\n\n'; | ||
const FILES = ['node_modules/@feathersjs/express/lib/declarations.d.ts']; | ||
|
||
Promise.allSettled(FILES.map(addTsNoCheck)).then((results) => { | ||
let hasErrors = false; | ||
|
||
for (const result of results) { | ||
if (result.status === 'rejected') { | ||
hasErrors = true; | ||
console.error(result.reason); | ||
} | ||
} | ||
|
||
if (hasErrors) { | ||
process.exit(1); | ||
} | ||
}); | ||
|
||
async function addTsNoCheck(file) { | ||
const content = fs.readFileSync(file).toString(); | ||
|
||
if (content.includes(ADDED_STR)) { | ||
console.log(JSON.stringify(ADDED_STR), 'is already in', file); | ||
} else { | ||
fs.writeFileSync(file, ADDED_STR + content); | ||
console.log(JSON.stringify(ADDED_STR), 'added into', file); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters