-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gha] Run checks and build against both Node 18/20 (#303)
* [gha] Run checks and build against both Node 18/20 * include workflow paths * [gha] Add Node 20 to CI (#7197) GitOrigin-RevId: 968e1d03fd3aa5d70da737c784eae7d65607177d * CI update lock file for PR --------- Co-authored-by: Corey Martin <[email protected]> Co-authored-by: Lightspark Eng <[email protected]>
- Loading branch information
1 parent
a59d636
commit b7ca10d
Showing
9 changed files
with
60 additions
and
34 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
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,21 @@ | ||
#!/bin/bash | ||
|
||
# See https://github.com/TypeStrong/ts-node/issues/1997#issuecomment-1774047586 | ||
# ts-node has a known issue with es modules in Node.js 20 and above so we need to | ||
# run with a different command to workaround with a warning: | ||
|
||
# Get the Node.js version and remove the 'v' prefix | ||
NODE_VERSION=$(node -v | cut -c 2-) | ||
|
||
# Split the version string into major, minor, and patch numbers | ||
IFS='.' read -ra VERSION_PARTS <<< "$NODE_VERSION" | ||
|
||
if (( ${VERSION_PARTS[0]} >= 20 )); then | ||
CMD="node --loader ts-node/esm" | ||
elif (( ${VERSION_PARTS[0]} == 18 )); then | ||
CMD="ts-node" | ||
else | ||
echo "Only Node.js versions 18 and above are supported" | ||
fi | ||
|
||
yarn nodemon --watch 'src/*.ts' --exec $CMD src/startServer.ts |
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,21 @@ | ||
#!/bin/bash | ||
|
||
# See https://github.com/TypeStrong/ts-node/issues/1997#issuecomment-1774047586 | ||
# ts-node has a known issue with es modules in Node.js 20 and above so we need to | ||
# run with a different command to workaround with a warning: | ||
|
||
# Get the Node.js version and remove the 'v' prefix | ||
NODE_VERSION=$(node -v | cut -c 2-) | ||
|
||
# Split the version string into major, minor, and patch numbers | ||
IFS='.' read -ra VERSION_PARTS <<< "$NODE_VERSION" | ||
|
||
if (( ${VERSION_PARTS[0]} >= 20 )); then | ||
CMD="node --loader ts-node/esm" | ||
elif (( ${VERSION_PARTS[0]} == 18 )); then | ||
CMD="ts-node" | ||
else | ||
echo "Only Node.js versions 18 and above are supported" | ||
fi | ||
|
||
yarn nodemon --watch 'src/*.ts' --exec $CMD src/startServer.ts |
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
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