Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: miscellaneous updates #56

Merged
merged 2 commits into from Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/build.yaml
@@ -0,0 +1,37 @@
name: Build

on:
push:
branches:
- main

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

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
47 changes: 47 additions & 0 deletions .github/workflows/coverage.yaml
@@ -0,0 +1,47 @@
name: Coverage

on:
push:
branches: [ main ]

jobs:
coverage-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
- name: Install deps 🧶
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test:badge

# Only run the coverage once
- name: Get Coverage for badge
run: |
SUMMARY="$(npm run test:badge | tail -2 | head -1)"
TOKENS=($SUMMARY)
echo "COVERAGE=$(echo ${TOKENS[2]})" >> $GITHUB_ENV

REF=${{ github.ref }}
echo "github.ref: $REF"
IFS='/' read -ra PATHS <<< "$REF"
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
echo $BRANCH_NAME
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV

- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.0.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: f3a173e87a763056b73438f503680993
filename: pdap-design-system__${{ env.BRANCH }}.json
label: Test Coverage
message: ${{ env.COVERAGE }}
color: green
namedLogo: vitest
style: for-the-badge
7 changes: 5 additions & 2 deletions .vscode/extensions.json
@@ -1,3 +1,6 @@
{
"recommendations": ["tailwind.tailwindcss", "vue.volar", "vue.vscode-typescript-vue-plugin"]
}
"recommendations": [
"tailwind.tailwindcss",
"vue.volar"
]
}
22 changes: 2 additions & 20 deletions README.md
Expand Up @@ -2,8 +2,8 @@
_A `Vue` component library, styling system, and image asset repository for PDAP-branded client apps._

[![Current npm release](https://img.shields.io/npm/v/pdap-design-system?style=for-the-badge)](https://www.npmjs.com/package/pdap-design-system)
![Build status](./badges/build.svg)
![Test coverage](./badges/coverage.svg)
![Build status](https://img.shields.io/github/actions/workflow/status/Police-Data-Accessibility-Project/design-system/build.yaml?branch=main&style=for-the-badge)
![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/joshuagraber/f3a173e87a763056b73438f503680993/raw/c849e80481d329e6a4176699d52b7ad70d12d829/pdap-design-system__heads_main.json)
![License](https://img.shields.io/github/license/Police-Data-Accessibility-Project/design-system.svg?style=for-the-badge&color=green)


Expand Down Expand Up @@ -88,24 +88,6 @@ Or, if you need them all, you can import all images at the app level. Just remem
import `pdap-design-system/images`;
```

### Using the CLI to copy assets to your local project directory

If you want either styles or images copied to a local directory, you can do so from the root directory of your project.

Assets can be copied using the `pdap-design-system` command line method exposed by this package.

One of the following arguments is required:
`--copy-assets`: Copies all images and styles.
`--copy-images`: Copies all images.
`--copy-styles`: Copies all styles.

The following argument is optional:
`--to={path}`: Path to directory where assets should be copied. Defaults to `assets`

```
pdap-design-system --copy-images --to=image-assets
```

## Development Setup

1. Clone the repo
Expand Down
1 change: 0 additions & 1 deletion badges/build.svg

This file was deleted.

1 change: 0 additions & 1 deletion badges/coverage.svg

This file was deleted.

28 changes: 0 additions & 28 deletions bin/pdap-design-system-cli.js

This file was deleted.

45 changes: 0 additions & 45 deletions cli/index.js

This file was deleted.