-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into @maksg/performance-fixes-ios
- Loading branch information
Showing
85 changed files
with
5,358 additions
and
2,674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,12 @@ jobs: | |
if: ${{ github.actor != 'OSBotify' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify | ||
# This is a workaround to allow pushes to a protected branch | ||
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }} | ||
|
||
- name: Decrypt & Import OSBotify GPG key | ||
run: | | ||
|
@@ -36,17 +39,11 @@ jobs: | |
git config --global user.name OSBotify | ||
git config --global user.email [email protected] | ||
- uses: actions/setup-node@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.x' | ||
node-version-file: '.nvmrc' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Generate branch name | ||
run: echo "BRANCH_NAME=OSBotify-bump-version-$(uuidgen)" >> $GITHUB_ENV | ||
|
||
- name: Create branch for version-bump pull request | ||
run: git checkout -b ${{ env.BRANCH_NAME }} | ||
|
||
- name: Install yarn packages | ||
run: yarn install --immutable | ||
|
||
|
@@ -63,26 +60,7 @@ jobs: | |
run: git tag ${{ env.NEW_VERSION }} | ||
|
||
- name: Push branch and publish tags | ||
run: git push --set-upstream origin ${{ env.BRANCH_NAME }} && git push --tags | ||
|
||
- name: Create pull request | ||
run: | | ||
gh pr create \ | ||
--title "Update version to ${{ env.NEW_VERSION }}" \ | ||
--body "Update version to ${{ env.NEW_VERSION }}" | ||
sleep 5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} | ||
|
||
- name: Auto-approve pull request | ||
run: gh pr review --approve ${{ env.BRANCH_NAME }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Auto-merge pull request | ||
run: gh pr merge --squash --delete-branch ${{ env.BRANCH_NAME }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: git push --set-upstream origin main && git push --tags | ||
|
||
- name: Build package | ||
run: yarn pack | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Test web E2E | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/web-e2e-test.yml | ||
- src/** | ||
- WebExample/** | ||
merge_group: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/web-e2e-test.yml | ||
- src/** | ||
- WebExample/** | ||
|
||
jobs: | ||
test: | ||
if: github.repository == 'Expensify/react-native-live-markdown' | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./WebExample | ||
|
||
concurrency: | ||
group: web-e2e-test-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install node_modules | ||
run: yarn install --immutable | ||
|
||
- name: Install browsers | ||
run: npx playwright install --with-deps | ||
|
||
- name: Install dependencies for browsers | ||
run: npx playwright install-deps | ||
|
||
- name: Run Playwright tests | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,3 +79,4 @@ lib/ | |
|
||
# react-native-live-markdown | ||
android/src/main/assets/react-native-live-markdown-parser.js | ||
.build_complete |
426 changes: 213 additions & 213 deletions
426
.yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.4.cjs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,7 @@ yarn-error.* | |
|
||
# typescript | ||
*.tsbuildinfo | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
rules: { | ||
'@lwc/lwc/no-async-await': 'off', | ||
'rulesdir/prefer-import-module-contents': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import * as TEST_CONST from '../../example/src/testConstants'; | ||
import {getCursorPosition, getElementValue, setupInput} from './utils'; | ||
|
||
test.beforeEach(async ({page}) => { | ||
await page.goto(TEST_CONST.LOCAL_URL, {waitUntil: 'load'}); | ||
}); | ||
|
||
test.describe('typing', () => { | ||
test('short text', async ({page}) => { | ||
const inputLocator = await setupInput(page, 'clear'); | ||
|
||
await inputLocator.focus(); | ||
await inputLocator.pressSequentially(TEST_CONST.EXAMPLE_CONTENT); | ||
|
||
expect(await getElementValue(inputLocator)).toEqual(TEST_CONST.EXAMPLE_CONTENT); | ||
}); | ||
|
||
test('fast type cursor position', async ({page}) => { | ||
const EXAMPLE_LONG_CONTENT = TEST_CONST.EXAMPLE_CONTENT.repeat(3); | ||
|
||
const inputLocator = await setupInput(page, 'clear'); | ||
|
||
await inputLocator.pressSequentially(EXAMPLE_LONG_CONTENT); | ||
|
||
expect(await getElementValue(inputLocator)).toBe(EXAMPLE_LONG_CONTENT); | ||
|
||
const cursorPosition = await getCursorPosition(inputLocator); | ||
|
||
expect(cursorPosition.end).toBe(EXAMPLE_LONG_CONTENT.length); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import type {Page} from '@playwright/test'; | ||
import * as TEST_CONST from '../../example/src/testConstants'; | ||
import {setupInput, getElementStyle} from './utils'; | ||
|
||
const testMarkdownContentStyle = async ({testContent, style, page}: {testContent: string; style: string; page: Page}) => { | ||
const inputLocator = await setupInput(page); | ||
|
||
const elementHandle = inputLocator.locator('span', {hasText: testContent}).last(); | ||
const elementStyle = await getElementStyle(elementHandle); | ||
|
||
expect(elementStyle).toEqual(style); | ||
}; | ||
|
||
test.beforeEach(async ({page}) => { | ||
await page.goto(TEST_CONST.LOCAL_URL, {waitUntil: 'load'}); | ||
await page.click('[data-testid="reset"]'); | ||
}); | ||
|
||
test.describe('markdown content styling', () => { | ||
test('bold', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'world', style: 'font-weight: bold;', page}); | ||
}); | ||
|
||
test('link', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'https://expensify.com', style: 'color: blue; text-decoration: underline;', page}); | ||
}); | ||
|
||
test('h1', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'header1', style: 'font-size: 25px; font-weight: bold;', page}); | ||
}); | ||
|
||
test('inline code', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'inline code', style: 'font-family: monospace; font-size: 20px; color: black; background-color: lightgray;', page}); | ||
}); | ||
|
||
test('codeblock', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'codeblock', style: 'font-family: monospace; font-size: 20px; color: black; background-color: lightgray;', page}); | ||
}); | ||
|
||
test('mention-here', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'here', style: 'color: green; background-color: lime;', page}); | ||
}); | ||
|
||
test('mention-user', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: '[email protected]', style: 'color: blue; background-color: cyan;', page}); | ||
}); | ||
|
||
test('mention-report', async ({page}) => { | ||
await testMarkdownContentStyle({testContent: 'mention-report', style: 'color: red; background-color: pink;', page}); | ||
}); | ||
|
||
test('blockquote', async ({page, browserName}) => { | ||
const blockquoteStyle = | ||
'border-color: gray; border-width: 6px; margin-left: 6px; padding-left: 6px; border-left-style: solid; display: inline-block; max-width: 100%; box-sizing: border-box;'; | ||
|
||
// Firefox border properties are serialized slightly differently | ||
const browserStyle = browserName === 'firefox' ? blockquoteStyle.replace('border-left-style: solid', 'border-left: 6px solid gray') : blockquoteStyle; | ||
|
||
await testMarkdownContentStyle({testContent: 'blockquote', style: browserStyle, page}); | ||
}); | ||
}); |
Oops, something went wrong.