Skip to content

Commit

Permalink
Merge pull request #32 from uswds/jm/gh-action-formatting
Browse files Browse the repository at this point in the history
USWDS-Next - CI: Create a GH action to test code formatting
  • Loading branch information
heymatthenry committed Jul 22, 2024
2 parents e3d1721 + a9f24f1 commit 1cc3b3a
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 22 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code formatting
on: push
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run prettier JavaScript
run: "npm run prettier:js"
- name: Run prettier Markdown
run: "npm run prettier:md"
3 changes: 2 additions & 1 deletion .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: "18.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install playwright
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package.json
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
13 changes: 7 additions & 6 deletions .storybook/UswdsTheme.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { create } from '@storybook/theming/create';
import { create } from "@storybook/theming/create";

export default create({
base: 'light',
base: "light",
brandTitle: "USWDS Next",
fontBase: '"Public Sans Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
colorPrimary: '#4a77b4',
colorSecondary: '#2672de',
textColor: '#1b1b1b',
fontBase:
'"Public Sans Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
colorPrimary: "#4a77b4",
colorSecondary: "#2672de",
textColor: "#1b1b1b",
});
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config = {
"@storybook/addon-links",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-a11y"
"@storybook/addon-a11y",
],
framework: {
name: "@storybook/web-components-vite",
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# USWDS.next (aka Screaming Eagle 🦅)

> [!CAUTION]
> Work on the next version of the Design System will happen in this repo. At the moment, any code in here is exploratory only, and in an extremely pre-alpha stage. APIs *will* change.
> Work on the next version of the Design System will happen in this repo. At the moment, any code in here is exploratory only, and in an extremely pre-alpha stage. APIs _will_ change.
Over the course of the next several months (and beyond), we will incrementally build the next version of the Design System. This version will introduce [Web Component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)-based implementations of Design System elements. We intend that, as we ship new components and new versions of existing components, you will be able to use them alongside older versions of USWDS.

Over the course of the next several months (and beyond), we will incrementally build the next version of the Design System. This version will introduce [Web Component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)-based implmentations of Design System elements. We intend that, as we ship new components and new versions of existing components, you will be able to use them alongside older versions of USWDS.

* [More on our decision to use Web Components](https://github.com/uswds/uswds-proposals/blob/main/decisions/0001-use-web-components.md)
- [More on our decision to use Web Components](https://github.com/uswds/uswds-proposals/blob/main/decisions/0001-use-web-components.md)

## Guiding Principles

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"dev": "vite",
"prettier:js": "npx prettier --check './src/components/**/*.js'",
"prettier:js:fix": "npx prettier --write './src/components/**/*.js'",
"prettier:md": "npx prettier --check '**/*.{md,mdx}'",
"prettier:md:fix": "npx prettier --write '**/*.{md,mdx}'",
"start": "npm run storybook",
"storybook:build": "storybook build",
"storybook": "storybook dev -p 8008",
Expand Down
2 changes: 1 addition & 1 deletion storybook/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Readme from "../README.md?raw";

<Meta title="README" />

<Markdown>{ Readme }</Markdown>
<Markdown>{Readme}</Markdown>
20 changes: 11 additions & 9 deletions storybook/welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ npm run start
title="Base"
subtitle="Grayscale colors"
colors={{
White: '#FFFFFF',
"Longer custom text": '#F3F3F3',
Black: "#000"
White: "#FFFFFF",
"Longer custom text": "#F3F3F3",
Black: "#000",
}}
/>
</ColorPalette>
Expand All @@ -47,13 +47,14 @@ npm run start

export const typography = {
type: {
primary: 'Public Sans Web, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol',
primary:
"Public Sans Web, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol",
},
weight: {
regular: '400',
bold: '700',
extrabold: '800',
black: '900',
regular: "400",
bold: "700",
extrabold: "800",
black: "900",
},
size: {
xs1: 13,
Expand All @@ -68,7 +69,8 @@ export const typography = {
},
};

export const SampleText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
export const SampleText =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.";

**Font:** Public Sans Web

Expand Down

0 comments on commit 1cc3b3a

Please sign in to comment.