4.0.3 • Published 2 years ago

@component-controls/cc-cli v4.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Table of contents

Overview

  • Easy to use cli with "zero" configuration.
  • Generates test files in cjs, esm or typescript format.
  • More advanced level to customize the framework renderer.
  • Advanced level for full control over which stories to use for the tests.

Install

yarn add @component-controls/cc-cli --dev

API

createStoreTemplate

function

create one large dynamic test for all the stories in the configuration/bundle

defined in @component-controls/cc-cli/plugins/cc-cli/src/jest-templates/store-template.ts

parameters

NameTypeDescription
options*Prendering options
dataImportsDataImportOptionsfilePath*: stringdata*: Record<string, any>
configurationtypewebpack: Configuration | WebpackConfigFnfinalWebpack: Configuration | WebpackConfigFnpresets: RuleType[]configPath: stringdistFolder: stringbundleName: stringstaticFolder: stringcssFileName: stringlogOptions: Partial<LogOptions>mode: "none" | "development" | "production"loadersencodeHTML*: encodeHTMLat*: function (index*: number) => T | undefinedmodule: stringident: stringloader: stringoptions: string | typestories: string | string[]files: string | string[]siteRoot: stringignore: string[]pages[string]: categories: DocType[]siteMap: type | booleansiteUrl: stringinstrument: anysearchindexingModule: stringsearchingModule*: stringfields: SearchFields[]emptySearchDocuments: string[]hitsPerPage: numberoptions: anytokensfigmaAccessToken: stringgithubAccessToken: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControlText | ComponentControlBoolean | ComponentControlColor | ComponentControlDate | ComponentControlObject<> | ComponentControlButton<> | ComponentControlOptions<> | ComponentControlNumber | ComponentControlArray | ComponentControlFilessmartControlssmart: booleaninclude: string[] | IncludeFnexclude: string[] | IncludeFndecorators: StoryRenderFn[]plugins: anycategory: string
returnsPromise<string>a string with the rendered template

createStoriesTemplate

function

create tests on a stories base (a test file for each document and inside, a test for each story)

defined in @component-controls/cc-cli/plugins/cc-cli/src/jest-templates/stories-template.ts

parameters

NameTypeDescription
options*Prendering options
dataImportsDataImportOptionsfilePath*: stringdata*: Record<string, any>
configurationBuildConfigurationwebpack: Configuration | WebpackConfigFnfinalWebpack: Configuration | WebpackConfigFnpresets: RuleType[]configPath: stringdistFolder: stringbundleName: stringstaticFolder: stringcssFileName: stringlogOptions: Partial<LogOptions>mode: "none" | "development" | "production"loadersencodeHTML*: encodeHTMLat*: function (index*: ) => T | undefinedmodule: stringstories: string | string[]files: string | string[]siteRoot: stringignore: string[]pages[string]: categories: DocType[]siteMap: type | booleansiteUrl: stringinstrument: anysearchindexingModule: stringsearchingModule*: stringfields: SearchFields[]emptySearchDocuments: string[]hitsPerPage: numberoptions: anytokensfigmaAccessToken: stringgithubAccessToken: stringcomponent: string | Record<string, unknown> | ElementType<Props>subcomponents: Record<string, (string, Record<string, unknown>, ElementType<Props>)>controls[string]: ComponentControlText | ComponentControlBoolean | ComponentControlColor | ComponentControlDate | ComponentControlObject<P> | ComponentControlButton | ComponentControlOptions | ComponentControlNumber | ComponentControlArray | ComponentControlFilessmartControlssmart: booleaninclude: string[] | IncludeFnexclude: string[] | IncludeFndecorators: StoryRenderFn[]plugins: anycategory: stringglobal configuration used at build time stored in a file named main.js/main.ts
returnsPromise<string>a string with the rendered template
4.0.3

2 years ago

3.15.0

3 years ago

3.14.1

3 years ago

3.11.4

3 years ago

3.14.0

3 years ago

3.13.1

3 years ago

3.11.3

3 years ago

3.10.4

3 years ago

3.8.3

3 years ago

3.14.3

3 years ago

3.9.1

3 years ago

3.8.2

3 years ago

3.14.2

3 years ago

3.9.0

3 years ago

3.8.1

3 years ago

3.14.5

3 years ago

3.14.4

3 years ago

3.14.6

3 years ago

3.11.0

3 years ago

3.10.1

3 years ago

3.8.0

3 years ago

3.10.0

3 years ago

3.7.0

3 years ago

3.13.0

3 years ago

3.10.3

3 years ago

3.12.0

3 years ago

3.11.1

3 years ago

3.10.2

3 years ago

3.6.3

3 years ago

3.6.2

3 years ago

3.6.1

3 years ago

3.6.0

3 years ago

3.5.5

3 years ago

3.5.4

3 years ago

3.5.3

3 years ago

3.5.2

3 years ago

3.5.1

3 years ago

3.5.0

3 years ago