-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add database support for addons #415
Conversation
From v1.5 it include get/set Database methods
@@ -4,6 +4,7 @@ import React from 'react'; | |||
import { Provider } from '@kadira/storybook-ui'; | |||
import addons from '@kadira/storybook-addons'; | |||
import createChannel from '@kadira/storybook-channel-pagebus'; | |||
import createDatabase from '@kadira/storybook-database-local'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to move this to another repo? If there's a reason we can move the server code too. (I mean the middleware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this on RN storybook also. I'll move the middle ware tomorrow. Please hold this PR until then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it to the same module. We can import the middleware like this:
import middleware from '@kadira/storybook-database-local/dist/middleware'
This is cool. |
@@ -64,7 +65,9 @@ if (program.staticDir) { | |||
// Build the webpack configuration using the `baseConfig` | |||
// custom `.babelrc` file and `webpack.config.js` files | |||
const configDir = program.configDir || './.storybook'; | |||
const dbPath = path.resolve(configDir, 'datastore.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, we should disable this by default.
We should enable saving data, if a user asked to do that via an option.
We can change that later, but until we figure things out this needs to be opt-in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about -d -- enable-db
flags for start-storybook command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. That's good.
I think we can get this. Do a release. |
Released |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 014fc27. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Add a new addon database feature which can be used by addons to persist data with the storybook. The default configuration stores data in a JSON file inside the storybook config directory (.storybook).