Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/aui storybook7 new demo #483

Merged
merged 3 commits into from
Jul 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: upgrade storybook7
liyouzhi committed Jul 11, 2023

Unverified

No user is associated with the committer email.
commit 31bc5af7d50977f17ab81c349d1634b97357b4f8
34 changes: 32 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@1stg/eslint-config/loose",
"extends": "./tools/eslintrc/index.js",
"parserOptions": {
"requireConfigFile": false
},
@@ -50,6 +50,36 @@
"@angular-eslint/no-input-rename": "off",
"@angular-eslint/no-output-rename": "off",
"@angular-eslint/no-host-metadata-property": "off",
"@typescript-eslint/no-unsafe-argument": "off"
"@typescript-eslint/no-unsafe-argument": "off",
"@angular-eslint/template/eqeqeq": 0,
"@angular-eslint/template/no-negated-async": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/naming-convention": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-floating-promises": 0,
"@typescript-eslint/no-magic-numbers": 0,
"@typescript-eslint/no-type-alias": 0,
"@typescript-eslint/no-unnecessary-condition": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/prefer-ts-expect-error": 0,
"@typescript-eslint/restrict-plus-operands": 0,
"@typescript-eslint/sort-type-union-intersection-members": 0,
"@typescript-eslint/unbound-method": 0,
"@typescript-eslint/no-inferrable-types": 0,
"regexp/optimal-quantifier-concatenation": 1,
"arrow-body-style": 0,
"accessor-pairs": 0,
"no-magic-numbers": 0,
"no-negated-condition": 0,
"promise/always-return": 0,
"promise/catch-or-return": 0,
"unicorn/explicit-length-check": 0,
"unicorn/no-array-for-each": 0,
"unicorn/no-fn-reference-in-iterator": 0,
"unicorn/prefer-number-properties": 0,
"unicorn/prefer-prototype-methods": 0,
"unicorn/prefer-spread": 0
}
}
22 changes: 16 additions & 6 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { StorybookConfig } from '@storybook/core-common';
import type { StorybookConfig } from "@storybook/angular";

const config: StorybookConfig = {
core: {
builder: 'webpack5',
},
core: {},
stories: [
'../stories/**/index.@(js|ts)',
'../stories/**/*.stories.@(js|ts|mdx)',
@@ -21,13 +19,25 @@ const config: StorybookConfig = {
use: [
{
loader: require.resolve('@storybook/source-loader'),
options: { parser: 'typescript' },
options: {
parser: 'typescript',
},
},
],
enforce: 'pre',
});
return config;
},
framework: {
name: '@storybook/angular',
options: {},
},
docs: {
autodocs: true,
},
features: {
legacyMdx1: true, // Enables MDX v1 support
storyStoreV7: false, // Opt out of on-demand story loading
},
};

