Skip to content

Commit a6b0d63

Browse files
Sergio Morenojuanpicado
Sergio Moreno
andauthored
feat: migrate Verdaccio.org to Docusaurus v2 and new design (verdaccio#2343)
Co-authored-by: Juan Picado <[email protected]>
1 parent b8c7b77 commit a6b0d63

File tree

1,670 files changed

+9857
-127938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,670 files changed

+9857
-127938
lines changed

.github/workflows/ci.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
node-version: 14
3131
- name: Install pnpm
32-
run: npm i pnpm@latest -g
32+
run: npm i pnpm@6.10.3 -g
3333
- name: set store
3434
run: |
3535
mkdir ~/.pnpm-store
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
node-version: 16
5656
- name: Install pnpm
57-
run: npm i pnpm@latest -g
57+
run: npm i pnpm@6.10.3 -g
5858
- uses: actions/cache@v2
5959
with:
6060
path: ~/.pnpm-store
@@ -74,7 +74,7 @@ jobs:
7474
with:
7575
node-version: 16
7676
- name: Install pnpm
77-
run: npm i pnpm@latest -g
77+
run: npm i pnpm@6.10.3 -g
7878
- uses: actions/cache@v2
7979
with:
8080
path: ~/.pnpm-store
@@ -94,7 +94,7 @@ jobs:
9494
with:
9595
node-version: 16
9696
- name: Install pnpm
97-
run: npm i pnpm@latest -g
97+
run: npm i pnpm@6.10.3 -g
9898
- uses: actions/cache@v2
9999
with:
100100
path: ~/.pnpm-store
@@ -131,7 +131,7 @@ jobs:
131131
- name: untar packages
132132
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
133133
- name: Install pnpm
134-
run: npm i pnpm@latest -g
134+
run: npm i pnpm@6.10.3 -g
135135
- uses: actions/cache@v2
136136
with:
137137
path: ~/.pnpm-store
@@ -155,7 +155,7 @@ jobs:
155155
- name: untar packages
156156
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
157157
- name: Install pnpm
158-
run: npm i pnpm@latest -g
158+
run: npm i pnpm@6.10.3 -g
159159
- uses: actions/cache@v2
160160
with:
161161
path: ~/.pnpm-store
@@ -182,7 +182,7 @@ jobs:
182182
- name: untar packages
183183
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
184184
- name: Install pnpm
185-
run: npm i pnpm@latest -g
185+
run: npm i pnpm@6.10.3 -g
186186
- uses: actions/cache@v2
187187
with:
188188
path: ~/.pnpm-store
@@ -203,7 +203,7 @@ jobs:
203203
with:
204204
node-version: 14
205205
- name: Install pnpm
206-
run: npm i pnpm@latest -g
206+
run: npm i pnpm@6.10.3 -g
207207
# pnpm cache is not working for windows (we need a solution)
208208
- uses: actions/cache@v2
209209
with:

.github/workflows/website.yml

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Verdaccio Website CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types:
7+
- opened
8+
- synchronize
9+
paths:
10+
- 'website/**'
11+
- 'package.json'
12+
- './github/workflows/website.yml'
13+
push:
14+
branches:
15+
- 'master'
16+
paths:
17+
- 'website/**'
18+
- 'package.json'
19+
- './github/workflows/website.yml'
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/[email protected]
26+
27+
- name: Use Node 14
28+
uses: actions/setup-node@v2
29+
with:
30+
node-version: 14
31+
32+
- name: Cache pnpm modules
33+
uses: actions/cache@v2
34+
env:
35+
cache-name: cache-pnpm-modules
36+
with:
37+
path: ~/.pnpm-store
38+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: |
40+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
41+
42+
- uses: pnpm/[email protected]
43+
with:
44+
version: 6.10.2
45+
run_install: |
46+
- recursive: true
47+
args: [--frozen-lockfile]
48+
49+
- name: Lint And Pretty
50+
run: |
51+
pnpm eslint:check --filter ...@verdaccio/website
52+
pnpm prettier:check --filter ...@verdaccio/website
53+
54+
- name: Cache Docusaurus Build
55+
uses: actions/cache@v2
56+
with:
57+
path: website/node_modules/.cache/webpack
58+
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
59+
restore-keys: cache/webpack-${{github.ref}}
60+
61+
# Will deploy to production on:
62+
# 1st: When a push occurs on master branch
63+
# 2nd: When we force the worflow dispatch through the UI
64+
- name: Build Production
65+
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
66+
env:
67+
CONTEXT: production
68+
run: pnpm netlify:build:production --filter ...@verdaccio/website
69+
70+
- name: 🔥 Deploy Production Netlify
71+
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
72+
uses: semoal/action-netlify-deploy@master
73+
with:
74+
github-token: ${{ secrets.GITHUB_TOKEN }}
75+
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
76+
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
77+
build-dir: './website/build'
78+
79+
# Will deploy to Preview URL, only when a pull request is open with changes on the website
80+
- name: Build Deployment Preview
81+
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
82+
env:
83+
CONTEXT: deploy-preview
84+
run: pnpm netlify:build:deployPreview --filter ...@verdaccio/website
85+
86+
- name: 🤖 Deploy Preview Netlify
87+
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
88+
uses: semoal/action-netlify-deploy@master
89+
id: netlify_preview
90+
with:
91+
draft: true
92+
comment-on-pull-request: true
93+
github-deployment-is-production: false
94+
github-deployment-is-transient: true
95+
github-token: ${{ secrets.GITHUB_TOKEN }}
96+
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
97+
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
98+
build-dir: './website/build'
99+
100+
- name: Audit preview URL with Lighthouse
101+
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
102+
id: lighthouse_audit
103+
uses: treosh/lighthouse-ci-action@v3
104+
with:
105+
urls: |
106+
${{ steps.netlify_preview.outputs.preview-url }}
107+
uploadArtifacts: true
108+
temporaryPublicStorage: true
109+
110+
- name: Format lighthouse score
111+
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
112+
id: format_lighthouse_score
113+
uses: actions/github-script@v3
114+
with:
115+
github-token: ${{secrets.GITHUB_TOKEN}}
116+
script: |
117+
const result = ${{ steps.lighthouse_audit.outputs.manifest }}[0].summary
118+
const links = ${{ steps.lighthouse_audit.outputs.links }}
119+
const formatResult = (res) => Math.round((res * 100))
120+
Object.keys(result).forEach(key => result[key] = formatResult(result[key]))
121+
const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴'
122+
const comment = [
123+
`⚡️ [Lighthouse report](${Object.values(links)[0]}) for the changes in this PR:`,
124+
'| Category | Score |',
125+
'| --- | --- |',
126+
`| ${score(result.performance)} Performance | ${result.performance} |`,
127+
`| ${score(result.accessibility)} Accessibility | ${result.accessibility} |`,
128+
`| ${score(result['best-practices'])} Best practices | ${result['best-practices']} |`,
129+
`| ${score(result.seo)} SEO | ${result.seo} |`,
130+
' ',
131+
`*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*`
132+
].join('\n')
133+
core.setOutput("comment", comment);
134+
135+
- name: Add comment to PR
136+
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
137+
id: comment_to_pr
138+
uses: marocchino/sticky-pull-request-comment@v1
139+
with:
140+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141+
number: ${{ github.event.issue.number }}
142+
header: lighthouse
143+
message: |
144+
${{ steps.format_lighthouse_score.outputs.comment }}

crowdin.yaml

+13-54
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,16 @@
1-
project_identifier_env: CROWDIN_VERDACCIO_PROJECT_ID
2-
api_key_env: CROWDIN_VERDACCIO_API_KEY
3-
base_path: './'
1+
project_id_env: CROWDIN_VERDACCIO_PROJECT_ID
2+
api_token_env: CROWDIN_VERDACCIO_API_KEY
3+
44
preserve_hierarchy: true
5-
commit_message: 'docs(website): new translation for %original_file_name% in %language%'
6-
append_commit_message: false
75

86
files:
9-
-
10-
source: '/docs/website/*.md'
11-
translation: '/website/translated_docs/%locale%/%original_file_name%'
12-
languages_mapping: &anchor
13-
locale:
14-
'af': 'af'
15-
'ar': 'ar'
16-
'bs-BA': 'bs-BA'
17-
'ca': 'ca'
18-
'cs': 'cs'
19-
'da': 'da'
20-
'de': 'de'
21-
'el': 'el'
22-
'es-ES': 'es-ES'
23-
'fa': 'fa-IR'
24-
'fi': 'fi'
25-
'fr': 'fr-FR'
26-
'he': 'he'
27-
'hu': 'hu'
28-
'id': 'id-ID'
29-
'it': 'it-IT'
30-
'ja': 'ja'
31-
'ko': 'ko'
32-
'mr': 'mr-IN'
33-
'nl': 'nl'
34-
'no': 'no-NO'
35-
'pl': 'pl-PL'
36-
'pt-BR': 'pt-BR'
37-
'pt-PT': 'pt-PT'
38-
'ro': 'ro'
39-
'ru': 'ru-RU'
40-
'sk': 'sk-SK'
41-
'sr-SP': 'sr-SP'
42-
'sr-CS': 'sr-CS'
43-
'sv-SE': 'sv-SE'
44-
'tr': 'tr'
45-
'uk': 'uk'
46-
'vi': 'vi-VN'
47-
'yo-NG': 'yo-NG'
48-
'zh-CN': 'zh-CN'
49-
'zh-TW': 'zh-TW'
50-
-
51-
source: '/website/versioned_docs/**/*.md'
52-
translation: '/website/translated_docs/%locale%/**/%original_file_name%'
53-
languages_mapping: *anchor
54-
-
55-
source: '/website/i18n/en.json'
56-
translation: '/website/i18n/%locale%.json'
57-
languages_mapping: *anchor
7+
[
8+
{
9+
source: '/website/i18n/en/**/*',
10+
translation: '/website/i18n/%locale%/**/%original_file_name%',
11+
},
12+
{
13+
source: '/website/docs/**/*',
14+
translation: '/website/i18n/%locale%/docusaurus-plugin-content-docs/current/**/%original_file_name%',
15+
}
16+
]

docs/website/amazon.md

-54
This file was deleted.

docs/website/ansible.md

-21
This file was deleted.

0 commit comments

Comments
 (0)