Skip to content

Commit

Permalink
fix(#464): update druxt stories
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Mar 6, 2022
1 parent f5c4d77 commit 48a4386
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 7,865 deletions.
4 changes: 0 additions & 4 deletions packages/druxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"module": "dist/druxt.esm.js",
"files": [
"dist",
"stories",
"templates"
],
"dependencies": {
Expand All @@ -47,9 +46,6 @@
"querystring": "^0.2.0",
"scule": "^0.2.0"
},
"devDependencies": {
"@storybook/addon-docs": "^6.4.13"
},
"peerDependencies": {
"axios": "*",
"consola": "*"
Expand Down
24 changes: 21 additions & 3 deletions packages/druxt/src/nuxt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,28 @@ const DruxtNuxtModule = function (moduleOptions = {}) {
this.options.cli.badgeMessages.push(`${chalk.bold('API:')} ${chalk.blue.underline(options.baseUrl + options.endpoint)}`)

// Nuxt Storybook.
const self = this
this.nuxt.hook('storybook:config', async ({ stories }) => {
stories.push('druxt/stories/*.stories.mdx')
stories.push('druxt/dist/components/*.stories.mdx')
stories.push('druxt/dist/components/*.stories.mjs')
// Druxt README story.
self.addTemplate({
src: resolve(__dirname, '../templates/stories/README.stories.mdx'),
fileName: 'stories/druxt-README.stories.mdx',
})
stories.push(resolve(self.options.buildDir, './stories/druxt-README.stories.mdx'))

// Druxt custom module story.
self.addTemplate({
src: resolve(__dirname, '../templates/stories/druxt-module.stories.mdx'),
fileName: 'stories/druxt-module.stories.mdx',
})
stories.push(resolve(self.options.buildDir, './stories/druxt-module.stories.mdx'))

// DruxtDebug component story.
self.addTemplate({
src: resolve(__dirname, '../templates/stories/druxt-debug.stories.js'),
fileName: 'stories/druxt-debug.stories.js',
})
stories.push(resolve(self.options.buildDir, './stories/druxt-debug.stories.js'))
})
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DruxtDebug from './DruxtDebug.vue'
import DruxtDebug from 'druxt/dist/components/DruxtDebug.vue'

export default {
title: 'Druxt/DruxtDebug',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Druxt module.
import DruxtModule from 'druxt/dist/components/DruxtModule.vue'
export default {
name: 'MyModule',
extends: DruxtModule
extends: DruxtModule,
druxt: {
async fetchConfig() {
// Load configuration data here.
Expand All @@ -113,7 +113,7 @@ export default {
// Build nested arrays of component options based on the context.
componentOptions: (context) => ([['default']]),
// Map props data from the context.
propsData: (context) => ({ ...context }),
propsData: (context) => ({}),
// Build slots render arrays.
slots(h) {
return {
Expand Down
Loading

0 comments on commit 48a4386

Please sign in to comment.