fix: Added preact configuration in missing (cli related) places

This commit is contained in:
Bart Waardenburg 2018-12-05 00:23:33 +01:00
parent e315006746
commit be653099f0
6 changed files with 27 additions and 1 deletions

View File

@ -99,6 +99,11 @@ jobs:
command: |
cd examples/riot-kitchen-sink
yarn build-storybook
- run:
name: Build preact kitchen-sink
command: |
cd examples/preact-kitchen-sink
yarn build-storybook
- run:
name: Build official-storybook
command: |
@ -166,6 +171,11 @@ jobs:
command: |
cd examples/riot-kitchen-sink
yarn storybook --smoke-test --quiet
- run:
name: Run preact kitchen-sink (smoke test)
command: |
cd examples/preact-kitchen-sink
yarn storybook --smoke-test --quiet
native-smoke-tests:
<<: *defaults
steps:

View File

@ -17,6 +17,7 @@ enum class StorybookApp(val appName: String, val exampleDir: String, val merged:
SVELTE("Svelte", "svelte-kitchen-sink"),
RIOT("Riot", "riot-kitchen-sink"),
EMBER("Ember", "ember-cli");
PREACT("Preact", "preact-kitchen-sink"),
val lowerName = appName.toLowerCase()

View File

@ -4,7 +4,7 @@ title: 'Quick Start Guide'
---
Storybook supports many different frontend view layers with more coming!
React, Vue, Angular, Mithril, Marko, HTML, Svelte, Meteor, and Ember are currently supported. Follow these steps to get started with Storybook.
React, Vue, Angular, Mithril, Marko, HTML, Svelte, Meteor, Ember and Preact are currently supported. Follow these steps to get started with Storybook.
Get started using the automated command line tool. This command adds a set of boilerplate files for Storybook in your project:

View File

@ -104,6 +104,13 @@ function detectFramework(dependencies) {
return types.RIOT;
}
if (
(dependencies.dependencies && dependencies.dependencies.preact) ||
(dependencies.devDependencies && dependencies.devDependencies.preact)
) {
return types.PREACT;
}
return false;
}

View File

@ -20,6 +20,7 @@ import mithrilGenerator from '../generators/MITHRIL';
import markoGenerator from '../generators/MARKO';
import htmlGenerator from '../generators/HTML';
import riotGenerator from '../generators/RIOT';
import preactGenerator from '../generators/PREACT';
const logger = console;
@ -150,6 +151,11 @@ const installStorybook = (projectType, options) => {
.then(commandLog('Adding storybook support to your "riot.js" app'))
.then(end);
case types.PREACT:
return preactGenerator(npmOptions)
.then(commandLog('Adding storybook support to your "Preact" app'))
.then(end);
default:
paddedLog(`We couldn't detect your project type. (code: ${projectType})`);
paddedLog(

View File

@ -17,6 +17,7 @@ const projectTypes = {
MARKO: 'MARKO',
HTML: 'HTML',
RIOT: 'RIOT',
PREACT: 'PREACT',
};
export default projectTypes;
@ -32,6 +33,7 @@ export const supportedFrameworks = [
'ember',
'marko',
'meteor',
'preact',
];
const notInstallableProjectTypes = [