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

feat(ui): add ui-components package #7223

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
54bd537
feat(ui): add `ui-components` package
avivkeller Nov 14, 2024
52a15c7
fixup! feat(ui): add `ui-components` package
avivkeller Nov 20, 2024
74eb402
Blog: v23.3.0 release post (#7268)
RafaelGSS Nov 20, 2024
f00963a
fix(cache): remove cache rules from fetch() (#7270)
avivkeller Nov 21, 2024
d80d08b
content(blog/events): Dublin collab summit 2024 (#7215)
AugustinMauroy Nov 22, 2024
21c810b
fix: align mdx (#7276)
ovflowd Nov 23, 2024
03eac35
meta: bump @heroicons/react from 2.1.5 to 2.2.0 (#7265)
dependabot[bot] Nov 23, 2024
e27ef77
meta: bump prettier-plugin-tailwindcss from 0.6.8 to 0.6.9 in the tai…
dependabot[bot] Nov 23, 2024
35848ba
meta: bump husky from 9.1.6 to 9.1.7 (#7264)
dependabot[bot] Nov 23, 2024
792ffbd
meta: bump @vercel/analytics from 1.4.0 to 1.4.1 in the next-js group…
dependabot[bot] Nov 23, 2024
dc2a7fa
meta: bump the lint group with 4 updates (#7256)
dependabot[bot] Nov 23, 2024
f5b35d1
meta: bump @radix-ui/react-tooltip from 1.1.3 to 1.1.4 (#7263)
dependabot[bot] Nov 23, 2024
1183b5c
meta: bump the storybook group with 6 updates (#7259)
dependabot[bot] Nov 23, 2024
029b167
chore: simplified storybook/next config (#7280)
ovflowd Nov 24, 2024
abe9879
meta: upgrade to node v22 (#7282)
ovflowd Nov 25, 2024
6768f01
meta: skip lighthouse CI when no vercel preview detected (#7266)
avivkeller Nov 27, 2024
43c4e03
fix: markdown link fix
ovflowd Nov 28, 2024
8fb835e
refactor(downloadreleasestable): added module version back to the rel…
benhalverson Nov 29, 2024
ee18dac
hotfix: only one og (#7291)
ovflowd Nov 29, 2024
5912ea8
feat(AvatarGroup): update overflow (#7273)
AugustinMauroy Nov 29, 2024
df34c95
hotfix: turbo config for i18n
ovflowd Nov 29, 2024
4496a58
meta: bump the lint group with 4 updates (#7298)
dependabot[bot] Dec 3, 2024
3770c7c
meta: bump prettier from 3.3.3 to 3.4.1 (#7305)
dependabot[bot] Dec 3, 2024
2e3d952
Blog: v22.12.0 release post (#7308)
ruyadorno Dec 3, 2024
7daf03d
meta: bump next-intl from 3.25.1 to 3.25.3 in the next-js group (#7300)
dependabot[bot] Dec 3, 2024
6379c41
meta: bump actions/dependency-review-action from 4.4.0 to 4.5.0 (#7297)
dependabot[bot] Dec 3, 2024
1eaf074
meta: bump the storybook group with 6 updates (#7299)
dependabot[bot] Dec 4, 2024
9aa4755
Add contribute link to navbar (#7274)
bmuenzenmeyer Dec 4, 2024
2355672
meta: bump turbo from 2.3.0 to 2.3.3 (#7304)
dependabot[bot] Dec 4, 2024
98ccf4e
meta: bump shiki from 1.23.1 to 1.24.0 (#7306)
dependabot[bot] Dec 4, 2024
0cc7474
meta: bump @types/node from 22.9.3 to 22.10.1 (#7303)
dependabot[bot] Dec 4, 2024
539d34c
feat(banner): add cyber week (#7311)
AugustinMauroy Dec 5, 2024
72bd044
meta: bump typescript from 5.6.3 to 5.7.2 (#7302)
dependabot[bot] Dec 5, 2024
a82caf7
Automated, scheduled crowdin sync (#7272)
bmuenzenmeyer Dec 5, 2024
b2ade80
hotfix: fix typos, trigger crowdin sync
bmuenzenmeyer Dec 5, 2024
64b5076
hotfix: add preserve_hierarchy to crowdin
bmuenzenmeyer Dec 5, 2024
05bd5b2
hotfix: trigger crowdin one more time
bmuenzenmeyer Dec 5, 2024
00ed3f4
fix: include npm audit reference link (#7309)
RafaelGSS Dec 5, 2024
b5561c0
meta: add security-wg as owners of security practices (#7310)
RafaelGSS Dec 6, 2024
b0500ea
hotfix: allow a workflow to trigger another workflow
bmuenzenmeyer Dec 6, 2024
73e32e4
hotfix: remove ci-skip
bmuenzenmeyer Dec 6, 2024
f17fc09
hotfix: provide proper context to workflow
bmuenzenmeyer Dec 6, 2024
2c51413
hotfix: don't warn on workflow_run events
bmuenzenmeyer Dec 6, 2024
0e15440
hotfix: move i18n formatting to sync workflow
bmuenzenmeyer Dec 7, 2024
b3374ca
hotfix: crowdin action needs the config
bmuenzenmeyer Dec 7, 2024
d16f7e1
hotfix: wat on completion of first job
bmuenzenmeyer Dec 7, 2024
1a89ed8
hotfix: assign job output
bmuenzenmeyer Dec 7, 2024
d67de56
hotfix: reference job correctly
bmuenzenmeyer Dec 7, 2024
d58ae81
hotfix: specify branch name
bmuenzenmeyer Dec 7, 2024
e3ba05d
chore: remove vestigial commitizen references (#7317)
bmuenzenmeyer Dec 9, 2024
8bc50b4
update hardcoded nvm version (#7323)
ljharb Dec 9, 2024
a9de273
[automated]: crowdin sync, enables korean (#7321)
github-actions[bot] Dec 10, 2024
861b8d7
Blog: v23.4.0 release post (#7325)
aduh95 Dec 10, 2024
b049f6f
[automated]: crowdin sync (#7329)
github-actions[bot] Dec 13, 2024
75d2dc2
Fix: whitespace between the main content and progressive sidebar (#7271)
amyy2 Dec 13, 2024
a84976d
Add CSS structure for country-specific style overrides (#7326) (#7327)
mpruser Dec 14, 2024
cc752c3
[automated]: crowdin sync (#7330)
github-actions[bot] Dec 14, 2024
dd071e3
feat(search): implements Orama searchbox (#6908)
micheleriva Dec 15, 2024
1563d81
Fix button focus (#7287)
faridomarAf Dec 16, 2024
9e18841
meta: bump @oramacloud/client from 1.3.16 to 2.1.4 in the orama group…
dependabot[bot] Dec 16, 2024
3bec78a
[automated]: crowdin sync (#7332)
github-actions[bot] Dec 17, 2024
d9c7506
Enable spanish (#7334)
bmuenzenmeyer Dec 18, 2024
ad3f328
docs: fix typos in wasm mjs example (#7333)
stanley2058 Dec 19, 2024
d4de2a6
Blog: v23.5.0 release post (#7341)
aduh95 Dec 19, 2024
00943d5
feat(ui): add `ui-components` package
avivkeller Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Review Dependencies
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
51 changes: 34 additions & 17 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,39 @@ permissions:
pull-requests: write

jobs:
lighthouse-ci:
get-vercel-preview:
# We want to skip our lighthouse analysis on Dependabot PRs
if: |
startsWith(github.event.pull_request.head.ref, 'dependabot/') == false &&
github.event.label.name == 'github_actions:pull-request'
name: Get Vercel Preview
runs-on: ubuntu-latest
outputs:
deployment_found: ${{ steps.check_deployment.outputs.deployment_found }}
url: ${{ steps.check_deployment.outputs.url }}
steps:
- name: Capture Vercel Preview
id: check_deployment
uses: patrickedqvist/wait-for-vercel-preview@06c79330064b0e6ef7a2574603b62d3c98789125 # v1.3.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 300 # timeout after 5 minutes
check_interval: 10 # check every 10 seconds
continue-on-error: true
- name: Set Outputs
if: always()
id: set_outputs
run: |
if [[ -z "${{ steps.check_deployment.outputs.url }}" ]]; then
echo "deployment_found=false" >> $GITHUB_OUTPUT
else
echo "deployment_found=true" >> $GITHUB_OUTPUT
echo "url=${{ steps.check_deployment.outputs.url }}" >> $GITHUB_OUTPUT
fi

lighthouse-ci:
needs: get-vercel-preview
if: needs.get-vercel-preview.outputs.deployment_found == 'true'
name: Lighthouse Report
runs-on: ubuntu-latest

Expand All @@ -57,16 +84,6 @@ jobs:
# Used later to edit the existing comment
comment-tag: 'lighthouse_audit'

- name: Capture Vercel Preview
uses: patrickedqvist/wait-for-vercel-preview@06c79330064b0e6ef7a2574603b62d3c98789125 # v1.3.2
id: vercel_preview_url
with:
token: ${{ secrets.GITHUB_TOKEN }}
# timeout after 5 minutes
max_timeout: 300
# check every 10 seconds
check_interval: 10

- name: Audit Preview URL with Lighthouse
# Conduct the lighthouse audit
id: lighthouse_audit
Expand All @@ -76,11 +93,11 @@ jobs:
configPath: './.lighthouserc.json'
# These URLS capture critical pages / site functionality.
urls: |
${{ steps.vercel_preview_url.outputs.url }}/en
${{ steps.vercel_preview_url.outputs.url }}/en/about
${{ steps.vercel_preview_url.outputs.url }}/en/about/previous-releases
${{ steps.vercel_preview_url.outputs.url }}/en/download
${{ steps.vercel_preview_url.outputs.url }}/en/blog
${{ needs.get-vercel-preview.outputs.url }}/en
${{ needs.get-vercel-preview.outputs.url }}/en/about
${{ needs.get-vercel-preview.outputs.url }}/en/about/previous-releases
${{ needs.get-vercel-preview.outputs.url }}/en/download
${{ needs.get-vercel-preview.outputs.url }}/en/blog
uploadArtifacts: true # save results as a action artifacts
temporaryPublicStorage: true # upload lighthouse report to the temporary storage

Expand All @@ -93,7 +110,7 @@ jobs:
# see https://github.com/actions/github-script#use-env-as-input
LIGHTHOUSE_RESULT: ${{ steps.lighthouse_audit.outputs.manifest }}
LIGHTHOUSE_LINKS: ${{ steps.lighthouse_audit.outputs.links }}
VERCEL_PREVIEW_URL: ${{ steps.vercel_preview_url.outputs.url }}
VERCEL_PREVIEW_URL: ${{ needs.get-vercel-preview.outputs.url }}
with:
# Run as a separate file so we do not have to inline all of our formatting logic.
# See https://github.com/actions/github-script#run-a-separate-file for more info.
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/translations-pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This Workflow is used to comment on PRs that have changes that touch Translated Files
# and then comments on their PRs mentioning that they should not do so

name: Incoming Translation Checks

on:
# run when someone tries to manually change localized content
pull_request_target:
branches:
- main
paths:
- 'apps/site/pages/**/*.md'
- 'apps/site/pages/**/*.mdx'
- '!apps/site/pages/en/**/*.md'
- '!apps/site/pages/en/**/*.mdx'
- 'packages/i18n/locales/*.json'
- '!packages/i18n/locales/en.json'

# Cancel any runs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: read

jobs:
comment_on_translation_pr:
# This comment should always be posted on forks, or from internal PRs not originating from Crowdin (which are direct branches)
if: |
(github.event.pull_request.head.repo.full_name != 'nodejs/nodejs.org') ||
(github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' && github.event.pull_request.head.ref != 'chore/crowdin')

name: Comment on Translation PR
runs-on: ubuntu-latest

permissions:
# This permission is required by `thollander/actions-comment-pull-request`
pull-requests: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- uses: thollander/actions-comment-pull-request@e2c37e53a7d2227b61585343765f73a9ca57eda9 # v3.0.0
with:
message: |
> [!NOTE]\
> Your Pull Request seems to be updating **Translations** of the Node.js Website.
>
> Whilst we appreciate your intent; Any Translation update should be done through our [Crowdin Project](https://crowdin.com/project/nodejs-web).
> We recommend giving a read on our [Translation Guidelines](https://github.com/nodejs/nodejs.org/blob/main/TRANSLATION.md).
>
> Thank you!
comment-tag: use_crowdin
Original file line number Diff line number Diff line change
@@ -1,67 +1,64 @@
# This Workflow is used to comment on PRs that have changes that touch Translated Files
# and then comments on their PRs mentioning that they should not do so
# This action automates the synchronization of our crowdin translations, so that a human does not need to kick it off from the crowdin UI
# It also formats incoming content because it is often not adherent to our rules post-translation.

name: Crowdin Checks
# See translations-upload.yml for automation to upload our source content
# See translations-pr-lint.yml for quality control we conduct on ingress of new translations.
name: Crowdin Download

on:
pull_request_target:
branches:
- main
paths:
- 'apps/site/pages/**/*.md'
- 'apps/site/pages/**/*.mdx'
- '!apps/site/pages/en/**/*.md'
- '!apps/site/pages/en/**/*.mdx'
- 'packages/i18n/locales/*.json'
- '!packages/i18n/locales/en.json'
workflow_dispatch: # Allow running when we want to, for events such as urgent translation mistakes or 100% completed languages
schedule:
- cron: '0 5 * * 5' # At 05:00 on Fridays. This guarantees that we have the 72 hour weekend time to review translations.

# Cancel any runs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
actions: read
# These permissions required by `crowdin/github-action`
contents: write
pull-requests: write

jobs:
comment_on_translation_pr:
# This comment should always be posted on forks, or from internal PRs not originating from Crowdin (which are direct branches)
if: |
(github.event.pull_request.head.repo.full_name != 'nodejs/nodejs.org') ||
(github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' && github.event.pull_request.head.ref != 'chore/crowdin')

name: Comment on Translation PR
synchronize-with-crowdin:
runs-on: ubuntu-latest

permissions:
# This permission is required by `thollander/actions-comment-pull-request`
pull-requests: write
outputs:
pull_request_number: ${{ steps.crowdin_pr.outputs.pull_request_number }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- uses: thollander/actions-comment-pull-request@e2c37e53a7d2227b61585343765f73a9ca57eda9 # v3.0.0
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# see all the options at https://github.com/crowdin/github-action
- name: Crowdin PR
uses: crowdin/github-action@2d540f18b0a416b1fbf2ee5be35841bd380fc1da # v2.3.0
id: crowdin_pr
with:
message: |
> [!NOTE]\
> Your Pull Request seems to be updating **Translations** of the Node.js Website.
>
> Whilst we appreciate your intent; Any Translation update should be done through our [Crowdin Project](https://crowdin.com/project/nodejs-web).
> We recommend giving a read on our [Translation Guidelines](https://github.com/nodejs/nodejs.org/blob/main/TRANSLATION.md).
>
> Thank you!
comment-tag: use_crowdin
# do not upload anything - this is a one-way operation download
upload_sources: false
upload_translations: false
# the rest of this controls how the PR comes in with new translations
download_translations: true
localization_branch_name: chore/crowdin
create_pull_request: true
pull_request_title: '[automated]: crowdin sync'
pull_request_body: 'New Crowdin translations from the [Node.js Crowdin project](https://crowdin.com/project/nodejs-web)'
commit_message: 'chore: synced translations from crowdin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# A numeric ID, found at https://crowdin.com/project/nodejs-web/tools/api
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
# Created from https://crowdin.com/settings#api-key logged in using nodejs-crowdin-bot
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

format_crowdin_pull_request:
# We should only run the automated Format Command on Crowdin-based Pull Requests
if: |
github.event.pull_request.head.repo.full_name == 'nodejs/nodejs.org' &&
github.event.pull_request.head.ref == 'chore/crowdin'

name: Format Crowdin Pull Request
needs: synchronize-with-crowdin
runs-on: ubuntu-latest

permissions:
Expand All @@ -77,8 +74,8 @@ jobs:
- name: Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Provides the Pull Request commit SHA or the GitHub merge group ref
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.ref }}
# Use the number from the output of crowdin/github-action
ref: refs/pull/${{ needs.synchronize-with-crowdin.outputs.pull_request_number }}/head

- name: Restore Lint Cache
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
Expand Down Expand Up @@ -123,6 +120,7 @@ jobs:
with:
commit_options: '--no-verify --signoff'
commit_message: 'chore: automated format of translated files'
branch: 'chore/crowdin'

- name: Save Lint Cache
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/translations-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This action automates the upload of our source content to crowdin.
# See translations-sync.yml for the automation to download new translations on a schedule
# See translations-pr-lint.yml for quality control we conduct on ingress of new translations.
name: Crowdin Upload

on:
push:
branches: [main]

# Cancel any runs on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
upload-to-crowdin:
runs-on: ubuntu-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# see all the options at https://github.com/crowdin/github-action
- name: crowdin action
uses: crowdin/github-action@2d540f18b0a416b1fbf2ee5be35841bd380fc1da # v2.3.0
with:
# only upload sources, ensuring this is a one-way operation
upload_sources: true
upload_translations: false
download_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# A numeric ID, found at https://crowdin.com/project/nodejs-web/tools/api
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
# Created from https://crowdin.com/settings#api-key logged in using nodejs-crowdin-bot
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
v22
File renamed without changes.
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ turbo.json @nodejs/nodejs-website @nodejs/web-infra
crowdin.yml @nodejs/web-infra
apps/site/redirects.json @nodejs/web-infra
apps/site/site.json @nodejs/web-infra

apps/site/pages/en/learn/getting-started/security-best-practices.md @nodejs/security-wg
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ for getting things done and landing your contribution.
```bash
cd ~/nodejs.org
git add .
git commit #let commitizen handle the commit
git commit -m "describe your changes"
git push -u origin name-of-your-branch
```

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<a title="scorecard" href="https://securityscorecards.dev/viewer/?uri=github.com/nodejs/nodejs.org">
<img src="https://api.securityscorecards.dev/projects/github.com/nodejs/nodejs.org/badge" alt="nodejs.org scorecard badge" />
</a>
<a href="http://commitizen.github.io/cz-cli/" alt="Commitizen friendly">
<img src="https://img.shields.io/badge/commitizen-friendly-brightgreen.svg">
</a>
<br />
<br />
</p>
Expand Down
9 changes: 9 additions & 0 deletions TRANSLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ Translation Keys should not be translated during Unit Testing. If your Component
- Unit Tests should not rely on text, titles, or string bags, as these texts will change arbitrarily and make the test suite fail.
- In this case, you should test your component by aria-text, or other `aria-*` attributes or even by class names or other artifacts.
- Visual Regression Testing is recommended to test how different languages and text appear within a Component.

## Deploying Translations

Translations are synced between Crowdin and the repository via GitHub Actions.

- On every push to `main`, we upload any new source content.
- Via a cron schedule, and as needed manually by a collaborator, we download completed translations.

Incoming translations are linted to ensure they come from crowdin, and are also formatted to adhere to our project settings.
Loading
Loading