Skip to content

Commit

Permalink
Merge branch 'main' into cloned_nightly_workflow_dispatch_a1260
Browse files Browse the repository at this point in the history
  • Loading branch information
furwellness authored Aug 13, 2024
2 parents a126064 + 4cbb85f commit e2e2f50
Show file tree
Hide file tree
Showing 355 changed files with 24,787 additions and 8,994 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.name_mapper='^@lexical/react/LexicalComposerContext$' -> '<PROJECT_ROOT>/
module.name_mapper='^@lexical/react/LexicalContentEditable$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalContentEditable.js.flow'
module.name_mapper='^@lexical/react/LexicalContextMenuPlugin$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalContextMenuPlugin.js.flow'
module.name_mapper='^@lexical/react/LexicalDecoratorBlockNode$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalDecoratorBlockNode.js.flow'
module.name_mapper='^@lexical/react/LexicalDraggableBlockPlugin$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalDraggableBlockPlugin.js.flow'
module.name_mapper='^@lexical/react/LexicalEditorRefPlugin$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalEditorRefPlugin.js.flow'
module.name_mapper='^@lexical/react/LexicalErrorBoundary$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalErrorBoundary.js.flow'
module.name_mapper='^@lexical/react/LexicalHashtagPlugin$' -> '<PROJECT_ROOT>/packages/lexical-react/flow/LexicalHashtagPlugin.js.flow'
Expand Down
9 changes: 8 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Lexical version:
Link to code example:

<!--
Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://codesandbox.io/s/lexical-plain-text-example-g932e), a link to a
Please provide a CodeSandbox (https://codesandbox.io/s/new) or (https://stackblitz.com/github/facebook/lexical/tree/main/examples/react-plain-text?embed=1&file=src%2FApp.tsx&terminalHeight=0&ctl=1&showSidebar=0&devtoolsheight=0&view=preview), a link to a
repository on GitHub, or provide a minimal code example that reproduces the
problem. You may provide a screenshot of the application if you think it is
relevant to your bug report. Here are some tips for providing a minimal
Expand All @@ -37,3 +37,10 @@ Link to code example:
## The current behavior

## The expected behavior

## Impact of fix
<!--
- How severe is this bug? How often does it happen? Is it causing an outage somewhere?
- Who would benefit from this fix? Any specific users, groups or companies?
- If possible include metrics. Approximately how many users would this fix benefit?
-->
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@ title: 'Feature: '
labels: 'enhancement'
---

## Description
<!--
Please provide a clear and concise description of the feature proposal and outline the motivation for the proposal. Is your feature request related to a specific problem? e.g., *"I'm working on X and would like Y to be possible"*. If this is related to another GitHub issue, please link here too.
-->

<!--
What are the use cases? List example use cases.
-->

<!--
A description of the alternative solutions or features you've considered, if any.
-->

<!--
Add any other context or screenshots about the feature request.
-->

## Impact
<!--
- Who would benefit from this feature? Any specific users, groups or companies?
- If possible include metrics. Approximately how many users would this feature benefit? How often would this feature be used?
-->


37 changes: 20 additions & 17 deletions .github/workflows/after-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,26 @@ on:
pull_request_review:
types: [submitted]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
label-pr:
if: github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests')
pre_job:
if: (github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests'))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: Add label for extended tests
env:
GH_TOKEN: ${{ secrets.LEXICAL_BOT_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Adding label 'extended-tests' to PR $NUMBER"
gh pr edit "$NUMBER" --add-label "extended-tests" || (echo "Failed to add label" && exit 1)
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
do_not_skip: '["pull_request", "merge_group"]'
paths_ignore: '["packages/lexical-website/**", "packages/*/README.md", ".size-limit.js", "examples/**"]'
e2e-tests:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' && (github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests'))
uses: ./.github/workflows/call-e2e-all-tests.yml

integration-tests:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' && (github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests'))
uses: ./.github/workflows/call-integration-tests.yml
45 changes: 38 additions & 7 deletions .github/workflows/call-e2e-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,27 @@ on:
workflow_call:

