Skip to content

Commit

Permalink
Merge pull request #855 from navikt/feature/node20
Browse files Browse the repository at this point in the history
Upgrade to node 20
  • Loading branch information
enstulen authored Oct 9, 2023
2 parents bcc0d44 + 6d232bb commit dc602b0
Show file tree
Hide file tree
Showing 734 changed files with 30,061 additions and 30,068 deletions.
9 changes: 3 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = false
insert_final_newline = true
max_line_length = 120

[*.{js,jsx,ejs,mjs,ts,tsx,json,css,yaml}]
indent_size = 2

[Makefile]
indent_style = tab
[*.{js,ejs,cjs,mjs,ts,jsx,tsx,json,css,less,yml,yaml}]
indent_size = 2
40 changes: 40 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:vitest/recommended',
'plugin:vitest-globals/recommended',
'plugin:cypress/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
plugins: ['react', 'react-hooks', 'import', '@typescript-eslint', 'vitest', 'cypress'],
globals: {
fetchMock: true,
vi: true,
FormioUtils: true,
},
env: {
'vitest-globals/env': true,
'cypress/globals': true,
},
rules: {
'no-unused-labels': 'error', // Should not have any unused labels
'import/no-duplicates': 'error', // Should not import the same module twice (should be handled automatically by prettier-plugin-organize-imports)
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true, argsIgnorePattern: '^[_$].*' }], // ignores unused variables starting with _ or $
'@typescript-eslint/ban-types': 'off', // TODO: Remove 'Function' as a type mostly
'@typescript-eslint/no-explicit-any': 'off', // Explicit any's
'@typescript-eslint/ban-ts-comment': 'off', // @ts-ignore and @ts-nocheck comments
'@typescript-eslint/no-namespace': 'off', // TODO: FormSummaryType.ts has a Summary namespace
'no-extra-boolean-cast': 'off', // TODO: Remove redudant "!!"
'no-case-declarations': 'off', // TODO: Remove "let/const" in switch cases
'vitest/expect-expect': 'off', // Cypress tests don't necessarily use expect
'react/jsx-key': ['error', { checkFragmentShorthand: true }], // There was an error with a missing key that crashed the app
'import/no-internal-modules': [
'error',
{ forbid: ['@navikt/skjemadigitalisering-shared-@(components|domain)/**'] },
], // Should not import from shared components or domain
},
root: true,
};
49 changes: 0 additions & 49 deletions .eslintrc.json

This file was deleted.

24 changes: 12 additions & 12 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "monthly"
interval: 'monthly'
versioning-strategy: increase
open-pull-requests-limit: 20
groups:
navikt:
patterns:
- "@navikt/*"
- '@navikt/*'
all-minor-patch:
patterns:
- "*"
- '*'
update-types:
- "minor"
- "patch"
- 'minor'
- 'patch'
ignore:
- dependency-name: "formiojs"
- dependency-name: 'formiojs'

- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: "monthly"
interval: 'monthly'
groups:
all:
patterns:
- "*"
- '*'
16 changes: 8 additions & 8 deletions .github/workflows/alert-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
branches:
- master
paths:
- "packages/bygger/.nais/alerts.yaml"
- "packages/bygger/.nais/preprod.yaml"
- "packages/bygger/.nais/prod.yaml"
- ".github/workflows/alert-deploy.yaml"
- 'packages/bygger/.nais/alerts.yaml'
- 'packages/bygger/.nais/preprod.yaml'
- 'packages/bygger/.nais/prod.yaml'
- '.github/workflows/alert-deploy.yaml'
jobs:
preprod-deploy:
name: Deploy to preprod
Expand All @@ -22,8 +22,8 @@ jobs:
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: "./packages/bygger/.nais/alerts.yaml"
VARS: "./packages/bygger/.nais/preprod.yaml"
RESOURCE: './packages/bygger/.nais/alerts.yaml'
VARS: './packages/bygger/.nais/preprod.yaml'

prod-deploy:
name: Deploy to prod
Expand All @@ -36,5 +36,5 @@ jobs:
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: "./packages/bygger/.nais/alerts.yaml"
VARS: "./packages/bygger/.nais/prod.yaml"
RESOURCE: './packages/bygger/.nais/alerts.yaml'
VARS: './packages/bygger/.nais/prod.yaml'
92 changes: 46 additions & 46 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,50 @@ concurrency: deploy-${{ github.ref }}

