Skip to content

Commit

Permalink
feat: add storybook (#2)
Browse files Browse the repository at this point in the history
* feat: ✅  add in storybook initialization

* feat: 💚 add in bundlewatch

* chore: ♻️  refactor it to use different directory

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* feat: ✅ add in testing

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ⬆️  fix lock file

* chore: 📈  fix bundlewatch code

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 💚 swap out yarn for npm

* fix: 💚 chromatic workflow

* chore: 💚 update commands

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ✅ fix storybook

* feat: 💚 fix some typos and organization with workflows

* feat: 📝 update storybook configuration

* chore: 🔧  update vite configuration

* fix: ✅ failing test, add more

* feat: ♻️  swap out for new task based demo

* feat: ➕ add in mock service worker

* feat: ✅ add in cypress

* chore: 🍱 add in fonts and icons

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 🐛issues with mocking

* fix: 🐛the whle build was busted

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* feat: ✅  add in cypress support

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🎨  update typos/format

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ♻️  modularize

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🔧 abstract configs out to root files

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* feat: 💚 add in lint action

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* feat: 👷 update build system

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 linting tool

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚  more fixes on build

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 more linting on actions

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 revert back to original

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 super linter

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix 💚 disable css linter

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 messing with paths

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 action

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 one more fix

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 incorrect env var

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 enable missing env var

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 all workflows need to be at root

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 fix runner.os

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 syntax errors in actions

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 an attempt to fix the errors

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 one more attempt

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 move bundlewatch back in

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 more on bundlewatch

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 overhaul entire ci build

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🚨 fix linting

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 editorconfig and a11y tests

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🚨 lint editorconfig

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🚨 fix editorconfig

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 labeler

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 comment out the fix linting system

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 add permissions

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 remove incorrect permissions

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 elevate the token

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 move token to correct location

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: fix linting issues

Signed-off-by: super-linter <super-linter@super-linter.dev>

* chore: 📝 update to add some links

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 💄 update some style suggestions

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: fix linting issues

Signed-off-by: super-linter <super-linter@super-linter.dev>

* fix: 💚 update dependencies to handle editorconfig

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: 🚨 issues with prettier

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ⬆️  update deps

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ➕ update deps

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ⬆️  more updates

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* fix: 💚 linting with labeler

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

* chore: ⬆️  update to use new holocron configs

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>

---------

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Signed-off-by: super-linter <super-linter@super-linter.dev>
Co-authored-by: iamnewton <iamnewton@users.noreply.github.com>
  • Loading branch information
iamnewton and iamnewton authored Oct 23, 2024
1 parent 82fd2e2 commit 77229d6
Show file tree
Hide file tree
Showing 63 changed files with 23,876 additions and 14,552 deletions.
7 changes: 6 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": ["@changesets/changelog-github", {"repo": "theholocron/configs"}],
"changelog": [
"@changesets/changelog-github",
{
"repo": "theholocron/configs"
}
],
"commit": false,
"updateInternalDependencies": "patch"
}
23 changes: 23 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"Version": "v3.0.3",
"Verbose": false,
"Format": "",
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [
"^LICENSE$",
"^public/.*"
],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"IndentSize": false,
"MaxLineLength": false
}
}
20 changes: 20 additions & 0 deletions .editorconfig-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Version": "v3.0.3",
"Verbose": false,
"Format": "",
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": ["^LICENSE$", "^public/.*"],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"IndentSize": false,
"MaxLineLength": false
}
}
26 changes: 16 additions & 10 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Add 'docs' label to any changes within 'docs' folder or any subfolders
# Add 'docs' label to any change to .md files within the entire repository
# Add "docs" label to any changes within "docs" folder or any subfolders
# Add "docs" label to any change to .md files within the entire repository
documentation:
- changed-files:
- any-glob-to-any-file:
- docs/**
- '**/*.md'
- changed-files:
- any-glob-to-any-file:
- docs/**
- "**/*.md"

# Add 'bug' label to any PR where the head branch name starts with `fix` or has a `fix` section in the name
# Add "bug" label to any PR where the head branch name starts with `fix` or has a `fix` section in the name
bug:
- head-branch: ['^fix', 'fix']
- head-branch:
- "^fix-"

# Add 'enhancement' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
# Add "enhancement" label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
enhancement:
- head-branch: ['^feat', 'feature']
- head-branch:
- "^feat-"

# Add "release" label to any PR that is opened against the `main` branch
release:
- base-branch: "main"
28 changes: 16 additions & 12 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@ name: Audit

on:
pull_request:
types: [synchronize, opened]
types:
- synchronize
- opened

jobs:
bundlewatch:
bundle-size:
name: "Audit the bundle size"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
name: Setup Node.js @v20
with:
cache: npm
node-version: 20.x
cache: "npm"

- name: Install dependencies
run: npm ci
- run: npm ci
name: Install dependencies

- name: Bundlewatch
uses: jackyef/bundlewatch-gh-action@0.3.0
- uses: jackyef/bundlewatch-gh-action@0.3.0
name: Analyze using BundleWatch
with:
build-script: npm run build
bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
bundlewatch-config: ./node_modules/@theholocron/bundlewatch-config/bundlewatch.config.js
43 changes: 23 additions & 20 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
name: Greetings

on: [pull_request, issues]
on:
- pull_request
- issues

