Skip to content

Commit 54b67f7

Browse files
authored
Merge pull request #26 from NativePHP/fix-build-quirks
Fix v2 build papercuts
2 parents 4c5793c + ae9910b commit 54b67f7

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

config/nativephp-internal.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
'vendor/nativephp/desktop/resources',
9393
'vendor/nativephp/desktop/vendor',
9494
'vendor/nativephp/php-bin',
95+
'nativephp',
9596

9697
// Also deleted in PrunesVendorDirectory after fresh composer install
9798
'vendor/bin',

resources/electron/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/electron/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "NativePHP",
3-
"version": "1.0.0",
2+
"name": "nativephp",
3+
"version": "v2",
44
"description": "A NativePHP Electron application",
55
"main": "./out/main/index.js",
66
"author": "NativePHP",

src/Builder/Concerns/CopiesToBuildDirectory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function copyToBuildDirectory(): bool
8888
}
8989

9090
$this->keepRequiredDirectories();
91+
$this->keepLivewireDispatcher();
9192

9293
return true;
9394
}
@@ -106,4 +107,17 @@ private function keepRequiredDirectories()
106107
$filesystem->dumpFile("{$buildPath}/storage/app/public/_native.json", '{}');
107108
$filesystem->dumpFile("{$buildPath}/storage/logs/_native.json", '{}');
108109
}
110+
111+
private function keepLivewireDispatcher()
112+
{
113+
// This is a bit leaky, since we only need this for electron, not potential other drivers
114+
// We'll find a better place for it when we add more drivers.
115+
$dispatcherPath = 'vendor/nativephp/desktop/resources/electron/electron-plugin/src/preload/livewire-dispatcher.js';
116+
$filesystem = new Filesystem;
117+
118+
$filesystem->copy(
119+
$this->sourcePath($dispatcherPath),
120+
$this->buildPath("app/{$dispatcherPath}")
121+
);
122+
}
109123
}

0 commit comments

Comments
 (0)