Skip to content

Build with obfuscated bundles#106

Closed
simonhamp wants to merge 16 commits into
mainfrom
feature/build-with-obfuscated-bundle
Closed

Build with obfuscated bundles#106
simonhamp wants to merge 16 commits into
mainfrom
feature/build-with-obfuscated-bundle

Conversation

@simonhamp
Copy link
Copy Markdown
Member

@simonhamp simonhamp commented Sep 7, 2024

The other half of NativePHP/electron-plugin#36

Fixes nativephp/laravel#343
Fixes nativephp/laravel#388

@simonhamp simonhamp changed the title Feature/build with obfuscated bundle Build with obfuscated bundles Sep 7, 2024
gwleuverink added a commit to gwleuverink/nativephp-electron that referenced this pull request Jan 7, 2025
Co-authored-by: Simon Hamp <github@simonhamp.me>
gwleuverink added a commit to gwleuverink/nativephp-electron that referenced this pull request Jan 7, 2025
Co-authored-by: Simon Hamp <github@simonhamp.me>
gwleuverink added a commit to gwleuverink/nativephp-electron that referenced this pull request Jan 7, 2025
Co-authored-by: Simon Hamp <github@simonhamp.me>
Comment thread src/Traits/SetsAppName.php Outdated
Comment on lines +5 to +7
use function Laravel\Prompts\intro;
use function Laravel\Prompts\note;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not used

removeSync(tmpDir);
let bundle = join(process.env.APP_PATH, 'build', '__nativephp_app_bundle');

if (existsSync(bundle)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existsSync is not imported

Comment on lines +116 to +121
writeJsonSync(join(appPath, 'storage', 'framework', 'cache', '_native.json'), {})
writeJsonSync(join(appPath, 'storage', 'framework', 'sessions', '_native.json'), {})
writeJsonSync(join(appPath, 'storage', 'framework', 'testing', '_native.json'), {})
writeJsonSync(join(appPath, 'storage', 'framework', 'views', '_native.json'), {})
writeJsonSync(join(appPath, 'storage', 'app', 'public', '_native.json'), {})
writeJsonSync(join(appPath, 'storage', 'logs', '_native.json'), {})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use outputJsonSync to create any missing directory in path or add additionall call ensureDirSync, but I prefer outputJsonSync

SRWieZ pushed a commit that referenced this pull request Feb 21, 2025
* copy app to build path before cleanup & composer install

* copied CleansEnvFile trait from upstream PR #106

Co-authored-by: Simon Hamp <github@simonhamp.me>

* copied updated app icon path from upstream PR #106

Co-authored-by: Simon Hamp <github@simonhamp.me>

* copied app name fix from upstream PR #106
Co-authored-by: Simon Hamp <github@simonhamp.me>

* tidy

* tidy

* added skip patterns from electron-builder & account for symlinks (for symlinked composer deps)

* add more default skip patterns

* merge upstream

* Build plugin

* wip

* remove redundant electron-builder app copy logic

* move php building from separate step to beforePack hook

* remove explicit php building from npm scripts

* tidy

* make sure database, logs, sessions & cached views are never included in builds!

* use 8.1 compatible syntax

* refactor to use symfony finder

* move vendor/bin & node_modules exclude to config file (see PR nativephp/laravel)

* fix ignore paths

* ignore vsc files

* revert back to using RecursiveDirectoryIterator

* Fix styling

* use npm ci for updating electron dependencies

* update mac x86 comment

* add PrunesVendorDirectory trait

* move default exclude list to nativephp-internal config

* Fix styling

* add comments for file relocation when more adapters are added later on

* decouple terminal messages from the build traits

* decouple source path from build traits (for testing)

* consolidate namespaces with identical purpose

* bring back default exclude list to electron repo

* fix regression

* wip - tests

* Fix styling

* add more tests

* Fix styling

* more flexibility when working with paths

* boyscouting

* add filesystem stub directories to gitignore

* add CleanEnvFile tests

* Fix styling

* add more tests

* fix unclosed bracket

* Fix styling

* dependency compatibility for php 8.1

* use php 8.1 compatible syntax

* fix - native config not loaded in CI

* wip - fix CI inconsistencies

* wip - typo

* fix typo

* Fix styling

* fix - yet another mistake

* use platform specific directory separators

Co-authored-by: @SRWieZ

* speed up tests & split by type

Co-authored-by: @SRWieZ

* Fix styling

* move app name step down

* remove mac x86 naming deviation

* add workflow_run trigger (for debugging)

* workflow dispatch instead of run

* cover unhappy path

* wip - fix test in CI

* wip - add dumps to debug CI errors

* disable flaky test (due to tight repo coupling)

* wip - fix composer version conflict after upstream merge

---------

Co-authored-by: Simon Hamp <github@simonhamp.me>
Co-authored-by: gwleuverink <17123491+gwleuverink@users.noreply.github.com>
@SRWieZ SRWieZ closed this Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

public/icon.png not being used for php artisan native:build Building app fails when there are spaces in the APP_NAME field of the .env file

3 participants