Skip to content

Commit

Permalink
Merge pull request #35 from fortanix/mkrause/241120-update-readme
Browse files Browse the repository at this point in the history
Update README
  • Loading branch information
nighto authored Nov 20, 2024
2 parents 0ab2a48 + e887ff4 commit 6a11fe2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ You can find the latest Storybook documentation [here](https://fortanix.github.i

## Usage

Requirements:

- React v19 or higher.

Installation:

```sh
```console
npm install --save @fortanix/baklava
```

Expand All @@ -30,13 +34,13 @@ this will be supported out of the box. Otherwise, you may need to configure your
Icons are loaded through SVG sprites. This requires some additional setup. If you're using vite, install the
`vite-plugin-svg-icons` plugin:

```sh
```console
npm install --save vite-plugin-svg-icons
```

Then, add the following to the `plugins` array in your vite config:

```
```typescript
createSvgIconsPlugin({
iconDirs: [path.resolve(__dirname, 'node_modules/@fortanix/baklava/src/assets/icons')],
symbolId: 'baklava-icon-[name]',
Expand All @@ -45,6 +49,12 @@ createSvgIconsPlugin({
}),
```

Additionally, you will need to add the following import in your main entry file:

```typescript
import 'virtual:svg-icons-register';
```


## Contributing

Expand Down
4 changes: 4 additions & 0 deletions package-lock.json

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

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,9 @@
"overrides": {
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc"
},
"peerDependencies": {
"react": ">= 19.0.0-rc.1",
"react-dom": ">= 19.0.0-rc.1"
}
}
}
8 changes: 6 additions & 2 deletions package.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ const packageConfig = {
// See https://react.dev/blog/2024/04/25/react-19-upgrade-guide#installing
'@types/react': 'npm:types-react@rc',
'@types/react-dom': 'npm:types-react-dom@rc',
}
},
peerDependencies: {
'react': '>= 19.0.0-rc.1',
'react-dom': '>= 19.0.0-rc.1',
},
};

const packageConfigWithComment = {
Expand All @@ -180,4 +184,4 @@ const packageConfigWithComment = {
const packageConfigFormatted = JSON.stringify(packageConfigWithComment, null, 2);

// Write to `package.json`
fs.writeFileSync('./package.json', packageConfigFormatted);
fs.writeFileSync('./package.json', packageConfigFormatted + '\n');

0 comments on commit 6a11fe2

Please sign in to comment.