Skip to content

Commit

Permalink
Merge branch 'main' into feature/build-with-obfuscated-bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhamp authored Nov 12, 2024
2 parents 7daf9fd + 0450e7a commit 9a02339
Show file tree
Hide file tree
Showing 96 changed files with 19,056 additions and 4,644 deletions.
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: simonhamp
open_collective: nativephp
35 changes: 35 additions & 0 deletions .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: plugin-build

on:
push:
branches: [main]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install dependencies
working-directory: ./resources/js/
run: npm install

- name: Build plugin
working-directory: ./resources/js/
run: npm run plugin:build

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Build plugin
23 changes: 23 additions & 0 deletions .github/workflows/run-plugin-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: plugin-tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install dependencies
working-directory: ./resources/js/
run: npm install
- name: Run tests
working-directory: ./resources/js/
run: npm run plugin:test
16 changes: 12 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
carbon: ^2.63
testbench: ^8.18
carbon: ^2.67

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -42,10 +42,18 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
composer update --${{ matrix.stability }} --no-interaction
- name: List Installed Dependencies
run: composer show -D

- name: Execute tests
- name: Show pest version
run: vendor/bin/pest --version

- name: Execute tests on Linux
if: matrix.os == 'ubuntu-latest'
run: Xvfb :99 & DISPLAY=:99 vendor/bin/pest

- name: Execute tests on Windows
if: matrix.os == 'windows-latest'
run: vendor/bin/pest
91 changes: 91 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,97 @@

All notable changes to `nativephp-laravel` will be documented in this file.

## 0.8.4 - 2024-11-11

### What's Changed

* Fix the relative path to PHP by @JCombee in https://github.com/NativePHP/electron/pull/125
* Improve child process by @SRWieZ in https://github.com/NativePHP/electron/pull/123
* Fix powerMonitor events by @SRWieZ in https://github.com/NativePHP/electron/pull/122

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.8.3...0.8.4

## 0.8.3 - 2024-11-05

Hotfix

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.8.2...0.8.3

## 0.8.2 - 2024-11-05

### `composer native:dev` 🔥

To get the command, run `php artisan native:install` after updating to this version

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.8.1...0.8.2

## 0.8.1 - 2024-11-04

### What's Changed

* Add endpoint for listing all windows by @JCombee in https://github.com/NativePHP/electron/pull/120
* Add PHP server exception reporting by @simonhamp in https://github.com/NativePHP/electron/pull/121

### New Contributors

* @JCombee made their first contribution in https://github.com/NativePHP/electron/pull/120

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.8.0...0.8.1

## 0.8.0 - 2024-11-01

### What's Changed

* Integrate Plugin by @RobertWesner in https://github.com/NativePHP/electron/pull/109
* Add active screen endpoint by @simonhamp in https://github.com/NativePHP/electron/pull/112
* Support `--no-interaction` in `native:serve` command by @simonhamp in https://github.com/NativePHP/electron/pull/119
* Child processes by @simonhamp in https://github.com/NativePHP/electron/pull/115
* Improved window management by @simonhamp in https://github.com/NativePHP/electron/pull/118
* Add support for custom events fired by clicking on notifications by @LukeTowers in https://github.com/NativePHP/electron/pull/114
* Fix windows php path for native:minify by @kritish-dhaubanjar in https://github.com/NativePHP/electron/pull/111
* Bump actions/checkout from 2 to 4 by @dependabot in https://github.com/NativePHP/electron/pull/116
* Bump actions/setup-node from 1 to 4 by @dependabot in https://github.com/NativePHP/electron/pull/117

### New Contributors

* @LukeTowers made their first contribution in https://github.com/NativePHP/electron/pull/114
* @kritish-dhaubanjar made their first contribution in https://github.com/NativePHP/electron/pull/111

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.7.4...0.8.0

## 0.7.4 - 2024-10-16

### What's Changed

* Fix for Laravel Prompts version by @sarukomine in https://github.com/NativePHP/electron/pull/110

### New Contributors

* @sarukomine made their first contribution in https://github.com/NativePHP/electron/pull/110

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.7.3...0.7.4

## 0.7.3 - 2024-09-27

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.7.2...0.7.3

## 0.7.2 - 2024-09-09

### What's Changed

