diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a4ff53b442cec..a122846990f36 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,14 +4,18 @@ # Infrastructure .github @nodejs/web-infra .husky @nodejs/web-infra +codecov.yml @nodejs/web-infra + +# Dependencies +pnpm-workspace.yaml @nodejs/nodejs-website @nodejs/web-infra +pnpm-lock.yaml @nodejs/web-infra # Framework apps/site/next.config.mjs @nodejs/web-infra apps/site/next.dynamic.mjs @nodejs/web-infra - -# Node.js Release Blog Posts -apps/site/pages/en/blog/release @nodejs/releasers -apps/site/pages/en/blog/announcements @nodejs/releasers +apps/site/middleware.ts @nodejs/web-infra +apps/site/navigation.mjs @nodejs/web-infra +apps/site/playwright.config.ts @nodejs/web-infra # Package Ecosystem package.json @nodejs/nodejs-website @@ -21,6 +25,19 @@ 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/wrangler.jsonc @nodejs/web-infra +apps/site/open-next.config.ts @nodejs/web-infra +apps/site/redirects.json @nodejs/web-infra + +# Critical Documents +LICENSE @nodejs/tsc +GOVERNANCE.md @nodejs/tsc +CONTRIBUTING.md @nodejs/nodejs-website @nodejs/web-infra +docs @nodejs/nodejs-website @nodejs/web-infra + +# Node.js Release Blog Posts +apps/site/pages/en/blog/release @nodejs/releasers +apps/site/pages/en/blog/announcements @nodejs/releasers # Specific content apps/site/pages/en/learn/getting-started/security-best-practices.md @nodejs/security-wg diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bd878abac653..e43d21ce30fd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,6 @@ permissions: env: # See https://turbo.build/repo/docs/reference/command-line-reference/run#--cache-dir TURBO_ARGS: --cache-dir=.turbo/cache - # See https://turbo.build/repo/docs/reference/command-line-reference/run#--force - TURBO_FORCE: true jobs: build: @@ -80,8 +78,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -96,7 +92,7 @@ jobs: - name: Build Next.js (ISR) # We want a ISR build on CI to ensure that regular Next.js builds work as expected. - run: pnpm exec turbo build ${{ env.TURBO_ARGS }} + run: node_modules/.bin/turbo build ${{ env.TURBO_ARGS }} env: # We want to ensure we have enough RAM allocated to the Node.js process # this should be a last resort in case by any chances the build memory gets too high @@ -109,7 +105,7 @@ jobs: # We only run full static builds within Pull Requests. This step is also used to export # static output in all languages, and it only works on `push` events. if: github.event_name == 'push' - run: pnpm exec turbo deploy ${{ env.TURBO_ARGS }} + run: node_modules/.bin/turbo deploy ${{ env.TURBO_ARGS }} env: # We want to ensure we have enough RAM allocated to the Node.js process # this should be a last resort in case by any chances the build memory gets too high @@ -128,7 +124,7 @@ jobs: if: | (github.event_name == 'pull_request_target' && github.event.pull_request.head.ref != 'chore/crowdin') - run: pnpm exec turbo deploy ${{ env.TURBO_ARGS }} + run: node_modules/.bin/turbo deploy ${{ env.TURBO_ARGS }} env: # We want to ensure we have enough RAM allocated to the Node.js process # this should be a last resort in case by any chances the build memory gets too high @@ -149,4 +145,4 @@ jobs: ORAMA_SECRET_KEY: ${{ github.event_name == 'push' && secrets.ORAMA_PRODUCTION_SECRET_KEY || secrets.ORAMA_SECRET_KEY }} if: matrix.os == 'ubuntu-latest' && github.event_name != 'merge_group' working-directory: apps/site - run: pnpm sync-orama + run: node --run sync-orama diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index e7f001ca8cccb..81108deb114a6 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -69,8 +69,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 diff --git a/.github/workflows/lint-and-tests.yml b/.github/workflows/lint-and-tests.yml index 5c53db89a0055..70fb3bd0cbecc 100644 --- a/.github/workflows/lint-and-tests.yml +++ b/.github/workflows/lint-and-tests.yml @@ -33,8 +33,8 @@ permissions: actions: read env: - # See https://turbo.build/repo/docs/reference/command-line-reference/run#--force - TURBO_FORCE: true + # See https://turbo.build/repo/docs/reference/command-line-reference/run#--cache-dir + TURBO_ARGS: --cache-dir=.turbo/cache jobs: lint: @@ -70,8 +70,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -90,7 +88,7 @@ jobs: if: | (github.event_name == 'push' || github.event_name == 'merge_group') || (github.event_name == 'pull_request' && github.event.pull_request.head.ref != 'chore/crowdin') - run: pnpm exec turbo lint check-types prettier + run: node_modules/.bin/turbo lint lint:types prettier ${{ env.TURBO_ARGS }} - name: Save Lint Cache # We only want to save caches on `push` events or `pull_request_target` events @@ -127,8 +125,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -143,7 +139,7 @@ jobs: - name: Run Unit Tests # We want to run Unit Tests in every circumstance, including Crowdin PRs and Dependabot PRs to ensure # that changes to dependencies or translations don't break the Unit Tests - run: pnpm test:ci + run: node --run test:ci -- ${{ env.TURBO_ARGS }} - name: Upload test coverage to Codecov if: ${{ !cancelled() && github.event_name != 'merge_group' }} diff --git a/.github/workflows/playwright-cloudflare-open-next.yml b/.github/workflows/playwright-cloudflare-open-next.yml index e3d10aa619072..748e7bab39b57 100644 --- a/.github/workflows/playwright-cloudflare-open-next.yml +++ b/.github/workflows/playwright-cloudflare-open-next.yml @@ -40,8 +40,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -56,7 +54,7 @@ jobs: - name: Get Playwright version id: playwright-version working-directory: apps/site - run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT + run: echo "version=$(node_modules/.bin/playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT - name: Cache Playwright browsers id: playwright-cache @@ -67,11 +65,11 @@ jobs: - name: Install Playwright Browsers working-directory: apps/site - run: pnpm exec playwright install --with-deps + run: node_modules/.bin/playwright install --with-deps - name: Run Playwright tests working-directory: apps/site - run: pnpm playwright + run: node --run playwright env: PLAYWRIGHT_RUN_CLOUDFLARE_PREVIEW: true PLAYWRIGHT_BASE_URL: http://127.0.0.1:8787 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 906f0fef71da0..dfda0591151f9 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -66,8 +66,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -82,7 +80,7 @@ jobs: - name: Get Playwright version id: playwright-version working-directory: apps/site - run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT + run: echo "version=$(node_modules/.bin/playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT - name: Cache Playwright browsers id: playwright-cache @@ -93,11 +91,11 @@ jobs: - name: Install Playwright Browsers working-directory: apps/site - run: pnpm exec playwright install --with-deps + run: node_modules/.bin/playwright install --with-deps - name: Run Playwright tests working-directory: apps/site - run: pnpm playwright + run: node --run playwright env: PLAYWRIGHT_BASE_URL: ${{ needs.get-vercel-preview.outputs.url }} diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 57c766d89d909..963761e1e6639 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -105,8 +105,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Setup Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 diff --git a/.github/workflows/translations-sync.yml b/.github/workflows/translations-sync.yml index d6674614e56a0..5613eb48bb762 100644 --- a/.github/workflows/translations-sync.yml +++ b/.github/workflows/translations-sync.yml @@ -94,8 +94,6 @@ jobs: - name: Set up pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - with: - cache: true - name: Set up Node.js uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 @@ -109,10 +107,10 @@ jobs: - name: Run ESLint working-directory: apps/site - run: pnpm lint:md --fix + run: node --run lint:md -- --fix - name: Run Prettier - run: pnpm prettier:fix + run: node --run prettier:fix - name: Push Changes back to Pull Request uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0 diff --git a/.gitignore b/.gitignore index 2c2edea1406ac..7097bc66bae66 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,9 @@ npm-debug.log package-lock.json # Next.js Build Output -.next -build +apps/site/.next +apps/site/build +apps/site/public/blog-data.json # Test Runner junit.xml @@ -35,14 +36,10 @@ cache tsconfig.tsbuildinfo dist/ -# Ignore the blog-data json that we generate during dev and build -apps/site/public/blog-data.json - # Cloudflare Build Output apps/site/.open-next apps/site/.wrangler - ## Playwright test-results playwright-report diff --git a/.husky/pre-commit b/.husky/pre-commit index 013b90be9aed3..5f31f933a76bf 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,7 @@ # lint and format staged files -pnpm exec lint-staged + +node --run lint:staged # verify typescript fully -pnpm check-types + +node --run lint:types diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 4b80a42c97bcb..91a0e156e4ab9 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,8 +1,3 @@ { - "**/*.{js,mjs,ts,tsx,md,mdx}": [ - "turbo run lint:lint-staged --", - "prettier --check --write" - ], - "**/*.css": ["stylelint --allow-empty-input", "prettier --write"], - "**/*.{json,yml}": ["prettier --check --write"] + "**/*.{js,mjs,ts,tsx,md,mdx,json.yml}": ["prettier --check --write"] } diff --git a/.prettierignore b/.prettierignore index fca5fe862757e..364ca79393788 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,9 +11,6 @@ package-lock.json .next build -# Next.js Generated Files -public/static/documents - # Test Runner junit.xml lcov.info @@ -39,6 +36,9 @@ tsconfig.tsbuildinfo # Metadata Files CODEOWNERS +# Public Folders +apps/site/public + # Prettier's Handlebar parser is limited and chokes on some syntax features # https://github.com/prettier/prettier/issues/11834 scripts/release-post/template.hbs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9597648401ba..97c2cfa2a0b6f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,7 @@ cd nodejs.org pnpm install --frozen-lockfile # Start development server -pnpm dev +node --run dev ``` For detailed setup instructions, see [Getting Started](./docs/getting-started.md). @@ -99,13 +99,13 @@ For detailed setup instructions, see [Getting Started](./docs/getting-started.md ```bash # Format and lint code -pnpm format +node --run format # Run tests -pnpm test +node --run test # Test build -pnpm build +node --run build ``` ### 4. Submit Your Contribution diff --git a/apps/site/.lintstagedrc.json b/apps/site/.lintstagedrc.json new file mode 100644 index 0000000000000..571dfad0759c2 --- /dev/null +++ b/apps/site/.lintstagedrc.json @@ -0,0 +1,5 @@ +{ + "**/*.{js,mjs,ts,tsx,md,mdx}": ["prettier --check --write", "eslint --fix"], + "**/*.css": ["stylelint --allow-empty-input", "prettier --write"], + "**/*.{json,yml}": ["prettier --check --write"] +} diff --git a/apps/site/eslint.config.js b/apps/site/eslint.config.js index 067acb4db1582..dd5bea57b1387 100644 --- a/apps/site/eslint.config.js +++ b/apps/site/eslint.config.js @@ -1,5 +1,5 @@ import { FlatCompat } from '@eslint/eslintrc'; -import importX from 'eslint-plugin-import-x'; +import { flatConfigs } from 'eslint-plugin-import-x'; import * as mdx from 'eslint-plugin-mdx'; import react from 'eslint-plugin-react'; import tseslint from 'typescript-eslint'; @@ -20,12 +20,12 @@ const compatConfig = compat.config({ export default tseslint.config( ...baseConfig, - { ignores: ['pages/en/blog/**/*.{md,mdx}/**'] }, + { ignores: ['pages/en/blog/**/*.{md,mdx}/**', 'public'] }, { extends: [ react.configs.flat['jsx-runtime'], ...tseslint.configs.recommended, - importX.flatConfigs.typescript, + flatConfigs.typescript, ...compatConfig, ], files: ['**/*.{js,md,mdx,mjs,ts,tsx}'], diff --git a/apps/site/package.json b/apps/site/package.json index abbe59438d972..6ad218fc016fb 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -2,30 +2,32 @@ "name": "@node-core/website", "type": "module", "scripts": { - "prebuild": "pnpm build:blog-data", - "build": "pnpm build:default --turbo", - "build:default": "cross-env NODE_NO_WARNINGS=1 next build", - "build:blog-data": "node ./scripts/blog-data/generate.mjs", + "prebuild": "node --run build:blog-data", + "build": "node --run build:default -- --turbo", + "build:blog-data": "cross-env NODE_NO_WARNINGS=1 node ./scripts/blog-data/generate.mjs", "build:blog-data:watch": "node --watch --watch-path=pages/en/blog ./scripts/blog-data/generate.mjs", - "check-types": "tsc --noEmit", - "deploy": "cross-env NEXT_PUBLIC_STATIC_EXPORT=true pnpm build:default", + "build:default": "cross-env NODE_NO_WARNINGS=1 next build", + "cloudflare:build:worker": "opennextjs-cloudflare build", + "cloudflare:deploy": "wrangler deploy", + "cloudflare:preview": "wrangler dev", + "predeploy": "node --run build:blog-data", + "deploy": "cross-env NEXT_PUBLIC_STATIC_EXPORT=true node --run build:default", + "predev": "node --run build:blog-data", "dev": "cross-env NODE_NO_WARNINGS=1 next dev --turbo", "lint": "turbo run lint:md lint:js lint:css", "lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache", - "lint:fix": "turbo run lint:md lint:js lint:css --no-cache -- --fix", + "lint:fix": "node --run lint -- -- --fix", "lint:js": "eslint \"**/*.{js,mjs,ts,tsx}\"", "lint:md": "eslint \"**/*.md?(x)\" --cache --cache-strategy=content --cache-location=.eslintmdcache", + "lint:types": "tsc --noEmit", "playwright": "playwright test", "scripts:release-post": "cross-env NODE_NO_WARNINGS=1 node scripts/release-post/index.mjs", - "serve": "pnpm dev", + "serve": "node --run dev", "start": "cross-env NODE_NO_WARNINGS=1 next start", - "sync-orama": "node ./scripts/orama-search/sync-orama-cloud.mjs", - "test": "turbo test:unit", + "sync-orama": "cross-env NODE_NO_WARNINGS=1 node ./scripts/orama-search/sync-orama-cloud.mjs", + "test": "node --run test:unit", "test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --test-coverage-exclude=**/*.test.* --experimental-test-module-mocks --enable-source-maps --import=global-jsdom/register --import=tsx --import=tests/setup.jsx --test **/*.test.*", - "test:unit:watch": "cross-env NODE_OPTIONS=\"--watch\" pnpm test:unit", - "cloudflare:build:worker": "opennextjs-cloudflare build", - "cloudflare:deploy": "wrangler deploy", - "cloudflare:preview": "wrangler dev" + "test:unit:watch": "node --run test:unit -- --watch" }, "dependencies": { "@heroicons/react": "~2.2.0", diff --git a/apps/site/playwright.config.ts b/apps/site/playwright.config.ts index fa3790f8d58cb..f4e612c3d1507 100644 --- a/apps/site/playwright.config.ts +++ b/apps/site/playwright.config.ts @@ -41,7 +41,7 @@ function getWebServerConfig(): Pick { if (process.env.PLAYWRIGHT_RUN_CLOUDFLARE_PREVIEW) { return { webServer: { - command: 'pnpm turbo run cloudflare:preview', + command: '../../node_modules/.bin/turbo cloudflare:preview', url: process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:3000', timeout: 60_000 * 3, }, diff --git a/apps/site/turbo.json b/apps/site/turbo.json index 33c7ab8af6976..b4211a13e6be0 100644 --- a/apps/site/turbo.json +++ b/apps/site/turbo.json @@ -116,6 +116,9 @@ "lint:fix": { "cache": false }, + "lint:types": { + "cache": false + }, "format": { "cache": false }, @@ -166,6 +169,9 @@ "*.{md,mdx,json,ts,tsx,mjs,yml}" ], "outputs": [".open-next/**"] + }, + "scripts:release-post": { + "cache": false } } } diff --git a/eslint.config.js b/eslint.config.js index 4359c1ca31f3e..fa0d69bfa4c32 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,9 +1,9 @@ import js from '@eslint/js'; -import importX from 'eslint-plugin-import-x'; +import { flatConfigs } from 'eslint-plugin-import-x'; export default [ js.configs.recommended, - importX.flatConfigs.recommended, + flatConfigs.recommended, { ignores: [ 'node_modules', diff --git a/package.json b/package.json index f1858901b6e17..bd993fd2a50da 100644 --- a/package.json +++ b/package.json @@ -1,36 +1,37 @@ { "name": "nodejs-website", + "type": "module", "private": true, + "license": "MIT", "description": "Nodejs.org Website", "homepage": "https://nodejs.org", "repository": { "type": "git", "url": "git+https://github.com/nodejs/nodejs.org.git" }, - "license": "MIT", "author": { - "name": "Node.js Website Working Group" + "name": "Node.js Website Team and Contributors" }, - "type": "module", "scripts": { - "build": "turbo run build", - "check-types": "turbo check-types", - "deploy": "turbo run deploy", - "dev": "turbo run dev", - "format": "pnpm lint:fix && pnpm prettier:fix", - "lint": "turbo run lint", - "lint:fix": "turbo run lint --force", + "build": "turbo build", + "cloudflare:deploy": "turbo cloudflare:deploy", + "cloudflare:preview": "turbo cloudflare:preview", + "deploy": "turbo deploy", + "dev": "turbo dev", + "format": "turbo lint:fix prettier:fix", + "lint": "turbo lint", + "lint:fix": "turbo lint:fix", + "lint:staged": "lint-staged", + "lint:types": "turbo lint:types", "prepare": "husky", "prettier": "prettier \"**/*.{js,mjs,ts,tsx,md,mdx,json,yml,css}\" --check --cache --cache-strategy=content --cache-location=.prettiercache", - "prettier:fix": "pnpm prettier --write", - "scripts:release-post": "turbo run scripts:release-post", - "start": "turbo run start", - "storybook": "turbo run storybook", - "storybook:build": "turbo run storybook:build", + "prettier:fix": "node --run prettier -- --write", + "scripts:release-post": "turbo scripts:release-post", + "start": "turbo start", + "storybook": "turbo storybook", + "storybook:build": "turbo storybook:build", "test": "turbo test:unit", - "test:ci": "cross-env NODE_OPTIONS=\"--test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=junit.xml --test-reporter=@reporters/github --test-reporter-destination=stdout\" turbo test:unit", - "cloudflare:preview": "turbo run cloudflare:preview", - "cloudflare:deploy": "turbo run cloudflare:deploy" + "test:ci": "cross-env NODE_OPTIONS=\"--test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=junit.xml --test-reporter=@reporters/github --test-reporter-destination=stdout\" turbo test:unit" }, "dependencies": { "husky": "9.1.7", @@ -48,13 +49,16 @@ "prettier-plugin-tailwindcss": "0.6.12" }, "packageManager": "pnpm@10.11.1", - "engines": { - "node": "v22" - }, "devEngines": { + "runtime": { + "name": "node", + "version": "v22", + "onFail": "error" + }, "packageManager": { "name": "pnpm", - "version": "10.11.1" + "version": "10.11.1", + "onFail": "error" } } } diff --git a/packages/i18n/.lintstagedrc.json b/packages/i18n/.lintstagedrc.json new file mode 100644 index 0000000000000..1d1673ffabe4d --- /dev/null +++ b/packages/i18n/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "**/*.{js,mjs,ts,tsx,md,mdx}": ["prettier --check --write", "eslint --fix"], + "**/*.{json,yml}": ["prettier --check --write"] +} diff --git a/packages/i18n/eslint.config.js b/packages/i18n/eslint.config.js index 2a6304344fb89..522c9d121b479 100644 --- a/packages/i18n/eslint.config.js +++ b/packages/i18n/eslint.config.js @@ -1,4 +1,4 @@ -import importX from 'eslint-plugin-import-x'; +import { flatConfigs } from 'eslint-plugin-import-x'; import tseslint from 'typescript-eslint'; import baseConfig from '../../eslint.config.js'; @@ -6,7 +6,7 @@ import baseConfig from '../../eslint.config.js'; export default [ ...baseConfig, ...tseslint.configs.recommended, - importX.flatConfigs.typescript, + flatConfigs.typescript, { rules: { '@typescript-eslint/array-type': ['error', { default: 'generic' }], diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 2505a64f47a40..426e8c8d5411c 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -14,13 +14,15 @@ "module": "./lib/index.mjs", "types": "./dist/index.d.mts", "files": [ - "locales", - "index.js", "config.json", + "index.js", + "locales", "types.d.ts" ], "scripts": { - "lint:js": "eslint \"**/*.{js,mjs,ts}\"" + "lint": "turbo lint:js", + "lint:js": "eslint \"**/*.{js,mjs,ts}\"", + "lint:fix": "node --run lint -- -- --fix" }, "devDependencies": { "eslint-import-resolver-typescript": "~4.4.2", diff --git a/packages/i18n/turbo.json b/packages/i18n/turbo.json index 642d71d8af575..e92cca2df8eb7 100644 --- a/packages/i18n/turbo.json +++ b/packages/i18n/turbo.json @@ -2,32 +2,11 @@ "$schema": "https://turbo.build/schema.json", "extends": ["//"], "tasks": { - "dev": { - "cache": false, - "persistent": true - }, - "build": { - "dependsOn": [], - "outputs": ["dist/**"], - "env": [ - "VERCEL_ENV", - "VERCEL_URL", - "VERCEL_REGION", - "NEXT_PUBLIC_STATIC_EXPORT", - "NEXT_PUBLIC_STATIC_EXPORT_LOCALE", - "NEXT_PUBLIC_BASE_URL", - "NEXT_PUBLIC_DIST_URL", - "NEXT_PUBLIC_DOCS_URL", - "NEXT_PUBLIC_BASE_PATH", - "NEXT_PUBLIC_ORAMA_API_KEY", - "NEXT_PUBLIC_ORAMA_ENDPOINT", - "NEXT_PUBLIC_DATA_URL", - "TURBO_CACHE", - "TURBO_TELEMETRY_DISABLED" - ] - }, "lint:js": { "inputs": ["lib/**/*.{js,mjs,ts}"] + }, + "lint:fix": { + "cache": false } } } diff --git a/packages/rehype-shiki/.lintstagedrc.json b/packages/rehype-shiki/.lintstagedrc.json new file mode 100644 index 0000000000000..1d1673ffabe4d --- /dev/null +++ b/packages/rehype-shiki/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "**/*.{js,mjs,ts,tsx,md,mdx}": ["prettier --check --write", "eslint --fix"], + "**/*.{json,yml}": ["prettier --check --write"] +} diff --git a/packages/rehype-shiki/package.json b/packages/rehype-shiki/package.json index ff94faba04cb9..2d7207280e003 100644 --- a/packages/rehype-shiki/package.json +++ b/packages/rehype-shiki/package.json @@ -6,9 +6,11 @@ "./*": "./src/*.mjs" }, "scripts": { + "lint": "turbo run lint:js", "lint:js": "eslint \"**/*.mjs\"", - "test": "turbo test:unit", - "test:unit": "node --experimental-test-coverage --experimental-test-module-mocks --test \"**/*.test.mjs\"" + "lint:fix": "node --run lint -- -- --fix", + "test": "node --run test:unit", + "test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --experimental-test-module-mocks --test \"**/*.test.mjs\"" }, "dependencies": { "@shikijs/core": "^3.4.2", diff --git a/packages/rehype-shiki/turbo.json b/packages/rehype-shiki/turbo.json index 1dd6dce7da26a..7a34fa4ca9091 100644 --- a/packages/rehype-shiki/turbo.json +++ b/packages/rehype-shiki/turbo.json @@ -2,10 +2,12 @@ "$schema": "https://turbo.build/schema.json", "extends": ["//"], "tasks": { - "build": {}, "lint:js": { "inputs": ["src/**/*.mjs"] }, + "lint:fix": { + "cache": false + }, "test:unit": { "inputs": ["src/**/*.mjs"] } diff --git a/packages/ui-components/.lintstagedrc.json b/packages/ui-components/.lintstagedrc.json new file mode 100644 index 0000000000000..571dfad0759c2 --- /dev/null +++ b/packages/ui-components/.lintstagedrc.json @@ -0,0 +1,5 @@ +{ + "**/*.{js,mjs,ts,tsx,md,mdx}": ["prettier --check --write", "eslint --fix"], + "**/*.css": ["stylelint --allow-empty-input", "prettier --write"], + "**/*.{json,yml}": ["prettier --check --write"] +} diff --git a/packages/ui-components/eslint.config.js b/packages/ui-components/eslint.config.js index fa5803300b76b..5d835e07068cf 100644 --- a/packages/ui-components/eslint.config.js +++ b/packages/ui-components/eslint.config.js @@ -1,4 +1,4 @@ -import importX from 'eslint-plugin-import-x'; +import { flatConfigs } from 'eslint-plugin-import-x'; import react from 'eslint-plugin-react'; import storybook from 'eslint-plugin-storybook'; import tseslint from 'typescript-eslint'; @@ -11,7 +11,7 @@ export default tseslint.config( extends: [ react.configs.flat['jsx-runtime'], ...tseslint.configs.recommended, - importX.flatConfigs.typescript, + flatConfigs.typescript, ], files: ['**/*.{js,mjs,ts,tsx}'], rules: { diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 651d459009575..5df2ec63c09d5 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -13,23 +13,23 @@ "files": [ "Common", "Containers", - "MDX", "Icons", + "MDX", + "stylelint", "styles", - "types.ts", - "stylelint" + "types.ts" ], "scripts": { - "check-types": "tsc --noEmit", "lint": "turbo run lint:js lint:css", "lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache", - "lint:fix": "turbo run lint:js lint:css --no-cache -- --fix", + "lint:fix": "node --run lint -- -- --fix", "lint:js": "eslint \"**/*.{js,mjs,ts,tsx}\"", + "lint:types": "tsc --noEmit", "storybook": "cross-env NODE_NO_WARNINGS=1 storybook dev -p 6006 --quiet", "storybook:build": "cross-env NODE_NO_WARNINGS=1 storybook build --quiet --webpack-stats-json", - "test": "turbo test:unit", + "test": "node --run test:unit", "test:unit": "cross-env NODE_NO_WARNINGS=1 node --experimental-test-coverage --test-coverage-exclude=**/*.test.* --enable-source-maps --import=global-jsdom/register --import=tsx --import=../../tests/setup.mjs --test **/*.test.*", - "test:unit:watch": "cross-env NODE_OPTIONS=\"--watch\" pnpm test:unit" + "test:unit:watch": "node --run test:unit -- --watch" }, "dependencies": { "@heroicons/react": "^2.2.0", @@ -49,8 +49,8 @@ "tailwindcss": "~4.0.17" }, "devDependencies": { - "@storybook/addon-themes": "^9.0.3", "@storybook/addon-styling-webpack": "^1.0.1", + "@storybook/addon-themes": "^9.0.3", "@storybook/addon-webpack5-compiler-swc": "^3.0.0", "@storybook/react": "^9.0.3", "@storybook/react-webpack5": "^9.0.3", diff --git a/packages/ui-components/turbo.json b/packages/ui-components/turbo.json index 4259720a66ae5..5876730ca18cc 100644 --- a/packages/ui-components/turbo.json +++ b/packages/ui-components/turbo.json @@ -3,7 +3,6 @@ "extends": ["//"], "globalEnv": ["NODE_ENV"], "tasks": { - "build": {}, "lint:js": { "inputs": ["**/*.{json,mjs,js,ts,tsx}"] }, @@ -14,6 +13,9 @@ "lint:fix": { "cache": false }, + "lint:types": { + "cache": false + }, "storybook": { "cache": false, "persistent": true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c47d8ad2e89ac..69b93ed5beb2f 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -7,7 +7,9 @@ packages: # run installation scripts. onlyBuiltDependencies: - '@swc/core' + - '@tailwindcss/oxide' - '@vercel/speed-insights' - esbuild - sharp - unrs-resolver + - workerd diff --git a/turbo.json b/turbo.json index 80bcb76f5f7ff..c11f6e713bf33 100644 --- a/turbo.json +++ b/turbo.json @@ -2,27 +2,16 @@ "$schema": "https://turbo.build/schema.json", "dangerouslyDisablePackageManagerCheck": true, "tasks": { - "scripts:release-post": { - "cache": false - }, "//#prettier": { "outputs": [".prettiercache"] }, - "lint": { - "dependsOn": [ - "@node-core/website#lint:md", - "@node-core/website#lint:css", - "lint:js" - ] + "build": { + "dependsOn": ["^topo"] }, - "lint:lint-staged": { - "dependsOn": [ - "@node-core/website#lint:md", - "@node-core/website#lint:css", - "@node-core/website#lint:js" - ] + "lint": { + "dependsOn": ["^topo"] }, - "check-types": { + "test": { "dependsOn": ["^topo"] }, "topo": {