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

Feature/remove old config #36

Merged
merged 8 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions .github/workflows/verify-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
Expand All @@ -35,6 +35,9 @@ jobs:
- name: Install Root
run: npm ci

- name: Build
run: npm run build

- name: Lint
run: npm run lint

Expand All @@ -47,9 +50,6 @@ jobs:
- name: Test
run: npm run test

- name: Build
run: npm run build

- name: Publish to Chromatic
uses: chromaui/action@latest
with:
Expand Down
47 changes: 0 additions & 47 deletions web-components/.storybook/main.cjs

This file was deleted.

27 changes: 27 additions & 0 deletions web-components/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { dirname, join } from 'path';
import { mergeConfig } from 'vite';
import turbosnap from 'vite-plugin-turbosnap';
import { StorybookConfig } from '@storybook/web-components-vite';

const config: StorybookConfig = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [getAbsolutePath('@storybook/addon-links'), getAbsolutePath('@storybook/addon-essentials')],
framework: {
name: '@storybook/web-components-vite',
options: {},
},
async viteFinal(config, { configType }) {
return mergeConfig(config, {
plugins: configType === 'PRODUCTION' ? [turbosnap({ rootDir: config.root ?? process.cwd() })] : [],
});
},
docs: {
autodocs: true,
},
};

export default config;

function getAbsolutePath(value: string) {
return dirname(require.resolve(join(value, 'package.json')));
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {addons} from '@storybook/addons';
import {themes} from '@storybook/theming';
import { addons } from '@storybook/addons';
import { themes } from '@storybook/theming';

addons.setConfig({
enableShortcuts: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import 'element-internals-polyfill';
import {setCustomElementsManifest} from '@storybook/web-components';
import { setCustomElementsManifest } from '@storybook/web-components';
import customElements from '../dist/custom-elements.json';
import '../src/rootStyles/style.css';

customElements?.modules?.forEach((module) => {
module?.declarations?.forEach(declaration => {
Object.keys(declaration).forEach(key => {
if (Array.isArray(declaration[key])) {
declaration[key] = declaration[key].filter((member) => !member.privacy?.includes('private'));
Object.entries(declaration).forEach(([key, value]) => {
if (Array.isArray(value)) {
// @ts-ignore
declaration[key] = value.filter((member) => !member.privacy?.includes('private'));
}
});
});
Expand Down
1 change: 1 addition & 0 deletions web-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
]
},
"include": [
".storybook/*.ts",
"**/*.ts"
],
"exclude": [
Expand Down