Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "prepare" mode: Let the user see and work with the calculated values (final paths, names, versions, etc) without having to build and inspect the results #1265

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Black-Platypus
Copy link
Contributor

@Black-Platypus Black-Platypus commented Oct 7, 2024

Add "prepare" mode, calculating all major values and returning it to user, without having to "build" anything.
Use output object to build if options.mode is 'build'
This will allow for builder apps to better handle building apps using nw-builder without having to know in advance what the nwjs app is going to provide.
Using things like, for example,

var meta = await nwbuild({
	mode: 'prepare'
	// ...
});
if( !meta.app.legalCopyright && meta.app.company){
	meta.app.legalCopyright = "© " + meta.app.company + " " + ((new Date()).getFullYear());
}
// ...
// Now that we've done our changes, build using the previously arrived-at values
meta.mode = 'build';
await nwbuild(meta);

, a lot of things can be streamlined, without having to parse the app's manifest itself, without knowing in advance how nw-builder will parse/assign values, without having to make sure that any path resolves to what the builder app thinks/hopes it does (hopefully it should just be resolving things within the CWD, but who knows), etc

ToDo: Implement OSX behavior (has its own file, I'm not sure of the reasons, nor can I test the behavior)

Fixes: #1264

@ayushmanchhabra
Copy link
Collaborator

I had thought of something similar to this a while back but dropped the idea because I wanted to keep things as open as possible. Will review this last since this is a feature request.

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.

Provide calculated values (final paths, names, versions, etc) to user without building app
2 participants