Developer Script Reference
Additional Info TL;DR - For reference when needed on developer scripts for an app repos built on Pankosmia
Table of Contents
Ecosystem setup and configuration
This repo pulls together several libraries and projects into a single app. The projects are spread across several repos to allow modular reuse. Scripts follow for assisting in setup, though it can also all be setup manually. The following assume the repos are installed with the following directory structure.
This is an example. Clients in use may vary. Configuration is handled via app_config.envand the app_setup script.
|-- repos
|-- pankosmia
|-- core-client-content repository
|-- core-client-dashboard repository
|-- core-client-i18n-editor repository
|-- core-client-remote-repos repository
|-- core-client-settings repository
|-- core-client-workspace repository
|-- [your-desktop-app-repo-name] (30 characters or less on windows!)
|-- resource-core
|-- webfonts-core
Installing the clients
The local_server (pankosmia_web) serves compiled files from the build directory of each client, each client must be built.
This is handled by the clone and build_clients scripts, though can also all be run manually which is helpful during development.
# In each client repo, NOT this repo!
npm install
npm run build
Running run, build_server, or bundle_... all copy the latest build to the build environment.
Scripts
Configuration
Config files must match clients and assets utilized. Scripts that write them are provided, as per app_config.env. Files created by the app_setup script are:
| Linux | Windows | MacOS |
|---|---|---|
| <pre>buildSpec.json /globalBuildResources/i18nPatch.json /globalBuildResources/product.json /linux/buildResources/setup/app_setup.json</pre> | <pre>buildSpec.json \globalBuildResources\i18nPatch.json \globalBuildResources\product.json \windows\buildResources\setup\app_setup.json</pre> | <pre>buildSpec.json /globalBuildResources/i18nPatch.json /globalBuildResources/product.json /macos/buildResources/setup/app_setup.json</pre> |
Review app_config.env and adjust as needed, then run one of the setup scripts that follow. Re-run the app_setup script anytime app_config.env is changed.
Config scripts:
Run from the provided location: | Description | Linux | Windows | MacOS | |————-|——-|———|——-| | Uses app_config.env to generate/rebuild/replace app_setup.json, buildSpec.json, product.json, and i18nPatch.json| /linux/scripts/app_setup.bsh | \windows\scripts\app_setup.bat | /macos/scripts/app_setup.zsh |
Setup scripts:
Run from the provided location: | Description | Linux | Windows | MacOS | |——-|——-|———|——-| | Clones all repos in /app_config.env if a directory by that name does not already exit | /linux/scripts/clone.bsh
Default clones via HTTPS.
Optional argument:./clone.bsh -s
Clones via SSH. | \windows\scripts\clone.bat
Default clones via HTTPS.
Optional argument:.\clone.bat -s
Clones via SSH. | /macos/scripts/clone.zsh
Default clones via HTTPS.
Optional argument:./clone.zsh -s
Clones via SSH. | | For each asset repo in /app_config.env: git checkout main, git pull
For each client repo in /app_config.env: git checkout main, git pull, npm install, and npm run build.
Dev’s should build manually when testing branch(es). | /linux/scripts/build_clients.bsh | \windows\scripts\build_clients.bat | /macos/scripts/build_clients.zsh | | Create an Electronite viewer for use with the local dev build environment. | /linux/scripts/build_viewer.bsh | \windows\scripts\build_viewer.ps1
(use a powershell terminal) | /macos/scripts/build_viewer.zsh |
Usage scripts:
Note: Multiple arguments can be applied in any order, e.g., ./run.zsh -s -d is the same as ./run.zsh -d -s
| Description | Linux | Windows | MacOS |
|---|---|---|---|
removes the build directory and runs cargo clean(%) | /linux/scripts/clean.bsh Optional arguments: ./clean.bsh -sWill not ask if server is off | \windows\scripts\clean.bat Optional arguments: .\clean.bat -sWill not ask if server is off | /macos/scripts/clean.zsh Optional arguments: ./clean.zsh -sWill not ask if server is off |
runs cargo build, and node build.js | /linux/scripts/build_server.bsh Optional arguments: ./build_server.bsh -sWill not ask if server is off ./build_server.bsh -dBuilds server in debug mode | \windows\scripts\build_server.bat Optional arguments: .\build_server.bat -sWill not ask if server is off .\build_server.bat -dBuilds server in debug mode | /macos/scripts/build_server.zsh Optional arguments: ./build_server.zsh -sWill not ask if server is off ./build_server.zsh -dBuilds server in debug mode |
| Assembles the build environment (clients) and starts the server (*) | /linux/scripts/run.bsh Optional arguments: ./run.bsh -sWill not ask if server is off .\run.bsh -dRuns with server in debug mode | \windows\scripts\run.bat Optional arguments: .\run.bat -sWill not ask if server is off .\run.bat -dRuns with server in debug mode | /macos/scripts/run.zsh Optional arguments: ./run.zsh -sWill not ask if server is off .\run.zsh -dRuns with server in debug mode |
Launches the Electronite viewer for use with the dev environment. (Requires the viewer having previously been created via the build_viewer script.) | /linux/scripts/viewer.bsh Dev Tools: Ctrl + Shift + I Optional argument: ./viewer.bsh [PORT#](default is 19119) | \windows\scripts\viewer.bat Dev Tools: Ctrl + Shift + I Optional argument: .\viewer.bat [PORT#](default is 19119) | /macos/scripts/viewer.zsh Dev Tools: Cmd + Option + I Optional argument: ./viewer.zsh [PORT#](default is 19119) |
Deletes the last bundles and temp contents for the given OS (if they exist), then on this repo runs git checkout main, git pull, and npm install, runs app_setup.bat to ensure version consistency, runs node build.js, then makes a zip release bundle and a stand-alone installer. (*) (•) | /linux/scripts/bundle_viewer.bsh (Only builds and bundles the viewer. Do all else in the description manually or through other scripts listed here.) | \windows\scripts\bundle_viewer.ps1 Optional arguments: or: “y”; Will not ask if server is off | /macos/scripts/bundle_viewer.zsh Optional arguments: ./bundle_viewer.zsh -sWill not ask if server is off |
Deletes the last .zip release bundle if it it exists, then on this repo runs git checkout main, git pull, and npm install, runs app_setup.bat to ensure version consistency, runs node build.js, then makes a zip release bundle (*) | /linux/scripts/bundle_tgz.bsh Optional arguments: ./bundle_tgz.bsh -sWill not ask if server is off /bundle_tgz.bsh -gRun from Github Actions | \windows\scripts\bundle_zip.ps1 Optional arguments: -ServerOff “Y” or: “y”; Will not ask if server is off -IsGHA “Y” or: “y”; Run from Gihtub Actions | /macos/scripts/bundle_zip.zsh Optional arguments: /bundle_zip.zsh -sWill not ask if server is off /bundle_zip.zsh -gRun from Github Actions |
Deletes the last .exe release bundle if it it exists, then on this repo runs git checkout main, git pull, and npm install, runs app_setup.bat to ensure version consistency, runs node build.js, then makes an exe installer (*) (•) | \windows\scripts\bundle_exe.ps1 Optional arguments: or: “y”; Will not ask if server is off (•) |
()** **Ensure the server (build_server.bat) is current!
(•) *Environment prerequisite for running the exe build locally: Install Inno Setup -tested with v6.4.3
(%) Targeted clean tips:
- To clean just the dev server: cd to the /local_server directory and run
cargo clean --target-dir target/debug - To clean just the dev server: cd to the /local_server directory and run
cargo clean --target-dir target/release - To clean just the build environment, cd to the subdirectory for your OS (i.e., /macos, /linux, or /windows), then recursively remove its build subdirectory.
- (The clean script does all of the above.)
Maintenance scripts:
Run from the provided location: | Description | Linux | Windows | MacOS | |——-|——-|———|——-| | Facilitates syncing with upstream with exclusion of files expected to differ: | /linux/scripts/sync.bsh
Optional arguments:./sync.bsh -p
Will not ask if latest is already pulled. | \windows\scripts\sync.bat
Optional arguments:.\sync.bat -p
Will not ask if latest is already pulled | /macos/scripts/sync.zsh
Optional arguments:./sync.zsh -p
Will not ask if latest is already pulled. |