export default config;
24 changes: 24 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "",
"main": "",
"tsConfig": "tsconfig.json",
"inlineStyleLanguage": "scss",
"styles": ["src/theme/style.scss"]
@@ -54,6 +56,28 @@
}
},
"defaultConfiguration": "production"
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "storybook:build",
"compodoc": false,
"port": 6006
},
"compodoc": true,
"compodocArgs": ["-e", "json", "-d", "."]
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "storybook:build",
"compodoc": false,
"outputDir": "dist"
},
"compodoc": true,
"compodocArgs": ["-e", "json", "-d", "."]
}
}
}
95 changes: 72 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -30,28 +30,33 @@
"prerelease": "yarn build",
"release": "changeset publish",
"start": "yarn storybook",
"storybook": "start-storybook -c .storybook -p 6006",
"storybook:build": "build-storybook -c .storybook -o dist",
"storybook": "ng run storybook:storybook",
"storybook:build": "ng run storybook:build-storybook",
"test": "jest --coverage",
"test:ci": "JEST_JUNIT_OUTPUT_DIR=reports jest --runInBand --coverage --reporters=jest-junit",
"test:clear": "jest --clearCache",
"test:update": "jest -u",
"test:watch": "jest --watch"
},
"peerDependencies": {
"@angular/animations": ">=13.0.0",
"@angular/cdk": ">=13.0.0",
"@angular/common": ">=13.0.0",
"@angular/core": ">=13.0.0",
"@angular/forms": ">=13.0.0",
"@angular/platform-browser": ">=13.0.0",
"@angular/animations": ">=15.0.0",
"@angular/cdk": ">=15.0.0",
"@angular/common": ">=15.0.0",
"@angular/core": ">=15.0.0",
"@angular/forms": ">=15.0.0",
"@angular/platform-browser": ">=15.0.0",
"dayjs": "^1.0.0",
"rxjs": "^7.0.0"
},
"devDependencies": {
"@1stg/app-config": "6.1.5",
"@angular-devkit/build-angular": "^15.2.8",
"@angular-devkit/core": "^15.2.8",
"@angular-eslint/builder": "^15.1.0",
"@angular-eslint/eslint-plugin": "^15.1.0",
"@angular-eslint/eslint-plugin-template": "^15.1.0",
"@angular-eslint/schematics": "^15.1.0",
"@angular-eslint/template-parser": "^15.1.0",
"@angular/animations": "^15.2.9",
"@angular/cdk": "15.2.9",
"@angular/cli": "^15.2.8",
@@ -62,39 +67,83 @@
"@angular/forms": "^15.2.9",
"@angular/platform-browser": "^15.2.9",
"@angular/platform-browser-dynamic": "^15.2.9",
"@babel/eslint-parser": "^7.18.9",
"@babel/eslint-plugin": "^7.17.7",
"@changesets/changelog-github": "^0.4.4",
"@changesets/cli": "^2.22.0",
"@storybook/addon-actions": "^6.4.22",
"@storybook/addon-docs": "^6.4.22",
"@storybook/addon-knobs": "^6.1.21",
"@storybook/addon-storysource": "^6.4.22",
"@storybook/addons": "^6.4.22",
"@storybook/angular": "^6.4.22",
"@storybook/builder-webpack5": "^6.4.22",
"@storybook/cli": "^6.4.22",
"@storybook/manager-webpack5": "^6.4.22",
"@storybook/source-loader": "^6.4.22",
"@compodoc/compodoc": "^1.1.19",
"@storybook/addon-actions": "^7.0.9",
"@storybook/addon-docs": "^7.0.9",
"@storybook/addon-knobs": "^7.0.2",
"@storybook/addon-mdx-gfm": "^7.0.9",
"@storybook/addon-storysource": "^7.0.9",
"@storybook/addons": "^7.0.9",
"@storybook/angular": "^7.0.9",
"@storybook/blocks": "^7.0.9",
"@storybook/cli": "^7.0.9",
"@storybook/mdx1-csf": "^1.0.0",
"@storybook/source-loader": "^7.0.9",
"@types/chroma-js": "^2.1.3",
"@types/file-saver": "^2.0.5",
"@types/jest": "^27.5.1",
"@types/jest": "29.4.4",
"@types/node": "^17.0.33",
"@types/resize-observer-browser": "^0.1.5",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"angular-eslint-template-parser": "^0.1.1",
"babel-plugin-dynamic-import-node": "^2.3.3",
"chroma-js": "^2.1.2",
"css-loader": "^6.7.1",
"dayjs": "^1.11.2",
"eslint": "8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-config-standard-react": "^11.0.1",
"eslint-formatter-friendly": "^7.0.0",
"eslint-import-resolver-typescript": "^3.3.0",
"eslint-plugin-css": "^0.6.0",
"eslint-plugin-es-x": "^5.2.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "npm:eslint-plugin-i@^2.26.0",
"eslint-plugin-jest": "^26.6.0",
"eslint-plugin-jsdoc": "^39.3.3",
"eslint-plugin-json-schema-validator": "^4.0.0",
"eslint-plugin-jsonc": "^2.3.1",
"eslint-plugin-markup": "^0.10.1",
"eslint-plugin-mdx": "^2.0.2",
"eslint-plugin-n": "^15.2.4",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-regexp": "^1.7.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-sonar": "^0.8.0",
"eslint-plugin-sonarjs": "^0.14.0",
"eslint-plugin-svelte": "^2.2.0",
"eslint-plugin-toml": "^0.3.1",
"eslint-plugin-unicorn": "^43.0.2",
"eslint-plugin-vue": "^9.2.0",
"eslint-plugin-yml": "^1.0.0",
"file-saver": "^2.0.5",
"gulp": "^4.0.2",
"gulp-dart-sass": "^1.0.2",
"jest": "^28.1.0",
"jest-junit": "^13.2.0",
"jest-preset-angular": "^12.0.1",
"jest": "29.4.3",
"jest-junit": "^16.0.0",
"jest-preset-angular": "13.1.1",
"ng-packagr": "^15.2.2",
"patch-package": "^6.4.7",
"postcss": "^8.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "7.8.0",
"sass-loader": "^12.6.0",
"storybook-dark-mode": "^1.1.0",
"storybook": "^7.0.9",
"storybook-dark-mode": "^3.0.0",
"style-loader": "^3.3.1",
"ts-jest": "29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"webpack": "^5.72.1",
"zone.js": "0.12.0"
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`BreadcrumbComponent should render correct template 1`] = `
<ng-component
__ngContext__={[Function LRootView]}
>
<ng-component>
<aui-breadcrumb>
<div
class="aui-breadcrumb"
4 changes: 2 additions & 2 deletions src/checkbox/checkbox.component.scss
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ $block: 'aui-checkbox';
border-color: use-rgb(primary);
background-color: use-rgb(main-bg);

&::before {
&:before {
content: '';
display: block;
width: 8px;
@@ -82,7 +82,7 @@ $block: 'aui-checkbox';
&.isIndeterminate.isDisabled &__pointer {
border-color: use-rgb(p-4);

&::before {
&:before {
background-color: use-rgb(p-4);
}
}
1 change: 1 addition & 0 deletions src/dialog/dialog.component.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import '../theme/var';
@import '../theme/mixin';
@import '../theme/motion';
@import '../../node_modules/@angular/cdk/overlay-prebuilt';

.cdk-overlay-backdrop.cdk-overlay-backdrop-showing.aui-dialog-backdrop {
@include modal-backdrop;
2 changes: 0 additions & 2 deletions src/form/__snapshots__/form.component.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@

exports[`FormComponent should match snapshot 1`] = `
<ng-component
__ngContext__={[Function LRootView]}
form={[Function NgForm]}
>
<form
@@ -71,7 +70,6 @@ exports[`FormComponent should match snapshot 1`] = `

exports[`FormComponent should match snapshot 2`] = `
<ng-component
__ngContext__={[Function LRootView]}
form={[Function NgForm]}
>
<form
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`InputGroupComponent should match snapshot 1`] = `
<ng-component
__ngContext__={[Function LRootView]}
>
<ng-component>
<aui-input-group>
<div
class="hasAddonBefore hasAddonAfter hasPrefix hasSuffix aui-input-group aui-input-group--medium"
4 changes: 2 additions & 2 deletions src/input/search/search.component.scss
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ $block: 'aui-search';

&.hasButton.isClearable .#{$block}__input {
padding-right: calc(
#{map-get($map, icon-size)}*
#{map-get($map, icon-size)} *
2 +
#{use-var(inline-padding-xs)} *
4 +
@@ -101,7 +101,7 @@ $block: 'aui-search';
align-items: center;
}

&:not(.isDisabled):not(.isSearching) &__button {
&:not(.isDisabled, .isSearching) &__button {
cursor: pointer;

&:hover {
1 change: 1 addition & 0 deletions src/message/message.component.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '../theme/var';
@import '../theme/mixin';
@import '../../node_modules/@angular/cdk/overlay-prebuilt';

.cdk-overlay-pane.aui-message-overlay-pane {
z-index: 1001;
1 change: 1 addition & 0 deletions src/notification/notification.component.scss
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

@import '../theme/var';
@import '../theme/mixin';
@import '../../node_modules/@angular/cdk/overlay-prebuilt';

.cdk-overlay-pane.aui-notification-overlay-pane {
z-index: 1001;
3 changes: 0 additions & 3 deletions src/paginator/__snapshots__/paginator.component.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@

exports[`PaginatorComponent should change page size correctly 1`] = `
<ng-component
__ngContext__={[Function LRootView]}
currentPage={[Function Number]}
disabled="false"
layout={[Function Array]}
@@ -222,7 +221,6 @@ exports[`PaginatorComponent should change page size correctly 1`] = `

exports[`PaginatorComponent should render current template 1`] = `
<ng-component
__ngContext__={[Function LRootView]}
currentPage={[Function Number]}
disabled="false"
layout={[Function Array]}
@@ -500,7 +498,6 @@ exports[`PaginatorComponent should render current template 1`] = `

exports[`PaginatorComponent should render current template 2`] = `
<ng-component
__ngContext__={[Function LRootView]}
currentPage={[Function Number]}
disabled={[Function Boolean]}
layout={[Function Array]}
1 change: 1 addition & 0 deletions src/radio/radio.component.scss
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ $block: 'aui-radio';
align-items: center;
min-height: use-var(inline-height-m);
@include text-set(m, main);

position: relative;

&__input {
Loading