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 update deps #141

Merged
merged 4 commits into from
Dec 24, 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
File renamed without changes.
110 changes: 46 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,97 +6,79 @@ name: Build & Release
on:
push:
pull_request:
branches:
- master
branches: [master]
types: [opened, synchronize, closed]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --immutable --network-timeout 500000
node-version: 20.x
cache: "yarn"
- name: Install dependencies 🚀
run: yarn install --immutable
- name: Run lint
run: yarn lint

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]

runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --immutable --network-timeout 500000
- name: Run test
node-version: 20.x
cache: "yarn"
- name: Install dependencies 🚀
run: yarn install --immutable
- name: Run test 🔍
run: yarn test

deploy-packages:
test-storybook:
timeout-minutes: 60
runs-on: ubuntu-latest
needs: [lint, test]
if: ${{ github.event_name != 'pull_request' && (contains(github.ref, 'master') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }}

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --immutable --network-timeout 500000
- name: Release packages
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: yarn release
- uses: actions/upload-artifact@v2
with:
name: packages
path: |
package.json
packages/*/package.json
node-version: 20.x
cache: "yarn"
- name: Install dependencies 🚀
run: yarn install --immutable
- name: Install Playwright 🚀
run: yarn playwright install
- name: Build Storybook
run: yarn storybook:build --quiet
- name: Serve Storybook and run tests 🔍
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on tcp:6006 && yarn storybook:test:ci"

publish-pages:
deploy-packages:
runs-on: ubuntu-latest
needs: deploy-packages
needs: [lint, test, test-storybook]
if: ${{ github.event_name != 'pull_request' && (contains(github.ref, 'master') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }}

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
node-version: 20.x
cache: "yarn"
- name: Install dependencies 🚀
run: yarn install --immutable
- name: Release packages
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish:storybook
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: yarn release
32 changes: 32 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .github/workflows/chromatic.yml

name: "Chromatic"

on:
push:
pull_request:
branches: [production]
types: [opened, synchronize, closed]

jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
run: yarn install --immutable

- name: Build tailwind
run: yarn tailwind:build

- name: Run Chromatic
uses: chromaui/action@latest
with:
storybookBaseDir: .
storybookConfigDir: ./.storybook
# ⚠️ Make sure to configure a `CHROMATIC_PROJECT_TOKEN` repository secret
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
79 changes: 56 additions & 23 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,65 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Website
name: Deploy website

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
publish-pages:
runs-on: ubuntu-latest
needs: deploy-packages
if: ${{ github.event_name != 'pull_request' && (contains(github.ref, 'master') || contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')) }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

strategy:
matrix:
node-version: [18.x]
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Checkout
uses: actions/checkout@v4
with:
node-version: ${{ matrix.node-version }}
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Release packages
env:
CI: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish:storybook
run: yarn install
- name: Build with Storybook
run: |
yarn storybook:build
touch ./storybook-static/.nojekyll
echo "formio.tsed.dev" > ./storybook-static/CNAME
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./storybook-static

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test/*.js.map
lib
dist
build
.out
storybook-static
/docs/api
/docs/api/**/*.md

Expand Down
36 changes: 36 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type {StorybookConfig} from "@storybook/react-vite";

const config: StorybookConfig = {
staticDirs: ["../packages/tailwind/build"],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

The Tailwind build directory path needs to be updated

The current path ../packages/tailwind/build in .storybook/main.ts is incorrect. Based on the package.json scripts and build configuration:

  • The Tailwind package has a tailwind:build script that outputs to build/tailwind.css
  • However, this build directory is relative to the package's root at packages/tailwind/
  • The current path in Storybook config uses ../packages/tailwind/build which won't resolve correctly

The path should be updated to:

  • ./packages/tailwind/build (relative to the project root)
🔗 Analysis chain

Verify the Tailwind build output path

Please ensure the static directory path ../packages/tailwind/build exists and contains the required Tailwind CSS build output.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the Tailwind build directory exists
fd -t d "tailwind/build$" packages/

Length of output: 37


Script:

#!/bin/bash
# Let's check if the tailwind package and its build directory structure exists
fd "tailwind" packages/

# Also check for any potential build or dist directories that might contain Tailwind output
fd "build|dist" packages/

# Let's also look for package.json files in tailwind-related directories to understand the build setup
fd "package.json" packages/ -x grep -l "tailwind" {}

Length of output: 1586


Script:

#!/bin/bash
# Let's check the package.json in the tailwind package to understand the build process
cat packages/tailwind/package.json

# Also check if there are any build scripts or configurations
cat packages/tailwind/build-colors.js

# Check the tailwind config file
cat packages/tailwind/tailwind.config.js

Length of output: 8755


stories: [
"../stories/Getting-started.mdx",
"../stories/**/*.mdx",
"../packages/{tailwind-formio,react-formio}/src/**/*.mdx",
"../packages/{tailwind-formio,react-formio}/src/**/*.stories.@(js|jsx|ts|tsx)",
"../packages/{tailwind-formio,react-formio}/src/**/*.story.@(js|jsx|ts|tsx)"
],

addons: [
"@storybook/addon-a11y",
"@storybook/addon-links",
"@storybook/addon-interactions",
"@storybook/addon-essentials",
"@storybook/addon-mdx-gfm",
"@storybook/addon-links",
"@storybook/addon-interactions",
"@chromatic-com/storybook"
],
Comment on lines +14 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove duplicate addons to avoid potential conflicts.
@storybook/addon-links and @storybook/addon-interactions both appear twice (lines 16 & 20, 17 & 21). Consider removing duplicates to prevent confusion.

  addons: [
    "@storybook/addon-a11y",
    "@storybook/addon-links",
    "@storybook/addon-interactions",
    "@storybook/addon-essentials",
    "@storybook/addon-mdx-gfm",
-   "@storybook/addon-links",
-   "@storybook/addon-interactions",
    "@chromatic-com/storybook"
  ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
addons: [
"@storybook/addon-a11y",
"@storybook/addon-links",
"@storybook/addon-interactions",
"@storybook/addon-essentials",
"@storybook/addon-mdx-gfm",
"@storybook/addon-links",
"@storybook/addon-interactions",
"@chromatic-com/storybook"
],
addons: [
"@storybook/addon-a11y",
"@storybook/addon-links",
"@storybook/addon-interactions",
"@storybook/addon-essentials",
"@storybook/addon-mdx-gfm",
"@chromatic-com/storybook"
],


framework: {
name: "@storybook/react-vite",
options: {}
},

docs: {},
typescript: {
reactDocgen: "react-docgen-typescript"
}
};

export default config;
File renamed without changes.
6 changes: 6 additions & 0 deletions .storybook/styles/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "tailwind.css";
@import "fonts/index.css";
@import "typography.css";
@import "../../node_modules/formiojs/dist/formio.full.css";
@import "../../packages/tailwind-formio/styles/index.css";

6 changes: 6 additions & 0 deletions chromatic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"onlyChanged": true,
"projectId": "Project:676abc3ef2ee519da9b21fb6",
"storybookBaseDir": "packages/storybook",
"zip": true
}
File renamed without changes.
4 changes: 0 additions & 4 deletions lint-staged.config.js

This file was deleted.

Loading
Loading