Skip to content

Commit 3a455b2

Browse files
authored
Scaffold multi-package workspace. (#6850)
1 parent c19f996 commit 3a455b2

File tree

1,564 files changed

+785
-1920
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,564 files changed

+785
-1920
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@ jobs:
136136
(matrix.os == 'ubuntu-latest') &&
137137
((github.event_name == 'push') || (github.event_name == 'pull_request_target'))
138138
run: |
139-
npm run sync-orama
139+
cd apps/site && npm run sync-orama

.github/workflows/lighthouse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
# Run as a separate file so we do not have to inline all of our formatting logic.
107107
# See https://github.com/actions/github-script#run-a-separate-file for more info.
108108
script: |
109-
const { formatLighthouseResults } = await import('${{github.workspace}}/scripts/lighthouse/index.mjs')
109+
const { formatLighthouseResults } = await import('${{github.workspace}}/apps/site/scripts/lighthouse/index.mjs')
110110
await formatLighthouseResults({core})
111111
112112
- name: Add Comment to PR

.github/workflows/lint-and-tests.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ jobs:
4545
# This step is responsible for providing a reusable string that can be used within other steps and jobs
4646
# that use the `turbo` cli command as a way of easily providing shared arguments to the `turbo` command
4747
id: turborepo_arguments
48-
# See https://turbo.build/repo/docs/reference/command-line-reference/run#--cache-dir
4948
# See https://turbo.build/repo/docs/reference/command-line-reference/run#--force
50-
run: echo "turbo_args=--force=true --cache-dir=.turbo/cache" >> "$GITHUB_OUTPUT"
49+
run: echo "turbo_args=--force=true" >> "$GITHUB_OUTPUT"
5150

5251
lint:
5352
# This Job should run either on `merge_groups` or `push` events
@@ -126,11 +125,7 @@ jobs:
126125
github.event.pull_request.head.ref != 'chore/crowdin')
127126
# We want to enforce that the actual `turbo@latest` package is used instead of a possible hijack from the user
128127
# the `${{ needs.base.outputs.turbo_args }}` is a string substitution happening from the base job
129-
run: npx --package=turbo@latest -- turbo lint:js lint:md lint:css prettier ${{ needs.base.outputs.turbo_args }}
130-
131-
- name: Run `tsc build`
132-
# We want to ensure that the whole codebase is passing and successfully compiles with TypeScript
133-
run: npx --package=typescript@latest -- tsc --build .
128+
run: npx --package=turbo@latest -- turbo lint check-types prettier ${{ needs.base.outputs.turbo_args }}
134129

135130
- name: Save Lint Cache
136131
# We only want to save caches on `push` events or `pull_request_target` events
@@ -227,6 +222,7 @@ jobs:
227222
# sha reference has no stable git tag reference or URL. see https://github.com/chromaui/chromatic-cli/issues/797
228223
uses: chromaui/action@5f6574e351eb055223ae8ea9e1a734d1d695ea9c
229224
with:
225+
workingDir: apps/site
230226
buildScriptName: storybook:build
231227
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
232228
exitOnceUploaded: true

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
npx lint-staged
66

77
# verify typescript staged files
8-
npx tsc --build .
8+
npx tsc --build apps/site

.lintstagedrc.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"**/*.{js,mjs,ts,tsx,md,mdx}": ["eslint --fix", "prettier --check --write"],
2+
"**/*.{js,mjs,ts,tsx,md,mdx}": [
3+
"turbo run lint:lint-staged --",
4+
"prettier --check --write"
5+
],
36
"**/*.css": ["stylelint --allow-empty-input", "prettier --write"],
47
"**/*.{json,yml}": ["prettier --check --write"]
58
}

COLLABORATOR_GUIDE.md

Lines changed: 30 additions & 26 deletions

CONTRIBUTING.md

Lines changed: 14 additions & 14 deletions

