Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.
Fixes: #14447
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.
Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh
Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
android/build.sh.
* Renames functions in builder-basic.inc.sh
More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.
Fixes: #14065
Build-bot: build all
Test-bot: skip
Adds documentation for various functions, removes unused functions (a
couple of simple, very lightly used functions were unDRYed; these could
go back the other way across all shell scripts if necessary). TODO items
noted for follow-up refactoring.
Fixes: #14275
Relates-to: #14269
Build-bot: build all
Test-bot: skip
Looks like dependabot did not cleanly upgrade multer (#13982). Possibly
a bug with workspaces? Removed from package.json, npm install, re-added,
npm install to fix the issue.
See-also: #13982
Some of the npm audit warnings left after #13897 require an updated `mocha` version to remedy. As we only really use `mocha` to do unit-testing, it should be safe to update if all of our existing tests pass with the new version.
Test-bot: skip
Previously the builder scripts defined a readonly `VERSION` environment
variable for the Keyman version. That caused problems when another
(external) script tried to define a `VERSION` variable. We encountered
this problem when trying to move the TC build steps of a configuration
into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.
This change uses a Keyman specific prefix for the version variables and
renames `VERSION` → `KEYMAN_VERSION` etc. Unfortunately these variables
are used in a lot of places, so this turned out to be a bit of a yak
shave.
Test-bot: skip
Move the sentry dependency out of developer-utils and into the console
apps kmc and server, in process of making sure that developer-utils has
no node dependencies.
Also copy the options.ts module into kmc and server, for the same
reason.
This first step duplicates two units, options.ts and KeymanSentry.ts. We
do need to refactor this again later to avoid this duplication (maybe
via yet another internal package?)
The way that Server is built for local distribution does not currently
handle transitive dependencies for @keymanapp dependencies well. So,
this adds four dependencies from @keymanapp/developer-utils to Server so
that they will be available in the packaged deployment.
A future improvement could be to package developer-utils using npm
packaging tools, but these struggled with bundling monorepo dependencies
in the past also.
With the full move to ES Modules, we no longer need to include
`references` in tsconfig.json, as we can rely on package.json and
build.sh dependency management. Note however that `tsc -b` may not work
to build dependencies -- they need to be built using `build.sh`, which
calculates which dependencies need building.
kmc-keyboard-info was missing a dependency link to kmc-package in
build.sh, correcting this at the same time.
Relates-to: #12027
Fixes the scenario where the `%AppData%\Keyman\Keyman Developer\Server\bin`
folder exists, but ngrok.exe is not in the folder, which caused Keyman
Developer Server to crash.
Fixes: #11542
Fixes: KEYMAN-DEVELOPER-1JE
Now builds from a clean repo:
developer/src/build.sh configure build test publish
* Splits kmbrowserhost into kmdbrowserhost for Developer; this means
that Developer Browser Host now inherits the Developer settings rather
than the Keyman for Windows settings, and simplifies distribution and
management. The only difference between the two is in the startup code
so this seems like a good split.
* Cleanup of various build scripts and dependencies.
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).
This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
Fixes#11324.
* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts