Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release-2.10' into electron_fr…
Browse files Browse the repository at this point in the history
…eebsd
  • Loading branch information
genneko committed Jun 4, 2023
2 parents 3290669 + 1100ab0 commit 73245ce
Show file tree
Hide file tree
Showing 991 changed files with 59,419 additions and 40,987 deletions.
1,562 changes: 49 additions & 1,513 deletions .eslintignore

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module.exports = {
'no-array-constructor': ['error'],
'radix': ['error'],
'eqeqeq': ['error', 'always'],
'no-console': ['error', { 'allow': ['warn', 'error'] }],

// Warn only for now because fixing everything would take too much
// refactoring, but new code should try to stick to it.
Expand All @@ -91,6 +92,7 @@ module.exports = {
// "react-hooks/exhaustive-deps": "warn",

'promise/prefer-await-to-then': 'error',
'no-unneeded-ternary': 'error',

// -------------------------------
// Formatting
Expand All @@ -109,6 +111,7 @@ module.exports = {
'exports': 'always-multiline',
'functions': 'never',
}],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'no-trailing-spaces': 'error',
'linebreak-style': ['error', 'unix'],
'prefer-template': ['error'],
Expand All @@ -134,6 +137,14 @@ module.exports = {
'spaced-comment': ['error', 'always'],
'keyword-spacing': ['error', { 'before': true, 'after': true }],
'no-multi-spaces': ['error'],

// Regarding the keyword blacklist:
// - err: We generally avoid using too many abbreviations, so it should
// be "error", not "err"
// - notebook: In code, it should always be "folder" (not "notebook").
// In user-facing text, it should be "notebook".
'id-denylist': ['error', 'err', 'notebook', 'notebooks'],
'prefer-arrow-callback': ['error'],
},
'plugins': [
'react',
Expand All @@ -146,6 +157,16 @@ module.exports = {
'promise',
],
'overrides': [
{
'files': [
'packages/tools/**',
'packages/app-mobile/tools/**',
'packages/app-desktop/tools/**',
],
'rules': {
'no-console': 'off',
},
},
{
// enable the rule specifically for TypeScript files
'files': ['*.ts', '*.tsx'],
Expand All @@ -158,6 +179,7 @@ module.exports = {
// make everything public which is not great. New code however should specify member accessibility.
'@typescript-eslint/explicit-member-accessibility': ['warn'],
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
'@typescript-eslint/no-inferrable-types': ['error', { 'ignoreParameters': true, 'ignoreProperties': true }],
'@typescript-eslint/comma-dangle': ['error', {
'arrays': 'always-multiline',
'objects': 'always-multiline',
Expand All @@ -168,6 +190,7 @@ module.exports = {
'tuples': 'always-multiline',
'functions': 'never',
}],
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/member-delimiter-style': ['error', {
'multiline': {
Expand Down
13 changes: 12 additions & 1 deletion .github/scripts/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ if [ "$IS_PULL_REQUEST" == "1" ] || [ "$IS_DEV_BRANCH" = "1" ]; then
if [ $testResult -ne 0 ]; then
exit $testResult
fi

yarn run packageJsonLint
testResult=$?
if [ $testResult -ne 0 ]; then
exit $testResult
fi
fi

# =============================================================================
Expand Down Expand Up @@ -177,7 +183,12 @@ if [[ $GIT_TAG_NAME = v* ]]; then
# cd "$ROOT_DIR/packages/tools"
# node bundleDefaultPlugins.js
cd "$ROOT_DIR/packages/app-desktop"
USE_HARD_LINKS=false yarn run dist

if [ "$IS_MACOS" == "1" ]; then
PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn run dist
else
USE_HARD_LINKS=false yarn run dist
fi
elif [[ $IS_LINUX = 1 ]] && [[ $GIT_TAG_NAME = $SERVER_TAG_PREFIX-* ]]; then
echo "Step: Building Docker Image..."
cd "$ROOT_DIR"
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# The goal of this action is to compile the Android debug build. That should
# tell us automatically if something got broken when a dependency was changed.

name: react-native-android-build-apk
on: [push, pull_request]

jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'

BuildAndroidDebug:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- name: Install Linux dependencies
run: |
sudo apt-get update || true
sudo apt-get install -y libsecret-1-dev
- uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Yarn
run: |
corepack enable
- uses: actions/checkout@v2

- name: Install
run: yarn install

- name: Build Android Release
run: |
cd packages/app-mobile/android && ./gradlew assembleDebug
36 changes: 36 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "CLA Assistant"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened,closed,synchronize]

jobs:
CLAAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: contributor-assistant/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
path-to-signatures: 'readme/cla_signatures.json'
path-to-document: 'https://github.com/laurent22/joplin/blob/dev/readme/cla.md' # e.g. a CLA or a DCO document
# branch should not be protected
branch: 'dev'
allowlist: joplinbot,renovate[bot]

# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
#use-dco-flag: true - If you are using DCO instead of CLA
42 changes: 38 additions & 4 deletions .github/workflows/github-actions-main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
name: Joplin Continuous Integration
on: [push, pull_request]
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'

Main:
needs: pre_job
# We always process server or desktop release tags, because they also publish the release
if: needs.pre_job.outputs.should_skip != 'true' || startsWith(github.ref, 'refs/tags/server-v') || startsWith(github.ref, 'refs/tags/v')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-2019]
steps:

# Trying to fix random networking issues on Windows
# https://github.com/actions/runner-images/issues/1187#issuecomment-686735760
- name: Disable TCP/UDP offload on Windows
if: runner.os == 'Windows'
run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6

- name: Disable TCP/UDP offload on Linux
if: runner.os == 'Linux'
run: sudo ethtool -K eth0 tx off rx off

- name: Disable TCP/UDP offload on macOS
if: runner.os == 'macOS'
run: |
sudo sysctl -w net.link.generic.system.hwcksum_tx=0
sudo sysctl -w net.link.generic.system.hwcksum_rx=0
# Silence apt-get update errors (for example when a module doesn't
# exist) since otherwise it will make the whole build fails, even though
# it might work without update. libsecret-1-dev is required for keytar -
Expand Down Expand Up @@ -41,7 +70,7 @@ jobs:
- uses: olegtarasov/[email protected]
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'

- name: Install Yarn
run: |
Expand All @@ -51,7 +80,7 @@ jobs:
# Login to Docker only if we're on a server release tag. If we run this on
# a pull request it will fail because the PR doesn't have access to
# secrets
- uses: docker/login-action@v1
- uses: docker/login-action@v2
if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/server-v')
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -99,6 +128,8 @@ jobs:
yarn install && cd packages/app-desktop && yarn run dist --publish=never
ServerDockerImage:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -123,7 +154,7 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: '18'

- name: Install Yarn
run: |
Expand All @@ -136,4 +167,7 @@ jobs:
run: |
yarn install
yarn run buildServerDocker --tag-name server-v0.0.0 --repository joplin/server
# Basic test to ensure that the created build is valid. It should exit with
# code 0 if it works.
docker run joplin/server:0.0.0-beta node dist/app.js migrate list
Loading

0 comments on commit 73245ce

Please sign in to comment.