jobs:
greeting:
name: Greet new interactions
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: >
Hey @${{ github.event.issue.user.login }}!
We really appreciate you taking the time to report an issue. The
collaborators on this project attempt to help as many people as
possible, but we are a limited number of volunteers, so it is
possible that this will not be addressed as swiftly.
- uses: actions/first-interaction@v1
with:
issue-message: >
Hey @${{ github.event.issue.user.login }}!
We really appreciate you taking the time to report an issue. The
collaborators on this project attempt to help as many people as
possible, but we are a limited number of volunteers, so it is
possible that this will not be addressed as swiftly.
Your patience is much appreciated and we will get back to you as
quickly as possible.
pr-message: >
Hey @${{ github.event.issue.user.login }}!
We really appreciate you taking the time to help out with this PR.
The collaborators on this project attempt to help as many people as
possible, but we are a limited number of volunteers, so it is
possible that this will not be addressed as swiftly.
Your patience is much appreciated and we will get back to you as
quickly as possible.
pr-message: >
Hey @${{ github.event.issue.user.login }}!
We really appreciate you taking the time to help out with this PR.
The collaborators on this project attempt to help as many people as
possible, but we are a limited number of volunteers, so it is
possible that this will not be addressed as swiftly.
Your patience is much appreciated and we will get back to you as
quickly as possible.
Your patience is much appreciated and we will get back to you as
quickly as possible.
repo-token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Labeler
name: Label

on: [pull_request_target]
on:
- pull_request_target

jobs:
label:
runs-on: ubuntu-latest
name: Label Pull Requests
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
sync-labels: true
repo-token: "${{ secrets.GITHUB_TOKEN }}"
92 changes: 92 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Lint

on:
- push
- pull_request

permissions:
contents: read

jobs:
super-lint:
name: "Lint entire codebase"
permissions:
contents: write # write linting fixes
statuses: write # write Super-linter status checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}

- uses: actions/setup-node@v4
name: Setup Node.js @v20
with:
cache: npm
node-version: 20.x

- run: npm ci
name: Install dependencies

- uses: super-linter/super-linter/slim@v7.1.0
name: Run Super Linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
LINTER_RULES_PATH: /
CSS_FILE_NAME: "stylelint.config.js"
EDITORCONFIG_FILE_NAME: ".editorconfig-checker.json"
FIX_CSS_PRETTIER: true
FIX_ENV: true
FIX_GRAPHQL_PRETTIER: true
FIX_HTML_PRETTIER: true
FIX_JAVASCRIPT_PRETTIER: true
# FIX_JSON_PRETTIER: true => turning this off til i figure out why its not respecting config
FIX_JSX_PRETTIER: true
FIX_MARKDOWN_PRETTIER: true
FIX_TSX: true
FIX_TYPESCRIPT_PRETTIER: true
# FIX_YAML_PRETTIER: true => turning this off til i figure out why its not respecting config
# GITHUB_ACTIONS_CONFIG_FILE: "actionlint.yml"
# GITLEAKS_CONFIG: ".gitleaks.toml" # Path to your Gitleaks config if you have one
JAVASCRIPT_ES_CONFIG_FILE: "eslint.config.js"
# MARKDOWN_CONFIG_FILE: ".markdown-lint.yml"
# NATURAL_LANGUAGE_CONFIG_FILE: "textlintrc.js"
PRETTIER_CONFIG: "prettier.config.js"
TYPESCRIPT_ES_CONFIG_FILE: "eslint.config.js"
TYPESCRIPT_STANDARD_TSCONFIG_FILE: "tsconfig.json"
VALIDATE_CSS_PRETTIER: true
VALIDATE_DOCKERFILE: true
VALIDATE_EDITORCONFIG: true
VALIDATE_ENV: true
VALIDATE_GIT_COMMITLINT: true
VALIDATE_GIT_MERGE_CONFLICT_MARKERS: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GITLEAKS: true
VALIDATE_GRAPHQL_PRETTIER: true
VALIDATE_HTML_PRETTIER: true
VALIDATE_JAVASCRIPT_PRETTIER: true
VALIDATE_JSON_PRETTIER: true
VALIDATE_JSX_PRETTIER: true
VALIDATE_MARKDOWN_PRETTIER: true
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_TSX: true
VALIDATE_TYPESCRIPT_PRETTIER: true
VALIDATE_YAML_PRETTIER: true

- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit and push linting fixes
# Run only on:
# - Pull requests
# - Not on the default branch
if: >
github.event_name == 'pull_request' &&
github.ref_name != github.event.repository.default_branch
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "chore: fix linting issues"
commit_options: "--no-verify --signoff"
commit_user_name: super-linter
commit_user_email: super-linter@super-linter.dev
47 changes: 28 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
name: "Version, Release, & Publish"
name: Release

on:
push:
branches: ["main"]
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
npm:
name: Publish to NPM
permissions:
contents: write # to create release
issues: write # to post issue comments
pull-requests: write # to create pull request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Publish to NPM
uses: changesets/action@v1
- uses: changesets/action@v1
name: Create a Changeset PR
with:
title: "chore(release): 🦋 version packages"
commit: "chore(release): 🦋 version packages"
version: npx changeset version
publish: npx changeset publish
title: "chore(release): 🦋 version packages"
version: npx changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

github-pages:
name: Publish Storybook to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
id: deploy-github-pages
name: Publish Storybook to GitHub Pages
with:
build_command: npm run build:storybook
install_command: npm ci
path: storybook-static
environment:
name: github-pages
url: ${{ steps.deploy-github-pages.outputs.page_url }}
Loading

0 comments on commit 77229d6

Please sign in to comment.