Skip to content
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
100 changes: 100 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"root": true,
"env": {
"node": true,
"es2022": true
},
"parserOptions": {
"sourceType": "module"
},
"extends": "eslint:recommended",
"rules": {
"brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
"func-call-spacing": ["warn", "never"],
"indent": ["warn", "tab", { "ignoredNodes": ["TemplateLiteral *"], "SwitchCase": 1 }],
"linebreak-style": ["warn", "unix"],
"no-console": ["warn", { "allow": ["warn", "error"] }],
"quotes": ["warn", "double"],
"semi": ["warn", "always"],
"space-before-blocks": ["warn", "always"]
},
"overrides": [
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"extends": ["plugin:jsonc/recommended-with-jsonc"],
},
{
"files": ["package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"jsonc/sort-keys": [
"warn",
{
"pathPattern": "^$",
"order": [
"$schema",
"private",
"name",
"version",
"description",
"license",
"author",
"maintainers",
"contributors",
"homepage",
"repository",
"bugs",
"type",
"exports",
"main",
"module",
"browser",
"man",
"preferGlobal",
"bin",
"files",
"directories",
"scripts",
"config",
"sideEffects",
"types",
"typings",
"workspaces",
"resolutions",
"dependencies",
"bundleDependencies",
"bundledDependencies",
"peerDependencies",
"peerDependenciesMeta",
"optionalDependencies",
"devDependencies",
"keywords",
"engines",
"engineStrict",
"os",
"cpu",
"publishConfig"
]
},
{
"pathPattern": "^repository$",
"order": ["type", "url", "directory"]
},
{
"pathPattern": "^spectrum$",
"order": { "type": "asc" }
},
{
"pathPattern": "^exports$",
"order": ["."]
},
{
"pathPattern": ".*",
"order": { "type": "asc" }
}
]
}
}
]
}
32 changes: 0 additions & 32 deletions .github/dependabot.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"baseBranchPatterns": ["main"],
"extends": [
"config:recommended",
":widenPeerDependencies",
"group:githubArtifactActions"
],
"labels": [],
"packageRules": [
{
"matchDatasources": ["npm"],
"minimumReleaseAge": "1 month"
},
{
"groupName": "commitlint ecosystem",
"matchPackageNames": ["commitlint", "@commitlint/*"]
}
],
"rebaseWhen": "behind-base-branch",
"reviewers": ["castastrophe"],
"lockFileMaintenance": {
"enabled": true,
"extends": ["schedule:monthly"]
}
}
25 changes: 23 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,33 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false

- name: Enable Corepack
run: corepack enable

- uses: actions/setup-node@v6
with:
node-version: 20
node-version: 22
cache: yarn
registry-url: https://registry.npmjs.org
- run: yarn install --frozen-lockfile

## --- YARN CACHE --- ##
- name: Check for cached dependencies
continue-on-error: true
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
.cache/yarn
node_modules
key: ubuntu-latest-node22-${{ hashFiles('yarn.lock') }}

## --- INSTALL --- ##
# If statement isn't needed here b/c yarn will leverage the cache if it exists
- name: Install dependencies
shell: bash
run: yarn install --immutable

- name: Semantic release
uses: cycjimmy/semantic-release-action@v5
env:
Expand Down
108 changes: 104 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v5

- name: Enable Corepack
run: corepack enable

- name: Use Node LTS version
uses: actions/setup-node@v6
with:
cache: yarn
node-version: 20
node-version: 22

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

- name: Run test suite
run: yarn test

Expand All @@ -27,12 +33,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Enable Corepack
run: corepack enable

- uses: actions/setup-node@v6
with:
cache: yarn
node-version: 20
node-version: 22

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

- name: Run coverage report
run: yarn coverage
- uses: actions/upload-artifact@v5
Expand All @@ -53,3 +65,91 @@ jobs:
path: code-coverage-results.md
- name: Write to job summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

# --- Lint pre-compiled assets for consistency --- #
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Check out code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Enable Corepack
run: corepack enable

- name: Use Node LTS version
uses: actions/setup-node@v6
with:
node-version: 22
cache: yarn

## --- YARN CACHE --- ##
- name: Check for cached dependencies
continue-on-error: true
id: cache-dependencies
uses: actions/cache@v4
with:
path: |
.cache/yarn
node_modules
key: ubuntu-latest-node22-${{ hashFiles('yarn.lock') }}

## --- INSTALL --- ##
# If statement isn't needed here b/c yarn will leverage the cache if it exists
- name: Install dependencies
shell: bash
run: yarn install --immutable

- name: Get changed files
id: changed-files
uses: step-security/changed-files@v46
with:
files_yaml: |
eslint:
- '*.js'
mdlint:
- '*.md'
- '!expected/**'
- '!fixtures/**'

- name: Run eslint
uses: reviewdog/action-eslint@v1.34.0
if: ${{ steps.changed-files.outputs.eslint_added_files != '' || steps.changed-files.outputs.eslint_modified_files != '' }}
with:
fail_level: error
level: error
reporter: github-pr-review
filter_mode: diff_context
# eslint_flags: "components/*/stories/*.js"
eslint_flags: "--config ${{ github.workspace }}/.eslintrc ${{ steps.changed-files.outputs.eslint_added_files }} ${{ steps.changed-files.outputs.eslint_modified_files }}"

- name: Run markdownlint on documentation
uses: reviewdog/action-markdownlint@v0.26.2
if: ${{ steps.changed-files.outputs.mdlint_added_files != '' || steps.changed-files.outputs.mdlint_modified_files != '' }}
with:
reporter: github-pr-review
filter_mode: diff_context
fail_level: error
markdownlint_flags: "--config ${{ github.workspace }}/.markdownlint.json ${{ steps.changed-files.outputs.mdlint_added_files }} ${{ steps.changed-files.outputs.mdlint_modified_files }}"

- name: Run lint
run: yarn lint --fix

# This step will evaluate the repo status and report the change
# If there are changes, capture the changes and upload them as an artifact
- name: Check if there are changes
shell: bash
run: |
if [[ -z $(git status --porcelain) ]]; then
echo "No changes detected"
exit 0
else
echo "Changes detected"
git status
git add .
exit 1
fi
Loading