Merge pull request #12181 from storybookjs/fix/aureliaDetection

CLI: Add aurelia detection
This commit is contained in:
Michael Shilman 2020-08-31 20:27:50 +08:00 committed by GitHub
commit 1a1a5e24c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions

View File

@ -209,6 +209,16 @@ const MOCK_FRAMEWORK_FILES = [
}, },
}, },
}, },
{
name: ProjectType.AURELIA,
files: {
'package.json': {
dependencies: {
'aurelia-bootstrapper': '1.0.0',
},
},
},
},
]; ];
describe('Detect', () => { describe('Detect', () => {

View File

@ -10,6 +10,7 @@ import {
} from './project_types'; } from './project_types';
import { commandLog, codeLog, paddedLog } from './helpers'; import { commandLog, codeLog, paddedLog } from './helpers';
import angularGenerator from './generators/ANGULAR'; import angularGenerator from './generators/ANGULAR';
import aureliaGenerator from './generators/AURELIA';
import emberGenerator from './generators/EMBER'; import emberGenerator from './generators/EMBER';
import meteorGenerator from './generators/METEOR'; import meteorGenerator from './generators/METEOR';
import reactGenerator from './generators/REACT'; import reactGenerator from './generators/REACT';
@ -217,6 +218,11 @@ const installStorybook = (projectType: ProjectType, options: CommandOptions): Pr
.then(commandLog('Adding Storybook support to your "Rax" app')) .then(commandLog('Adding Storybook support to your "Rax" app'))
.then(end); .then(end);
case ProjectType.AURELIA:
return aureliaGenerator(packageManager, npmOptions, generatorOptions)
.then(commandLog('Adding Storybook support to your "Aurelia" app'))
.then(end);
default: default:
paddedLog(`We couldn't detect your project type. (code: ${projectType})`); paddedLog(`We couldn't detect your project type. (code: ${projectType})`);
paddedLog( paddedLog(

View File

@ -40,6 +40,7 @@ export enum ProjectType {
PREACT = 'PREACT', PREACT = 'PREACT',
SVELTE = 'SVELTE', SVELTE = 'SVELTE',
RAX = 'RAX', RAX = 'RAX',
AURELIA = 'AURELIA',
} }
export const SUPPORTED_FRAMEWORKS: SupportedFrameworks[] = [ export const SUPPORTED_FRAMEWORKS: SupportedFrameworks[] = [
@ -56,6 +57,7 @@ export const SUPPORTED_FRAMEWORKS: SupportedFrameworks[] = [
'preact', 'preact',
'svelte', 'svelte',
'rax', 'rax',
'aurelia',
]; ];
export enum StoryFormat { export enum StoryFormat {
@ -221,6 +223,13 @@ export const supportedTemplates: TemplateConfiguration[] = [
return dependencies.every(Boolean); return dependencies.every(Boolean);
}, },
}, },
{
preset: ProjectType.AURELIA,
dependencies: ['aurelia-bootstrapper'],
matcherFunction: ({ dependencies }) => {
return dependencies.every(Boolean);
},
},
]; ];
const notInstallableProjectTypes: ProjectType[] = [ const notInstallableProjectTypes: ProjectType[] = [