Skip to content

Commit a648f4c

Browse files
committed
chore: use pnpm and github actions
1 parent 014eb3e commit a648f4c

20 files changed

Lines changed: 7643 additions & 8249 deletions
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

‎.github/ISSUE_TEMPLATE/feature_request.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

‎.github/pull_request_template.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Thank you for contributing to @dash-ui/unitless
2+
3+
## Before submitting
4+
5+
Read the [CONTRIBUTING.md](../CONTRIBUTING.md) file and confirm that you're following
6+
all of the guidelines
7+
8+
> ⚠️ Please do not create a Pull Request without creating an issue first.
9+
> **Any change needs to be discussed before proceeding.** Failure to do so may result
10+
> in the rejection of the pull request.
11+
12+
## Please provide enough information so that others can review your pull request
13+
14+
- What does this implement/fix? Explain your changes.
15+
- Does this close any currently open issues?
16+
17+
## Testing
18+
19+
Confirm that your pull request contains tests and that all existing tests pass.
20+
21+
## Closing issues
22+
23+
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).

‎.github/workflows/release.yml‎

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
- alpha
9+
pull_request:
10+
branches:
11+
- main
12+
- next
13+
- alpha
14+
15+
jobs:
16+
release:
17+
name: 🚀 Release
18+
if: "!contains(github.event.head_commit.message, '[skip ci]') && !startsWith(github.event.head_commit.message, 'chore:') && !startsWith(github.event.head_commit.message, 'style:') && !contains(github.event.pull_request.title, '[skip ci]') && !startsWith(github.event.pull_request.title, 'chore:') && !startsWith(github.event.pull_request.title, 'style:') && !startsWith(github.event.head_commit.message, 'chore(') && !startsWith(github.event.head_commit.message, 'style(') && !startsWith(github.event.pull_request.title, 'chore(') && !startsWith(github.event.pull_request.title, 'style(')"
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
node-version: [16.x]
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
with:
27+
fetch-depth: 0
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v2.0.1
30+
with:
31+
version: 6.14.3
32+
- name: Setup Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
- name: Cache node_modules
37+
id: cache-node-modules
38+
uses: actions/cache@v2
39+
with:
40+
path: node_modules
41+
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
- name: Install
43+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
44+
run: pnpm install --reporter=silent
45+
- name: ✅ Check types
46+
run: pnpm check-types
47+
- name: 🧹 Lint
48+
run: pnpm lint -- --quiet
49+
- name: 🧪 Test
50+
run: pnpm test -- --coverage --silent
51+
- name: Publish tests to Codecov
52+
if: always()
53+
uses: codecov/codecov-action@v2
54+
with:
55+
files: coverage/clover.xml
56+
verbose: false
57+
fail_ci_if_error: false
58+
- name: Build
59+
if: "github.event_name == 'push'"
60+
run: pnpm build
61+
- name: Stage changes
62+
if: "github.event_name == 'push'"
63+
run: git add .
64+
- name: 🚀 Release
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
68+
run: pnpx -y semantic-release

‎.husky/commit-msg‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm commitlint --edit $1

‎.husky/pre-commit‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm lint-staged

‎.travis.yml‎

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

‎CODE_OF_CONDUCT.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

‎CONTRIBUTING.md‎

100644100755
Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
# Contributing to Dash
1+
# Contributing to @dash-ui/unitless
22

33
To contribute to this project, first:
44