jobs:
build-and-test:
name: "Build and test packages"
name: 'Build and test packages'
runs-on: ubuntu-latest-8-cores
permissions:
contents: "read"
packages: "read"
contents: 'read'
packages: 'read'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.1"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
node-version: '20.8.0'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
registry-url: https://npm.pkg.github.com/
scope: "@navikt"
- name: "Install dependencies"
scope: '@navikt'
- name: 'Install dependencies'
run: yarn --frozen-lockfile
- name: "No unstaged changes allowed (changes in yarn.lock?)"
- name: 'No unstaged changes allowed (changes in yarn.lock?)'
run: git diff --quiet
- name: "Check types"
- name: 'Check types'
run: yarn check-types
- name: "Build"
- name: 'Build'
run: yarn build
- name: "Test"
- name: 'Test'
run: yarn test

package-and-push-bygger:
if: github.ref == 'refs/heads/master'
name: "Package bygger"
name: 'Package bygger'
runs-on: ubuntu-latest-8-cores
permissions:
contents: "read"
id-token: "write"
packages: "read"
contents: 'read'
id-token: 'write'
packages: 'read'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.1"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
node-version: '20.8.0'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
registry-url: https://npm.pkg.github.com/
scope: "@navikt"
scope: '@navikt'

- name: "Build application: Bygger"
- name: 'Build application: Bygger'
env:
VITE_GIT_VERSION: ${{ github.sha }}
run: yarn --frozen-lockfile && yarn build
Expand All @@ -72,28 +72,28 @@ jobs:

package-and-push-fyllut-base:
if: github.ref == 'refs/heads/master'
name: "Package fyllut"
name: 'Package fyllut'
runs-on: ubuntu-latest-8-cores
permissions:
contents: "read"
id-token: "write"
packages: "read"
contents: 'read'
id-token: 'write'
packages: 'read'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.1"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
node-version: '20.8.0'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
registry-url: https://npm.pkg.github.com/
scope: "@navikt"
scope: '@navikt'

- name: "Build application: Fyllut"
- name: 'Build application: Fyllut'
env:
VITE_GIT_VERSION: ${{ github.sha }}
run: yarn --frozen-lockfile && yarn build

- name: "Build and push Docker image: fyllut-base-dev"
- name: 'Build and push Docker image: fyllut-base-dev'
uses: nais/docker-build-push@v0
id: docker-build-push-dev
with:
Expand All @@ -108,7 +108,7 @@ jobs:
pull: true
tag: ${{ github.sha }}

- name: "Build and push Docker image: fyllut-base"
- name: 'Build and push Docker image: fyllut-base'
if: github.ref == 'refs/heads/master'
uses: nais/docker-build-push@v0
id: docker-build-push
Expand All @@ -125,39 +125,39 @@ jobs:
tag: ${{ github.sha }}

deploy-bygger-to-prod:
name: "Deploy bygger to prod"
name: 'Deploy bygger to prod'
if: github.ref == 'refs/heads/master'
needs: [build-and-test, package-and-push-bygger, package-and-push-fyllut-base]
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
- name: "Deploy to PROD"
uses: "nais/deploy/actions/deploy@v1"
- uses: 'actions/checkout@v3'
- name: 'Deploy to PROD'
uses: 'nais/deploy/actions/deploy@v1'
env:
APIKEY: "${{ secrets.NAIS_DEPLOY_APIKEY }}"
CLUSTER: "prod-gcp"
RESOURCE: "./packages/bygger/.nais/nais.yaml"
VARS: "./packages/bygger/.nais/prod.yaml"
VAR: "image=${{ needs.package-and-push-bygger.outputs.image }}"
APIKEY: '${{ secrets.NAIS_DEPLOY_APIKEY }}'
CLUSTER: 'prod-gcp'
RESOURCE: './packages/bygger/.nais/nais.yaml'
VARS: './packages/bygger/.nais/prod.yaml'
VAR: 'image=${{ needs.package-and-push-bygger.outputs.image }}'

trigger-deploy-fyllut-to-dev:
name: "Trigger deploy fyllut to dev"
name: 'Trigger deploy fyllut to dev'
needs: [build-and-test, package-and-push-bygger, package-and-push-fyllut-base]
runs-on: ubuntu-latest
steps:
- name: "Generate app installation access token"
- name: 'Generate app installation access token'
uses: navikt/github-app-token-generator@v1
id: generate-token
with:
private-key: ${{ secrets.PUBLISHING_APP_PRIVATE_KEY }}
app-id: ${{ secrets.PUBLISHING_APP_ID }}
repo: navikt/skjemautfylling-formio

- name: "Trigger deploy fyllut to dev"
- name: 'Trigger deploy fyllut to dev'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: "Trigger dev deploy"
workflow: 'Trigger dev deploy'
repo: navikt/skjemautfylling-formio
ref: "dev-deploy"
ref: 'dev-deploy'
token: ${{ steps.generate-token.outputs.token }}
inputs: '{ "monorepoGitHash": "${{ github.sha }}" }'
Loading

0 comments on commit dc602b0

Please sign in to comment.