Skip to content

Commit

Permalink
fixing dbus not present and moving from yarn to npm (#1284)
Browse files Browse the repository at this point in the history
* fixing dbus not present and moving from yarn to npm

* removing package-lock.json from .gitignore file

* forcing the use of public npmrc
  • Loading branch information
IsmaelMartinez authored Jun 6, 2024
1 parent 0896927 commit fa228d9
Show file tree
Hide file tree
Showing 11 changed files with 4,773 additions and 2,443 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:linux:x64 -- --publish always
run: npm run dist:linux:x64 -- --publish always

linux_arm64:
runs-on: ubuntu-latest
Expand All @@ -36,17 +36,17 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:linux:arm64 -- --publish always
run: npm run dist:linux:arm64 -- --publish always

linux_arm:
runs-on: ubuntu-latest
Expand All @@ -55,17 +55,17 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:linux:arm -- --publish always
run: npm run dist:linux:arm -- --publish always

dmg:
runs-on: macos-latest
Expand All @@ -74,17 +74,17 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:mac:x64 -- --publish always
run: npm run dist:mac:x64 -- --publish always

exe:
runs-on: windows-latest
Expand All @@ -93,14 +93,14 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:windows -- --publish always
run: npm run dist:windows -- --publish always
16 changes: 8 additions & 8 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:linux:snap --publish always
run: npm run dist:linux:snap --publish always

snap-armv7l:
runs-on: ubuntu-latest
Expand All @@ -46,14 +46,14 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: yarn --link-duplicates --pure-lockfile
run: npm ci

- name: Release
if: contains(github.ref, 'develop')
run: yarn dist:linux:snap:armv7l --publish always
run: npm run dist:linux:snap:armv7l --publish always
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules/
dist/
parts/
snap/.snapcraft/
package-lock.json
generated-sources.json
.flatpak-builder/
flatpak-build/
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry="https://registry.npmjs.org/"
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ Each subfolder has a README.md file that explains the reason of existence and an

## Pre-requisites

To run this application from source, you will need yarn installed.
To run this application from source, you will need npm installed.

Please refer to the [yarn installation page](https://yarnpkg.com/en/docs/install)
Please refer to the [npm installation page](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)

## Run from source

To run the application from source:

```bash
yarn start
npm run start
```

## Build for linux

We are using [electron-build](https://www.electron.build/) in conbination with [travis-ci](https://travis-ci.org/) to create our build files.
We are using [electron-build](https://www.electron.build/) in combination with github actions to create our build files.

If you want to generate the build locally, you can run the following command:

```bash
yarn run dist:linux
npm run dist:linux
```

### Using a node container and podman (or docker)
If you want to use a node container to create your packages, use this command:
(docker user should replace podman by docker)
```bash
podman run -it --rm --volume .:/var/mnt:z -w /var/mnt/ node:14 /bin/bash -c "apt update && apt install -y rpm && yarn install && yarn run dist:linux"
podman run -it --rm --volume .:/var/mnt:z -w /var/mnt/ node:14 /bin/bash -c "apt update && apt install -y rpm && npm ci && npm run dist:linux"
```

This will build an deb, rpm, snap, AppImage and tar.gz files in the dist folder. This files can be run in most popular linux distributions.
Expand All @@ -51,7 +51,7 @@ Is possible to specify the snap or AppImage build type using running this:

```bash
# Standalone build
yarn run dist:linux:snap
npm run dist:linux:snap

# Or, if you have docker installed, you can alternatively build there
./dockerBuildSnap.sh
Expand Down
4 changes: 2 additions & 2 deletions KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The Intel build works on Apple Silicon Macs, but runs slow because it is emulate

You can **build your own Apple Silicon build from this repo yourself**, signed with your own local developer account keys. This is free, but the keys work only on our Mac.

The steps below expect that you have NodeJS and Yarn installed (both are in Homebrew).
The steps below expect that you have NodeJS and npm installed (both are in Homebrew).

1. Download XCode (from AppStore)
2. Open it
Expand All @@ -77,5 +77,5 @@ The steps below expect that you have NodeJS and Yarn installed (both are in Home
5. Click plus on lower left -> Apple development
6. Close the settings menu and create a new project in XCode. Does not matter which one, just create something using
the wizard, doesn't matter what. This is required to get the certificate into your local Keychain as trusted.
7. Run `yarn install`, `yarn dist:mac:arm64` in this repository. You should see `signing` step in the output with no errors, except for `skipped macOS notarization` warning.
7. Run `npm ci`, `npm run dist:mac:arm64` in this repository. You should see `signing` step in the output with no errors, except for `skipped macOS notarization` warning.
8. The app is built in the `dist/mac-arm64/` folder, from where you can copy it to Applications.
11 changes: 8 additions & 3 deletions app/mainAppWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ const TrayIconChooser = require('../browser/tools/trayIconChooser');
const { AppConfiguration } = require('../appConfiguration');
const connMgr = require('../connectionManager');
const fs = require('fs');
const intune = require('../intune');

/**
* @type {TrayIconChooser}
*/
let iconChooser;

let intune;

let blockerId = null;

let isOnCall = false;
Expand Down Expand Up @@ -67,6 +68,7 @@ exports.onAppReady = async function onAppReady(configGroup) {
});

if (config.ssoInTuneEnabled) {
intune = require('../intune');
intune.initSso(logger, config.ssoInTuneAuthUser);
}

Expand Down Expand Up @@ -328,7 +330,7 @@ function setImgSrcSecurityPolicy(policies) {
* @param {Electron.BeforeSendResponse} callback
*/
function onBeforeSendHeadersHandler(detail, callback) {
if (intune.isSsoUrl(detail.url)) {
if (intune && intune.isSsoUrl(detail.url)) {
intune.addSsoCookie(logger, detail, callback);
} else {
if (detail.url.startsWith(customBGServiceUrl.href)) {
Expand Down Expand Up @@ -418,7 +420,10 @@ function addEventHandlers() {

function getWebRequestFilterFromURL() {
const filter = customBGServiceUrl.protocol === 'http:' ? { urls: ['http://*/*'] } : { urls: ['https://*/*'] };
intune.setupUrlFilter(filter);
if (intune) {
intune.setupUrlFilter(filter);
}

return filter;
}

Expand Down
8 changes: 8 additions & 0 deletions com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<url type="bugtracker">https://github.com/IsmaelMartinez/teams-for-linux/issues</url>
<launchable type="desktop-id">com.github.IsmaelMartinez.teams_for_linux.desktop</launchable>
<releases>
<release version="1.6.0" date="2024-06-06">
<description>
<ul>
<li>FIX broken app when dbus not present</li>
<li>Moved from Yarn to NPM to simplify the build process</li>
</ul>
</description>
</release>
<release version="1.5.3" date="2024-06-04">
<description>
<ul>
Expand Down
Loading

0 comments on commit fa228d9

Please sign in to comment.