Skip to content

Commit

Permalink
misc/ Upgrade to Angular 16.1.3 & Electron 2
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegris committed Jun 30, 2023
1 parent 9b22567 commit 5f8e817
Show file tree
Hide file tree
Showing 15 changed files with 5,441 additions and 3,750 deletions.
11 changes: 9 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"prefer-arrow/prefer-arrow-functions": 0,
"@angular-eslint/directive-selector": 0,
"@angular-eslint/component-selector": [
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

# Introduction

Bootstrap and package your project with Angular 15 and Electron 24 (Typescript + SASS + Hot Reload) for creating Desktop applications.
Bootstrap and package your project with Angular 16 and Electron 25 (Typescript + SASS + Hot Reload) for creating Desktop applications.

Currently runs with:

- Angular v15.2.9
- Electron v24.3.0
- Angular v16.1.3
- Electron v25.2.0

With this sample, you can:

Expand All @@ -29,7 +29,7 @@ With this sample, you can:

/!\ Hot reload only pertains to the renderer process. The main electron process is not able to be hot reloaded, only restarted.

/!\ Angular CLI & Electron Builder needs Node 14 or later to work correctly.
/!\ Angular CLI & Electron Builder needs Node 18.10 or later to work correctly.

## Getting Started

Expand Down Expand Up @@ -157,8 +157,9 @@ Please refer to [HOW_TO file](./HOW_TO.md)
- Angular 12 & Electron 16 : Branch [angular12](https://github.com/maximegris/angular-electron/tree/angular12)
- Angular 13 & Electron 18 : Branch [angular13](https://github.com/maximegris/angular-electron/tree/angular13)
- Angular 14 & Electron 21 : Branch [angular14](https://github.com/maximegris/angular-electron/tree/angular14)
- Angular 15 & Electron 24 : (main)

- Angular 15 & Electron 24 : Branch [angular15](https://github.com/maximegris/angular-electron/tree/angular15)
- Angular 16 & Electron 25 : (main)
-
[maintained-badge]: https://img.shields.io/badge/maintained-yes-brightgreen
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license]: https://github.com/maximegris/angular-electron/blob/main/LICENSE.md
Expand Down
5 changes: 3 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
"schematicCollections": [
"@angular-eslint/schematics"
]
},
"version": 1,
"newProjectRoot": "projects",
Expand Down Expand Up @@ -183,7 +185,6 @@
}
}
},
"defaultProject": "angular-electron",
"schematics": {
"@angular-eslint/schematics:application": {
"setParserOptionsProject": true
Expand Down
4 changes: 2 additions & 2 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {app, BrowserWindow, screen} from 'electron';
import * as path from 'path';
import * as fs from 'fs';

let win: BrowserWindow = null;
let win: BrowserWindow | null = null;
const args = process.argv.slice(1),
serve = args.some(val => val === '--serve');

Expand All @@ -19,7 +19,7 @@ function createWindow(): BrowserWindow {
webPreferences: {
nodeIntegration: true,
allowRunningInsecureContent: (serve),
contextIsolation: false, // false if you want to run e2e test with Spectron
contextIsolation: false,
},
});

Expand Down
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Maxime GRIS",
"email": "[email protected]"
},
"version": "12.0.1",
"version": "13.0.0",
"main": "main.js",
"private": true,
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions e2e/main.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BrowserContext, ElectronApplication, Page, _electron as electron } from 'playwright';
import { test, expect } from '@playwright/test';
const PATH = require('path');
import * as PATH from 'path';

test.describe('Check Home Page', async () => {
test.describe('Check Home Page', () => {
let app: ElectronApplication;
let firstWindow: Page;
let context: BrowserContext;
Expand Down Expand Up @@ -48,7 +48,7 @@ test.describe('Check Home Page', async () => {

test('Check title', async () => {
const elem = await firstWindow.$('app-home h1');
const text = await elem.innerText();
const text = elem ? await elem.innerText() : null;
expect(text).toBe('App works !');
});

Expand Down
1 change: 1 addition & 0 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ const config = {
},
};

// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
module.exports = config;
Loading

0 comments on commit 5f8e817

Please sign in to comment.