Skip to content

Commit

Permalink
Oppdatere redis, node og storybook (#1125)
Browse files Browse the repository at this point in the history
* feat(Oppdatere redis-tilkobling): oppdatere redistilkobling til siste versjon

affects: @navikt/familie-backend

* Oppdatere til node 18 for bygging

* chore(Storybook): oppdaterer storybook for å støtte node18-versjon av byggeprosessen

affects: @navikt/familie-backend, @navikt/familie-dokumentliste, @navikt/familie-tidslinje

* chore(Tving oppdatering av pakker for å deploye canary): tving oppdatering av pakker for å deploye c

affects: @navikt/familie-backend, @navikt/familie-dokumentliste, @navikt/familie-tidslinje
  • Loading branch information
charliemidtlyng authored Jul 17, 2023
1 parent 1f116a0 commit 6bd8a5d
Show file tree
Hide file tree
Showing 15 changed files with 4,280 additions and 4,916 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'yarn'
registry-url: "https://npm.pkg.github.com"
- name: Prepare repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'yarn'
registry-url: "https://npm.pkg.github.com"
- name: Prepare repository
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ tsconfig.tsbuildinfo
docs
*.log
.idea

storybook-static
35 changes: 0 additions & 35 deletions .storybook/main.js

This file was deleted.

55 changes: 55 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import type { StorybookConfig } from '@storybook/react-webpack5';


const storybookConfig: StorybookConfig = {
stories: ['../packages/familie-*/src/**/*.stories.@(tsx|mdx)', '../packages/familie-*/*.stories.@(tsx|mdx)'],
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y', '@storybook/addon-storysource', '@storybook/addon-mdx-gfm'],
typescript: {
check: true,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
},
},
framework: {
name: '@storybook/react-webpack5',
options: {},
},
docs: {
autodocs: true,
},
async webpackFinal(config) {
if (config.module && config.module.rules) {
config.module.rules.push({
test: /\.(less)$/,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader',
options: {
modules: {
compileType: 'icss',
},
},
}, {
loader: require.resolve('less-loader'),
}],
});
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});
}
if (config.resolve && config.resolve.extensions) {
config.resolve.extensions.push('.less');

}
return config;
},

}
;

