Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ updates:
patterns:
- 'eslint'
- 'eslint-*'
- '@eslint/*'
typescript:
patterns:
- 'typescript'
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: 'npm'

- name: Install dependencies
run: yarn --immutable
run: npm ci

- name: Run tests with coverage
run: yarn test:coverage
run: npm run test:coverage

- name: Run node server side tests
run: yarn test:serverside
run: npm run test:serverside

run-checks:
runs-on: ubuntu-latest
Expand All @@ -48,19 +48,19 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'yarn'
cache: 'npm'

# The yarn cache is not node_modules
# The npm cache is not node_modules
- name: Install dependencies
run: yarn --immutable
run: npm ci

- name: Lint code
run: yarn lint
run: npm run lint

- name: Check format
run: yarn format:check
run: npm run format:check

- name: Run Danger JS
run: yarn danger ci --failOnErrors
run: npx danger ci --failOnErrors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'yarn'
cache: 'npm'

- name: Deploy 🚀
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
with:
install_command: yarn install
build_command: yarn build-storybook
install_command: npm ci
build_command: npm run build-storybook
path: storybook-static
checkout: false
8 changes: 4 additions & 4 deletions .github/workflows/happo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'yarn'
cache: 'npm'

- name: Install dependencies
run: yarn --immutable
run: npm ci

- name: Build Storybook
run: yarn build-storybook
run: npm run build-storybook

- name: Happo
run: yarn happo-ci
run: npm run happo-ci
env:
HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }}
HAPPO_API_SECRET: ${{ secrets.HAPPO_API_SECRET }}
18 changes: 9 additions & 9 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'yarn'
# The yarn cache is not node_modules
cache: 'npm'

# The npm cache is not node_modules
- name: Install Dependencies
run: yarn add --cached
run: npm ci

- name: Run tests
run: yarn test
run: npm test

- name: Package library
# https://v3.yarnpkg.com/cli/pack
run: yarn pack --out trussworks-react-uswds-v%v.tgz
# https://docs.npmjs.com/cli/commands/npm-pack
run: npm pack

- name: Upload package
uses: actions/upload-artifact@v4
with:
path: trussworks-react-uswds-v*.*.*.tgz
path: trussworks-react-uswds-*.tgz
if-no-files-found: error
retention-days: 5
44 changes: 22 additions & 22 deletions .github/workflows/publish-next.yml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action only runs when code lands on main. Additionally, it's been broken for some time. There's an open issue for that here: #3324

Just for visibility, I won't invest any effort in making it work or triaging a failure in that pipeline after this PR until picking that issues up.

Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

# Setup .npmrc file to publish to GitHub Packages
- name: Set up node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
registry-url: 'https://npm.pkg.github.com'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir='.yarn/cache'" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

# The yarn cache is not node_modules
- name: Install dependencies
run: yarn add --cached

# Setup .npmrc file to publish to GitHub Packages
- name: Set up node
uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
node-version-file: '.node-version'
run: npm ci

# npm has no equivalent of yarn's --tolerate-republish, so skip
# publishing when this version already exists in the registry
- name: Check if version is already published
id: version-check
run: |
VERSION=$(node -p "require('./package.json').version")
if npm view "@trussworks/react-uswds@${VERSION}" version --registry=https://npm.pkg.github.com > /dev/null 2>&1; then
echo "Version ${VERSION} is already published, skipping"
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Publish to GitHub Packages
- run: yarn npm publish --tag next --tolerate-republish
- name: Publish to GitHub Packages
if: steps.version-check.outputs.exists == 'false'
run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 1 addition & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
doctor-storybook.log

# Runtime data
Expand Down Expand Up @@ -73,18 +71,7 @@ storybook-static/

# Output of 'npm pack'

\*.tgz

# Yarn

.yarn-integrity
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
*.tgz

# dotenv environment variables file

Expand Down
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

875 changes: 0 additions & 875 deletions .yarn/releases/yarn-3.8.7.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarnrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ src/stories/ @trussworks/react-uswds-design-owners
*.stories.tsx @trussworks/react-uswds-design-owners
.storybook/ @trussworks/react-uswds-design-owners

# Owners for PRs that change ONLY package.json and/or yarn.lock
# Owners for PRs that change ONLY package.json and/or package-lock.json

package.json
yarn.lock
package-lock.json
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# @trussworks/react-uswds

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-44-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![npm version](https://img.shields.io/npm/v/@trussworks/react-uswds)](https://www.npmjs.com/package/@trussworks/react-uswds)
Expand Down Expand Up @@ -35,16 +37,16 @@ A deployed instance of the ReactUSWDS Storybook is located at: [https://trusswor

## Install

Install this package with npm or yarn:
Install this package with npm:

```
yarn add @trussworks/react-uswds
npm i @trussworks/react-uswds
```

or
or with the package manager of your choice, e.g. yarn:

```
npm i @trussworks/react-uswds
yarn add @trussworks/react-uswds
```

## Peer Dependencies
Expand Down Expand Up @@ -144,7 +146,7 @@ This repository is governed by the [Contributor Covenant](./CODE_OF_CONDUCT.md)

### Quick links:

- [Yarn scripts](./docs/contributing.md#available-commands)
- [npm scripts](./docs/contributing.md#available-commands)
- [PR commit guidelines](./docs/contributing.md#opening--merging-pull-requests)
- [Adding new components](./docs/adding_new_components.md)
- [Testing in an application](./docs/contributing.md#testing-in-an-application)
Expand Down
Loading
Loading