* Updated php-bin dependencies to ^0.5 by @SRWieZ in https://github.com/NativePHP/electron/pull/107
* Fixed Tests by @RobertWesner in https://github.com/NativePHP/electron/pull/104
* Customizable deeplink scheme by @simonhamp in https://github.com/NativePHP/electron/pull/105
* Add environment variable for php bin directory. by @kisuka in https://github.com/NativePHP/electron/pull/101

### New Contributors

* @SRWieZ made their first contribution in https://github.com/NativePHP/electron/pull/107
* @RobertWesner made their first contribution in https://github.com/NativePHP/electron/pull/104
* @kisuka made their first contribution in https://github.com/NativePHP/electron/pull/101

**Full Changelog**: https://github.com/NativePHP/electron/compare/0.7.1...0.7.2

## 0.7.1 - 2024-09-02

### What's Changed
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
{
"type": "github",
"url": "https://github.com/sponsors/simonhamp"
},
{
"type": "opencollective",
"url": "https://opencollective.com/nativephp"
}
],
"homepage": "https://github.com/nativephp/electron",
Expand All @@ -29,7 +33,7 @@
"require": {
"php": "^8.1",
"illuminate/contracts": "^10.0|^11.0",
"laravel/prompts": "^0.1.1",
"laravel/prompts": "^0.1.1|^0.2|^0.3",
"nativephp/laravel": "*",
"nativephp/php-bin": "^0.5",
"spatie/laravel-package-tools": "^1.14.0"
Expand All @@ -39,7 +43,7 @@
"nunomaduro/collision": "^7.9",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^8.18",
"pestphp/pest": "^2.0",
"pestphp/pest": "^2.7",
"pestphp/pest-plugin-arch": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
Expand Down
17 changes: 5 additions & 12 deletions resources/js/electron-builder.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
const {copySync, removeSync, writeJsonSync, existsSync} = require("fs-extra");
const {join} = require("path");
const os = require('os');
const {mkdtempSync} = require("fs");
const {execSync} = require("child_process");
const { join } = require("path");
const { mkdtempSync } = require("fs");
const { copySync, removeSync, writeJsonSync } = require("fs-extra");

const isBuilding = process.env.NATIVEPHP_BUILDING;
const appId = process.env.NATIVEPHP_APP_ID;
const appName = process.env.NATIVEPHP_APP_NAME;
const fileName = process.env.NATIVEPHP_APP_FILENAME;
const appVersion = process.env.NATIVEPHP_APP_VERSION;
const appUrl = process.env.APP_URL;
const appAuthor = process.env.NATIVEPHP_APP_AUTHOR;
const deepLinkProtocol = process.env.NATIVEPHP_DEEPLINK_SCHEME;

// Since we do not copy the php executable here, we only need these for building
const isWindows = process.argv.includes('--win');
Expand Down Expand Up @@ -119,12 +120,6 @@ if (isBuilding) {
console.log('Copied app to resources');
console.log(join(process.env.APP_PATH, 'dist'));
console.log('=====================');

if (! existsSync(bundle)) {
const artisanPath = join(appPath, 'artisan');
// We'll use the default PATH PHP binary here, as we can cross-compile for all platforms. This shouldn't be changed.
execSync(`php ${artisanPath} native:minify ${appPath}`);
}
} catch (e) {
console.error('=====================');
console.error('Error copying app to resources');
Expand All @@ -134,8 +129,6 @@ if (isBuilding) {

}

const deepLinkProtocol = 'nativephp';

module.exports = {
appId: appId,
productName: appName,
Expand Down
18 changes: 18 additions & 0 deletions resources/js/electron-plugin/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
"browser": true,
"node": true
},
"rules": {
"prettier/prettier": "error"
}
}
25 changes: 25 additions & 0 deletions resources/js/electron-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# production
build
dist-ssr
*.local

# logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
coverage
18 changes: 18 additions & 0 deletions resources/js/electron-plugin/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-sass-guidelines"
],
"overrides": [
{
"files": ["**/*.scss"],
"customSyntax": "postcss-scss"
}
],
"rules": {
"function-parentheses-space-inside": null,
"no-descending-specificity": null,
"max-nesting-depth": 2,
"selector-max-id": 1
}
}
5 changes: 5 additions & 0 deletions resources/js/electron-plugin/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@babel/preset-typescript',
],
};
Loading

0 comments on commit 9a02339

Please sign in to comment.