Skip to content

Commit 22122a5

Browse files
committed
refactor: per Simon's review
1 parent 07dfc02 commit 22122a5

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

resources/js/electron-plugin/src/server/api/childProcess.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function startProcess(settings) {
7979

8080
// Experimental feature on Electron,
8181
// I keep this here to remember and retry when we upgrade
82+
// https://www.electronjs.org/docs/latest/api/utility-process#event-error-experimental
8283
// proc.on('error', (error) => {
8384
// clearTimeout(startTimeout);
8485
// console.error(`Process [${alias}] error: ${error.message}`);
@@ -168,11 +169,6 @@ function startPhpProcess(settings) {
168169
return ['-d', `${key}=${iniSettings[key]}`];
169170
}).flat();
170171

171-
172-
// if (args[0] === 'artisan' && runningSecureBuild()) {
173-
// args.unshift(join(appPath, 'build', '__nativephp_app_bundle'));
174-
// }
175-
176172
if (settings.cmd[0] === 'artisan' && runningSecureBuild()) {
177173
settings.cmd.unshift(join(getAppPath(), 'build', '__nativephp_app_bundle'));
178174
}

resources/js/electron-plugin/src/server/php.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ function serveApp(secret, apiPort, phpIniSettings): Promise<ProcessResult> {
308308
// Make sure the storage path is linked - as people can move the app around, we
309309
// need to run this every time the app starts
310310
if (!runningSecureBuild()) {
311+
/*
312+
* Simon: Note for later that we should strip out using storage:link
313+
* all of the necessary files for the app to function should be a part of the bundle
314+
* (whether it's a secured bundle or not), so symlinking feels redundant
315+
*/
311316
console.log('Linking storage path...');
312317
callPhpSync(['artisan', 'storage:link', '--force'], phpOptions, phpIniSettings)
313318
}

resources/js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"@typescript-eslint/parser": "^8.18.1",
7777
"@vue/eslint-config-prettier": "^10.1.0",
7878
"cross-env": "^7.0.3",
79-
"electron": "^32.2.6",
79+
"electron": "^32.2.7",
8080
"electron-builder": "^25.1.8",
8181
"electron-chromedriver": "^32.2.6",
8282
"electron-vite": "^3.0.0",

src/Commands/BundleCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Illuminate\Support\Str;
1212
use Native\Electron\Traits\CleansEnvFile;
1313
use Native\Electron\Traits\CopiesToBuildDirectory;
14-
use Native\Electron\Traits\HandleApiRequests;
14+
use Native\Electron\Traits\HandlesZephpyr;
1515
use Native\Electron\Traits\HasPreAndPostProcessing;
1616
use Native\Electron\Traits\InstallsAppIcon;
1717
use Native\Electron\Traits\PrunesVendorDirectory;
@@ -25,7 +25,7 @@ class BundleCommand extends Command
2525
{
2626
use CleansEnvFile;
2727
use CopiesToBuildDirectory;
28-
use HandleApiRequests;
28+
use HandlesZephpyr;
2929
use HasPreAndPostProcessing;
3030
use InstallsAppIcon;
3131
use PrunesVendorDirectory;

src/Traits/HandleApiRequests.php renamed to src/Traits/HandlesZephpyr.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use function Laravel\Prompts\intro;
88

9-
trait HandleApiRequests
9+
trait HandlesZephpyr
1010
{
1111
private function baseUrl(): string
1212
{
@@ -49,7 +49,7 @@ private function checkForZephpyrToken()
4949
$this->line('');
5050
$this->warn('No ZEPHPYR_TOKEN found. Cannot bundle!');
5151
$this->line('');
52-
$this->line('Add your api ZEPHPYR_TOKEN to its .env file:');
52+
$this->line('Add your Zephpyr API token to your .env file (ZEPHPYR_TOKEN):');
5353
$this->line(base_path('.env'));
5454
$this->line('');
5555
$this->info('Not set up with Zephpyr yet? Secure your NativePHP app builds and more!');

0 commit comments

Comments
 (0)