diff --git a/package.json b/package.json index 14878998..512449ba 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "vue-eslint-parser": "^7.1.0", "vue-jest": "^3.0.5", "vue-loader": "^15.9.1", - "vue-styleguidist": "^4.31.0", + "vue-styleguidist": "^4.33.9", "vue-template-compiler": "^2.6.11", "webpack": "^4.42.1", "webpack-cli": "^4.0.0", diff --git a/styleguide.config.js b/styleguide.config.js index 48e4fecc..965eb713 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -1,6 +1,17 @@ const path = require('path'); +const { merge } = require('webpack-merge'); const webpackConfig = require('./webpack.dev.js'); +const newConfig = Object.assign({}, webpackConfig, { + externals: {}, + module: { + // Ignore eslint + rules: webpackConfig.module.rules.filter( + rule => rule.use !== 'eslint-loader' + ) + }, +}) + module.exports = { require: [ path.join(__dirname, 'styleguide/global.requires.js'), @@ -10,22 +21,31 @@ module.exports = { pagePerSection: true, minimize: true, verbose: false, - webpackConfig: Object.assign({}, webpackConfig, { - externals: {}, - module: { - // Ignore eslint - rules: webpackConfig.module.rules.filter( - rule => rule.use !== 'eslint-loader' - ), + + webpackConfig: merge(newConfig, { + // https://webpack.js.org/configuration/dev-server/#devserverproxy + devServer: { + proxy: { + // redirect to the guest avatar endpoint + '/index.php/avatar': { + target: 'https://nextcloud.com/wp-content/themes/next/assets/img/common/nextcloud-square-logo.png', + changeOrigin: true, + ignorePath: true, + secure: false, + } + } }, }), + exampleMode: 'expand', usageMode: 'expand', + components: 'src/components/*/*.vue', getComponentPathLine(componentPath) { const name = path.basename(componentPath, '.vue') return `import ${name} from '@nextcloud/vue/dist/Components/${name}'` }, + sections: [ { name: 'Introduction', @@ -95,17 +115,18 @@ module.exports = { name: 'Multiselect', components: [ 'src/components/Multiselect/Multiselect.vue', - 'src/components/Multiselect/AvatarSelectOption.vue', 'src/components/MultiselectTags/MultiselectTags.vue', ], }, ], }, ], + ribbon: { text: 'Fork me on GitHub', url: 'https://github.com/nextcloud/nextcloud-vue', }, + // see https://github.com/styleguidist/react-styleguidist/blob/master/src/client/styles/theme.js theme: { maxWidth: '900px', diff --git a/styleguide/global.requires.js b/styleguide/global.requires.js index a52d462d..3c14b799 100644 --- a/styleguide/global.requires.js +++ b/styleguide/global.requires.js @@ -81,6 +81,7 @@ window.OC = { return aa.length - bb.length }, }, + webroot: '' } window.OCA = {}