feat(storybook): interaction testing init generator (#18051)
This commit is contained in:
parent
c364207f3e
commit
58e1f233cf
@ -18,12 +18,18 @@
|
|||||||
"x-dropdown": "projects",
|
"x-dropdown": "projects",
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
|
"interactionTests": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Set up Storybook interaction tests.",
|
||||||
|
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
||||||
|
"alias": ["configureTestRunner"],
|
||||||
|
"x-priority": "important",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"configureCypress": {
|
"configureCypress": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Specifies whether to configure Cypress or not.",
|
"description": "Specifies whether to configure Cypress or not.",
|
||||||
"x-prompt": "Configure a Cypress e2e app to run against the storybook instance?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"generateStories": {
|
"generateStories": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -35,9 +41,7 @@
|
|||||||
"generateCypressSpecs": {
|
"generateCypressSpecs": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Specifies whether to automatically generate test files in the generated Cypress e2e app.",
|
"description": "Specifies whether to automatically generate test files in the generated Cypress e2e app.",
|
||||||
"x-prompt": "Automatically generate test files in the generated Cypress e2e app?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"configureStaticServe": {
|
"configureStaticServe": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -48,7 +52,8 @@
|
|||||||
},
|
},
|
||||||
"cypressDirectory": {
|
"cypressDirectory": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A directory where the Cypress project will be placed. Placed at the root by default."
|
"description": "A directory where the Cypress project will be placed. Placed at the root by default.",
|
||||||
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
@ -59,7 +64,7 @@
|
|||||||
"tsConfiguration": {
|
"tsConfiguration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
||||||
"default": false,
|
"default": true,
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
"skipFormat": {
|
"skipFormat": {
|
||||||
@ -79,10 +84,6 @@
|
|||||||
"**/**/src/**/*.other.*",
|
"**/**/src/**/*.other.*",
|
||||||
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"configureTestRunner": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Add a Storybook Test-Runner target."
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
"tsConfiguration": {
|
"tsConfiguration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
||||||
"default": false
|
"default": true
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
|
|||||||
@ -18,12 +18,18 @@
|
|||||||
"x-dropdown": "projects",
|
"x-dropdown": "projects",
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
|
"interactionTests": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Set up Storybook interaction tests.",
|
||||||
|
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
||||||
|
"x-priority": "important",
|
||||||
|
"alias": ["configureTestRunner"],
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"configureCypress": {
|
"configureCypress": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Run the cypress-configure generator.",
|
"description": "Run the cypress-configure generator.",
|
||||||
"x-prompt": "Configure a cypress e2e app to run against the storybook instance?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"generateStories": {
|
"generateStories": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -35,9 +41,7 @@
|
|||||||
"generateCypressSpecs": {
|
"generateCypressSpecs": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Automatically generate test files in the Cypress E2E app generated by the `cypress-configure` generator.",
|
"description": "Automatically generate test files in the Cypress E2E app generated by the `cypress-configure` generator.",
|
||||||
"x-prompt": "Automatically generate test files in the Cypress E2E app generated by the cypress-configure generator?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"configureStaticServe": {
|
"configureStaticServe": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -48,7 +52,8 @@
|
|||||||
},
|
},
|
||||||
"cypressDirectory": {
|
"cypressDirectory": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A directory where the Cypress project will be placed. Placed at the root by default."
|
"description": "A directory where the Cypress project will be placed. Placed at the root by default.",
|
||||||
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
},
|
},
|
||||||
"js": {
|
"js": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -58,7 +63,7 @@
|
|||||||
"tsConfiguration": {
|
"tsConfiguration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
||||||
"default": false
|
"default": true
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
@ -77,10 +82,6 @@
|
|||||||
"**/**/src/**/*.other.*",
|
"**/**/src/**/*.other.*",
|
||||||
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"configureTestRunner": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Add a Storybook Test-Runner target."
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
|
|||||||
@ -18,15 +18,22 @@
|
|||||||
"x-dropdown": "projects",
|
"x-dropdown": "projects",
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
|
"interactionTests": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Set up Storybook interaction tests.",
|
||||||
|
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
||||||
|
"alias": ["configureTestRunner"],
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"configureCypress": {
|
"configureCypress": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Run the cypress-configure generator.",
|
"description": "Run the cypress-configure generator.",
|
||||||
"x-prompt": "Configure a cypress e2e app to run against the storybook instance?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"cypressDirectory": {
|
"cypressDirectory": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A directory where the Cypress project will be placed. Added at root by default."
|
"description": "A directory where the Cypress project will be placed. Added at root by default.",
|
||||||
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
@ -56,10 +63,6 @@
|
|||||||
"description": "Add a static-storybook to serve the static storybook built files.",
|
"description": "Add a static-storybook to serve the static storybook built files.",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"configureTestRunner": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Add a Storybook Test-Runner target."
|
|
||||||
},
|
|
||||||
"bundler": {
|
"bundler": {
|
||||||
"description": "The Storybook builder to use.",
|
"description": "The Storybook builder to use.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@ -40,8 +40,8 @@ describe('Storybook generators and executors for standalone workspaces - using R
|
|||||||
describe('Storybook generated files', () => {
|
describe('Storybook generated files', () => {
|
||||||
it('should generate storybook files', () => {
|
it('should generate storybook files', () => {
|
||||||
checkFilesExist(
|
checkFilesExist(
|
||||||
'.storybook/main.js',
|
'.storybook/main.ts',
|
||||||
'.storybook/preview.js',
|
'.storybook/preview.ts',
|
||||||
'tsconfig.storybook.json'
|
'tsconfig.storybook.json'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export async function generateStorybookConfiguration(
|
|||||||
linter: options.linter,
|
linter: options.linter,
|
||||||
cypressDirectory: options.cypressDirectory,
|
cypressDirectory: options.cypressDirectory,
|
||||||
tsConfiguration: options.tsConfiguration,
|
tsConfiguration: options.tsConfiguration,
|
||||||
configureTestRunner: options.configureTestRunner,
|
interactionTests: options.interactionTests,
|
||||||
configureStaticServe: options.configureStaticServe,
|
configureStaticServe: options.configureStaticServe,
|
||||||
skipFormat: true,
|
skipFormat: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,5 +11,5 @@ export interface StorybookConfigurationOptions {
|
|||||||
tsConfiguration?: boolean;
|
tsConfiguration?: boolean;
|
||||||
skipFormat?: boolean;
|
skipFormat?: boolean;
|
||||||
ignorePaths?: string[];
|
ignorePaths?: string[];
|
||||||
configureTestRunner?: boolean;
|
interactionTests?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,12 +18,18 @@
|
|||||||
"x-dropdown": "projects",
|
"x-dropdown": "projects",
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
|
"interactionTests": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Set up Storybook interaction tests.",
|
||||||
|
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
||||||
|
"alias": ["configureTestRunner"],
|
||||||
|
"x-priority": "important",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"configureCypress": {
|
"configureCypress": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Specifies whether to configure Cypress or not.",
|
"description": "Specifies whether to configure Cypress or not.",
|
||||||
"x-prompt": "Configure a Cypress e2e app to run against the storybook instance?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"generateStories": {
|
"generateStories": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -35,9 +41,7 @@
|
|||||||
"generateCypressSpecs": {
|
"generateCypressSpecs": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Specifies whether to automatically generate test files in the generated Cypress e2e app.",
|
"description": "Specifies whether to automatically generate test files in the generated Cypress e2e app.",
|
||||||
"x-prompt": "Automatically generate test files in the generated Cypress e2e app?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"configureStaticServe": {
|
"configureStaticServe": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -48,7 +52,8 @@
|
|||||||
},
|
},
|
||||||
"cypressDirectory": {
|
"cypressDirectory": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A directory where the Cypress project will be placed. Placed at the root by default."
|
"description": "A directory where the Cypress project will be placed. Placed at the root by default.",
|
||||||
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
@ -59,7 +64,7 @@
|
|||||||
"tsConfiguration": {
|
"tsConfiguration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
||||||
"default": false,
|
"default": true,
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
"skipFormat": {
|
"skipFormat": {
|
||||||
@ -82,10 +87,6 @@
|
|||||||
"**/**/src/**/*.other.*",
|
"**/**/src/**/*.other.*",
|
||||||
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"configureTestRunner": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Add a Storybook Test-Runner target."
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
"tsConfiguration": {
|
"tsConfiguration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
||||||
"default": false
|
"default": true
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
import { nxVersion } from '../../utils/versions';
|
import { nxVersion } from '../../utils/versions';
|
||||||
|
|
||||||
async function generateStories(host: Tree, schema: StorybookConfigureSchema) {
|
async function generateStories(host: Tree, schema: StorybookConfigureSchema) {
|
||||||
|
// TODO(katerina): Remove cypress stuff for Nx 17?
|
||||||
ensurePackage('@nx/cypress', nxVersion);
|
ensurePackage('@nx/cypress', nxVersion);
|
||||||
const { getE2eProjectName } = await import(
|
const { getE2eProjectName } = await import(
|
||||||
'@nx/cypress/src/utils/project-name'
|
'@nx/cypress/src/utils/project-name'
|
||||||
@ -57,7 +58,7 @@ export async function storybookConfigurationGenerator(
|
|||||||
linter: schema.linter,
|
linter: schema.linter,
|
||||||
cypressDirectory: schema.cypressDirectory,
|
cypressDirectory: schema.cypressDirectory,
|
||||||
tsConfiguration: schema.tsConfiguration,
|
tsConfiguration: schema.tsConfiguration,
|
||||||
configureTestRunner: schema.configureTestRunner,
|
interactionTests: schema.interactionTests,
|
||||||
configureStaticServe: schema.configureStaticServe,
|
configureStaticServe: schema.configureStaticServe,
|
||||||
uiFramework:
|
uiFramework:
|
||||||
bundler === 'vite'
|
bundler === 'vite'
|
||||||
|
|||||||
@ -10,6 +10,6 @@ export interface StorybookConfigureSchema {
|
|||||||
linter?: Linter;
|
linter?: Linter;
|
||||||
cypressDirectory?: string;
|
cypressDirectory?: string;
|
||||||
ignorePaths?: string[];
|
ignorePaths?: string[];
|
||||||
configureTestRunner?: boolean;
|
interactionTests?: boolean;
|
||||||
configureStaticServe?: boolean;
|
configureStaticServe?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,12 +18,18 @@
|
|||||||
"x-dropdown": "projects",
|
"x-dropdown": "projects",
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
|
"interactionTests": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Set up Storybook interaction tests.",
|
||||||
|
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
||||||
|
"x-priority": "important",
|
||||||
|
"alias": ["configureTestRunner"],
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"configureCypress": {
|
"configureCypress": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Run the cypress-configure generator.",
|
"description": "Run the cypress-configure generator.",
|
||||||
"x-prompt": "Configure a cypress e2e app to run against the storybook instance?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"generateStories": {
|
"generateStories": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -35,9 +41,7 @@
|
|||||||
"generateCypressSpecs": {
|
"generateCypressSpecs": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Automatically generate test files in the Cypress E2E app generated by the `cypress-configure` generator.",
|
"description": "Automatically generate test files in the Cypress E2E app generated by the `cypress-configure` generator.",
|
||||||
"x-prompt": "Automatically generate test files in the Cypress E2E app generated by the cypress-configure generator?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"default": true,
|
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"configureStaticServe": {
|
"configureStaticServe": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -48,7 +52,8 @@
|
|||||||
},
|
},
|
||||||
"cypressDirectory": {
|
"cypressDirectory": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A directory where the Cypress project will be placed. Placed at the root by default."
|
"description": "A directory where the Cypress project will be placed. Placed at the root by default.",
|
||||||
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
},
|
},
|
||||||
"js": {
|
"js": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@ -58,7 +63,7 @@
|
|||||||
"tsConfiguration": {
|
"tsConfiguration": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
||||||
"default": false
|
"default": true
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
@ -80,10 +85,6 @@
|
|||||||
"**/**/src/**/*.other.*",
|
"**/**/src/**/*.other.*",
|
||||||
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"configureTestRunner": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Add a Storybook Test-Runner target."
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["name"],
|
"required": ["name"],
|
||||||
|
|||||||
@ -5,7 +5,7 @@ exports[`@nx/storybook:configuration for workspaces with Root project basic func
|
|||||||
|
|
||||||
const config: StorybookConfig = {
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-vite',
|
name: '@storybook/react-vite',
|
||||||
options: {
|
options: {
|
||||||
@ -66,7 +66,11 @@ exports[`@nx/storybook:configuration for workspaces with Root project basic func
|
|||||||
|
|
||||||
const config: StorybookConfig = {
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
|
addons: [
|
||||||
|
'@storybook/addon-essentials',
|
||||||
|
'@storybook/addon-interactions',
|
||||||
|
'@nx/react/plugins/storybook',
|
||||||
|
],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-webpack5',
|
name: '@storybook/react-webpack5',
|
||||||
options: {},
|
options: {},
|
||||||
|
|||||||
@ -5,7 +5,7 @@ exports[`@nx/storybook:configuration for Storybook v7 basic functionalities shou
|
|||||||
|
|
||||||
const config: StorybookConfig = {
|
const config: StorybookConfig = {
|
||||||
stories: ['../**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/angular',
|
name: '@storybook/angular',
|
||||||
options: {},
|
options: {},
|
||||||
@ -87,6 +87,12 @@ exports[`@nx/storybook:configuration for Storybook v7 basic functionalities shou
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c libs/test-ui-lib/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@ -98,7 +104,7 @@ exports[`@nx/storybook:configuration for Storybook v7 basic functionalities shou
|
|||||||
|
|
||||||
const config: StorybookConfig = {
|
const config: StorybookConfig = {
|
||||||
stories: ['../**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/angular',
|
name: '@storybook/angular',
|
||||||
options: {},
|
options: {},
|
||||||
@ -151,7 +157,7 @@ exports[`@nx/storybook:configuration for Storybook v7 basic functionalities shou
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-vite/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-vite/.storybook/" 1`] = `
|
||||||
"const config = {
|
"const config = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-vite',
|
name: '@storybook/react-vite',
|
||||||
options: {
|
options: {
|
||||||
@ -177,7 +183,7 @@ exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configu
|
|||||||
|
|
||||||
const config: StorybookConfig = {
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-vite',
|
name: '@storybook/react-vite',
|
||||||
options: {
|
options: {
|
||||||
@ -199,9 +205,15 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-vite-ts/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-vite-ts/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-webpack/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-webpack/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/react-webpack5';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
|
addons: [
|
||||||
|
'@storybook/addon-essentials',
|
||||||
|
'@storybook/addon-interactions',
|
||||||
|
'@nx/react/plugins/storybook',
|
||||||
|
],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-webpack5',
|
name: '@storybook/react-webpack5',
|
||||||
options: {},
|
options: {},
|
||||||
@ -219,9 +231,11 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-webpack/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/main-webpack/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/nextapp/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/nextapp/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/nextjs';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../components/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../components/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/nextjs',
|
name: '@storybook/nextjs',
|
||||||
options: {},
|
options: {},
|
||||||
@ -239,9 +253,15 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/nextapp/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/nextapp/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/react-swc/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/react-swc/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/react-webpack5';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
|
addons: [
|
||||||
|
'@storybook/addon-essentials',
|
||||||
|
'@storybook/addon-interactions',
|
||||||
|
'@nx/react/plugins/storybook',
|
||||||
|
],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-webpack5',
|
name: '@storybook/react-webpack5',
|
||||||
options: {},
|
options: {},
|
||||||
@ -261,7 +281,7 @@ exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configu
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reapp/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reapp/.storybook/" 1`] = `
|
||||||
"const config = {
|
"const config = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-vite',
|
name: '@storybook/react-vite',
|
||||||
options: {
|
options: {
|
||||||
@ -283,9 +303,15 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reapp/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reapp/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reappw/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reappw/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/react-webpack5';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
|
addons: [
|
||||||
|
'@storybook/addon-essentials',
|
||||||
|
'@storybook/addon-interactions',
|
||||||
|
'@nx/react/plugins/storybook',
|
||||||
|
],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-webpack5',
|
name: '@storybook/react-webpack5',
|
||||||
options: {},
|
options: {},
|
||||||
@ -303,9 +329,11 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reappw/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/reappw/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/wv1/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/wv1/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/web-components-vite';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/web-components-vite',
|
name: '@storybook/web-components-vite',
|
||||||
options: {
|
options: {
|
||||||
@ -327,9 +355,11 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/wv1/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/wv1/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/ww1/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/ww1/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/web-components-webpack5';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/web-components-webpack5',
|
name: '@storybook/web-components-webpack5',
|
||||||
options: {},
|
options: {},
|
||||||
@ -347,9 +377,15 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/ww1/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "apps/ww1/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "libs/react-rollup/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "libs/react-rollup/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/react-webpack5';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials', '@nx/react/plugins/storybook'],
|
addons: [
|
||||||
|
'@storybook/addon-essentials',
|
||||||
|
'@storybook/addon-interactions',
|
||||||
|
'@nx/react/plugins/storybook',
|
||||||
|
],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-webpack5',
|
name: '@storybook/react-webpack5',
|
||||||
options: {},
|
options: {},
|
||||||
@ -367,9 +403,11 @@ export default config;
|
|||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "libs/react-rollup/.storybook/" 2`] = `null`;
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "libs/react-rollup/.storybook/" 2`] = `null`;
|
||||||
|
|
||||||
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "libs/react-vite/.storybook/" 1`] = `
|
exports[`@nx/storybook:configuration for Storybook v7 generate Storybook configuration for all types of projects should contain the correct configuration in "libs/react-vite/.storybook/" 1`] = `
|
||||||
"const config = {
|
"import type { StorybookConfig } from '@storybook/react-vite';
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
|
||||||
addons: ['@storybook/addon-essentials'],
|
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
|
||||||
framework: {
|
framework: {
|
||||||
name: '@storybook/react-vite',
|
name: '@storybook/react-vite',
|
||||||
options: {
|
options: {
|
||||||
@ -484,6 +522,12 @@ Map {
|
|||||||
"coverage/apps/main-vite",
|
"coverage/apps/main-vite",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/main-vite/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"main-vite-e2e" => {
|
"main-vite-e2e" => {
|
||||||
@ -615,6 +659,12 @@ Map {
|
|||||||
"coverage/apps/main-vite-ts",
|
"coverage/apps/main-vite-ts",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/main-vite-ts/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"main-vite-ts-e2e" => {
|
"main-vite-ts-e2e" => {
|
||||||
@ -774,6 +824,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/main-webpack/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"main-webpack-e2e" => {
|
"main-webpack-e2e" => {
|
||||||
@ -930,6 +986,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/nextapp/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"nextapp-e2e" => {
|
"nextapp-e2e" => {
|
||||||
@ -1330,6 +1392,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/react-swc/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"react-swc-e2e" => {
|
"react-swc-e2e" => {
|
||||||
@ -1498,6 +1566,12 @@ Map {
|
|||||||
"coverage/apps/reapp",
|
"coverage/apps/reapp",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/reapp/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"reapp-e2e" => {
|
"reapp-e2e" => {
|
||||||
@ -1656,6 +1730,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/reappw/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"reappw-e2e" => {
|
"reappw-e2e" => {
|
||||||
@ -1787,6 +1867,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/wv1/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"wv1-e2e" => {
|
"wv1-e2e" => {
|
||||||
@ -1933,6 +2019,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c apps/ww1/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"ww1-e2e" => {
|
"ww1-e2e" => {
|
||||||
@ -2197,6 +2289,12 @@ Map {
|
|||||||
"{workspaceRoot}/coverage/{projectRoot}",
|
"{workspaceRoot}/coverage/{projectRoot}",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c libs/react-rollup/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"react-rollup-2" => {
|
"react-rollup-2" => {
|
||||||
@ -2328,6 +2426,12 @@ Map {
|
|||||||
"coverage/libs/react-vite",
|
"coverage/libs/react-vite",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
"test-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"options": {
|
||||||
|
"command": "test-storybook -c libs/react-vite/.storybook --url=http://localhost:4400",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"react-vite-2" => {
|
"react-vite-2" => {
|
||||||
|
|||||||
@ -19,13 +19,6 @@ jest.mock('nx/src/project-graph/project-graph', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
describe('@nx/storybook:configuration for workspaces with Root project', () => {
|
describe('@nx/storybook:configuration for workspaces with Root project', () => {
|
||||||
beforeAll(() => {
|
|
||||||
process.env.NX_INTERACTIVE = 'true';
|
|
||||||
});
|
|
||||||
afterAll(() => {
|
|
||||||
// cleanup
|
|
||||||
delete process.env.NX_INTERACTIVE;
|
|
||||||
});
|
|
||||||
describe('basic functionalities', () => {
|
describe('basic functionalities', () => {
|
||||||
let tree: Tree;
|
let tree: Tree;
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
@ -93,6 +86,7 @@ describe('@nx/storybook:configuration for workspaces with Root project', () => {
|
|||||||
await configurationGenerator(tree, {
|
await configurationGenerator(tree, {
|
||||||
name: 'web',
|
name: 'web',
|
||||||
uiFramework: '@storybook/react-webpack5',
|
uiFramework: '@storybook/react-webpack5',
|
||||||
|
tsConfiguration: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(tree.exists('.storybook/main.js')).toBeTruthy();
|
expect(tree.exists('.storybook/main.js')).toBeTruthy();
|
||||||
@ -106,7 +100,6 @@ describe('@nx/storybook:configuration for workspaces with Root project', () => {
|
|||||||
await configurationGenerator(tree, {
|
await configurationGenerator(tree, {
|
||||||
name: 'reapp',
|
name: 'reapp',
|
||||||
uiFramework: '@storybook/react-webpack5',
|
uiFramework: '@storybook/react-webpack5',
|
||||||
tsConfiguration: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(tree.exists('.storybook/main.ts')).toBeFalsy();
|
expect(tree.exists('.storybook/main.ts')).toBeFalsy();
|
||||||
@ -120,7 +113,6 @@ describe('@nx/storybook:configuration for workspaces with Root project', () => {
|
|||||||
await configurationGenerator(tree, {
|
await configurationGenerator(tree, {
|
||||||
name: 'web',
|
name: 'web',
|
||||||
uiFramework: '@storybook/react-vite',
|
uiFramework: '@storybook/react-vite',
|
||||||
tsConfiguration: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(tree.exists('.storybook/main.ts')).toBeTruthy();
|
expect(tree.exists('.storybook/main.ts')).toBeTruthy();
|
||||||
|
|||||||
@ -189,7 +189,7 @@ describe('@nx/storybook:configuration for Storybook v7', () => {
|
|||||||
it('should add test-storybook target', async () => {
|
it('should add test-storybook target', async () => {
|
||||||
await configurationGenerator(tree, {
|
await configurationGenerator(tree, {
|
||||||
name: 'test-ui-lib',
|
name: 'test-ui-lib',
|
||||||
configureTestRunner: true,
|
interactionTests: true,
|
||||||
uiFramework: '@storybook/react-webpack5',
|
uiFramework: '@storybook/react-webpack5',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -197,6 +197,22 @@ describe('@nx/storybook:configuration for Storybook v7', () => {
|
|||||||
readJson(tree, 'package.json').devDependencies['@storybook/test-runner']
|
readJson(tree, 'package.json').devDependencies['@storybook/test-runner']
|
||||||
).toBeTruthy();
|
).toBeTruthy();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
readJson(tree, 'package.json').devDependencies[
|
||||||
|
'@storybook/testing-library'
|
||||||
|
]
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
readJson(tree, 'package.json').devDependencies['@storybook/jest']
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
readJson(tree, 'package.json').devDependencies[
|
||||||
|
'@storybook/addon-interactions'
|
||||||
|
]
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
const project = readProjectConfiguration(tree, 'test-ui-lib');
|
const project = readProjectConfiguration(tree, 'test-ui-lib');
|
||||||
expect(project.targets['test-storybook']).toEqual({
|
expect(project.targets['test-storybook']).toEqual({
|
||||||
executor: 'nx:run-commands',
|
executor: 'nx:run-commands',
|
||||||
|
|||||||
@ -36,6 +36,8 @@ import {
|
|||||||
} from '../../utils/utilities';
|
} from '../../utils/utilities';
|
||||||
import {
|
import {
|
||||||
nxVersion,
|
nxVersion,
|
||||||
|
storybookJestVersion,
|
||||||
|
storybookTestingLibraryVersion,
|
||||||
storybookTestRunnerVersion,
|
storybookTestRunnerVersion,
|
||||||
storybookVersion,
|
storybookVersion,
|
||||||
tsNodeVersion,
|
tsNodeVersion,
|
||||||
@ -109,6 +111,7 @@ export async function configurationGenerator(
|
|||||||
root,
|
root,
|
||||||
projectType,
|
projectType,
|
||||||
projectIsRootProjectInStandaloneWorkspace(root),
|
projectIsRootProjectInStandaloneWorkspace(root),
|
||||||
|
schema.interactionTests,
|
||||||
mainDir,
|
mainDir,
|
||||||
!!nextBuildTarget,
|
!!nextBuildTarget,
|
||||||
compiler === 'swc',
|
compiler === 'swc',
|
||||||
@ -133,13 +136,13 @@ export async function configurationGenerator(
|
|||||||
addStorybookToNamedInputs(tree);
|
addStorybookToNamedInputs(tree);
|
||||||
|
|
||||||
if (schema.uiFramework === '@storybook/angular') {
|
if (schema.uiFramework === '@storybook/angular') {
|
||||||
addAngularStorybookTask(tree, schema.name, schema.configureTestRunner);
|
addAngularStorybookTask(tree, schema.name, schema.interactionTests);
|
||||||
} else {
|
} else {
|
||||||
addStorybookTask(
|
addStorybookTask(
|
||||||
tree,
|
tree,
|
||||||
schema.name,
|
schema.name,
|
||||||
schema.uiFramework,
|
schema.uiFramework,
|
||||||
schema.configureTestRunner
|
schema.interactionTests
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +150,7 @@ export async function configurationGenerator(
|
|||||||
addStaticTarget(tree, schema);
|
addStaticTarget(tree, schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(katerina): remove this feature in 17?
|
||||||
if (schema.configureCypress) {
|
if (schema.configureCypress) {
|
||||||
const e2eProject = await getE2EProjectName(tree, schema.name);
|
const e2eProject = await getE2EProjectName(tree, schema.name);
|
||||||
if (!e2eProject) {
|
if (!e2eProject) {
|
||||||
@ -176,9 +180,13 @@ export async function configurationGenerator(
|
|||||||
devDeps['ts-node'] = tsNodeVersion;
|
devDeps['ts-node'] = tsNodeVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.configureTestRunner === true) {
|
if (schema.interactionTests) {
|
||||||
devDeps['@storybook/test-runner'] = storybookTestRunnerVersion;
|
devDeps['@storybook/test-runner'] = storybookTestRunnerVersion;
|
||||||
|
devDeps['@storybook/addon-interactions'] = storybookVersion;
|
||||||
|
devDeps['@storybook/testing-library'] = storybookTestingLibraryVersion;
|
||||||
|
devDeps['@storybook/jest'] = storybookJestVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.configureStaticServe) {
|
if (schema.configureStaticServe) {
|
||||||
devDeps['@nx/web'] = nxVersion;
|
devDeps['@nx/web'] = nxVersion;
|
||||||
}
|
}
|
||||||
@ -196,9 +204,10 @@ function normalizeSchema(
|
|||||||
schema: StorybookConfigureSchema
|
schema: StorybookConfigureSchema
|
||||||
): StorybookConfigureSchema {
|
): StorybookConfigureSchema {
|
||||||
const defaults = {
|
const defaults = {
|
||||||
configureCypress: true,
|
interactionTests: true,
|
||||||
linter: Linter.EsLint,
|
linter: Linter.EsLint,
|
||||||
js: false,
|
js: false,
|
||||||
|
tsConfiguration: true,
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
...defaults,
|
...defaults,
|
||||||
|
|||||||
@ -35,7 +35,7 @@ export function addStorybookTask(
|
|||||||
tree: Tree,
|
tree: Tree,
|
||||||
projectName: string,
|
projectName: string,
|
||||||
uiFramework: string,
|
uiFramework: string,
|
||||||
configureTestRunner: boolean
|
interactionTests: boolean
|
||||||
) {
|
) {
|
||||||
if (uiFramework === '@storybook/react-native') {
|
if (uiFramework === '@storybook/react-native') {
|
||||||
return;
|
return;
|
||||||
@ -68,7 +68,7 @@ export function addStorybookTask(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (configureTestRunner === true) {
|
if (interactionTests === true) {
|
||||||
projectConfig.targets['test-storybook'] = {
|
projectConfig.targets['test-storybook'] = {
|
||||||
executor: 'nx:run-commands',
|
executor: 'nx:run-commands',
|
||||||
options: {
|
options: {
|
||||||
@ -83,7 +83,7 @@ export function addStorybookTask(
|
|||||||
export function addAngularStorybookTask(
|
export function addAngularStorybookTask(
|
||||||
tree: Tree,
|
tree: Tree,
|
||||||
projectName: string,
|
projectName: string,
|
||||||
configureTestRunner: boolean
|
interactionTests: boolean
|
||||||
) {
|
) {
|
||||||
const projectConfig = readProjectConfiguration(tree, projectName);
|
const projectConfig = readProjectConfiguration(tree, projectName);
|
||||||
const { ngBuildTarget } = findStorybookAndBuildTargetsAndCompiler(
|
const { ngBuildTarget } = findStorybookAndBuildTargetsAndCompiler(
|
||||||
@ -124,7 +124,7 @@ export function addAngularStorybookTask(
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (configureTestRunner === true) {
|
if (interactionTests === true) {
|
||||||
projectConfig.targets['test-storybook'] = {
|
projectConfig.targets['test-storybook'] = {
|
||||||
executor: 'nx:run-commands',
|
executor: 'nx:run-commands',
|
||||||
options: {
|
options: {
|
||||||
@ -497,6 +497,7 @@ export function createProjectStorybookDir(
|
|||||||
root: string,
|
root: string,
|
||||||
projectType: string,
|
projectType: string,
|
||||||
projectIsRootProjectInStandaloneWorkspace: boolean,
|
projectIsRootProjectInStandaloneWorkspace: boolean,
|
||||||
|
interactionTests: boolean,
|
||||||
mainDir?: string,
|
mainDir?: string,
|
||||||
isNextJs?: boolean,
|
isNextJs?: boolean,
|
||||||
usesSwc?: boolean,
|
usesSwc?: boolean,
|
||||||
@ -533,6 +534,7 @@ export function createProjectStorybookDir(
|
|||||||
offsetFromRoot: offsetFromRoot(root),
|
offsetFromRoot: offsetFromRoot(root),
|
||||||
projectDirectory,
|
projectDirectory,
|
||||||
projectType,
|
projectType,
|
||||||
|
interactionTests,
|
||||||
mainDir,
|
mainDir,
|
||||||
isNextJs: isNextJs && projectType === 'application',
|
isNextJs: isNextJs && projectType === 'application',
|
||||||
usesSwc,
|
usesSwc,
|
||||||
|
|||||||
@ -6,7 +6,7 @@ const config: StorybookConfig = {
|
|||||||
'../**/*.stories.@(js|jsx|ts|tsx|mdx)' <% } else { %>
|
'../**/*.stories.@(js|jsx|ts|tsx|mdx)' <% } else { %>
|
||||||
'../<%= projectDirectory %>/**/*.stories.@(js|jsx|ts|tsx|mdx)'
|
'../<%= projectDirectory %>/**/*.stories.@(js|jsx|ts|tsx|mdx)'
|
||||||
<% } %>],
|
<% } %>],
|
||||||
addons: ['@storybook/addon-essentials' <% if(uiFramework === '@storybook/react-webpack5') { %>, '@nx/react/plugins/storybook' <% } %><% if(uiFramework === '@storybook/react-native') { %>, '@storybook/addon-ondevice-actions', '@storybook/addon-ondevice-backgrounds', '@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-notes' <% } %>],
|
addons: ['@storybook/addon-essentials' <% if(interactionTests) { %>, '@storybook/addon-interactions' <% } %><% if(uiFramework === '@storybook/react-webpack5') { %>, '@nx/react/plugins/storybook' <% } %><% if(uiFramework === '@storybook/react-native') { %>, '@storybook/addon-ondevice-actions', '@storybook/addon-ondevice-backgrounds', '@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-notes' <% } %>],
|
||||||
framework: {
|
framework: {
|
||||||
name: '<%= uiFramework %>',
|
name: '<%= uiFramework %>',
|
||||||
options: {
|
options: {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ const config = {
|
|||||||
'../**/*.stories.@(js|jsx|ts|tsx|mdx)' <% } else { %>
|
'../**/*.stories.@(js|jsx|ts|tsx|mdx)' <% } else { %>
|
||||||
'../<%= projectDirectory %>/**/*.stories.@(js|jsx|ts|tsx|mdx)'
|
'../<%= projectDirectory %>/**/*.stories.@(js|jsx|ts|tsx|mdx)'
|
||||||
<% } %>],
|
<% } %>],
|
||||||
addons: ['@storybook/addon-essentials' <% if(uiFramework === '@storybook/react-webpack5') { %>, '@nx/react/plugins/storybook' <% } %><% if(uiFramework === '@storybook/react-native') { %>, '@storybook/addon-ondevice-actions', '@storybook/addon-ondevice-backgrounds', '@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-notes' <% } %>],
|
addons: ['@storybook/addon-essentials' <% if(interactionTests) { %>, '@storybook/addon-interactions' <% } %><% if(uiFramework === '@storybook/react-webpack5') { %>, '@nx/react/plugins/storybook' <% } %><% if(uiFramework === '@storybook/react-native') { %>, '@storybook/addon-ondevice-actions', '@storybook/addon-ondevice-backgrounds', '@storybook/addon-ondevice-controls', '@storybook/addon-ondevice-notes' <% } %>],
|
||||||
framework: {
|
framework: {
|
||||||
name: '<%= uiFramework %>',
|
name: '<%= uiFramework %>',
|
||||||
options: {
|
options: {
|
||||||
|
|||||||
@ -7,10 +7,10 @@ export interface StorybookConfigureSchema {
|
|||||||
configureCypress?: boolean;
|
configureCypress?: boolean;
|
||||||
linter?: Linter;
|
linter?: Linter;
|
||||||
js?: boolean;
|
js?: boolean;
|
||||||
|
interactionTests?: boolean;
|
||||||
tsConfiguration?: boolean;
|
tsConfiguration?: boolean;
|
||||||
cypressDirectory?: string;
|
cypressDirectory?: string;
|
||||||
standaloneConfig?: boolean;
|
standaloneConfig?: boolean;
|
||||||
configureTestRunner?: boolean;
|
|
||||||
configureStaticServe?: boolean;
|
configureStaticServe?: boolean;
|
||||||
skipFormat?: boolean;
|
skipFormat?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,15 +18,22 @@
|
|||||||
"x-dropdown": "projects",
|
"x-dropdown": "projects",
|
||||||
"x-priority": "important"
|
"x-priority": "important"
|
||||||
},
|
},
|
||||||
|
"interactionTests": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Set up Storybook interaction tests.",
|
||||||
|
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
||||||
|
"alias": ["configureTestRunner"],
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"configureCypress": {
|
"configureCypress": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Run the cypress-configure generator.",
|
"description": "Run the cypress-configure generator.",
|
||||||
"x-prompt": "Configure a cypress e2e app to run against the storybook instance?",
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
"x-priority": "important"
|
|
||||||
},
|
},
|
||||||
"cypressDirectory": {
|
"cypressDirectory": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A directory where the Cypress project will be placed. Added at root by default."
|
"description": "A directory where the Cypress project will be placed. Added at root by default.",
|
||||||
|
"x-deprecated": "Please use Storybook interaction tests instead."
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"description": "The tool to use for running lint checks.",
|
"description": "The tool to use for running lint checks.",
|
||||||
@ -56,10 +63,6 @@
|
|||||||
"description": "Add a static-storybook to serve the static storybook built files.",
|
"description": "Add a static-storybook to serve the static storybook built files.",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"configureTestRunner": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Add a Storybook Test-Runner target."
|
|
||||||
},
|
|
||||||
"bundler": {
|
"bundler": {
|
||||||
"description": "The Storybook builder to use.",
|
"description": "The Storybook builder to use.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@ -196,6 +196,7 @@ function migrateProjectLevelStorybookInstance(
|
|||||||
root,
|
root,
|
||||||
projectType,
|
projectType,
|
||||||
false,
|
false,
|
||||||
|
false,
|
||||||
mainDir,
|
mainDir,
|
||||||
!!nextBuildTarget,
|
!!nextBuildTarget,
|
||||||
compiler === 'swc'
|
compiler === 'swc'
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
export const nxVersion = require('../../package.json').version;
|
export const nxVersion = require('../../package.json').version;
|
||||||
export const storybookReactNativeVersion = '^6.5.3';
|
export const storybookReactNativeVersion = '^6.5.3';
|
||||||
export const reactNativeStorybookLoader = '^2.0.5';
|
export const reactNativeStorybookLoader = '^2.0.5';
|
||||||
export const storybookTestRunnerVersion = '^0.7.2';
|
export const storybookTestRunnerVersion = '^0.11.0';
|
||||||
|
export const storybookTestingLibraryVersion = '~0.2.0';
|
||||||
|
export const storybookJestVersion = '~0.1.0';
|
||||||
export const litVersion = '^2.6.1';
|
export const litVersion = '^2.6.1';
|
||||||
export const tsNodeVersion = '10.9.1';
|
export const tsNodeVersion = '10.9.1';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user