-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Re-introduce support for TS 3.9
Closes #1362. Co-Authored-By: Constantine Dergachev <13132449+Dergash@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,16 +1,29 @@ | ||
// @ts-check | ||
|
||
const fs = require('fs-extra'); | ||
const { join } = require('path'); | ||
const fs = require("fs-extra"); | ||
const { join } = require("path"); | ||
|
||
const file = join(__dirname, '../dist/lib/application.js'); | ||
const file = join(__dirname, "../dist/lib/application.js"); | ||
|
||
Promise.all([ | ||
fs.readJson(join(__dirname, '../package.json')).then(({ version }) => version), | ||
fs.readFile(file, { encoding: 'utf-8' }) | ||
]).then(([version, text]) => { | ||
return fs.writeFile(file, text.replace(/{{ VERSION }}/g, version)); | ||
}).catch(reason => { | ||
async function main() { | ||
const [package, text] = await Promise.all([ | ||
fs.readJson(join(__dirname, "../package.json")), | ||
fs.readFile(file, { encoding: "utf-8" }), | ||
]); | ||
|
||
const replacements = { | ||
VERSION: package.version, | ||
SUPPORTED: package.peerDependencies.typescript, | ||
}; | ||
|
||
const replaced = text.replace(/{{ (VERSION|SUPPORTED) }}/g, (_, match) => { | ||
return replacements[match]; | ||
}); | ||
|
||
await fs.writeFile(file, replaced); | ||
} | ||
|
||
main().catch((reason) => { | ||
console.error(reason); | ||
process.exit(1); | ||
}); |
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