Skip to content

Commit

Permalink
Merge branch 'main' into unchecked_value_for_check_box
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Sep 30, 2022
2 parents 1fce54d + c71f026 commit c481da1
Show file tree
Hide file tree
Showing 191 changed files with 66,993 additions and 23,670 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", {"repo": "primer/view_components"}],
"commit": false,
"commit": true,
"fixed": [],
"linked": [],
"access": "public",
Expand Down
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l
ARG BUNDLER_VERSION=2.2.11
RUN gem install bundler:${BUNDLER_VERSION} solargraph

# Install yarn
RUN npm install -g yarn

# Install chrome
RUN curl --silent --show-error --location --fail --retry 3 --output /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& (sudo dpkg -i /tmp/google-chrome-stable_current_amd64.deb || sudo apt-get -fy install) \
Expand Down
36 changes: 36 additions & 0 deletions .erb-linters/reporters/github_reporter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

require "erb_lint/reporters/compact_reporter"

module ERBLint
module Reporters
# :nodoc:
class GithubReporter < CompactReporter
def preview; end

def show
processed_files.each do |filename, offenses|
offenses.each do |offense|
puts format_offense(filename, offense)
end
end
end

private

def format_offense(filename, offense)
[
"::error ",
[
"file=#{filename}",
"line=#{offense.line_number}",
"col=#{offense.column}"
].join(","),
"::",
"#{offense.linter.class.simple_name}: ",
offense.message.to_s
].join
end
end
end
end
9 changes: 9 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
css:
- app/components/**/*.pcss

ruby:
- app/components/**/*.rb
- app/components/**/*.erb

javascript:
- app/components/**/*.ts
25 changes: 25 additions & 0 deletions .github/workflows/check-for-changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check for changeset

on:
pull_request:
types:
# On by default if you specify no types.
- "opened"
- "reopened"
- "synchronize"
# For `skip-label` only.
- "labeled"
- "unlabeled"

jobs:
check-for-changeset:
name: Check for changeset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Check for changeset"
uses: brettcannon/check-for-changed-files@v1
with:
file-pattern: ".changeset/*.md"
skip-label: "skip changelog"
failure-message: "No changeset found. If these changes should not result in a new version, apply the ${skip-label} label to this pull request. If these changes should result in a version bump, please add a changeset https://git.io/J6QvQ"
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
key: gems-build-rails-${{ matrix.rails_version }}-ruby-${{ matrix.ruby_version }}-${{ hashFiles('**/Gemfile.lock') }}
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- run: |
yarn
cd demo && yarn
npm i
cd demo && npm i
- name: Build and test with Rake
run: |
gem install bundler:2.2.9
Expand Down Expand Up @@ -112,10 +112,10 @@ jobs:
ruby-version: 2.7.x
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- run: |
yarn
cd demo && yarn
npm i
cd demo && npm i
- name: Build and test with Rake
run: |
gem install bundler:2.2.9
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
ruby-version: 2.7.x
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn
node-version: 16
- run: npm i
- uses: actions/cache@v2
with:
path: vendor/bundle
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/docs-preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
node-version: 16
cache: 'npm'
cache-dependency-path: |
yarn.lock
docs/yarn.lock
package-lock.json
docs/package-lock.json
- uses: actions/cache@v2
with:
path: vendor/bundle
key: gems-deploy-preview-${{ hashFiles('**/Gemfile.lock') }}

- name: Install dependencies
run: yarn && cd docs && yarn && cd ..
run: npm i && cd docs && npm i && cd ..

- name: Generate static files
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
bundle exec rake static:dump
- name: Build
run: yarn build:docs:preview
run: npm run build:docs:preview

- name: Archive build output
run: 'tar --dereference --directory docs/public -cvf artifact.tar .'
Expand All @@ -73,6 +73,6 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: paper-spa/deploy-pages@main
uses: actions/deploy-pages@v1
with:
preview: true
14 changes: 7 additions & 7 deletions .github/workflows/docs-production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
node-version: 16
cache: 'npm'
cache-dependency-path: |
yarn.lock
docs/yarn.lock
package-lock.json
docs/package-lock.json
- name: Cache dependencies
uses: actions/cache@v2
Expand All @@ -42,7 +42,7 @@ jobs:
${{ runner.os }}-node-
- name: Install dependencies
run: yarn && cd docs && yarn && cd ..
run: npm i && cd docs && npm i && cd ..

