Don't import package.json in scripts/refresh-assets.ts, just read it (#3116)

Per #3018, the `import` causes `scripts/refresh-assets.ts` to fail on
Windows. This PR applies @SomeHats's suggestions cleanly on top of the
current `main`. Thank you @cscxj for the original report!

Describe what your pull request does. If appropriate, add GIFs or images
showing the before and after.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package
pull/3111/head
Dan Groshev 2024-03-11 17:52:58 +00:00 zatwierdzone przez GitHub
rodzic 19a1d01b8e
commit f1b4f807d8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -402,9 +402,9 @@ async function writeAssetDeclarationDTSFile() {
}
async function copyVersionToDotCom() {
const packageVersion = await import(join(REPO_ROOT, 'packages', 'tldraw', 'package.json')).then(
(pkg) => pkg.version
)
const packageJson = await readJsonIfExists(join(REPO_ROOT, 'packages', 'tldraw', 'package.json'))
const packageVersion = packageJson.version
const file = `export const version = '${packageVersion}'`
await writeCodeFile(
'scripts/refresh-assets.ts',