-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
WIP: Suggestions for executors #127
Conversation
cli: runs the firebase cli via exec sync with some input parsing - uses execSync to avoid issues with run-commands interactivity - confirms that active project is desired if not specified - only passes through params defined by firebase-cli kill-emulator: kills processes running on ports in firebase.config.json - accepts a file path and if the port numbers are defined in the expected format (a firebase.config.json) - kills the processes ports if mac/linux - windows unimplemented - there to catch if firebase-cli doesn't shut down ports correctly copy-local-files: copies .env.local and .secret.local to dist folder - the assets property for esbuild does not copy across .gitignore - this executor gets around this by manually copying the local files required for emulators
process.env.NX_REACT_APP_FIRESTORE_EMULATOR = 'true' | ||
process.env.NX_REACT_APP_STORAGE_EMULATOR = 'true' | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my current workaround for detecting if my frontend application should connect to the emulators when serving, but as you can see it is specific to cra applications. The frontend code then looks for these variables before in initialises each sdk.
Not sure if there is a more generic way of doing this/if it should be removed and handled elsewhere
Hi @Schmale97 , thanks for your PR. It's great to have submissions & experiementations, and I can see how such solutions might be useful for customising a specific workflow/workspace, but for a generic plugin like this one, I'm not sure it adds value over what we already have:
The For your custom
|
I'm going to close this PR for now, but I welcome & will review future contributions. |
This is a PR with some suggestions for some executors to improve firebase's cli within nx. I have these changes currently as a workspace plugin that I have been playing around with and noticed a few issues pop-up which I think these executors help to fix ( #92 and #40 ). I have copied the local plugin into these repo quickly to gauge interest in including these in this plugin.
There are 3 executors:
cli: the way to interact with the firebase cli-tool - has been written to be similar to the firebase-tools when using in the terminal but with some tweaks to improve how it can be used in the project.json
kill-emulator: kills all the process running on the ports defined in the defined firebase.*.json
copy-local-files: used for handling .gitignored env files, namely .env.local and .secret.local
My project stucture is:
The project.json I have in the functions folder is
and the project json I have for the firebase folder is:
I have shared these jsons just to demonstrate how I am using the executors in the pr.
Again, this is just what I have found to be useful so far and am still working through a few things:
Let me know what you think