jobs:
mac:
mac-rich:
strategy:
matrix:
node-version: [18.18.0]
browser: ['chromium', 'firefox', 'webkit']
editor-mode: ['rich-text', 'plain-text']
browser: ['webkit', 'chromium', 'firefox']
editor-mode: ['rich-text']
events-mode: ['modern-events']
uses: ./.github/workflows/call-e2e-test.yml
with:
os: 'macos-latest'
node-version: ${{ matrix.node-version }}
browser: ${{ matrix.browser }}
editor-mode: ${{ matrix.editor-mode }}
events-mode: ${{ matrix.events-mode }}

mac-plain:
strategy:
matrix:
node-version: [18.18.0]
browser: ['webkit']
editor-mode: ['plain-text']
events-mode: ['modern-events']
uses: ./.github/workflows/call-e2e-test.yml
with:
Expand Down Expand Up @@ -56,7 +71,7 @@ jobs:
strategy:
matrix:
node-version: [18.18.0]
browser: ['chromium', 'firefox', 'webkit']
browser: ['webkit']
uses: ./.github/workflows/call-e2e-test.yml
with:
os: 'macos-latest'
Expand Down Expand Up @@ -94,7 +109,7 @@ jobs:
prod:
strategy:
matrix:
os: ['macos-latest']
os: ['ubuntu-latest']
node-version: [18.18.0]
browser: ['chromium']
editor-mode: ['rich-text']
Expand All @@ -111,7 +126,7 @@ jobs:
collab-prod:
strategy:
matrix:
os: ['macos-latest']
os: ['ubuntu-latest']
node-version: [18.18.0]
browser: ['chromium']
editor-mode: ['rich-text-with-collab']
Expand All @@ -134,10 +149,26 @@ jobs:
prod: [false]
uses: ./.github/workflows/call-e2e-test.yml
with:
os: 'macos-latest'
os: 'ubuntu-latest'
browser: 'chromium'
node-version: 18.18.0
events-mode: 'modern-events'
editor-mode: ${{ matrix.editor-mode }}
prod: ${{ matrix.prod }}
override-react-version: beta

flaky:
strategy:
matrix:
node-version: [18.18.0]
browser: ['chromium', 'firefox']
editor-mode: ['rich-text', 'plain-text', 'rich-text-with-collab']
events-mode: ['modern-events']
uses: ./.github/workflows/call-e2e-test.yml
with:
os: 'ubuntu-latest'
flaky: true
node-version: ${{ matrix.node-version }}
browser: ${{ matrix.browser }}
editor-mode: ${{ matrix.editor-mode }}
events-mode: ${{ matrix.events-mode }}
2 changes: 1 addition & 1 deletion .github/workflows/call-e2e-canary-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
canary:
strategy:
matrix:
os: ['macos-latest']
os: ['ubuntu-latest']
node-version: [18.18.0]
browser: ['chromium']
editor-mode: ['rich-text']
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/call-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ on:
editor-mode: {required: true, type: string}
events-mode: {required: true, type: string}
prod: {required: false, type: boolean}
flaky: {required: false, type: boolean} # Defaults to false: dont run flaky
override-react-version: {required: false, type: string}