.eslintrc.json renamed to apps/site/.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"extends": "prettier",
3+
"ignorePatterns": ["storybook-static/**"],
34
"overrides": [
45
{
56
"files": ["public/**/*.js"],
@@ -19,6 +20,7 @@
1920
"plugins": ["import"],
2021
"extends": ["eslint:recommended", "next", "next/core-web-vitals"],
2122
"rules": {
23+
"import/namespace": "off",
2224
"import/order": [
2325
"error",
2426
{
@@ -48,6 +50,10 @@
4850
"plugin:import/typescript"
4951
],
5052
"parser": "@typescript-eslint/parser",
53+
"parserOptions": {
54+
"project": true,
55+
"tsconfigRootDir": "."
56+
},
5157
"rules": {
5258
"@typescript-eslint/consistent-type-imports": "error",
5359
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

apps/site/README.md

Lines changed: 1 addition & 0 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

client-context.ts renamed to apps/site/client-context.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { cache } from 'react';
22

33
import type { ClientSharedServerContext } from '@/types';
4-
5-
import { assignClientContext } from './util/assignClientContext';
4+
import { assignClientContext } from '@/util/assignClientContext';
65

76
// This allows us to have Server-Side Context's of the shared "contextual" data
87
// which includes the frontmatter, the current pathname from the dynamic segments

components/Common/Blockquote/index.module.css renamed to apps/site/components/Common/Blockquote/index.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
dark:text-white;
1717

1818
& cite {
19-
@apply text-base
20-
font-regular
19+
@apply font-regular
20+
text-base
2121
not-italic;
2222

2323
&::before {

components/Common/Button/index.module.css renamed to apps/site/components/Common/Button/index.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.button {
2-
@apply relative
2+
@apply px-4.5
3+
relative
34
inline-flex
45
items-center
56
gap-2
6-
px-4.5
77
py-2.5
88
text-center
99
font-semibold;
@@ -95,15 +95,15 @@
9595
shadow-sm;
9696

9797
&::before {
98-
@apply absolute
98+
@apply bg-gradient-glow-backdrop
99+
absolute
99100
left-0
100101
right-0
101102
top-0
102103
-z-10
103104
mx-auto
104105
h-full
105106
w-full
106-
bg-gradient-glow-backdrop
107107
opacity-30
108108
content-[''];
109109
}

components/Common/CodeBox/index.module.css renamed to apps/site/components/Common/CodeBox/index.module.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
p-4;
1111

1212
& > code {
13-
@apply grid
13+
@apply font-ibm-plex-mono
14+
font-regular
15+
grid
1416
overflow-x-auto
1517
bg-transparent
1618
p-0
17-
font-ibm-plex-mono
1819
text-sm
19-
font-regular
2020
leading-snug
2121
text-neutral-400
2222
[counter-reset:line];
@@ -32,13 +32,13 @@
3232
}
3333

3434
&:not(:empty:last-child)::after {
35-
@apply absolute
35+
@apply w-4.5
36+
font-ibm-plex-mono
37+
absolute
3638
left-0
3739
top-0
3840
mr-4
39-
w-4.5
4041
text-right
41-
font-ibm-plex-mono
4242
text-neutral-600
4343
[content:counter(line)]
4444
[counter-increment:line];

components/Common/LinkTabs/index.module.css renamed to apps/site/components/Common/LinkTabs/index.module.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.tabsList {
2-
@apply mb-6
2+
@apply font-open-sans
3+
max-xs:hidden
4+
mb-6
35
mt-10
46
flex
57
gap-2
68
border-b
79
border-b-neutral-200
8-
font-open-sans
9-
dark:border-b-neutral-800
10-
max-xs:hidden;
10+
dark:border-b-neutral-800;
1111

1212
.tabsTrigger {
1313
@apply border-b-2
@@ -33,9 +33,9 @@
3333
md:hidden;
3434

3535
> span {
36-
@apply my-6
36+
@apply max-xs:flex
37+
my-6
3738
hidden
38-
w-full
39-
max-xs:flex;
39+
w-full;
4040
}
4141
}

components/Common/Pagination/PaginationListItem/index.module.css renamed to apps/site/components/Common/Pagination/PaginationListItem/index.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
.listItem,
22
.listItem:link,
33
.listItem:active {
4-
@apply flex
4+
@apply aria-current:bg-green-600
5+
aria-current:text-white
6+
flex
57
size-10
68
items-center
79
justify-center
810
rounded
911
px-3
1012
py-2.5
1113
text-neutral-800
12-
aria-current:bg-green-600
13-
aria-current:text-white
1414
dark:text-neutral-200;
1515

1616
&:hover {

0 commit comments

Comments
 (0)