Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2bdf295
feat: native:bundle command
SRWieZ Mar 4, 2025
08a3726
feat: native:bundle --clear
SRWieZ Mar 4, 2025
a2f9888
feat: php.ts run with bundle
SRWieZ Mar 4, 2025
3535d22
fix: require nativephp/laravel on dev-feat/bundle-builds
SRWieZ Mar 4, 2025
b9c6ccf
wip: bundle cached services?
SRWieZ Mar 4, 2025
37eca6a
wip: try with everything first
SRWieZ Mar 4, 2025
613d955
wip: fix .env missing
SRWieZ Mar 4, 2025
666f68b
fix: bundling
SRWieZ Mar 5, 2025
130323a
feat: bundling a base L12 app works 🎉
SRWieZ Mar 5, 2025
e920c44
feat: native:reset command
SRWieZ Mar 10, 2025
b3ecbf6
fix: realpath() returns false if the directory does not exists
SRWieZ Mar 10, 2025
bb7b06a
feat: failsafe
SRWieZ Mar 10, 2025
15de455
wip: it works, but need some minor cleaning/refactoring/testing
SRWieZ Mar 10, 2025
118c85e
perf: fixes and perf of Laravel on subsequent launches
SRWieZ Mar 11, 2025
5724b18
fix: running the bundle in dev mode
SRWieZ Mar 11, 2025
72b29df
fix: consistent appData directory
SRWieZ Mar 11, 2025
ecb8a03
wip: fix running artisan commands in bundle
SRWieZ Mar 11, 2025
029bd2e
feat: artisan commands in bundles
SRWieZ Mar 11, 2025
3e660a7
feat: artisan commands in bundles
SRWieZ Mar 11, 2025
b8f54b9
fix: native:serve will no longer run the bundle
SRWieZ Mar 11, 2025
cba4063
refactor: even more consistency + reducing the size of the bundled bi…
SRWieZ Mar 12, 2025
d28ed6b
feat: Better reset command
SRWieZ Mar 14, 2025
4156153
chore: upgrade outdated packages
SRWieZ Mar 14, 2025
a85d895
docs: added some comments
SRWieZ Mar 14, 2025
6f6fd36
feat: include symlinked composer packages
SRWieZ Mar 14, 2025
07dfc02
Merge branch 'main' into feat/bundle-builds
SRWieZ Mar 14, 2025
22122a5
refactor: per Simon's review
SRWieZ Mar 15, 2025
ed76171
Attempt to understand
simonhamp Mar 18, 2025
45231cd
Attempted fix
simonhamp Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: per Simon's review
  • Loading branch information
SRWieZ committed Mar 15, 2025
commit 22122a5095b2a471630af8a5d9a45cf466deacf2
6 changes: 1 addition & 5 deletions resources/js/electron-plugin/src/server/api/childProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function startProcess(settings) {

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


// if (args[0] === 'artisan' && runningSecureBuild()) {
// args.unshift(join(appPath, 'build', '__nativephp_app_bundle'));
// }

if (settings.cmd[0] === 'artisan' && runningSecureBuild()) {
settings.cmd.unshift(join(getAppPath(), 'build', '__nativephp_app_bundle'));
}
Expand Down
5 changes: 5 additions & 0 deletions resources/js/electron-plugin/src/server/php.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ function serveApp(secret, apiPort, phpIniSettings): Promise<ProcessResult> {
// Make sure the storage path is linked - as people can move the app around, we
// need to run this every time the app starts
if (!runningSecureBuild()) {
/*
* Simon: Note for later that we should strip out using storage:link
* all of the necessary files for the app to function should be a part of the bundle
* (whether it's a secured bundle or not), so symlinking feels redundant
*/
console.log('Linking storage path...');
callPhpSync(['artisan', 'storage:link', '--force'], phpOptions, phpIniSettings)
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@typescript-eslint/parser": "^8.18.1",
"@vue/eslint-config-prettier": "^10.1.0",
"cross-env": "^7.0.3",
"electron": "^32.2.6",
"electron": "^32.2.7",
"electron-builder": "^25.1.8",
"electron-chromedriver": "^32.2.6",
"electron-vite": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/BundleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Illuminate\Support\Str;
use Native\Electron\Traits\CleansEnvFile;
use Native\Electron\Traits\CopiesToBuildDirectory;
use Native\Electron\Traits\HandleApiRequests;
use Native\Electron\Traits\HandlesZephpyr;
use Native\Electron\Traits\HasPreAndPostProcessing;
use Native\Electron\Traits\InstallsAppIcon;
use Native\Electron\Traits\PrunesVendorDirectory;
Expand All @@ -25,7 +25,7 @@ class BundleCommand extends Command
{
use CleansEnvFile;
use CopiesToBuildDirectory;
use HandleApiRequests;
use HandlesZephpyr;
use HasPreAndPostProcessing;
use InstallsAppIcon;
use PrunesVendorDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use function Laravel\Prompts\intro;

trait HandleApiRequests
trait HandlesZephpyr
{
private function baseUrl(): string
{
Expand Down Expand Up @@ -49,7 +49,7 @@ private function checkForZephpyrToken()
$this->line('');
$this->warn('No ZEPHPYR_TOKEN found. Cannot bundle!');
$this->line('');
$this->line('Add your api ZEPHPYR_TOKEN to its .env file:');
$this->line('Add your Zephpyr API token to your .env file (ZEPHPYR_TOKEN):');
$this->line(base_path('.env'));
$this->line('');
$this->info('Not set up with Zephpyr yet? Secure your NativePHP app builds and more!');
Expand Down
Loading