Skip to content

Commit

Permalink
fix(storybook): re-enable x-prompt and remove custom handling (#17360)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Jun 2, 2023
1 parent 8a7f79f commit 6d147b6
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"@storybook/web-components-vite"
],
"aliases": ["storybook7UiFramework"],
"x-prompt": "Choose the Storybook framework that you need to use.",
"x-priority": "important",
"hidden": false
},
Expand Down
1 change: 0 additions & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
},
"dependencies": {
"dotenv": "~10.0.0",
"enquirer": "~2.3.6",
"@phenomnomnominal/tsquery": "~5.0.1",
"semver": "7.3.4",
"@nx/cypress": "file:../cypress",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
writeJson,
} from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import * as enquirer from 'enquirer';

import configurationGenerator from './configuration';
import * as workspaceConfiguration from './test-configs/root-workspace-configuration.json';
Expand All @@ -19,9 +18,6 @@ jest.mock('nx/src/project-graph/project-graph', () => ({
.mockImplementation(async () => ({ nodes: {}, dependencies: {} })),
}));

jest.mock('enquirer');
// @ts-ignore
enquirer.prompt = jest.fn();
describe('@nx/storybook:configuration for workspaces with Root project', () => {
beforeAll(() => {
process.env.NX_INTERACTIVE = 'true';
Expand All @@ -32,10 +28,6 @@ describe('@nx/storybook:configuration for workspaces with Root project', () => {
});
describe('basic functionalities', () => {
let tree: Tree;
// @ts-ignore
enquirer.prompt = jest
.fn()
.mockReturnValue(Promise.resolve({ bundler: 'webpack' }));
beforeEach(async () => {
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
updateJson<NxJsonConfiguration>(tree, 'nx.json', (json) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
writeJson,
} from '@nx/devkit';
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
import * as enquirer from 'enquirer';

import { Linter } from '@nx/linter';
import { libraryGenerator } from '@nx/js';
Expand All @@ -26,9 +25,6 @@ jest.mock('nx/src/project-graph/project-graph', () => ({
.fn()
.mockImplementation(async () => ({ nodes: {}, dependencies: {} })),
}));
jest.mock('enquirer');
// @ts-ignore
enquirer.prompt = jest.fn();

describe('@nx/storybook:configuration for Storybook v7', () => {
describe('basic functionalities', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
storybookVersion,
tsNodeVersion,
} from '../../utils/versions';
import { getGeneratorConfigurationOptions } from './lib/user-prompts';

export async function configurationGenerator(
tree: Tree,
Expand All @@ -49,10 +48,6 @@ export async function configurationGenerator(
throw new Error(pleaseUpgrade());
}

if (process.env.NX_INTERACTIVE === 'true') {
rawSchema = await getGeneratorConfigurationOptions(rawSchema);
}

const schema = normalizeSchema(rawSchema);

const tasks: GeneratorCallback[] = [];
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"@storybook/web-components-vite"
],
"aliases": ["storybook7UiFramework"],
"x-prompt": "Choose the Storybook framework that you need to use.",
"x-priority": "important",
"hidden": false
},
Expand Down

1 comment on commit 6d147b6

@vercel
Copy link

@vercel vercel bot commented on 6d147b6 Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev

Please sign in to comment.