This is the repository for Helsenorge core packages. More details are found in the README for each package.
The code in this repository is maintained in a private Git repository also containing code we have not yet open sourced. We use Gitexporter to create the open source repository with only the code for NPM packages used in our other public repositories (Refero and Structor).
The private Git repository is a monorepo containing other NPM packages, web pages and micro frontends for helsenorge.no. It uses NPM workspaces and Lerna for easier installation of dependencies, building and testing. Since the setup will not work without all the code from the monorepo, this is not included in the public repository. Therefore each package has to be built and tested separately for now.
Questions about the code or project can be askes at ROX Slack channel or as issues on GitHub.
https://confluence.atlassian.nhn.no/display/HR2/@helsenorge+NPM+pakker
- Følg how-to for oppsett av kubernetes
- Følg how-to for installasjon av hncli
- Deploy tjenesten til kubernetes
devspace deploy # Nås nå på # - http://corefrontend-internalapi.localtest.me:30080 # - http://corefrontend-externalapi.localtest.me:30080
- Konfigurer
dotnet-hncli dev config deploy --env-config dev-mot-k8s
- Du kan nå enten
- A) Kjør hele løsningsområdet inni kubernetes basert på lokalt bygd image
# Dette innbærer for alle komponenter # - Docker image for hele løsningsområdet bygges lokalt # - Kubernetes podens image byttes ut med lokalt image for hele løsningsområdet devspace dev
- B) Kjør utvalgte komponenter inni kubernetes basert på lokalt bygd image
# Dette innbærer bare for valgt komponent # - Docker image for internalapi bygges lokalt # - Kubernetes podens image byttes ut med lokalt image bare for internalapi # - Det vil bli kjørt devspace deploy av de andre komponentene i løsningsområdet devspace dev "internalapi" # For å kjøre devspace dev av flere enkelt komponenter så kan man separere med mellomrom som under devspace dev "internalapi externalapi"
- C) Kjør api på din lokale maskin, configurert mot kubernetes resurser, med riktig launch-profile. Evt F5 i Visual Studio.
dotnet watch run --launch-profile InternalApi --project .\Source\InternalApi\ dotnet watch run --launch-profile ExternalApi --project .\Source\ExternalApi\
- A) Kjør hele løsningsområdet inni kubernetes basert på lokalt bygd image
For developing locally you should follow these steps:
- Clone the repository
- Run
npm i
in root folder - Run
npm run build
in build folder- To build what is needed for a specific package you can run
npm run build -- --scope=@helsenorge/core-framework
in root folder
- To build what is needed for a specific package you can run
- Run the specific package you are going to work on inside the package. Check the specific run scripts for each package.
-
Missing packages when building/running a package:
- Run
npm run build
in root folder to make sure that all the packages are existing
- Run
-
Other npm errors and troubles:
- Delete all node_modules and package-lock.json and try reinstalling all packages.
npm i
andnpm run build
in root
- Delete all node_modules and package-lock.json and try reinstalling all packages.
npm i -g npm-check-updates
ncu -u \
--deep \
-x react \
-x react-dom \
-x react-router \
-x @types/react \
-x @types/react-dom \
-x @types/node \
-x conventional-changelog-cli
Build using docker:
docker build -f documentation.Dockerfile --build-arg PAT=$env:HNDEV_PAT -t helsenorge/frontenddocs/static .
docker run -p 8080:8080 --rm -it --name helsenorge-frontenddocs-static helsenorge/frontenddocs/static
Available sites:
- http://localhost:8080/cmstest/
- http://localhost:8080/documentation/
- http://localhost:8080/tjenestertest/
cd web # Or other folder with Playwright tests
# Only necessary the first time
npx playwright install
# Run tests
npx playwright test
# or use the UI
npx playwright test --ui