scripts: convert to ESM and deduplicate #290

Merged
norm merged 2 commits from scripts-esm into main 2022-12-16 17:15:26 +00:00
Owner

This makes it a bit easier to add any new files that may need to be
cleaned up in the future.

Also allows us to use top-level await for the yarn dev task.

This makes it a bit easier to add any new files that may need to be cleaned up in the future. Also allows us to use top-level await for the `yarn dev` task.
norm added 1 commit 2022-12-15 20:17:29 +00:00
scripts: convert to ESM and deduplicate
Some checks failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
13fdd4558b
This makes it a bit easier to add any new files that may need to be
cleaned up in the future.

Also allows us to use top-level await for the `yarn dev` task.
Johann150 reviewed 2022-12-15 20:27:25 +00:00
@ -0,0 +13,4 @@
stderr: process.stderr,
});
execa('npx', ['gulp', 'watch'], {
Owner

Why are some of these awaited and some not?

Why are some of these `await`ed and some not?
Author
Owner

These were the case in the original dev.js script, not sure if we should just run all of these processes asynchronously.

These were the case in the original `dev.js` script, not sure if we should just run all of these processes asynchronously.
Author
Owner

I think the first two do need the await since it doesn't make sense to clean asynchronously and pretty much every package depends on foundkey-js being built.

I think the first two do need the `await` since it doesn't make sense to clean asynchronously and pretty much every package depends on `foundkey-js` being built.
Owner

The first two produce a result (cleaning out stuff, building things), the non-awaited commands are watchers, where you probably will have a hard time waiting for a result being returned.

The first two produce a result (cleaning out stuff, building things), the non-awaited commands are watchers, where you probably will have a hard time waiting for a result being returned.
Johann150 marked this conversation as resolved
@ -0,0 +46,4 @@
});
} catch (e) {
await new Promise(resolve => setTimeout(resolve, 3000));
start();
Owner

Can't this be simplified to just setTimeout(start, 3000); ?

Can't this be simplified to just `setTimeout(start, 3000);` ?
Owner

Hmm I'm not so sure any more but I think the change was fine because start isn't awaited on anyway...

Hmm I'm not so sure any more but I think the change was fine because `start` isn't awaited on anyway...
norm marked this conversation as resolved
norm added 1 commit 2022-12-15 20:29:49 +00:00
simplify setTimeout call
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
634a29c9c2
Johann150 approved these changes 2022-12-16 16:33:07 +00:00
norm merged commit 8f782f8ce5 into main 2022-12-16 17:15:26 +00:00
norm deleted branch scripts-esm 2022-12-16 17:15:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#290
No description provided.