Skip to content

Commit

Permalink
feat(storybook): upgrade to Storybook 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
juristr committed Dec 3, 2021
1 parent 7dbb645 commit c08b61b
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 36 deletions.
12 changes: 3 additions & 9 deletions e2e/angular-extensions/src/storybook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('Angular Package', () => {
});

describe('build storybook', () => {
xit('should execute e2e tests using Cypress running against Storybook', async () => {
it('should execute e2e tests using Cypress running against Storybook', async () => {
if (isNotWindows()) {
const myapp = uniq('myapp');
runCLI(`generate @nrwl/angular:app ${myapp} --no-interactive`);
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('Angular Package', () => {
}
}, 1000000);

xit('should build an Angular based storybook', () => {
it('should build an Angular based storybook', () => {
const angularStorybookLib = uniq('test-ui-lib');
createTestUILib(angularStorybookLib);
runCLI(
Expand All @@ -205,12 +205,9 @@ describe('Angular Package', () => {
// build Angular lib
runCLI(`run ${angularStorybookLib}:build-storybook`);
checkFilesExist(`dist/storybook/${angularStorybookLib}/index.html`);
expect(
readFile(`dist/storybook/${angularStorybookLib}/index.html`)
).toContain(`<title>Storybook</title>`);
}, 1000000);

xit('should build an Angular based storybook that references another lib', () => {
it('should build an Angular based storybook that references another lib', () => {
const angularStorybookLib = uniq('test-ui-lib');
createTestUILib(angularStorybookLib);
runCLI(
Expand Down Expand Up @@ -266,9 +263,6 @@ describe('Angular Package', () => {
// build Angular lib
runCLI(`run ${angularStorybookLib}:build-storybook`);
checkFilesExist(`dist/storybook/${angularStorybookLib}/index.html`);
expect(
readFile(`dist/storybook/${angularStorybookLib}/index.html`)
).toContain(`<title>Storybook</title>`);
}, 1000000);
});
});
Expand Down
6 changes: 0 additions & 6 deletions e2e/storybook/src/storybook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ describe('Storybook schematics', () => {
// build React lib
runCLI(`run ${reactStorybookLib}:build-storybook --verbose`);
checkFilesExist(`dist/storybook/${reactStorybookLib}/index.html`);
expect(
readFile(`dist/storybook/${reactStorybookLib}/index.html`)
).toContain(`<title>Storybook</title>`);
}, 1000000);

it('should lint a React based storybook without errors', () => {
Expand Down Expand Up @@ -132,9 +129,6 @@ describe('Storybook schematics', () => {
// build React lib
runCLI(`run ${reactStorybookLib}:build-storybook`);
checkFilesExist(`dist/storybook/${reactStorybookLib}/index.html`);
expect(
readFile(`dist/storybook/${reactStorybookLib}/index.html`)
).toContain(`<title>Storybook</title>`);
}, 1000000);
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { GeneratorCallback, Tree } from '@nrwl/devkit';
import { addDependenciesToPackageJson } from '@nrwl/devkit';
import { storybookVersion } from '../../utils/versions';
import { assertCompatibleStorybookVersion } from './lib/assert-compatible-storybook-version';
import { generateStories } from './lib/generate-stories';
import { generateStorybookConfiguration } from './lib/generate-storybook-configuration';
Expand All @@ -14,17 +12,6 @@ export async function storybookConfigurationGenerator(
assertCompatibleStorybookVersion();
validateOptions(options);

// TODO(coly010/juristr): remove when @nrwl/storybook has been updated
const angularStorybookInstallTask = addDependenciesToPackageJson(
tree,
{},
{
'@storybook/angular': storybookVersion,
'@storybook/manager-webpack5': storybookVersion,
'@storybook/builder-webpack5': storybookVersion,
'@storybook/addon-essentials': storybookVersion,
}
);
const storybookGeneratorInstallTask = await generateStorybookConfiguration(
tree,
options
Expand All @@ -35,7 +22,6 @@ export async function storybookConfigurationGenerator(
}

return () => {
angularStorybookInstallTask();
storybookGeneratorInstallTask();
};
}
Expand Down
1 change: 0 additions & 1 deletion packages/angular/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export const ngrxVersion = '~13.0.0';
export const rxjsVersion = '~7.4.0';
export const jestPresetAngularVersion = '11.0.0';
export const angularEslintVersion = '~13.0.1';
export const storybookVersion = '~6.4.0-rc.3';
export const angularArchitectsModuleFederationPluginVersion = '^13.0.1';
29 changes: 29 additions & 0 deletions packages/storybook/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,35 @@
}
},
"packageJsonUpdates": {
"13.3.0": {
"version": "13.3.0-beta.3",
"packages": {
"@storybook/angular": {
"version": "~6.4.5",
"alwaysAddToPackageJson": false
},
"@storybook/react": {
"version": "~6.4.5",
"alwaysAddToPackageJson": false
},
"@storybook/web": {
"version": "~6.4.5",
"alwaysAddToPackageJson": false
},
"@storybook/addon-essentials": {
"version": "~6.4.5",
"alwaysAddToPackageJson": false
},
"@storybook/builder-webpack5": {
"version": "~6.4.5",
"alwaysAddToPackageJson": true
},
"@storybook/manager-webpack5": {
"version": "~6.4.5",
"alwaysAddToPackageJson": true
}
}
},
"9.0.0": {
"version": "9.0.0-beta.1",
"packages": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Object {
},
"devDependencies": Object {
"@angular/forms": "*",
"@nrwl/storybook": "~6.3.0",
"@storybook/addon-essentials": "~6.3.0",
"@storybook/angular": "~6.3.0",
"@storybook/builder-webpack5": "~6.3.0",
"@storybook/manager-webpack5": "~6.3.0",
"@nrwl/storybook": "~6.4.5",
"@storybook/addon-essentials": "~6.4.5",
"@storybook/angular": "~6.4.5",
"@storybook/builder-webpack5": "~6.4.5",
"@storybook/manager-webpack5": "~6.4.5",
"existing": "1.0.0",
},
"name": "test-name",
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const nxVersion = '*';
export const storybookVersion = '~6.3.0';
export const storybookVersion = '~6.4.5';
export const babelCoreVersion = '7.12.13';
export const babelLoaderVersion = '8.1.0';
export const babelPresetTypescriptVersion = '7.12.13';
Expand Down

0 comments on commit c08b61b

Please sign in to comment.