jobs:
e2e-test:
runs-on: ${{ inputs.os }}
continue-on-error: ${{ inputs.flaky }}
if: (inputs.browser != 'webkit' || inputs.os == 'macos-latest') && (inputs.editor-mode != 'rich-text-with-collab' || inputs.events-mode != 'legacy-events')
env:
CI: true
Expand All @@ -22,7 +24,7 @@ jobs:
OVERRIDE_REACT_VERSION: ${{ inputs.override-react-version }}
cache_playwright_path: ${{ inputs.os == 'macos-latest' && '~/Library/Caches/ms-playwright' || inputs.os == 'windows-latest' && 'C:\Users\runneradmin\AppData\Local\ms-playwright' || '~/.cache/ms-playwright' }}
test_results_path: ${{ inputs.os == 'windows-latest' && '~/.npm/_logs/' || 'test-results/' }}
test_script: test-e2e-${{ inputs.editor-mode == 'rich-text-with-collab' && 'collab-' || '' }}${{ inputs.prod && 'prod-' || '' }}ci-${{ inputs.browser }}
test_script: test-e2e-${{ inputs.editor-mode == 'rich-text-with-collab' && 'collab-' || '' }}${{ inputs.prod && 'prod-' || '' }}ci-${{ inputs.browser }} ${{ inputs.flaky && '-- -- --grep "@flaky"' || '-- -- --grep-invert "@flaky"' }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ inputs.node-version }}
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/call-increment-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Increment Version
on:
workflow_call:
inputs:
increment:
required: true
type: string
dry-run:
required: true
type: boolean
channel:
required: true
type: string
git-repo:
required: true
type: string
secrets:
SSH_KEY:
required: true
outputs:
version:
description: 'The new package.json version, e.g. "0.16.0"'
value: ${{ jobs.release.outputs.version }}
tag-ref:
description: 'The fully qualified ref for the tag, e.g. "refs/tags/v0.16.0"'
value: ${{ jobs.release.outputs.tag-ref }}
latest-release:
description: 'The latest release (per GitHub releases) prior to this increment, e.g. "v0.15.0"'
value: ${{ jobs.release.outputs.latest-release }}

jobs:
release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.increment-version.outputs.version }}
tag-ref: ${{ steps.increment-version.outputs.tag-ref }}
latest-release: ${{ steps.latest.outputs.release }}
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_KEY }}
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: |
git config user.name "Lexical GitHub Actions Bot"
git config user.email "<>"
- id: latest
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: facebook
repo: lexical
excludes: draft
- id: increment-version
run: npm run increment-version
env:
# These are passed in the environment as they are used by
# the postversion script
INCREMENT: ${{ inputs.increment }}
CHANNEL: ${{ inputs.channel }}
LATEST_RELEASE: ${{ steps.latest.outputs.release }}
DRY_RUN: ${{ inputs.dry-run && '1' || '' }}
GIT_REPO: ${{ inputs.git-repo }}
2 changes: 1 addition & 1 deletion .github/workflows/call-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.18.0]
node-version: [20.15.1]
env:
CI: true
steps:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/call-npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: (call) Publish to NPM
on:
workflow_call:
inputs:
ref:
required: true
type: string
dry-run:
required: true
type: boolean
channel:
required: true
type: string
secrets:
NPM_TOKEN:
required: true

jobs:
release:
runs-on: ubuntu-latest
env:
DRY_RUN_ARG: ${{ inputs.dry-run && '--dry-run' || '' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run prepare-release
- run: node ./scripts/npm/release.js --non-interactive $DRY_RUN_ARG --channel='${{ inputs.channel }}'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 20 additions & 22 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
name: Nightly Release Branch
on:
# remove the workflow_dispatch when this is turned on
workflow_dispatch
# Run daily at 2:30am UTC
# schedule:
# - cron: '30 2 * * 1-5'
schedule:
- cron: '30 2 * * 1-5'
jobs:
release:
increment-version:
# prevents this action from running on forks
if: github.repository_owner == 'facebook'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_KEY }}
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name "Lexical GitHub Actions Bot"
git config user.email "<>"
- run: npm ci
- run: npm run increment-version -- --i prerelease
- run: git push -u [email protected]:facebook/lexical.git --follow-tags
uses: ./.github/workflows/call-increment-version.yml
with:
channel: nightly
increment: prerelease
dry-run: false
git-repo: '[email protected]:facebook/lexical.git'
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}
npm-release:
uses: ./.github/workflows/call-npm-publish.yml
needs: [increment-version]
with:
ref: ${{ needs.increment-version.outputs.tag-ref }}
dry-run: false
channel: nightly
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit e2e2f50

Please sign in to comment.