Skip to content

Commit

Permalink
Merge 87c1a21 into 187a1ce
Browse files Browse the repository at this point in the history
  • Loading branch information
peturgq authored Oct 18, 2022
2 parents 187a1ce + 87c1a21 commit 94b3401
Show file tree
Hide file tree
Showing 83 changed files with 45,601 additions and 32,188 deletions.
2 changes: 1 addition & 1 deletion .github/actions/unit-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:

- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Cache for NodeJS dependencies
id: node-modules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/external-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -341,7 +341,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -374,7 +374,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- name: Setup yarn
run: npm install -g yarn
- name: Cache for NodeJS dependencies - host OS
Expand Down Expand Up @@ -408,7 +408,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- name: Setup yarn
run: npm install -g yarn
- name: Cache for NodeJS dependencies - host OS
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
- name: Setup yarn
run: npm install -g yarn
- name: Cache for NodeJS dependencies - host OS
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -439,7 +439,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'

- name: Setup yarn
run: npm install -g yarn
Expand Down Expand Up @@ -505,12 +505,12 @@ jobs:
continue-on-error: true
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
if: steps.gather.outcome == 'success'

- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
if: steps.gather.outcome == 'success'

- name: Setup yarn
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/dist
/tmp
/out-tsc

**/tsconfig.tsbuildinfo
# Contentful extensions
libs/contentful-extensions/translation/build
libs/contentful-extensions/translation/.cache
Expand All @@ -15,6 +15,12 @@ libs/contentful-extensions/parent-slug/.cache

# dependencies
node_modules/
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# IDEs and editors
/.idea
Expand Down
783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.3.cjs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.3.cjs
2 changes: 2 additions & 0 deletions apps/air-discount-scheme/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Module } from '@nestjs/common'
import { ApolloDriver } from '@nestjs/apollo'
import { GraphQLModule } from '@nestjs/graphql'
import { CmsModule } from '@island.is/cms'

