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.

0 commit comments

Comments
 (0)