From 23d7e7e3f107a053e84f4b5e2047fce6b5d57af0 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 10 Jan 2023 14:17:21 +0100 Subject: [PATCH] Only support Angular >= 14 --- .circleci/config.yml | 20 ++++---- code/frameworks/angular/package.json | 46 +++++++++---------- .../src/builders/build-storybook/index.ts | 9 ++-- .../src/builders/build-storybook/schema.json | 4 +- .../src/builders/start-storybook/index.ts | 9 ++-- .../src/builders/start-storybook/schema.json | 4 +- .../angular/src/server/preset-options.ts | 5 +- code/lib/cli/src/repro-templates.ts | 11 ----- 8 files changed, 46 insertions(+), 62 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 888dd6175ce3..9cc68ef894f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -599,23 +599,23 @@ workflows: requires: - build - create-sandboxes: - parallelism: 16 + parallelism: 15 requires: - build - build-sandboxes: - parallelism: 16 + parallelism: 15 requires: - create-sandboxes - test-runner-sandboxes: - parallelism: 16 + parallelism: 15 requires: - build-sandboxes - chromatic-sandboxes: - parallelism: 16 + parallelism: 15 requires: - build-sandboxes - e2e-sandboxes: - parallelism: 16 + parallelism: 15 requires: - build-sandboxes daily: @@ -624,25 +624,25 @@ workflows: jobs: - build - create-sandboxes: - parallelism: 28 + parallelism: 27 requires: - build # - smoke-test-sandboxes: # disabled for now # requires: # - create-sandboxes - build-sandboxes: - parallelism: 28 + parallelism: 27 requires: - create-sandboxes - test-runner-sandboxes: - parallelism: 28 + parallelism: 27 requires: - build-sandboxes - chromatic-sandboxes: - parallelism: 28 + parallelism: 27 requires: - build-sandboxes - e2e-sandboxes: - parallelism: 28 + parallelism: 27 requires: - build-sandboxes diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index ecacc76ba73a..dea017fc300f 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -37,6 +37,7 @@ }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-beta.21", + "@storybook/cli": "7.0.0-beta.21", "@storybook/client-logger": "7.0.0-beta.21", "@storybook/core-client": "7.0.0-beta.21", "@storybook/core-common": "7.0.0-beta.21", @@ -65,18 +66,17 @@ "webpack": "5" }, "devDependencies": { - "@angular-devkit/architect": "^0.1303.5", - "@angular-devkit/build-angular": "^13.3.5", - "@angular-devkit/core": "^13.3.5", - "@angular/cli": "^13.3.5", - "@angular/common": "^13.3.6", - "@angular/compiler": "^13.3.6", - "@angular/compiler-cli": "^13.3.6", - "@angular/core": "^13.3.6", - "@angular/forms": "^13.3.6", - "@angular/platform-browser": "^13.3.6", - "@angular/platform-browser-dynamic": "^13.3.6", - "@nrwl/workspace": "14.6.1", + "@angular-devkit/architect": "^0.1500.4", + "@angular-devkit/build-angular": "^15.0.4", + "@angular-devkit/core": "^15.0.4", + "@angular/cli": "^15.0.4", + "@angular/common": "^15.0.4", + "@angular/compiler": "^15.0.4", + "@angular/compiler-cli": "^15.0.4", + "@angular/core": "^15.0.4", + "@angular/forms": "^15.0.4", + "@angular/platform-browser": "^15.0.4", + "@angular/platform-browser-dynamic": "^15.0.4", "@types/rimraf": "^3.0.2", "@types/tmp": "^0.2.3", "cross-spawn": "^7.0.3", @@ -90,17 +90,17 @@ "zone.js": "^0.12.0" }, "peerDependencies": { - "@angular-devkit/architect": ">=0.1300.0", - "@angular-devkit/build-angular": ">=13.0.0", - "@angular-devkit/core": ">=13.0.0", - "@angular/cli": ">=13.0.0", - "@angular/common": ">=13.0.0", - "@angular/compiler": ">=13.0.0", - "@angular/compiler-cli": ">=13.0.0", - "@angular/core": ">=13.0.0", - "@angular/forms": ">=13.0.0", - "@angular/platform-browser": ">=13.0.0", - "@angular/platform-browser-dynamic": ">=13.0.0", + "@angular-devkit/architect": ">=0.1400.0", + "@angular-devkit/build-angular": ">=14.0.0", + "@angular-devkit/core": ">=14.0.0", + "@angular/cli": ">=14.0.0", + "@angular/common": ">=14.0.0", + "@angular/compiler": ">=14.0.0", + "@angular/compiler-cli": ">=14.0.0", + "@angular/core": ">=14.0.0", + "@angular/forms": ">=14.0.0", + "@angular/platform-browser": ">=14.0.0", + "@angular/platform-browser-dynamic": ">=14.0.0", "@babel/core": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/code/frameworks/angular/src/builders/build-storybook/index.ts b/code/frameworks/angular/src/builders/build-storybook/index.ts index 30314f72bbf7..0fdc2c2bf6a4 100644 --- a/code/frameworks/angular/src/builders/build-storybook/index.ts +++ b/code/frameworks/angular/src/builders/build-storybook/index.ts @@ -11,13 +11,10 @@ import { CLIOptions } from '@storybook/types'; import { catchError, map, mapTo, switchMap } from 'rxjs/operators'; import { sync as findUpSync } from 'find-up'; import { sync as readUpSync } from 'read-pkg-up'; -import { - BrowserBuilderOptions, - ExtraEntryPoint, - StylePreprocessorOptions, -} from '@angular-devkit/build-angular'; +import { BrowserBuilderOptions, StylePreprocessorOptions } from '@angular-devkit/build-angular'; import { buildStaticStandalone } from '@storybook/core-server'; +import { StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema'; import { StandaloneOptions } from '../utils/standalone-options'; import { runCompodoc } from '../utils/run-compodoc'; import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-handler'; @@ -27,7 +24,7 @@ export type StorybookBuilderOptions = JsonObject & { tsConfig?: string; compodoc: boolean; compodocArgs: string[]; - styles?: ExtraEntryPoint[]; + styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; } & Pick< // makes sure the option exists diff --git a/code/frameworks/angular/src/builders/build-storybook/schema.json b/code/frameworks/angular/src/builders/build-storybook/schema.json index 1640a3f986dd..29ebe3b5e19d 100644 --- a/code/frameworks/angular/src/builders/build-storybook/schema.json +++ b/code/frameworks/angular/src/builders/build-storybook/schema.json @@ -61,7 +61,7 @@ "type": "array", "description": "Global styles to be included in the build.", "items": { - "$ref": "#/definitions/extraEntryPoint" + "$ref": "#/definitions/styleElement" }, "default": "" }, @@ -83,7 +83,7 @@ }, "additionalProperties": false, "definitions": { - "extraEntryPoint": { + "styleElement": { "oneOf": [ { "type": "object", diff --git a/code/frameworks/angular/src/builders/start-storybook/index.ts b/code/frameworks/angular/src/builders/start-storybook/index.ts index f4a3d89c4751..381176740a87 100644 --- a/code/frameworks/angular/src/builders/start-storybook/index.ts +++ b/code/frameworks/angular/src/builders/start-storybook/index.ts @@ -6,11 +6,7 @@ import { targetFromTargetString, } from '@angular-devkit/architect'; import { JsonObject } from '@angular-devkit/core'; -import { - BrowserBuilderOptions, - ExtraEntryPoint, - StylePreprocessorOptions, -} from '@angular-devkit/build-angular'; +import { BrowserBuilderOptions, StylePreprocessorOptions } from '@angular-devkit/build-angular'; import { from, Observable, of } from 'rxjs'; import { CLIOptions } from '@storybook/types'; import { map, switchMap, mapTo } from 'rxjs/operators'; @@ -18,6 +14,7 @@ import { sync as findUpSync } from 'find-up'; import { sync as readUpSync } from 'read-pkg-up'; import { buildDevStandalone } from '@storybook/core-server'; +import { StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema'; import { StandaloneOptions } from '../utils/standalone-options'; import { runCompodoc } from '../utils/run-compodoc'; import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-handler'; @@ -27,7 +24,7 @@ export type StorybookBuilderOptions = JsonObject & { tsConfig?: string; compodoc: boolean; compodocArgs: string[]; - styles?: ExtraEntryPoint[]; + styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; } & Pick< // makes sure the option exists diff --git a/code/frameworks/angular/src/builders/start-storybook/schema.json b/code/frameworks/angular/src/builders/start-storybook/schema.json index 3c78f907bdd1..bfc83a59fe29 100644 --- a/code/frameworks/angular/src/builders/start-storybook/schema.json +++ b/code/frameworks/angular/src/builders/start-storybook/schema.json @@ -83,7 +83,7 @@ "type": "array", "description": "Global styles to be included in the build.", "items": { - "$ref": "#/definitions/extraEntryPoint" + "$ref": "#/definitions/styleElement" }, "default": "" }, @@ -105,7 +105,7 @@ }, "additionalProperties": false, "definitions": { - "extraEntryPoint": { + "styleElement": { "oneOf": [ { "type": "object", diff --git a/code/frameworks/angular/src/server/preset-options.ts b/code/frameworks/angular/src/server/preset-options.ts index a831d206f861..5412d5a19482 100644 --- a/code/frameworks/angular/src/server/preset-options.ts +++ b/code/frameworks/angular/src/server/preset-options.ts @@ -1,14 +1,15 @@ import { Options as CoreOptions } from '@storybook/types'; import { BuilderContext } from '@angular-devkit/architect'; -import { ExtraEntryPoint, StylePreprocessorOptions } from '@angular-devkit/build-angular'; +import { StylePreprocessorOptions } from '@angular-devkit/build-angular'; +import { StyleElement } from '@angular-devkit/build-angular/src/builders/browser/schema'; export type PresetOptions = CoreOptions & { /* Allow to get the options of a targeted "browser builder" */ angularBrowserTarget?: string | null; /* Defined set of options. These will take over priority from angularBrowserTarget options */ angularBuilderOptions?: { - styles?: ExtraEntryPoint[]; + styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; }; /* Angular context from builder */ diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index 616b50328ae5..8a88e034f5f8 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -234,16 +234,6 @@ export const allTemplates = { builder: '@storybook/builder-webpack5', }, }, - 'angular-cli/13-ts': { - name: 'Angular CLI (Version 13)', - script: - 'npx -p @angular/cli@13 ng new angular-v13 --directory . --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn', - expected: { - framework: '@storybook/angular', - renderer: '@storybook/angular', - builder: '@storybook/builder-webpack5', - }, - }, 'svelte-kit/skeleton-js': { name: 'Svelte Kit (JS)', script: @@ -367,7 +357,6 @@ export const merged: TemplateKey[] = [ 'react-webpack/18-ts', 'react-webpack/17-ts', 'angular-cli/14-ts', - 'angular-cli/13-ts', 'preact-webpack5/default-ts', 'preact-vite/default-ts', 'html-webpack/default',