Expand Down Expand Up @@ -27,6 +28,7 @@ const autoSchemaFile = environment.production
path: '/api/graphql',
context: ({ req }) => ({ req }),
dataSources: () => ({ backendApi: new BackendAPI() }),
driver: ApolloDriver,
}),
AuthModule.register(environment.identityServerAuth),
UserModule,
Expand Down
4 changes: 2 additions & 2 deletions apps/air-discount-scheme/web-e2e/src/integration/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('air-discount-scheme-web', () => {
xdescribe('air-discount-scheme-web', () => {
beforeEach(() => cy.visit('/'))

it('should display welcome message', () => {
xit('should display welcome message', () => {
cy.get('h1').contains('Loftbrú')
})
})
2 changes: 1 addition & 1 deletion apps/air-discount-scheme/web/graphql/withApollo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NextComponentType } from 'next'
import initApollo from './client'
import { BaseContext, NextPageContext } from 'next/dist/next-server/lib/utils'
import { BaseContext, NextPageContext } from 'next/dist/shared/lib/utils'

export const withApollo = <
C extends BaseContext = NextPageContext,
Expand Down
2 changes: 1 addition & 1 deletion apps/air-discount-scheme/web/i18n/withLocale.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { NextComponentType } from 'next'
import { BaseContext, NextPageContext } from 'next/dist/next-server/lib/utils'
import { BaseContext, NextPageContext } from 'next/dist/shared/lib/utils'
import ApolloClient from 'apollo-client'
import { NormalizedCacheObject } from 'apollo-cache-inmemory'
import gql from 'graphql-tag'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const GetGenericPageQuery = gql`
interface InitialProps {
apolloClient: ApolloClient<NormalizedCacheObject>
locale: string
route: string
route?: string
}

GenericPage.getInitialProps = async ({
Expand Down
3 changes: 2 additions & 1 deletion apps/air-discount-scheme/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true
"isolatedModules": true,
"incremental": true
},
"include": [],
"exclude": ["node_modules"],
Expand Down
2 changes: 1 addition & 1 deletion apps/air-discount-scheme/web/types.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloClient, NormalizedCacheObject } from '@apollo/client'
import { NextComponentType } from 'next'
import { NextPageContext } from 'next/dist/next-server/lib/utils'
import { NextPageContext } from 'next/dist/shared/lib/utils'
import { Locale } from '@island.is/shared/types'

export interface Routes {
Expand Down
3 changes: 2 additions & 1 deletion apps/air-discount-scheme/web/utils/hooks/useLogout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { UserContext } from '@island.is/air-discount-scheme-web/context'

export const useLogOut = () => {
const { setUser, setIsAuthenticated } = useContext(UserContext)
const [session]: AuthSession = useSession()
const [session] = useSession() as [AuthSession, boolean]

const logOut = () => {
setUser && setUser(undefined)
setIsAuthenticated && setIsAuthenticated(false)
Expand Down
2 changes: 2 additions & 0 deletions apps/api/esbuild.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"platform": "node",
"external": [
"@apollo/subgraph",
"fsevents",
"@nestjs/microservices",
"class-transformer",
Expand Down Expand Up @@ -41,6 +42,7 @@
"@protobufjs/pool",
"@protobufjs/utf8",
"safer-buffer",
"ts-morph",
"ioredis"
],
"keepNames": true
Expand Down
19 changes: 12 additions & 7 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Module } from '@nestjs/common'
import { ApolloDriver } from '@nestjs/apollo'
import { GraphQLModule } from '@nestjs/graphql'
import { TerminusModule } from '@nestjs/terminus'
import responseCachePlugin from 'apollo-server-plugin-response-cache'
//import responseCachePlugin from 'apollo-server-plugin-response-cache'
import { AuthModule as AuthDomainModule } from '@island.is/api/domains/auth'
import { ContentSearchModule } from '@island.is/api/domains/content-search'
import { CmsModule } from '@island.is/cms'
Expand Down Expand Up @@ -79,6 +80,7 @@ const autoSchemaFile = environment.production
controllers: [HealthController],
imports: [
GraphQLModule.forRoot({
driver: ApolloDriver,
debug,
playground,
autoSchemaFile,
Expand All @@ -87,14 +89,17 @@ const autoSchemaFile = environment.production
fieldMiddleware: [maskOutFieldsMiddleware],
},
plugins: [
responseCachePlugin({
shouldReadFromCache: ({ request: { http } }) => {
const bypassCacheKey = http?.headers.get('bypass-cache-key')
return bypassCacheKey !== process.env.BYPASS_CACHE_KEY
},
}),
// This was causing problems since graphql upgrade, gives us issues like:
// Error: overallCachePolicy.policyIfCacheable is not a function
// responseCachePlugin({
// shouldReadFromCache: ({ request: { http } }) => {
// const bypassCacheKey = http?.headers.get('bypass-cache-key')
// return bypassCacheKey !== process.env.BYPASS_CACHE_KEY
// },
// }),
],
}),

AuthDomainModule,
AuditModule.forRoot(environment.audit),
ContentSearchModule,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/app/graphql.middleware.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('GraphQL Middlewares', () => {
describe('filterFields', () => {
it('should not mask out when no extensions is defined', () => {
// Arrange
const extensions = undefined
const extensions: any = undefined

// Act & Assert
fields.forEach((field) => {
Expand Down
5 changes: 4 additions & 1 deletion apps/api/src/app/graphql.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export const maskOutFieldsMiddleware: FieldMiddleware = async (
const { extensions } = info.parentType

if (extensions?.filterFields) {
const { condition = () => true, fields = [] } = extensions.filterFields
const {
condition = () => true,
fields = [],
} = extensions.filterFields as any

if (condition(ctx) && !fields.includes(info.fieldName)) {
return null
Expand Down
3 changes: 2 additions & 1 deletion apps/api/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": ["node"],
"skipLibCheck": true
},
"exclude": ["**/*.spec.ts", "**/*.test.ts"],
"include": ["**/*.ts"]
Expand Down
1 change: 0 additions & 1 deletion apps/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {},
"include": [],
"files": [],
"references": [
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-admin-web/specs/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { render } from '@testing-library/react'

import 'whatwg-fetch'
import Index from '../pages/index'

describe('Index', () => {
Expand Down
3 changes: 2 additions & 1 deletion apps/auth-admin-web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true
"isolatedModules": true,
"incremental": true
},
"include": ["**/*.ts", "**/*.tsx", "next-env.d.ts"],
"exclude": ["node_modules"]
Expand Down
1 change: 1 addition & 0 deletions apps/external-contracts-tests/jest-to-dd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const jestReport = JSON.parse(
assertionResults: { fullName: string; status: 'passed' | 'failed' }[]
}[]
}

const testCasesInfo = jestReport.testResults.flatMap(
(testResult) =>
testResult.assertionResults.map((test) => ({
Expand Down
5 changes: 3 additions & 2 deletions apps/financial-aid/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AuthModule } from '@island.is/auth-nest-tools'
import { Module } from '@nestjs/common'
import { ApolloDriver } from '@nestjs/apollo'
import { GraphQLModule } from '@nestjs/graphql'
import { NationalRegistryClientConfig } from '@island.is/clients/national-registry-v2'
import { ConfigModule, XRoadConfig } from '@island.is/nest/config'

import { environment } from '../environments'
import { BackendAPI } from '../services'
import {
Expand All @@ -25,11 +25,12 @@ const autoSchemaFile = environment.production
@Module({
imports: [
GraphQLModule.forRoot({
driver: ApolloDriver,
debug,
playground,
autoSchemaFile,
path: '/api/graphql',
context: ({ req }) => req,
context: ({ req }: any) => req,
dataSources: () => ({
backendApi: new BackendAPI(),
}),
Expand Down
3 changes: 2 additions & 1 deletion apps/financial-aid/web-osk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"resolveJsonModule": true,
"isolatedModules": true
"isolatedModules": true,
"incremental": true
},
"include": [],
"exclude": ["node_modules"],
Expand Down
Loading

0 comments on commit 94b3401

Please sign in to comment.