Skip to content

Commit a492e23

Browse files
Merge pull request #42 from yousifalraheem/chore/cleanup
Code cleanup
2 parents b2e9d17 + 921edf5 commit a492e23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+24602
-13406
lines changed

.commitlintrc.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
};

.github/workflows/node.js.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/npm-publish.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
1+
# Release workflow powered by semantic-release.
2+
# Only publishes when conventional commits since last release warrant a release.
33

4-
name: Node.js Package
4+
name: Release
55

66
on:
7-
release:
8-
types: [created]
97
push:
108
branches: [ "main" ]
9+
workflow_dispatch:
1110

1211
jobs:
13-
publish-npm:
12+
release:
1413
runs-on: ubuntu-latest
1514
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-node@v3
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/setup-node@v4
1819
with:
1920
node-version: 18
2021
registry-url: https://registry.npmjs.org/
21-
- run: yarn install
22-
- run: yarn install:ci
22+
- name: Enable Corepack (Yarn 4)
23+
run: corepack enable
24+
- run: yarn install --immutable
2325
- run: yarn tsc
2426
- run: yarn build
25-
- run: npm publish
27+
- name: Run semantic-release
28+
run: yarn release
2629
env:
27-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/verify.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Verify workflow runs on PRs to validate build and tests, and preview release outcome in dry-run.
2+
name: Verify
3+
4+
on:
5+
pull_request:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
verify:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [18.x]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: Enable Corepack (Yarn 4)
22+
run: corepack enable
23+
- run: yarn install --immutable
24+
- run: yarn tsc
25+
- run: yarn build
26+
- run: yarn test:ci

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,13 @@ dist-types
2020

2121
# run
2222
/run
23+
24+
# Yarn files
25+
.pnp.*
26+
.yarn/*
27+
!.yarn/patches
28+
!.yarn/plugins
29+
!.yarn/releases
30+
!.yarn/sdks
31+
!.yarn/versions
32+
.yarn-integrity

.husky/commit-msg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# Lint commit message using commitlint (conventional commits)
5+
yarn commitlint --edit "$1"

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
yarn lint && yarn tsc
4+
yarn format:staged && yarn lint && yarn tsc

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Build and dependencies
2+
dist-types
3+
dist
4+
node_modules
5+
coverage
6+
7+
# Configs
8+
.github
9+
.vscode
10+
.idea
11+
.codacy
12+
.husky
13+
.yarn

.releaserc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/npm",
8+
{
9+
"npmPublish": true
10+
}
11+
],
12+
[
13+
"@semantic-release/github",
14+
{
15+
"assets": [
16+
{"path": "dist", "label": "Distribution"}
17+
]
18+
}
19+
]
20+
]
21+
}

.yarn/releases/yarn-4.10.3.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)