-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: update misc snapshots * ci: add test:ci script for quiet console output * build(files): update package.json * ci: add github actions Pull: runs build, lint, test, Release: runs above, then releases via semantic-release * docs: rename doc dir -> docs * chore(deps): add semantic release * refactor(workflows): miscellaneous edits * chore(deps): use node v20.6.1 * chore(directories): move cli to top level * chore(deps): add commitizen add commitizen, add conventional changelog adapter * fix(components): update miscellaneous styles per stylelint * chore(deps): add and configure husky and lint-staged * docs(contributing): move -> docs/ * chore(husky): add pre-push hook to run tests * refactor(tools): move tools src -> ./ * feat(config): export tailwind config with library * fix(lint): update linting config * chore: misc updates to package scripts * docs(readme,contributing): update miscellaneous docs document new scripts and build process * fix(build): use quiet test script in pre-push hook * fix(ci): update workflow actions use checkout@v4, fetch depth 0 for lint script
- Loading branch information
1 parent
cd1380f
commit 8ef8774
Showing
32 changed files
with
23,282 additions
and
8,829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,3 @@ node_modules | |
dist | ||
|
||
*.config.* | ||
cli | ||
bin | ||
# TODO: remove bin and cli once they are converted to TS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel previous | ||
uses: styfle/cancel-workflow-action@0.11.0 | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- name: Install deps 🧶 | ||
run: npm ci | ||
|
||
|
||
lint: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- run: npm ci | ||
- name: Lint commit messages 🗂️ | ||
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
- name: Lint TS and CSS 🎨 | ||
run: npm run lint | ||
|
||
test: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- run: npm ci | ||
- name: Run tests 📋 | ||
run: npm run test:ci | ||
|
||
build: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- run: npm ci | ||
- name: Build lib 👷♂️ | ||
run: npm run build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
id-token: write | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel previous | ||
uses: styfle/cancel-workflow-action@0.11.0 | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
- name: Install deps 🧶 | ||
run: npm ci | ||
|
||
release: | ||
name: Release | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
cache: 'npm' | ||
|
||
- name: Install deps 🧶 | ||
run: npm ci | ||
|
||
- name: Lint TS and CSS 🎨 | ||
run: npm run lint | ||
|
||
- name: Lint commit messages 🗂️ | ||
run: npx commitlint --from HEAD~1 --to HEAD | ||
|
||
- name: Run tests 📋 | ||
run: npm run test:ci | ||
|
||
- name: Build lib 👷♂️ | ||
run: npm run build | ||
|
||
- name: Release 🚀🚀🚀 | ||
run: npm exec semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env sh | ||
[ -n "$CI" ] && exit 0 | ||
|
||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit ${1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env sh | ||
[ -n "$CI" ] && exit 0 | ||
|
||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm exec lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"*.{js,jsx,ts,tsx,vue}": [ | ||
"eslint src --ext .ts ." | ||
], | ||
"*.{css,vue}": [ | ||
"stylelint 'src/**/*.{css,vue}'" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"css.validate": false | ||
"css.validate": false, | ||
"eslint.validate": ["typescript", "javascript", "vue"], | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {extends: ['@commitlint/config-conventional']}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Imports | ||
import * as tailwindConfig from '../tailwind.config'; | ||
|
||
// Exports | ||
export { tailwindConfig }; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Contributing | ||
|
||
## Tech Stack | ||
|
||
This is a `Vue` component library. It is built using `Vue3` and the `composition` API with TypeScript. Styles are created using `TailwindCSS`. The library is built using `Vite`. For testing, we use `Vitest`, for linting `eslint`, for formatting `prettier`. Conventional commits are enforced using `commitizen`, and publishing is done automatically via `semantic-release`. | ||
Some helpful resources and reading: | ||
|
||
[Commitizen](https://commitizen-tools.github.io/commitizen/) | ||
[Semantic Release](https://semantic-release.gitbook.io/semantic-release/) | ||
[Tailwind](https://tailwindui.com/documentation) | ||
[TypeScript](https://www.typescriptlang.org/docs/) | ||
[Vite](https://vitejs.dev/guide/) | ||
[Vitest](https://vitest.dev/guide/) | ||
[Vue Testing Handbook](https://lmiller1990.github.io/vue-testing-handbook/v3/) | ||
[Vue.js](https://vuejs.org/guide/introduction.html) | ||
[Vuelidate](https://vuelidate.js.org/) | ||
|
||
### Etiquette | ||
|
||
Head to [\#outreach](https://discord.com/channels/828274060034965575/853442226034442260/) in our [Discord](https://discord.gg/vKhDv7nC8B) if you'd like to collect feedback from the wider group. | ||
|
||
Test your changes **locally first**, if possible. Include **screenshots with your PR** if you're changing something visual. | ||
|
||
### Setup | ||
|
||
1. [Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository). | ||
2. Install `node@v20.6.1` (Recommended to [use `nvm` to manage `node` versions](https://github.com/nvm-sh/nvm)) | ||
3. `cd` into the project directory `cd design-system` and install dependencies `npm i` | ||
|
||
### Workflow | ||
1. Create a branch prefixed with the appropriate action (e.g. `feature/add-dropdown-component`, `fix/button-border-styles`). | ||
2. Make your changes. | ||
3. Commit your changes, using `npm run _commit` (this calls `commitizen`, which guides you through creating a conventional commit).* | ||
|
||
|
||
* [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) are strictly enforced. It is generally best to use `npm run _commit` or `cz`, if you have `commitizen` installed globally. Even if you commit using `git commit`, this repository uses `husky` to lint commit messages. If you must skip the pre-commit hook (useful for `git commit --amend`, etc.) you can pass `no-verify` to `git commit`. But we check commit messages again on pull request, so please make sure they are formatted according to the convention. | ||
#### A few examples | ||
``` | ||
# example 1 | ||
feat: Button | ||
# example 2 | ||
fix(Button): update border styles | ||
Bug in post-css causing.... | ||
BREAKING CHANGE | ||
# example 3 | ||
docs(README): add button documentation | ||
Document component API | ||
``` | ||
|
||
### Why all this humbuggery about conventional commits? | ||
Because we use `semantic-release` to auto-generate releases, `CHANGELOG` entries, etc., based on conventional commits, all commits need to follow the convention. | ||
|
||
### Testing and verifying changes | ||
To test the package locally: | ||
|
||
1. Run `npm link` from the root of the project directory. | ||
2. `cd` into the local directory of the app you want to test importing into, then run `npm link pdap-design-system` | ||
3. This will create a symlink between your local directories, allowing you to test changes in real time without actually publish to the `npm` registry. | ||
4. To test publishing, squash merge your local feature/fix/whatever branch into `main`. Then from `main` run `npm exec semantic-release --dry-run`. Then revert the squash merge commit. | ||
|
||
The `lint`, `test`, and `build` scripts are all required to pass before pull requests can be merged. The `lint` scripts are run against all staged files, and you can run `test:changed` to verify test suites against all local changes (staged and unstaged) before committing. You can run `build` locally as well, if you want to verify that it will pass before pushing changes. |
File renamed without changes.
Oops, something went wrong.