55
1. [Fork this repo to your account](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo)
6-
2. ```sh
7-
# Create a directory for Dash if you don't already have one
8-
mkdir dash-ui
9-
cd dash-ui
10-
# Clone your forked repo
11-
git clone https://github.com/[your-username]/unitless.git
12-
# Install the repo using Yarn
13-
cd unitless
14-
yarn install
6+
2. [Clone this repo](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) to your local machine
7+
3. ```sh
8+
# Install the repo using pnpm
9+
cd [repo-name]
10+
pnpm install
1511
# Start dev mode
16-
yarn dev
12+
pnpm dev
1713
```
1814

1915
## Before you contribute
@@ -29,7 +25,7 @@ Before your PR will be considered I will look for:
2925

3026
- **Documentation** Please submit updates to the docs when public-facing APIs are changed.
3127
- **Tests** Your PR will not be accepted if it doesn't have well-designed tests. Additionally, make sure
32-
that you run `yarn validate` before you submit your PR and make sure your PR passes the linting rules,
28+
that you run `pnpm validate` before you submit your PR and make sure your PR passes the linting rules,
3329
type checking, and tests that already exist.
3430
- **Types** Your types should be as strong as possible.
3531
- **Comments** If your PR implements non-obvious logic, I fully expect you to explain the rationale in
@@ -38,7 +34,7 @@ Before your PR will be considered I will look for:
3834

3935
## Development
4036

41-
Here's what you need to know to start developing Dash.
37+
Here's what you need to know to start developing `@dash-ui/unitless`.
4238

4339
### Package scripts
4440

@@ -62,30 +58,21 @@ Formats all of the applicable source files with prettier
6258

6359
Runs `eslint` on the package source
6460

65-
#### `prerelease`
66-
67-
Runs before the package is published. This calls `validate` and `build` scripts.
68-
69-
#### `release`
70-
71-
Starts a release using `standard-version`. This must be run before `npm publish`.
72-
7361
#### `test`
7462

7563
Tests the package with `jest`
7664

7765
#### `validate`
7866

79-
Runs `check-types`, `lint`, and `test` scripts. This is used in CI and
80-
in `prerelease`.
67+
Runs `check-types`, `lint`, and `test` scripts.
8168

8269
---
8370

8471
### Husky hooks
8572

8673
#### `pre-commit`
8774

88-
Runs `lint-staged` and the `build-types` script
75+
Runs `lint-staged` script
8976

9077
#### `commit-msg`
9178

‎README.md‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
<hr>
2-
<br/>
32
<img src='https://github.com/dash-ui/styles/raw/master/assets/logo.png'/>
43
<blockquote>
54
An object containing CSS properties that don't accept values with units.
65
This is a fork of <code>@emotion/unitless</code> because they don't have TypeScript types
76
over yonder and that has been a real pain point.
87
</blockquote>
98
<pre>npm i @dash-ui/unitless</pre>
10-
<br/>
11-
9+
10+
<p>
1211
<a href="https://bundlephobia.com/result?p=@dash-ui/unitless">
1312
<img alt="Bundlephobia" src="https://img.shields.io/bundlephobia/minzip/@dash-ui/unitless?style=for-the-badge&labelColor=24292e">
1413
</a>
1514
<a aria-label="Types" href="https://www.npmjs.com/package/@dash-ui/unitless">
1615
<img alt="Types" src="https://img.shields.io/npm/types/@dash-ui/unitless?style=for-the-badge&labelColor=24292e">
1716
</a>
18-
<a aria-label="Build status" href="https://travis-ci.com/dash-ui/unitless">
19-
<img alt="Build status" src="https://img.shields.io/travis/com/dash-ui/unitless?style=for-the-badge&labelColor=24292e">
17+
<a aria-label="Code coverage report" href="https://codecov.io/gh/dash-ui/unitless">
18+
<img alt="Code coverage" src="https://img.shields.io/codecov/c/gh/dash-ui/unitless?style=for-the-badge&labelColor=24292e">
19+
</a>
20+
<a aria-label="Build status" href="https://github.com/dash-ui/unitless/actions/workflows/release.yml">
21+
<img alt="Build status" src="https://img.shields.io/github/workflow/status/dash-ui/unitless/release/main?style=for-the-badge&labelColor=24292e">
2022
</a>
2123
<a aria-label="NPM version" href="https://www.npmjs.com/package/@dash-ui/unitless">
2224
<img alt="NPM Version" src="https://img.shields.io/npm/v/@dash-ui/unitless?style=for-the-badge&labelColor=24292e">
2325
</a>
2426
<a aria-label="License" href="https://jaredlunde.mit-license.org/">
2527
<img alt="MIT License" src="https://img.shields.io/npm/l/@dash-ui/unitless?style=for-the-badge&labelColor=24292e">
2628
</a>
27-
<hr>
29+
</p>
30+
31+
---
2832

2933
## Quick start
3034

3135
```js
32-
import unitless from '@dash-ui/unitless'
36+
import unitless from "@dash-ui/unitless";
3337

34-
unitless.boxFlex === 1 // true
35-
unitless.padding === 1 // false
38+
unitless.boxFlex === 1; // true
39+
unitless.padding === 1; // false
3640
```
3741

38-
## API
39-
4042
## LICENSE
4143

4244
MIT

0 commit comments

Comments
 (0)