-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use JSDOM alternative for deploying to Vercel #95
Draft
Josehower
wants to merge
62
commits into
upleveled:main
Choose a base branch
from
Josehower:vercel-deploy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 54 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
5360fc9
Update next
Josehower 896f69e
Remove Fly deploy
Josehower 99f045e
Configure for railway
Josehower 21cfc53
Update webpack config
Josehower 5513174
Use canvas externals in webpack
Josehower 73f34ad
Use ENV variable from vercel
Josehower 9e70757
Use ligth JSDOM lib
Josehower 4074dd3
Update lock
Josehower fe22997
Remove extra webpack config
Josehower d90acd5
Add vercel fix suggestion
Josehower af6f979
Update to use different canvas
Josehower dd55c34
Use different dom lib
Josehower 281ba8f
Remove canvas
Josehower d9ebf98
Use new JSDOM lib
Josehower aa1c96e
Update to trigger deploy
Josehower 61d93f6
Use ESM
Josehower 27a6367
Use ESM
Josehower f900e10
Update object
Josehower 8b14159
Update ssl
Josehower 53e81a3
Use default export
Josehower 25bb8b5
Update next
Josehower fd69555
Remove Fly deploy
Josehower a8482d9
Configure for railway
Josehower f8e9a7f
Update sass
Josehower afc6f2f
Update dependencies
Josehower b2957c1
Update lock
Josehower 3fc307f
Merge branch 'main' into vercel-deploy
Josehower 7f9e56a
Delete ley.config.js
karlhorky 33c31b6
Update types
Josehower 2331a16
Add generic
Josehower d829dae
Add types
Josehower 7bd396a
Discard changes to ...rkflows/lint-check-types-build-deploy.yml
karlhorky 9828dd4
Update lint-check-types-build-deploy.yml
karlhorky 392d455
Discard changes to ...rkflows/lint-check-types-build-deploy.yml
karlhorky 21cafe0
Create lint-check-types-build-deploy.yml
karlhorky 7c01333
Discard changes to scripts/fly-io-start.sh
karlhorky e30ad76
Update next.config.js
karlhorky c5ffe0f
Add back deleted file
karlhorky 51ea59d
Update config file to work
Josehower 76e8678
Update dependency upgrades - non-major (#97)
Josehower 2071c6f
Update dependency eslint-config-upleveled to v5 (#98)
renovate[bot] 2e35968
Enable deployment to both Fly and Vercel (#96)
Josehower d0a3fff
Remove Fly deploy
Josehower c75a75f
Configure for railway
Josehower 5933f1e
Use ligth JSDOM lib
Josehower 0894cc2
Update object
Josehower 19c51b6
Update ssl
Josehower d3d60bc
Add back removed deploy step
karlhorky 32f0518
Rename lint-check-types-build.yml to lint-check-types-build-deploy.yml
karlhorky 5c96612
Create fly-io-start.sh
karlhorky fe782aa
Create fly.toml
karlhorky e661e69
Fix dockerfile
Josehower afc7e2b
Delete ley.config.js
karlhorky b5b186c
Update connect
Josehower bc86540
Merge branch 'main' into vercel-deploy
Josehower 181b96b
Update lock
Josehower c39d258
Use Boolean constructor instead of !!
Josehower a4be47b
Use sinfle file for jsdom types
Josehower baa4d62
Remove unnecesary configuration
Josehower 7bc5af8
Merge branch 'main' into vercel-deploy
karlhorky be48c35
Update tsconfig.json
karlhorky 31abf21
Merge branch 'main' into vercel-deploy
karlhorky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.Config} */ | ||
const config = { | ||
extends: ['upleveled'], | ||
globals: { | ||
NodeJS: true, | ||
}, | ||
}; | ||
|
||
module.exports = config; |
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,4 +1,14 @@ | ||
{ | ||
"typescript.tsdk": "./node_modules/typescript/lib", | ||
"typescript.enablePromptUseWorkspaceTsdk": true | ||
// Enable Stylelint in javascript and typescriptreact (for CSS-in-JS) and scss | ||
"css.lint.unknownAtRules": "ignore", | ||
// Ignore unknown CSS at rules for Tailwind CSS | ||
"stylelint.validate": [ | ||
"css", | ||
"scss", | ||
"postcss", | ||
"javascript", | ||
"typescriptreact" | ||
], | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"typescript.tsdk": "./node_modules/typescript/lib" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import fs from 'node:fs'; | ||
import dotenv from 'dotenv'; | ||
|
||
export function setEnvironmentVariables() { | ||
if (process.env.NODE_ENV === 'production' || process.env.CI) { | ||
// Set standard environment variables for Postgres.js from Vercel environment variables | ||
if (process.env.POSTGRES_URL) { | ||
process.env.PGHOST = process.env.POSTGRES_HOST; | ||
process.env.PGDATABASE = process.env.POSTGRES_DATABASE; | ||
process.env.PGUSERNAME = process.env.POSTGRES_USER; | ||
process.env.PGPASSWORD = process.env.POSTGRES_PASSWORD; | ||
} | ||
return; | ||
} | ||
|
||
// Replacement for unmaintained dotenv-safe package | ||
// https://github.com/rolodato/dotenv-safe/issues/128#issuecomment-1383176751 | ||
// | ||
// TODO: Remove this and switch to dotenv/safe if this proposal gets implemented: | ||
// https://github.com/motdotla/dotenv/issues/709 | ||
dotenv.config(); | ||
|
||
const unconfiguredEnvVars = Object.keys( | ||
dotenv.parse(fs.readFileSync('./.env.example')), | ||
).filter((exampleKey) => !process.env[exampleKey]); | ||
|
||
if (unconfiguredEnvVars.length > 0) { | ||
throw new Error( | ||
`.env.example environment ${ | ||
unconfiguredEnvVars.length > 1 ? 'variables' : 'variable' | ||
} ${unconfiguredEnvVars.join(', ')} not configured in .env file`, | ||
); | ||
} | ||
} | ||
|
||
setEnvironmentVariables(); | ||
|
||
const options = { | ||
ssl: !!process.env.POSTGRES_URL, | ||
}; | ||
|
||
export default options; |
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 was deleted.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use
Boolean()
here for expressiveness?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c39d258