Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
8 changes: 5 additions & 3 deletions .github/workflows/backstop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
jobs:
backstop-tests:
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 60

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
Expand All @@ -22,7 +24,7 @@ jobs:
run: yarn install --frozen-lockfile

- name: Build packages
run: lerna run build
run: yarn build

- name: Start Storybook
run: yarn storybook -p 6006 &
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/lint_staged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,30 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16' # or the version you're using
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: |
npm install
run: yarn install --frozen-lockfile

- name: Lint staged files
- name: Lint changed files
run: |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=AM | grep -E '\.(js|jsx|ts|tsx)$' || true)
CHANGED_FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }}...HEAD | grep -E '\.(js|jsx|ts|tsx)$' || true)

if [ -n "$STAGED_FILES" ]; then
npx eslint $STAGED_FILES
if [ -n "$CHANGED_FILES" ]; then
npx eslint $CHANGED_FILES
else
echo "No staged files to lint."
echo "No changed files to lint."
fi
13 changes: 6 additions & 7 deletions .github/workflows/reject_scss_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ on:
jobs:
check-scss-files:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Fetch base branch
run: git fetch origin ${{ github.event.pull_request.base.ref }}
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for new .scss files in the PR
run: |
# Get the list of changed files in the PR
added_files=$(git diff --diff-filter=A --name-only origin/${{ github.event.pull_request.base.ref }} ${{ github.sha }})
added_files=$(git diff --diff-filter=A --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.sha }})

# Check if any .scss files are present
if echo "$added_files" | grep -q '\.scss$'; then
echo "Error: PR contains newly added .scss files."
exit 1
Expand Down
95 changes: 42 additions & 53 deletions .github/workflows/storybook-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,42 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Storybook Deploy

on:
push:
branches: ['test']

jobs:
build:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max-old-space-size=6144

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- run: npx yarn install
- run: npm install -g storybook
- run: npx lerna run build
- run: npm run predeploy
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./.storybook_build

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

name: Storybook Deploy

on:
push:
branches: ['test']

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
NODE_OPTIONS: --max-old-space-size=6144

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn predeploy
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./.storybook_build

deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .github/workflows/stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
stylelint:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
Expand All @@ -17,6 +19,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
jobs:
storybook-tests:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
Expand All @@ -23,7 +25,7 @@ jobs:
run: yarn install --frozen-lockfile

- name: Build Packages
run: lerna run build
run: yarn build

- name: Install Playwright with dependencies
run: npx playwright install chromium --with-deps
Expand Down
45 changes: 22 additions & 23 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Unit Test CI

on:
pull_request:
branches: ['dev']

jobs:
unit-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'
- run: yarn install --production=false
- run: lerna run build
- run: npm run test --workspaces
name: Unit Test CI

on:
pull_request:
branches: ["dev"]

jobs:
unit-tests:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "yarn"
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test-unit
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"@faker-js/faker": "^8.4.1",
"@nx/devkit": "17.3.2",
"@rollup/plugin-dsv": "^3.0.2",
"@storybook/addon-a11y": "^10.1.11",
"@storybook/addon-docs": "^10.1.11",
"@storybook/addon-links": "^10.1.11",
"@storybook/addon-vitest": "^10.1.11",
"@storybook/builder-vite": "^10.1.11",
"@storybook/react-vite": "^10.1.11",
"@storybook/addon-a11y": "^10.3.3",
"@storybook/addon-docs": "^10.3.3",
"@storybook/addon-links": "^10.3.3",
"@storybook/addon-vitest": "^10.3.3",
"@storybook/builder-vite": "^10.3.3",
"@storybook/react-vite": "^10.3.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.6.1",
Expand Down Expand Up @@ -58,11 +58,11 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^10.1.11",
"eslint-plugin-storybook": "^10.3.3",
"gh-pages": "^5.0.0",
"html-react-parser": "^5.2.3",
"husky": "^8.0.0",
"jsdom": "^22.1.0",
"jsdom": "^24.0.0",
"knip": "^5.81.0",
"lerna": "8.2.4",
"lint-staged": "^15.5.1",
Expand All @@ -86,7 +86,7 @@
"resize-observer-polyfill": "^1.5.1",
"rollup-plugin-node-externals": "^6.1.2",
"sass": "^1.89.2",
"storybook": "^10.1.11",
"storybook": "^10.3.3",
"storybook-addon-fetch-mock": "^2.0.1",
"stylelint": "^17.3.0",
"stylelint-order": "^7.0.1",
Expand All @@ -110,7 +110,7 @@
},
"private": true,
"resolutions": {
"storybook": "10.1.11",
"storybook": "10.3.3",
"esbuild": "^0.25.0",
"jackspeak": "^2.3.6",
"js-yaml": "^4.1.1",
Expand All @@ -120,7 +120,10 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.59.0",
"tar": "^7.5.11"
"tar": "^7.5.11",
"flatted": ">=3.4.2",
"effect": ">=3.20.0",
"handlebars": ">=4.7.9"
},
"scripts": {
"backstop:approve": "backstop approve",
Expand Down
2 changes: 1 addition & 1 deletion packages/map/topojson-updater/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Node script to convert shapefile data from census.gov to topojson, and format/op


Usage
1. Run yarn install at root folder
1. Run "yarn install" inside the packages/map/topojson-updater folder (this package is not part of the root Yarn workspace)
2. Download shapefiles from census.gov (https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.html) for the year that needs to be supported to the "shapefiles" folder of the project
- Always choose the options with the smallest file size
- Shapefiles for both states and counties should be downloaded for each year being added
Expand Down
Loading
Loading