Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
feat!: update to nodejs 20 (#197)
Browse files Browse the repository at this point in the history
* feat: update to nodejs 20

* fix: update distroless image
  • Loading branch information
dolcalmi authored May 18, 2023
1 parent 7c5a162 commit 5ab9b8d
Show file tree
Hide file tree
Showing 13 changed files with 1,991 additions and 2,210 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: "yarn"
- run: yarn install --frozen-lockfile
- name: Run audit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: "yarn"
- run: yarn install --frozen-lockfile
- name: Run check code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- run: yarn install
- name: Run check code
run: . ./.envrc && yarn code:check
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- run: yarn install
- name: Run all tests
run: yarn test
2 changes: 1 addition & 1 deletion .github/workflows/vendor/nodejs-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: "yarn"
- run: yarn install --frozen-lockfile
- name: Run audit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vendor/nodejs-check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: "yarn"
- run: yarn install --frozen-lockfile
- name: Run check code
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine AS BUILD_IMAGE
FROM node:20-alpine AS BUILD_IMAGE

ARG CUSTOM_MODULES="default"

Expand All @@ -16,7 +16,7 @@ COPY ./*.js ./
RUN CUSTOM_MODULES=${CUSTOM_MODULES} yarn build:node && yarn build:files && yarn build:bundler


FROM gcr.io/distroless/nodejs:18
FROM gcr.io/distroless/nodejs20-debian11

ARG CUSTOM_MODULES="default"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"codegen": "graphql-codegen --config codegen.yml"
},
"engines": {
"node": "18"
"node": "20"
},
"dependencies": {
"@apollo/client": "^3.7.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Icon from "components/icon"
const headerNavPages = ["home"] as const

type Page =
| typeof headerNavPages[number]
| (typeof headerNavPages)[number]
| "conversion-flow"
| "send-bitcoin"
| "receive-bitcoin"
Expand Down
1 change: 1 addition & 0 deletions src/components/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const SettingsPasswordUpdate: FCT = ({ flowData: flowDataProp }) => {
kratos
.initializeSelfServiceSettingsFlowForBrowsers(
returnTo ? String(returnTo) : undefined,
undefined,
{ withCredentials: true },
)
.then(({ data }) => setFlowData(data))
Expand Down
20 changes: 10 additions & 10 deletions src/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export const ExchangeCurrencyUnit = {
} as const

export type ExchangeCurrencyUnit =
typeof ExchangeCurrencyUnit[keyof typeof ExchangeCurrencyUnit]
(typeof ExchangeCurrencyUnit)[keyof typeof ExchangeCurrencyUnit]
/** Provides global settings for the application which might have an impact for the user. */
export type Globals = {
readonly __typename: "Globals"
Expand Down Expand Up @@ -339,7 +339,7 @@ export const InvoicePaymentStatus = {
} as const

export type InvoicePaymentStatus =
typeof InvoicePaymentStatus[keyof typeof InvoicePaymentStatus]
(typeof InvoicePaymentStatus)[keyof typeof InvoicePaymentStatus]
export type LnInvoice = {
readonly __typename: "LnInvoice"
readonly paymentHash: Scalars["PaymentHash"]
Expand Down Expand Up @@ -747,7 +747,7 @@ export const Network = {
Testnet: "testnet",
} as const

export type Network = typeof Network[keyof typeof Network]
export type Network = (typeof Network)[keyof typeof Network]
export type OnChainAddressCreateInput = {
readonly walletId: Scalars["WalletId"]
}
Expand Down Expand Up @@ -844,14 +844,14 @@ export const PaymentSendResult = {
Success: "SUCCESS",
} as const

export type PaymentSendResult = typeof PaymentSendResult[keyof typeof PaymentSendResult]
export type PaymentSendResult = (typeof PaymentSendResult)[keyof typeof PaymentSendResult]
export const PhoneCodeChannelType = {
Sms: "SMS",
Whatsapp: "WHATSAPP",
} as const

export type PhoneCodeChannelType =
typeof PhoneCodeChannelType[keyof typeof PhoneCodeChannelType]
(typeof PhoneCodeChannelType)[keyof typeof PhoneCodeChannelType]
/** Price amount expressed in base/offset. To calculate, use: `base / 10^offset` */
export type Price = {
readonly __typename: "Price"
Expand All @@ -870,7 +870,7 @@ export const PriceGraphRange = {
OneYear: "ONE_YEAR",
} as const

export type PriceGraphRange = typeof PriceGraphRange[keyof typeof PriceGraphRange]
export type PriceGraphRange = (typeof PriceGraphRange)[keyof typeof PriceGraphRange]
export type PriceInput = {
readonly amount: Scalars["SatAmount"]
readonly amountCurrencyUnit: ExchangeCurrencyUnit
Expand Down Expand Up @@ -1154,7 +1154,7 @@ export const TxDirection = {
Send: "SEND",
} as const

export type TxDirection = typeof TxDirection[keyof typeof TxDirection]
export type TxDirection = (typeof TxDirection)[keyof typeof TxDirection]
export const TxNotificationType = {
IntraLedgerPayment: "IntraLedgerPayment",
IntraLedgerReceipt: "IntraLedgerReceipt",
Expand All @@ -1165,14 +1165,14 @@ export const TxNotificationType = {
} as const

export type TxNotificationType =
typeof TxNotificationType[keyof typeof TxNotificationType]
(typeof TxNotificationType)[keyof typeof TxNotificationType]
export const TxStatus = {
Failure: "FAILURE",
Pending: "PENDING",
Success: "SUCCESS",
} as const

export type TxStatus = typeof TxStatus[keyof typeof TxStatus]
export type TxStatus = (typeof TxStatus)[keyof typeof TxStatus]
/** A wallet belonging to an account which contains a USD balance and a list of transactions. */
export type UsdWallet = Wallet & {
readonly __typename: "UsdWallet"
Expand Down Expand Up @@ -1374,7 +1374,7 @@ export const WalletCurrency = {
Usd: "USD",
} as const

export type WalletCurrency = typeof WalletCurrency[keyof typeof WalletCurrency]
export type WalletCurrency = (typeof WalletCurrency)[keyof typeof WalletCurrency]
export type CaptchaCreateChallengeMutationVariables = Exact<{ [key: string]: never }>

export type CaptchaCreateChallengeMutation = {
Expand Down
2 changes: 1 addition & 1 deletion src/kratos/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const getUrlForFlow = ({
kratosBrowserUrl,
query,
}: {
flow: typeof KratosFlow[keyof typeof KratosFlow]
flow: (typeof KratosFlow)[keyof typeof KratosFlow]
kratosBrowserUrl: string
query?: URLSearchParams
}) =>
Expand Down
Loading

0 comments on commit 5ab9b8d

Please sign in to comment.