Skip to content

Commit

Permalink
chore: repository cleanup (#80)
Browse files Browse the repository at this point in the history
* chore: repository cleanup

* chore(vscode): remove github-markdown-preview

* chore: final touches

* ci(integration): remove ci cache

* ci(labelssync): naming
  • Loading branch information
RealShadowNova authored May 4, 2022
1 parent 55a98a7 commit fbccee6
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 402 deletions.
7 changes: 7 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [2, "always", ["chore", "ci", "docs", "feat", "fix", "perf", "refactor", "style", "test"]],
"footer-leading-blank": [2, "always"]
}
}
2 changes: 2 additions & 0 deletions .github/workflows/auto-deprecate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3
with:
node-version: 16
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Deprecate Versions
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,43 @@ on:
prNumber:
description: The number of the PR that is being deployed
required: true
ref:
description: The branch that is being deployed. Should be a branch on the given repository
branch:
description: The branch that is being deployed.
required: false
default: main
push:
branches:
- main

jobs:
Publish:
name: Publish Next to npm
publish:
name: Publish Next to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.ref || 'main' }}
- name: Add TypeScript problem matcher
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Add TypeScript Problem Matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js 16
- name: Use Node.js v16
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3
with:
node-version: 16
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Bump Version & Publish
run: |
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events.
echo -e "\n# Resolve the tag to be used. \"next\" for push events, \"pr-{prNumber}\" for dispatch events."
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'next' || echo 'pr-${{ github.event.inputs.prNumber }}')
echo -e "\n# Bump the version"
yarn standard-version --skip.commit --skip.tag --prerelease "${TAG}.$(git rev-parse --verify --shot HEAD)"
echo -e "\n# Publish to NPM"
npm publish --tag ${TAG}
yarn release --tag ${TAG}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
43 changes: 15 additions & 28 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,30 @@ on:
push:
branches:
- main
- stable
pull_request:

jobs:
Linting:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Add problem matcher
- name: Add ESLint Problem Matcher
run: echo "::add-matcher::.github/problemMatchers/eslint.json"
- name: Use Node.js v16
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3
with:
node-version: 16
- name: Restore CI Cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3
id: cache-restore
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies if Cache Miss
if: ${{ !steps.cache-restore.outputs.cache-hit }}
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Run ESLint
run: yarn lint --fix=false

Testing:
testing:
name: Unit Tests
runs-on: ubuntu-latest
steps:
Expand All @@ -41,37 +37,28 @@ jobs:
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3
with:
node-version: 16
- name: Restore CI Cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3
id: cache-restore
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies if Cache Miss
if: ${{ !steps.cache-restore.outputs.cache-hit }}
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Run tests
run: yarn test --coverage

Building:
building:
name: Compile Source Code
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Add problem matcher
- name: Add TypeScript Problem Matcher
run: echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js v16
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3
with:
node-version: 16
- name: Restore CI Cache
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # tag=v3
id: cache-restore
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies if Cache Miss
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
if: ${{ !steps.cache-restore.outputs.cache-hit }}
run: yarn --immutable
- name: Build Code
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/deprecate-on-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: NPM Deprecate PR On Merge

on:
pull_request:
types:
- closed

jobs:
deprecate-on-merge:
name: NPM Deprecate PR On Merge
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node.js v16
uses: actions/setup-node@56337c425554a6be30cdef71bf441f15be286854 # tag=v3
with:
node-version: 16
cache: yarn
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: yarn --immutable
- name: Deprecate versions
run: yarn npm-deprecate --name "*pr-${PR_NUMBER}*" -d -v
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
2 changes: 1 addition & 1 deletion .github/workflows/labelssync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

jobs:
label_sync:
label-sync:
name: Automatic Label Synchronization
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
"source.organizeImports": true
},
"files.eol": "\n",
"typescript.tsdk": "node_modules\\typescript\\lib",
"cSpell.maxNumberOfProblems": 8,
"cSpell.numSuggestions": 24,
"cSpell.words": ["joshdb", "Évelyne", "Lachance", "Hendry", "typedoc", "realware", "commitlint", "favware", "tsbuildinfo", "middlewares"]
"typescript.tsdk": "node_modules\\typescript\\lib"
}
11 changes: 2 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
},
"scripts": {
"clean": "rimraf dist node_modules/.cache",
"docs": "typedoc",
"lint": "eslint src tests --ext ts --fix",
"format": "prettier --write \"{src,tests}/**/*.ts\"",
"test": "jest",
"update": "yarn upgrade-interactive",
"build": "rollup -c rollup.bundle.ts",
"watch": "tsc -b src -w",
"release": "npm publish",
"prepublishOnly": "rollup-type-bundler",
"prepare": "husky install"
},
Expand Down Expand Up @@ -65,9 +65,7 @@
"standard-version": "^9.3.2",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"typedoc": "^0.22.15",
"typescript": "^4.6.4",
"vite": "^2.9.6"
"typescript": "^4.6.4"
},
"repository": {
"type": "git",
Expand All @@ -94,11 +92,6 @@
"@commitlint/config-conventional"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"lint-staged": {
"*.ts": "eslint --fix --ext ts"
},
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"importHelpers": true,
"noEmitHelpers": true,
"target": "ES2021",
"module": "ESNext",
"types": ["vite/client", "jest"]
"module": "ESNext"
}
}
5 changes: 0 additions & 5 deletions typedoc.json

This file was deleted.

Loading

0 comments on commit fbccee6

Please sign in to comment.