Skip to content

Commit

Permalink
feat(build): monorepo packagesManager and PackageMetadata abstraction…
Browse files Browse the repository at this point in the history
…s and build integration tests

Extracted from facebook#5876 to hopefully land it in smaller chunks.
Addresses the infrastructure needed for facebook#5869 (without the associated changes to scripts)
  • Loading branch information
etrepum committed Apr 22, 2024
1 parent da06d8f commit 2a5cc10
Show file tree
Hide file tree
Showing 107 changed files with 18,028 additions and 482 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
**/config/**
**/build/**
**/npm/**
**/__tests__/integration/fixtures/**
!scripts/npm/**
**/*.js.flow
**/*.d.ts
**/playwright*/**
Expand Down
9 changes: 6 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module.exports = {
// node scripts should be console logging so don't lint against that
files: ['scripts/**/*.js'],
rules: {
// https://github.com/Stuk/eslint-plugin-header/issues/39
'header/header': OFF,
'no-console': OFF,
},
},
Expand Down Expand Up @@ -213,7 +215,8 @@ module.exports = {

'react/jsx-tag-spacing': ERROR,

'react/jsx-uses-react': ERROR,
// This hasn't been necessary since React 17
'react/jsx-uses-react': OFF,

// We don't care to do this
'react/jsx-wrap-multilines': [
Expand All @@ -223,8 +226,8 @@ module.exports = {

'react/no-is-mounted': OFF,

// This isn't useful in our test code
'react/react-in-jsx-scope': ERROR,
// This hasn't been necessary since React 17
'react/react-in-jsx-scope': OFF,

'react/self-closing-comp': ERROR,

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,33 @@ jobs:
run: npm ci
- run: npm run test-unit

integration:
if: github.repository_owner == 'facebook'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.18.0]
env:
CI: true
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@8
- uses: actions/cache@v3
id: cache
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-v${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run test-integration

e2e-mac:
if: github.repository_owner == 'facebook'
runs-on: macos-latest
Expand Down
10 changes: 6 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# NOTE: In general this should be kept in sync with .eslintignore

packages/**/dist/**
packages/**/build/**
packages/**/npm/**
packages/**/config/**
**/dist/**
**/build/**
**/npm/**
**/__tests__/integration/fixtures/**
**/config/**
packages/**/.wxt/**
packages/playwright
packages/playwright-core
packages/**/vite.config.js
packages/**/vite.prod.config.js
packages/lexical-website/docs/api
**/*.md
**/*.js.flow
**/node_modules
Expand Down
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ module.exports = {
'^.+\\.tsx$': 'ts-jest',
},
},
{
...common,
displayName: 'integration',
globalSetup: './scripts/__tests__/integration/setup.js',
testMatch: ['**/scripts/__tests__/integration/**/*.test.js'],
},
{
...common,
displayName: 'e2e',
Expand Down
Loading

0 comments on commit 2a5cc10

Please sign in to comment.