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

Move examples out of workspaces #502

Merged
merged 17 commits into from
Sep 28, 2022
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
38 changes: 0 additions & 38 deletions .github/workflows/buildAndPublish.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/buildExamples.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/buildOverview.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI

on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
env:
wd: ./packages/builder-vite
steps:
- uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Build builder
run: yarn build
working-directory: ${{env.wd}}
- name: Archive built files
uses: actions/upload-artifact@v3
with:
name: builder-vite
path: |
./packages/builder-vite/dist
lint:
needs: build
runs-on: ubuntu-latest
env:
wd: ./packages/builder-vite
steps:
- uses: actions/checkout@v2
- name: Use Node
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Restore builder-vite dist
uses: actions/download-artifact@v3
with:
name: builder-vite
path: |
./packages/builder-vite/dist
- name: Lint
run: yarn lint-ci
working-directory: ${{env.wd}}

examples:
needs: build
env:
wd: ./examples/${{ matrix.framework }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
framework: [lit-ts, preact, react, react-18, react-ts, svelte, vue, workspaces]

steps:
- uses: actions/checkout@v2
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache-dependency-path: ${{env.wd}}/yarn.lock
- name: Install dependencies
run: yarn install
working-directory: ${{env.wd}}
- name: Install builder-vite dependencies
run: yarn install
working-directory: packages/builder-vite
- name: Restore builder-vite dist
uses: actions/download-artifact@v3
with:
name: builder-vite
path: |
./packages/builder-vite/dist
- name: Build example
run: yarn build-storybook
working-directory: ${{env.wd}}
- name: Test built example
run: yarn test-ci
working-directory: ${{env.wd}}
env:
# Workaround for https://github.com/facebook/jest/issues/8536
TEMP: ${{ runner.temp }}
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ plugins:
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.1.1.cjs

cacheFolder: "./.yarn/cache"
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { withOverview } from 'bookcase-builder';

const { mergeConfig } = require('vite');
const postcssLit = require('rollup-plugin-postcss-lit');

export default withOverview(__dirname)({
module.exports = {
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
core: {
Expand All @@ -22,4 +20,4 @@ export default withOverview(__dirname)({
plugins: [postcssLit({ include: ['**/*.scss', '**/*.scss\?*'] })],
});
},
});
};
3 changes: 3 additions & 0 deletions examples/lit-ts/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

cacheFolder: "../../.yarn/cache"
7 changes: 2 additions & 5 deletions examples/lit-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@storybook/addon-actions": "^6.5.9",
"@storybook/addon-docs": "^6.5.9",
"@storybook/addon-essentials": "^6.5.9",
"@storybook/addon-links": "^6.5.9",
"@storybook/builder-vite": "workspace:*",
"@storybook/builder-vite": "portal:../../packages/builder-vite",
"@storybook/test-runner": "0.1.0",
"@storybook/web-components": "^6.5.9",
"http-server": "^14.1.0",
Expand All @@ -31,6 +29,5 @@
"sass": "^1.50.1",
"vite": "^3.1.0-beta.1",
"wait-on": "^6.0.1"
},
"bookcase-builder": {}
}
}
Loading