export default storybookConfig;
16 changes: 16 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
166 changes: 86 additions & 80 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,89 @@
{
"name": "familie-felles-frontend",
"private": true,
"repository": "https://github.com/navikt/familie-felles-frontend.git",
"license": "MIT",
"scripts": {
"ct": "git-cz",
"bootstrap": "lerna bootstrap --use-workspaces --no-ci",
"build": "lerna run build",
"storybook": "start-storybook -p 8000",
"build-storybook": "build-storybook",
"deploy-storybook": "storybook-to-ghpages",
"lint": "eslint './packages/**/*.{ts,tsx}'",
"lint:fix": "eslint './packages/**/*.{ts,tsx}' --fix",
"publish:ci": "lerna publish -y --no-verify-access",
"publish:canary": "lerna publish --canary",
"publish:canary:ci": "lerna publish -y --no-verify-access --canary"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"lint-staged": {
"./packages/**/*.{js,ts,tsx}": [
"eslint --fix"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-lerna-changelog"
}
},
"devDependencies": {
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.4.4",
"@storybook/addon-a11y": "^6.5.12",
"@storybook/addon-essentials": "^6.5.12",
"@storybook/addon-storysource": "^6.5.12",
"@storybook/react": "^6.5.12",
"@storybook/storybook-deployer": "^2.8.12",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.2.5",
"classnames": "^2.3.2",
"commitizen": "^4.3.0",
"copyfiles": "^2.4.1",
"css-loader": "^5.0.1",
"cz-lerna-changelog": "^2.0.3",
"eslint": "^8.36.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"lerna": "^5.6.2",
"less": "^4.1.3",
"less-loader": "^7.3.0",
"lint-staged": "^13.2.0",
"lodash.throttle": "^4.1.1",
"prettier": "^2.8.7",
"pretty-quick": "^3.1.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"rollup-plugin-less": "^1.1.3",
"storybook-addon-react-docgen": "^1.2.42",
"style-loader": "^1.3.0",
"ts-loader": "^9.4.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.9.4"
},
"workspaces": [
"packages/*"
"name": "familie-felles-frontend",
"private": true,
"repository": "https://github.com/navikt/familie-felles-frontend.git",
"license": "MIT",
"scripts": {
"ct": "git-cz",
"bootstrap": "lerna bootstrap --use-workspaces --no-ci",
"build": "lerna run build",
"storybook": "storybook dev -p 8000",
"build-storybook": "storybook build",
"deploy-storybook": "storybook-to-ghpages",
"lint": "eslint './packages/**/*.{ts,tsx}'",
"lint:fix": "eslint './packages/**/*.{ts,tsx}' --fix",
"publish:ci": "lerna publish -y --no-verify-access",
"publish:canary": "lerna publish --canary",
"publish:canary:ci": "lerna publish -y --no-verify-access --canary"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
},
"lint-staged": {
"./packages/**/*.{js,ts,tsx}": [
"eslint --fix"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-lerna-changelog"
}
},
"devDependencies": {
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.4.4",
"@storybook/addon-a11y": "^7.0.27",
"@storybook/addon-essentials": "^7.0.27",
"@storybook/addon-mdx-gfm": "^7.0.27",
"@storybook/addon-storysource": "^7.0.27",
"@storybook/react": "^7.0.27",
"@storybook/react-webpack5": "^7.0.27",
"@storybook/storybook-deployer": "^2.8.16",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.2.5",
"classnames": "^2.3.2",
"commitizen": "^4.3.0",
"copyfiles": "^2.4.1",
"css-loader": "^5.0.1",
"cz-lerna-changelog": "^2.0.3",
"eslint": "^8.36.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"lerna": "^5.6.2",
"less": "^4.1.3",
"less-loader": "^7.3.0",
"lint-staged": "^13.2.0",
"lodash.throttle": "^4.1.1",
"prettier": "^2.8.7",
"pretty-quick": "^3.1.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"rollup-plugin-less": "^1.1.3",
"storybook": "^7.0.27",
"storybook-addon-react-docgen": "^1.2.43",
"style-loader": "^1.3.0",
"ts-loader": "^9.4.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.9.4"
},
"workspaces": [
"packages/*"
]
}
5 changes: 2 additions & 3 deletions packages/familie-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
},
"dependencies": {
"@navikt/familie-logging": "^6.0.0",
"@types/connect-redis": "~0.0.19",
"@types/cookie-parser": "^1.4.3",
"@types/express": "^4.17.15",
"@types/express-session": "^1.17.5",
"@types/passport": "^1.0.11",
"connect-redis": "^6.1.3",
"connect-redis": "^7.1.0",
"cookie-parser": "^1.4.6",
"express": "^4.18.2",
"express-http-proxy": "^1.6.3",
Expand All @@ -43,7 +42,7 @@
"openid-client": "^5.4.0",
"passport": "^0.6.0",
"prom-client": "^14.2.0",
"redis": "^4.6.5",
"redis": "^4.6.7",
"snyk": "^1.1142.0"
},
"snyk": true
Expand Down
2 changes: 1 addition & 1 deletion packages/familie-backend/server.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/addon-docs/blocks';

<Meta title="Backend/Server" />
<Meta title="Backend/Server saksbehandling" />

# Familie backend

Expand Down
4 changes: 1 addition & 3 deletions packages/familie-backend/src/auth/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { logError, logInfo } from '@navikt/familie-logging';
import { ISessionKonfigurasjon } from '../typer';

import RedisStore from 'connect-redis';
const redisStore = RedisStore(session);

export default (
app: Express,
Expand All @@ -22,7 +21,6 @@ export default (
logInfo('Setter opp redis for session');

const redisClient = redis.createClient({
legacyMode: true,
database: 1,
socket: {
host: sessionKonfigurasjon.redisUrl,
Expand All @@ -33,7 +31,7 @@ export default (
redisClient.connect().catch(logError);
redisClient.unref();

const store = new redisStore({
const store = new RedisStore({
disableTouch: true,
client: redisClient,
ttl: sessionKonfigurasjon.sessionMaxAgeSekunder,
Expand Down
Loading

0 comments on commit 6bd8a5d

Please sign in to comment.