-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[angular-ngrx-scss]: update Angular to 16 & Storybook to 7 (#1322)
* chore: ng update to angular 14 * chore: update ngrx to v14 * chore: ng update angular and ngrx to 15 * chore: update storybook * chore: ng update to angular and ngrx v16 * chore: update storybook to 7.2 and run prettier * fix: fix build storybook script * fix: pin dependencies
- Loading branch information
Showing
17 changed files
with
160 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import { dirname, join } from 'path'; | ||
module.exports = { | ||
"stories": [ | ||
"../src/**/*.stories.mdx", | ||
"../src/**/*.stories.@(js|jsx|ts|tsx)" | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
getAbsolutePath('@storybook/addon-links'), | ||
getAbsolutePath('@storybook/addon-essentials'), | ||
getAbsolutePath('@storybook/addon-interactions'), | ||
], | ||
"addons": [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions" | ||
], | ||
"framework": "@storybook/angular", | ||
"core": { | ||
"builder": "@storybook/builder-webpack5" | ||
} | ||
framework: { | ||
name: getAbsolutePath('@storybook/angular'), | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: true, | ||
}, | ||
}; | ||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value) { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { setCompodocJson } from "@storybook/addon-docs/angular"; | ||
import docJson from "../documentation.json"; | ||
import { setCompodocJson } from '@storybook/addon-docs/angular'; | ||
import docJson from '../documentation.json'; | ||
setCompodocJson(docJson); | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
docs: { inlineStories: true }, | ||
} | ||
docs: { story: { inline: true } }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
{ | ||
"extends": "../tsconfig.app.json", | ||
"compilerOptions": { | ||
"types": [ | ||
"node" | ||
], | ||
"types": ["node"], | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"exclude": [ | ||
"../src/test.ts", | ||
"../src/**/*.spec.ts", | ||
"../projects/**/*.spec.ts" | ||
], | ||
"include": [ | ||
"../src/**/*", | ||
"../projects/**/*" | ||
], | ||
"files": [ | ||
"./typings.d.ts" | ||
] | ||
"exclude": ["../src/test.ts", "../src/**/*.spec.ts", "../projects/**/*.spec.ts"], | ||
"include": ["../src/**/*", "../projects/**/*"], | ||
"files": ["./typings.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ | |
"pathMapping": { | ||
"/_karma_webpack_": "${workspaceFolder}" | ||
} | ||
}, | ||
|
||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 25 additions & 24 deletions
49
starters/angular-ngrx-scss/src/app/counter-example/starter-button/starter-button.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
// also exported from '@storybook/angular' if you can deal with breaking changes in 6.1 | ||
import { Story, Meta } from '@storybook/angular/types-6-0'; | ||
import { StarterButtonComponent } from './starter-button.component'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/angular'; | ||
|
||
// More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export | ||
export default { | ||
const meta: Meta<StarterButtonComponent> = { | ||
title: 'Example/Button', | ||
component: StarterButtonComponent, | ||
// More on argTypes: https://storybook.js.org/docs/angular/api/argtypes | ||
argTypes: { | ||
backgroundColor: { control: 'color' }, | ||
}, | ||
} as Meta; | ||
}; | ||
export default meta; | ||
|
||
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args | ||
const Template: Story<StarterButtonComponent> = (args: StarterButtonComponent) => ({ | ||
props: args, | ||
}); | ||
type Story = StoryObj<StarterButtonComponent>; | ||
|
||
export const Primary = Template.bind({}); | ||
// More on args: https://storybook.js.org/docs/angular/writing-stories/args | ||
Primary.args = { | ||
primary: true, | ||
label: 'Button', | ||
export const Primary: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Secondary = Template.bind({}); | ||
Secondary.args = { | ||
label: 'Button', | ||
export const Secondary: Story = { | ||
args: { | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Large = Template.bind({}); | ||
Large.args = { | ||
size: 'large', | ||
label: 'Button', | ||
export const Large: Story = { | ||
args: { | ||
size: 'large', | ||
label: 'Button', | ||
}, | ||
}; | ||
|
||
export const Small = Template.bind({}); | ||
Small.args = { | ||
size: 'small', | ||
label: 'Button', | ||
export const Small: Story = { | ||
args: { | ||
size: 'small', | ||
label: 'Button', | ||
}, | ||
}; |
2 changes: 1 addition & 1 deletion
2
starters/angular-ngrx-scss/src/app/fetch-example/fetch-example.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.fetch-example{ | ||
.fetch-example { | ||
width: 40%; | ||
&__greeting { | ||
text-align: center; | ||
|
Oops, something went wrong.