Skip to content

Commit

Permalink
Merge pull request #24367 from storybookjs/valentin/fix-angular-sandbox
Browse files Browse the repository at this point in the history
Angular: Fix Angular 15 support and add zone.js v0.14.x support
  • Loading branch information
valentinpalkovic authored Oct 5, 2023
2 parents f0a10f7 + b838b29 commit 7d8a2c6
Show file tree
Hide file tree
Showing 19 changed files with 1,119 additions and 1,131 deletions.
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,27 +555,27 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 20
parallelism: 21
requires:
- build
- build-sandboxes:
parallelism: 20
parallelism: 21
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 17
parallelism: 18
requires:
- build-sandboxes
- e2e-production:
parallelism: 17
parallelism: 18
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
requires:
- create-sandboxes
- test-runner-production:
parallelism: 17
parallelism: 18
requires:
- build-sandboxes
- bench:
Expand Down Expand Up @@ -609,30 +609,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 33
parallelism: 34
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 33
parallelism: 34
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 30
parallelism: 31
requires:
- build-sandboxes
- e2e-production:
parallelism: 30
parallelism: 31
requires:
- build-sandboxes
- e2e-dev:
parallelism: 4
requires:
- create-sandboxes
- test-runner-production:
parallelism: 30
parallelism: 31
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
Expand Down
11 changes: 11 additions & 0 deletions RESOLUTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Resolutions and Exact versions

This file keeps track of any resolutions or exact versions specified in any `package.json` file. Resolutions are used to specify a specific version of a package to be used, even if a different version is specified as a dependency of another package.

## code/renderers/svelte/package.json

[email protected] (bug: 3.5.x): Type issues

## code/ui/components/package.json

[email protected] (bug: 2.3.x): The Scrollbar doesn't disappear anymore by default. It might has something to do with the `scrollbars.autoHideSuspend` option, which was introduced in 2.3.0. https://github.com/KingSora/OverlayScrollbars/blob/master/packages/overlayscrollbars/CHANGELOG.md#230
2 changes: 1 addition & 1 deletion code/addons/docs/src/DocsRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ErrorBoundary extends Component<{
const { hasError } = this.state;
const { children } = this.props;

return hasError ? null : children;
return hasError ? null : <>{children}</>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
"rxjs": "^6.0.0 || ^7.4.0",
"typescript": "^4.0.0 || ^5.0.0",
"zone.js": "^0.8.29 || >= 0.9.0 < 1.0.0"
"zone.js": ">= 0.11.1 < 1.0.0"
},
"peerDependenciesMeta": {
"@angular/cli": {
Expand Down
10 changes: 9 additions & 1 deletion code/frameworks/angular/src/builders/build-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ export type StorybookBuilderOptions = JsonObject & {
} & Pick<
// makes sure the option exists
CLIOptions,
'outputDir' | 'configDir' | 'loglevel' | 'quiet' | 'webpackStatsJson' | 'disableTelemetry'
| 'outputDir'
| 'configDir'
| 'loglevel'
| 'quiet'
| 'webpackStatsJson'
| 'disableTelemetry'
| 'debugWebpack'
>;

export type StorybookBuilderOutput = JsonObject & BuilderOutput & { [key: string]: any };
Expand Down Expand Up @@ -81,6 +87,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
quiet,
enableProdMode = true,
webpackStatsJson,
debugWebpack,
disableTelemetry,
assets,
} = options;
Expand All @@ -103,6 +110,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
},
tsConfig,
webpackStatsJson,
debugWebpack,
};

return standaloneOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"description": "Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent].",
"pattern": "(silly|verbose|info|warn|silent)"
},
"debugWebpack": {
"type": "boolean",
"description": "Debug the Webpack configuration",
"default": false
},
"enableProdMode": {
"type": "boolean",
"description": "Disable Angular's development mode, which turns off assertions and other checks within the framework.",
Expand Down
3 changes: 3 additions & 0 deletions code/frameworks/angular/src/builders/start-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type StorybookBuilderOptions = JsonObject & {
| 'initialPath'
| 'open'
| 'docs'
| 'debugWebpack'
>;

export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
Expand Down Expand Up @@ -103,6 +104,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
assets,
initialPath,
open,
debugWebpack,
} = options;

const standaloneOptions: StandaloneOptions = {
Expand Down Expand Up @@ -130,6 +132,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
tsConfig,
initialPath,
open,
debugWebpack,
};

return standaloneOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
"default": null
},
"debugWebpack": {
"type": "boolean",
"description": "Debug the Webpack configuration",
"default": false
},
"tsConfig": {
"type": "string",
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const printErrorDetails = (error: any): void => {
} else if ((error as any).stats && (error as any).stats.compilation.errors) {
(error as any).stats.compilation.errors.forEach((e: any) => logger.plain(e));
} else {
logger.error(error);
logger.error(error as any);
}
} else if (error.compilation?.errors) {
error.compilation.errors.forEach((e: any) => logger.plain(e));
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/src/client/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { global } from '@storybook/global';
/** *************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/** *************************************************************************************************
* APPLICATION IMPORTS
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"@types/babel__core": "^7",
"@types/babel__plugin-transform-runtime": "^7",
"@types/babel__preset-env": "^7",
"next": "^13.4.8",
"next": "13.4.19",
"typescript": "^4.9.3",
"webpack": "^5.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ export const merged: TemplateKey[] = [
...normal,
'react-webpack/18-ts',
'react-webpack/17-ts',
// 'angular-cli/15-ts', // TODO: re-enable when building the storybook works again
'angular-cli/15-ts',
'preact-webpack5/default-ts',
'preact-vite/default-ts',
'html-webpack/default',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"chalk": "^4.1.0",
"esbuild": "^0.18.0",
"esbuild-register": "^3.5.0",
"file-system-cache": "^2.4.4",
"file-system-cache": "2.3.0",
"find-cache-dir": "^3.0.0",
"find-up": "^5.0.0",
"fs-extra": "^11.1.0",
Expand Down
2 changes: 1 addition & 1 deletion code/lib/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@storybook/channels": "workspace:*",
"@types/babel__core": "^7.0.0",
"@types/express": "^4.7.0",
"file-system-cache": "^2.4.4"
"file-system-cache": "2.3.0"
},
"devDependencies": {
"@storybook/csf": "^0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion code/renderers/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"devDependencies": {
"expect-type": "^0.15.0",
"svelte": "^4.0.0",
"svelte-check": "^3.4.3",
"svelte-check": "3.4.6",
"typescript": "^5.0.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion code/ui/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@types/react-syntax-highlighter": "11.0.5",
"@types/util-deprecate": "^1.0.0",
"css": "^3.0.0",
"overlayscrollbars": "^2.2.0",
"overlayscrollbars": "2.2.1",
"overlayscrollbars-react": "^0.5.0",
"polished": "^4.2.2",
"prettier": "^2.8.0",
Expand Down
4 changes: 2 additions & 2 deletions code/ui/components/src/components/Zoom/ZoomIFrame.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RefObject, ReactElement } from 'react';
import { Component } from 'react';
import React, { Component } from 'react';

export type IZoomIFrameProps = {
scale: number;
Expand Down Expand Up @@ -57,6 +57,6 @@ export class ZoomIFrame extends Component<IZoomIFrameProps> {

render() {
const { children } = this.props;
return children;
return <>{children}</>;
}
}
Loading

0 comments on commit 7d8a2c6

Please sign in to comment.