Skip to content

Commit

Permalink
Sandbox -> main (Already reviewed) (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlp73 authored Aug 15, 2024
2 parents 288489b + f081a2c commit ccbc900
Show file tree
Hide file tree
Showing 24 changed files with 1,990 additions and 213 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ mockServiceWorker.js
cypress
src/nais.js
public/src/nais.js
scripts/FetchLandListe.js

22 changes: 19 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
"scripts": {
"start": "vite",
"start:production": "vite --mode production",
"fetch-land-liste": "node --experimental-fetch ./scripts/FetchLandListe.js",
"fetch-dev-types": "openapi-typescript https://pensjonskalkulator-backend.intern.dev.nav.no/v3/api-docs/current -o ./src/types/schema.d.ts",
"postfetch-dev-types": "npm run format:types",
"format:types": "prettier --write ./src/types/schema.d.ts && eslint ./src/types/schema.d.ts --fix",
"prebuild": "npm run eslint:check && npm run prettier:check && npm run stylelint:check",
"prebuild": "npm run fetch-land-liste && npm run eslint:check && npm run prettier:check && npm run stylelint:check",
"build": "tsc && vite build --mode staging",
"build:server": "tsc -p tsconfig.server.json",
"build:production": "tsc && vite build --mode production",
Expand Down Expand Up @@ -39,6 +40,7 @@
"winston": "^3.14.1"
},
"devDependencies": {
"@babel/plugin-syntax-import-attributes": "^7.24.7",
"@formatjs/intl-datetimeformat": "^6.12.5",
"@formatjs/intl-numberformat": "^8.10.3",
"@grafana/faro-web-sdk": "^1.8.0",
Expand Down
20 changes: 20 additions & 0 deletions scripts/FetchLandListe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import fs from 'fs'
import prettier from 'prettier'

fetch(`https://pensjonskalkulator-backend.intern.dev.nav.no/api/v1/land-liste`)
.then((response) => response.text())
.then(async (body) => {
const formattedJson = await prettier.format(
JSON.stringify(JSON.parse(body)),
{
parser: 'json',
}
)
fs.writeFileSync('./src/assets/land-liste.json', formattedJson)
})
.catch((error) => {
console.error(
'Error while fetching or processing /api/v1/land-liste',
error
)
})
Loading

0 comments on commit ccbc900

Please sign in to comment.