Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove husky, add commitlint action, remove prettier, update n…
Browse files Browse the repository at this point in the history
…ode version in actions
edodusi committed Nov 13, 2024
1 parent ca537d9 commit e9618b3
Showing 14 changed files with 1,359 additions and 4,349 deletions.
20 changes: 10 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -5,23 +5,23 @@

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
- package-ecosystem: pip
directory: /
schedule:
interval: "daily"
interval: daily
# Raise pull requests for version updates
# to pip against the `develop` branch
target-branch: "fix/update-package-json-INT-122"
target-branch: fix/update-package-json-INT-122
# Labels on pull requests for version updates only
labels:
- "pip dependencies"
- pip dependencies

- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: npm
directory: /
schedule:
interval: "weekly"
interval: weekly
# Check for npm updates on Sundays
day: "sunday"
day: sunday
# Labels on pull requests for security and version updates
labels:
- "npm dependencies"
- npm dependencies
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -6,23 +6,28 @@ on:
pull_request:
branches: [main]

env:
PNPM_CACHE_FOLDER: .pnpm-store
HUSKY: 0 # Bypass husky commit hook for CI

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [20]
environment: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js 18
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- run: pnpm run lint
- run: pnpm run prettier . --check

- run: pnpm run build
- name: Build
- run: pnpm build
36 changes: 36 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on: [push, pull_request]

jobs:
commitlint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install required dependencies
run: |
apt update
apt install -y sudo
sudo apt install -y git curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run linters
on: [push]
env:
PNPM_CACHE_FOLDER: .pnpm-store
HUSKY: 0 # Bypass husky commit hook for CI
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run Lint
run: pnpm run lint
10 changes: 4 additions & 6 deletions .github/workflows/pkg.pr.new.yml
Original file line number Diff line number Diff line change
@@ -5,28 +5,26 @@ on:
- '**'
tags:
- '!**'

env:
PNPM_CACHE_FOLDER: .pnpm-store
HUSKY: 0 # Bypass husky commit hook for CI

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout code
uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
6 changes: 1 addition & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Release CI

# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

on:
push:
branches: [main, next, beta]
@@ -29,4 +25,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release@22.0.12
run: npx semantic-release@24.2.0
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -8,17 +8,20 @@ env:
jobs:
test:
name: Tests
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: [20]
environment: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js 18
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import { storyblokLintConfig } from '@storyblok/eslint-config';

export default storyblokLintConfig({
rules: {
// @TODO: remove all of them after fixing and proper testing in v7
'@typescript-eslint/no-this-alias': 'off',
'ts/no-this-alias': 'off',
'no-async-promise-executor': 'off',
19 changes: 0 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -49,7 +49,6 @@
],
"scripts": {
"lint": "eslint --max-warnings=0 './src/**/*.{ts,js}'",
"prettier": "prettier . --write",
"build": "node vite.build.mjs && tsc",
"demo": "vite serve playground",
"dev:umd": "npx serve ./",
@@ -60,8 +59,6 @@
"prepare": "npm run build"
},
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@storyblok/eslint-config": "^0.3.0",
"@tsconfig/recommended": "^1.0.8",
"@typescript-eslint/eslint-plugin": "^8.14.0",
@@ -70,7 +67,6 @@
"@vitest/ui": "^2.1.4",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.6",
"isomorphic-fetch": "^3.0.0",
"kolorist": "^1.8.0",
"prettier": "^3.3.3",
@@ -96,24 +92,9 @@
"publishConfig": {
"access": "public"
},
"lint-staged": {
"*.{js,jsx,css,ts,tsx}": [
"prettier --write",
"eslint"
],
"*.md": [
"prettier --write"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"prettier": {
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
}
Loading

0 comments on commit e9618b3

Please sign in to comment.