Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README #35

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');