-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update to [email protected] via @web/storybook-builder (#3730)
* docs: test Storybook 7 instead of WDS-storybook * docs: use wds storybook * chore: make it work with latest version in github branch * chore: use framework * chore: use latest storybook * chore: use latest versions with middleware modeOC * chore: take latest versions * docs: correct dist dir for Storybook CEM creation * chore: versions * chore: trim addons * chore: remove patches with latest versions * docs: link CSS storybook * chore: patch dependencies for watch mode in storybook * refactor: use full releases of dependencies --------- Co-authored-by: Mikhail Bashkirov <[email protected]>
- Loading branch information
Showing
17 changed files
with
3,254 additions
and
494 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,6 @@ jobs: | |
- name: Deploy to GitHub Pages | ||
run: | | ||
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
touch projects/documentation/dist/.nojekyll | ||
npx gh-pages -d projects/documentation/dist -m "[skip ci] update demonstration site" -t -u "github-actions-bot <[email protected]>" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,3 +1,8 @@ | ||
[build] | ||
command = "yarn docs:build" | ||
publish = "projects/documentation/dist" | ||
publish = "projects/documentation/dist" | ||
|
||
[[headers]] | ||
for = "/storybook/*.json" | ||
[headers.values] | ||
Access-Control-Allow-Origin = "*" |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
Copyright 2022 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
import rollupJson from '@rollup/plugin-json'; | ||
import { mergeConfigs } from '@web/dev-server'; | ||
import { fromRollup } from '@web/dev-server-rollup'; | ||
import { watchSWC } from '../web-test-runner.utils.js'; | ||
|
||
/** @type { import('storybook-builder-wds').StorybookConfigWds } */ | ||
const config = { | ||
stories: [ | ||
'../packages/*/stories/*.stories.js', | ||
'../tools/*/stories/*.stories.js', | ||
], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-a11y', | ||
], | ||
framework: { | ||
name: '@web/storybook-framework-web-components', | ||
}, | ||
wdsFinal(config) { | ||
const json = fromRollup(rollupJson); | ||
return mergeConfigs(config, { | ||
nodeResolve: { | ||
exportConditions: ['browser', 'development'], | ||
moduleDirectories: [ | ||
'node_modules', | ||
'packages', | ||
'projects', | ||
'tools', | ||
], | ||
}, | ||
clearTerminalOnReload: false, | ||
mimeTypes: { | ||
'**/*.json': 'js', | ||
}, | ||
plugins: [json(), watchSWC()], | ||
http2: true, | ||
watch: true, | ||
middleware: [ | ||
async (ctx, next) => { | ||
await next(); | ||
if ( | ||
// Icon packages | ||
ctx.url.search('/icons-') > -1 || | ||
// Node modules | ||
(ctx.url.search('/node_modules/') > -1 && | ||
ctx.url.search('/@spectrum-web-components') === -1) | ||
) { | ||
ctx.set( | ||
'Cache-Control', | ||
'public, max-age=604800, stale-while-revalidate=86400' | ||
); | ||
} | ||
}, | ||
], | ||
}); | ||
}, | ||
rollupFinal(config) { | ||
// add a new plugin to the build | ||
config.plugins.push(rollupJson()); | ||
return config; | ||
}, | ||
}; | ||
|
||
if (process.env.NODE_ENV === 'development') { | ||
config.refs = { | ||
'design-system': { | ||
title: 'Spectrum CSS', | ||
url: 'https://opensource.adobe.com/spectrum-css/preview/', | ||
expanded: false, // Optional, true by default | ||
}, | ||
}; | ||
} | ||
|
||
export default config; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
Copyright 2022 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
import { addons } from '@storybook/addons'; | ||
import yourTheme from './theme.js'; | ||
|
||
addons.setConfig({ | ||
theme: yourTheme, | ||
sidebar: { | ||
showRoots: false, | ||
}, | ||
}); |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Copyright 2022 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
import { setCustomElementsManifest } from '@storybook/web-components'; | ||
import { swcThemeDecorator } from '@spectrum-web-components/story-decorator/decorator.js'; | ||
import cem from './custom-elements.json'; | ||
|
||
setCustomElementsManifest(cem); | ||
|
||
export const parameters = { | ||
docs: { hidden: true }, | ||
controls: { expanded: true }, | ||
layout: 'fullscreen', | ||
}; | ||
|
||
export const decorators = [swcThemeDecorator]; |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
Copyright 2022 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
import { TemplateResult } from '@spectrum-web-components/base'; | ||
|
||
export interface Story<T> { | ||
(args?: T): TemplateResult; | ||
args: Partial<T>; | ||
} |
Oops, something went wrong.