@nrk/core-icons ·
Icon and logo kit providing a consistent and predictable user experience across platforms and NRK services
Documentation
https://static.nrk.no/core-icons/latest/
Local development
First clone @nrk/core-icons
and install its dependencies:
git clone git@github.com:nrkno/core-icons.git
cd core-icons
npm ci
npm start
Building and committing
After having applied changes, remember to build before commiting and pushing your changes upstream.
See Conventional Commits for commit guidelines.
git checkout -b feature/my-changes
npm run build
npm run test
git commit -am "<type>[optional scope]: <desciption>"
git push --set-upstream origin feature/my-changes
Testing
We use Testpack-cli to ensure published exports work as intended. In short it does the following:
- Runs
npm pack
and moves the generated archive to a sibling test folder nrk-core-icons-testpack
(which is created if not present) to core-icons - npm-installs React in the testpack-folder
- Copies the
test
-folder to the testpack-folder - Runs the
testpack-script
in the testpack-folder - Cleans up
We use arethetypeswring/cli to verify that our type declarations are available for consumers.
- We purposefully ignore the false-cjs-rule as our types are generated from @nrk/svg-to-js which only gives us cjs types. We chose not to duplicate the
d.ts
-file to a d.mts
to solve this error as it could lead to unexpected behavior for consumers.
nvm
Uses Node Version Manager (nvm) to organize node version
nvm config is saved in .nvmrc
, set appropriate node version using:
nvm use
Android
See the installation guide and usage guide.
Local development
To test the script that generates the drawables and Kotlin code locally run node .github\scripts\generate-android-vectors.js
Use gradlew publishToMavenLocal
to publish a version locally on your machine to test in other projects