- name: Generate static files
run: |
Expand All @@ -54,7 +54,7 @@ jobs:
bundle exec rake static:dump
- name: Build
run: yarn build:docs
run: npm run build:docs

- name: Archive build output
run: 'tar --dereference --directory docs/public -cvf artifact.tar .'
Expand All @@ -75,6 +75,6 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: paper-spa/deploy-pages@main
uses: actions/deploy-pages@v1
with:
preview: false
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
sync-labels: true
repo-token: "${{ secrets.GITHUB_TOKEN }}"
17 changes: 9 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: xt0rted/markdownlint-problem-matcher@v1
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 16
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-main-${{ hashFiles('yarn.lock') }}
key: node-modules-main-${{ hashFiles('package-lock.json') }}
- name: Get specific changed files
id: changed-files
uses: tj-actions/[email protected]
Expand All @@ -30,8 +31,8 @@ jobs:
- name: Lint with Markdownlint
if: steps.changed-files.outputs.any_changed == 'true'
run: |
yarn
yarn markdownlint ${{ steps.changed-files.outputs.all_changed_files }}
npm i
npx markdownlint ${{ steps.changed-files.outputs.all_changed_files }}
rubocop:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec rubocop ${{ steps.changed-files.outputs.all_changed_files }}
bundle exec rubocop ${{ steps.changed-files.outputs.all_changed_files }} --format github
erblint:
runs-on: ubuntu-latest
Expand All @@ -86,7 +87,7 @@ jobs:
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec erblint ${{ steps.changed-files.outputs.all_changed_files }}
bundle exec erblint ${{ steps.changed-files.outputs.all_changed_files }} --format github
eslint:
runs-on: ubuntu-latest
Expand All @@ -99,7 +100,7 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-main-${{ hashFiles('yarn.lock') }}
key: node-modules-main-${{ hashFiles('package-lock.json') }}
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
Expand All @@ -109,5 +110,5 @@ jobs:
- name: Lint with ESLint
if: steps.changed-files.outputs.any_changed == 'true'
run: |
yarn
yarn eslint --quiet ${{ steps.changed-files.outputs.all_changed_files }}
npm i
npx eslint --quiet ${{ steps.changed-files.outputs.all_changed_files }}
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
release:
types: [published]
name: Publish primer_view_components and @primer/view-components
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: "3.1.x"
- name: Bundle install
run: |
gem install bundler:2.2.9
bundle config path vendor/bundle
bundle install
- name: Create .gem credentials
run: |
mkdir -p $HOME/.gem
cat << EOF > $HOME/.gem/credentials
---
:rubygems_api_key: ${RUBYGEMS_TOKEN}
EOF
chmod 0600 $HOME/.gem/credentials
env:
RUBYGEMS_TOKEN: ${{ secrets.RUBYGEMS_TOKEN_SHARED }}
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Create .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
- name: NPM install
run: |
npm i
- name: Publish Gem
run: bundle exec rake release
- name: Publish NPM
run: npm publish --access public
2 changes: 1 addition & 1 deletion .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: ${{ github.repository == 'primer/view_components' }}
uses: primer/.github/.github/workflows/release_canary.yml@main
with:
install: yarn
install: npm i
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:

- name: Install dependencies
run: |
yarn
npm i
bundle install
- name: Create release pull request or publish to npm
id: changesets
uses: changesets/action@master
with:
title: Release Tracking
version: yarn changeset:version
version: npm run changeset:version
publish: script/changeset-publish
env:
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Generated from yarn prepare
# Generated from npm prepare
app/components/**/*.js
app/components/**/*.d.ts
app/assets/

# Generated by demo yarn post-install
demo/app/assets/stylesheets/primer*
# Generated by demo npm post-install
demo/app/assets/stylesheets/prim*

# Generated by lib/tasks/docs.rake
/.yardoc
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"explorer.fileNesting.patterns": {
"*.rb": "${basename}.rb, ${basename}.html.erb, ${basename}.ts, ${basename}.pcss"
}
}
Loading

0 comments on commit c481da1

Please sign in to comment.