Skip to content

Commit

Permalink
Merge branch 'unstable' into feature/ses-476/remove-profile-picture
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Aug 21, 2023
2 parents 69c8bd7 + 61fbd23 commit bc081df
Show file tree
Hide file tree
Showing 472 changed files with 4,922 additions and 7,818 deletions.
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
build/**
components/**
dist/**
mnemonic_languages/**

# editor
.vscode/**
.vscrof/**

# TypeScript generated files
ts/**/*.js
**/ts/**/*.js

playwright.config.js
preload.js
stylesheets/dist/
compiled.d.ts
.eslintrc.js
playwright.config.js
66 changes: 61 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
// For reference: https://github.com/airbnb/javascript

module.exports = {
root: true,
settings: {
'import/core-modules': ['electron'],
react: {
version: 'detect',
},
},

extends: ['airbnb-base', 'prettier'],
extends: [
'airbnb-base',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],

plugins: ['mocha', 'more'],
plugins: ['mocha', 'more', '@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: { project: ['tsconfig.json'] },

rules: {
'comma-dangle': [
Expand Down Expand Up @@ -47,10 +57,38 @@ module.exports = {
'linebreak-style': ['error', 'unix'],

quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/no-misused-promises': 'error',

// Prettier overrides:
'arrow-parens': 'off',
'no-nested-ternary': 'off',
'function-paren-newline': 'off',

'import/prefer-default-export': 'off',
'operator-linebreak': 'off',
'prefer-destructuring': 'off',
'max-classes-per-file': 'off',
'lines-between-class-members': 'off',
'@typescript-eslint/no-explicit-any': 'off', // to reenable later
'arrow-body-style': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'no-void': 'off',
'default-param-last': 'off',

'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'class-methods-use-this': 'off',
camelcase: 'off',

'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// 'no-unused-expressions': 'off',
// '@typescript-eslint/no-unused-expressions': 'error',

'max-len': [
'error',
{
Expand All @@ -59,10 +97,28 @@ module.exports = {
// high value as a buffer to let Prettier control the line length:
code: 999,
// We still want to limit comments as before:
comments: 150,
comments: 200,
ignoreUrls: true,
ignoreRegExpLiterals: true,
},
],
},
overrides: [
{
files: ['*_test.ts'],
rules: {
'no-unused-expressions': 'off',
'no-await-in-loop': 'off',
'no-empty': 'off',
},
},
{
files: ['ts/state/ducks/*.tsx', 'ts/state/ducks/*.ts'],
rules: { 'no-param-reassign': ['error', { props: false }] },
},
{
files: ['ts/node/**/*.ts', 'ts/test/**/*.ts'],
rules: { 'no-console': 'off', 'import/no-extraneous-dependencies': 'off' },
},
],
};
43 changes: 4 additions & 39 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
branches:
- clearnet
- unstable
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -27,45 +30,7 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v3

# we stay on v2 even if there is a v3 because the v3 logic is less flexible for our usecase
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}

# Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global yarn node-gyp@latest
npm config set msvs_version 2022
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000 --force

- name: Generate and concat files
run: yarn build-everything

- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one
if: runner.os == 'Linux'
run: yarn lint-full

- name: Unit Test
run: yarn test
- uses: ./actions/setup_and_build

- name: Build windows production binaries
if: runner.os == 'Windows'
Expand Down
36 changes: 6 additions & 30 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
branches:
- clearnet
- unstable
- unstable1

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -23,36 +28,7 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v3

# we stay on v2 even if there is a v3 because the v3 logic is less flexible for our usecase
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}

#Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global node-gyp@latest
npm config set msvs_version 2022
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000 --force

- name: Generate and concat files
run: yarn build-everything
- uses: ./actions/setup_and_build

- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one
Expand Down
40 changes: 1 addition & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,7 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v3

# we stay on v2 even if there is a v3 because the v3 logic is less flexible for our usecase
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v2
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}

#Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
run: |
npm install --global node-gyp@latest
npm config set msvs_version 2022
- name: Install Desktop node_modules
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000 --force

- name: Generate and concat files
run: yarn build-everything

- name: Lint Files
# no need to lint files on all platforms. Just do it once on the quicker one
if: runner.os == 'Linux'
run: yarn lint-full

- name: Unit Test
run: yarn test
- uses: ./actions/setup_and_build

- name: Build windows production binaries
if: runner.os == 'Windows'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ yarn-error.log

# editor
.vscode/
.vscrof/


playwright.config.js
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.0
18.15.0
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ts/test/automation/notes
# Third-party files
node_modules/**
mnemonic_languages/**
playwright.config.js
.vscode/
.vscrof/

# Managed by package manager (`yarn`/`npm`):
/package.json
Expand Down
1 change: 0 additions & 1 deletion .yarnclean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ __tests__
test
tests
powered-test
!@playwright/test/**

# asset directories
docs
Expand Down
2 changes: 1 addition & 1 deletion INTERNALBUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ base64 -i certificate.p12 -o encoded.txt

### Node version

You will need node `16.13.0`.
You will need node `18.15.0`.
This can be done by using [nvm](https://github.com/nvm-sh/nvm) and running `nvm use` or you can install it manually.
Once nvm is installed, just run `nvm install` to install the version from the `.nvmrc` file and then `nvm use` to use it.

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Session Desktop

[Download at getsession.org](https://getsession.org/download)

## Summary

Session integrates directly with [Oxen Service Nodes](https://docs.oxen.io/about-the-oxen-blockchain/oxen-service-nodes), which are a set of distributed, decentralized and Sybil resistant nodes. Service Nodes act as servers which store messages offline, and a set of nodes which allow for onion routing functionality obfuscating users IP Addresses. For a full understanding of how Session works, read the [Session Whitepaper](https://getsession.org/whitepaper).
<br/><br/>
![DesktopSession](https://i.imgur.com/ZnHvYjo.jpg)
![DesktopSession](https://i.imgur.com/ydVhH00.png)

## Want to Contribute? Found a Bug or Have a feature request?

Expand Down
4 changes: 3 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
"messageBodyMissing": "Please enter a message body.",
"messageBody": "Message body",
"unblockToSend": "Unblock this contact to send a message.",
"unblockGroupToSend": "This group is blocked. Unlock it if you would like to send a message.",
"youChangedTheTimer": "You set the disappearing message timer to $time$",
"timerSetOnSync": "Updated disappearing message timer to $time$",
"theyChangedTheTimer": "$name$ set the disappearing message timer to $time$",
Expand Down Expand Up @@ -443,6 +442,8 @@
"clearAll": "Clear All",
"clearDataSettingsTitle": "Clear Data",
"messageRequests": "Message Requests",
"blindedMsgReqsSettingTitle": "Community Message Requests",
"blindedMsgReqsSettingDesc": "Allow message requests from Community conversations.",
"requestsSubtitle": "Pending Requests",
"requestsPlaceholder": "No requests",
"hideRequestBannerDescription": "Hide the Message Request banner until you receive a new message request.",
Expand Down Expand Up @@ -490,6 +491,7 @@
"clearAllConfirmationTitle": "Clear All Message Requests",
"clearAllConfirmationBody": "Are you sure you want to clear all message requests?",
"noMessagesInReadOnly": "There are no messages in <b>$name$</b>.",
"noMessagesInBlindedDisabledMsgRequests": "<b>$name$</b> has message requests from Community conversations turned off, so you cannot send them a message.",
"noMessagesInNoteToSelf": "You have no messages in <b>$name$</b>.",
"noMessagesInEverythingElse": "You have no messages from <b>$name$</b>. Send a message to start the conversation!",
"hideBanner": "Hide",
Expand Down
1 change: 1 addition & 0 deletions about_preload.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* global window */

const { ipcRenderer } = require('electron');
Expand Down
37 changes: 37 additions & 0 deletions actions/setup_and_build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Setup and build'
description: 'Setup and build Session Desktop'
runs:
using: 'composite'
steps:
- name: Install node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'

- name: Cache Desktop node_modules
id: cache-desktop-modules
uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}

# Not having this will break the windows build because the PATH won't be set by msbuild.
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
shell: bash
run: |
yarn global add node-gyp@latest
- name: Install dependencies
shell: bash
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --network-timeout 600000

- name: Generate and concat files
shell: bash
run: yarn build-everything
Loading

0 comments on commit bc081df

Please sign in to comment.