Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Commit 051fd87

Browse files
committed
Prompt which generator is experimental
- mark addons info as experimental - mark custom-blocks generator as experimental
1 parent 3947090 commit 051fd87

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# vue-authoring-template (Work In Progress)
2-
[![CircleCI](https://circleci.com/gh/DrSensor/vue-authoring-template.svg?style=shield)](https://circleci.com/gh/DrSensor/vue-authoring-template)
1+
# vue-authoring-template
2+
<!-- [![CircleCI](https://circleci.com/gh/DrSensor/vue-authoring-template.svg?style=shield)](https://circleci.com/gh/DrSensor/vue-authoring-template) -->
33
[![donate](https://img.shields.io/badge/donate-$-green.svg?maxAge=2592000&style=flat-square)](https://github.com/DrSensor/vue-authoring-template/blob/master/DONATE.md)
44

5-
This template is to help authoring Vue component with it's use case.
5+
This template is to help authoring Vue component with it's use case in story-scenario (storybook) format.
66

77
## Motivation
88
There is a time when developer involved in a project then build component to solve specific problem 😎.

meta.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const fs = require('fs')
33
const {
44
sortDependencies,
55
installDependencies,
6-
runLintFix,
76
toPascalCase,
87
printMessage
98
} = require('./utils')
@@ -52,7 +51,11 @@ module.exports = {
5251
choices: [
5352
'knobs',
5453
'notes',
55-
'info',
54+
{
55+
name: 'info (experimental)',
56+
value: 'info',
57+
short: 'info'
58+
},
5659
'readme',
5760
'console'
5861
],
@@ -64,8 +67,9 @@ module.exports = {
6467
},
6568
customBlocks: {
6669
type: 'confirm',
67-
// when: 'addons',
68-
message: 'Enable custom-blocks?'
70+
when: 'addons.notes || addons.info || addons.readme',
71+
message: 'Enable custom-blocks? (experimental)',
72+
default: false
6973
},
7074
useci: {
7175
type: 'confirm',
@@ -95,7 +99,8 @@ module.exports = {
9599
},
96100
alphabetical: {
97101
type: 'confirm',
98-
message: 'Sort story and scenario in alphabetical order?'
102+
message: 'Sort story and scenario in alphabetical order?',
103+
default: false
99104
},
100105
autoInstall: {
101106
type: 'list',
@@ -122,10 +127,10 @@ module.exports = {
122127
},
123128
filters: {
124129
'.circleci/*': 'useci',
130+
'FOOTER.md': 'addons.readme',
125131
'.loader/docs-loader.js': 'addons.readme && customBlocks',
126132
'.loader/info-loader.js': 'addons.info && customBlocks',
127133
'.loader/notes-loader.js': 'addons.notes && customBlocks',
128-
'.loader/knobs-loader.js': 'addons.knobs && customBlocks'
129134
},
130135
complete: function (data, { chalk }) {
131136
const green = chalk.green
@@ -140,9 +145,6 @@ module.exports = {
140145

141146
if (data.autoInstall) {
142147
installDependencies(cwd, data.autoInstall, green)
143-
.then(() => {
144-
return runLintFix(cwd, data, green)
145-
})
146148
.then(() => {
147149
printMessage(data, green)
148150
})

template/.storybook/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const optionsCallback = (options) => ({ panelExclude: [...options.panelExclude,
2424
addDecorator((storyFn, context) => withConsole(optionsCallback)(storyFn)(context))
2525
{{/isEnabled}}
2626

27-
{{#isEnabled addons 'info'}}
27+
{{#isEnabled addons 'readme'}}
2828
addDecorator(withReadme(Readme))
2929
withDocs.addFooter(Footer)
3030
{{/isEnabled}}

template/stories/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ require.context('.', true, /\.vue$/).keys()
2929
.sort((a, b) => { // sort by storyOrder
3030
a = a.split('/').map(s => s.replace('.vue', ''))
3131
b = b.split('/').map(s => s.replace('.vue', ''))
32-
let order = storyOrder.indexOf(a[1]) - storyOrder.indexOf(b[1])
32+
33+
if (storyOrder) var order = storyOrder.indexOf(a[1]) - storyOrder.indexOf(b[1])
34+
else order = a[1].charAt(0).toUpperCase() - b[1].charAt(0).toUpperCase() // sort alphabetically
3335

3436
if (order !== 0) {
3537
if (scenarioOrder === undefined) { // sort alphabetically

utils/index.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ To get started:
7373
7474
List of command:
7575
76-
${green('npm run dev')} \t:\t running in development mode
77-
${green('npm run build:storybook')} \t:\t build storybook page
78-
${green('npm run build:component')} \t:\t build .vue component into .js
79-
${green('npm run deploy')} \t:\t deploying into surge.sh
76+
${green('npm run dev')} \t\t: running in development mode
77+
${green('npm run build:storybook')} \t: build storybook page
78+
${green('npm run build:component')} \t: build .vue component into .js
79+
${green('npm run deploy')} \t\t: deploying into surge.sh
8080
8181
${custBlcksMsg(data, magenta)}
82+
83+
${data.addons.info && custBlcksMsg
84+
? `Thank you for trying experimental features.
85+
If you find bugs and/or have suggestion, feel free to open issue https://github.com/DrSensor/vue-authoring-template/issues/new
86+
`
87+
: `For more information consult https://github.com/DrSensor/vue-authoring-template`}
8288
`
8389
console.log(message)
8490
}
@@ -95,7 +101,7 @@ function custBlcksMsg (data, color) {
95101
Then ${color('require.resolve(.loader/<your-loader>.js')} into vue.loaders config at ${color('.storybook/poi.config.js')}
96102
\n
97103
`
98-
}
104+
} else return '^[K'
99105
}
100106

101107
/**

0 commit comments

Comments
 (0)