@jskit-ai/jskit-catalog 0.2.91 → 0.2.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/packages.json +267 -267
- package/package.json +1 -1
- package/scripts/browser-test-build.mjs +3 -3
- package/scripts/test-environment.mjs +3 -3
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// The production build of the frontend that every browser-test server serves, as a
|
|
2
|
-
// loads a few bundled files instead of every source module from a development server. The build goes where the app
|
|
1
|
+
// The production build of the frontend that every browser-test server serves, as a staging or production server
|
|
2
|
+
// does: a page then loads a few bundled files instead of every source module from a development server. The build goes where the app
|
|
3
3
|
// server serves it from (dist/), never a folder of its own: the server tells every page which build it serves from
|
|
4
4
|
// dist/index.html, and a page from any other build offers a reload over the screen. It is reused while its inputs' contents
|
|
5
5
|
// are unchanged and dist/index.html is still the one it made, so a repeated focused run does not rebuild, even though a
|
|
@@ -55,7 +55,7 @@ function buildFingerprint(appRoot, build, env = process.env) {
|
|
|
55
55
|
function runToCompletion(command, appRoot) {
|
|
56
56
|
const [program, ...args] = String(command).trim().split(/\s+/u);
|
|
57
57
|
return new Promise((resolve, reject) => {
|
|
58
|
-
// The build a
|
|
58
|
+
// The build a staging or production server serves, whatever NODE_ENV the launcher was given.
|
|
59
59
|
const child = spawn(program, args, {
|
|
60
60
|
cwd: appRoot,
|
|
61
61
|
env: { ...process.env, NODE_ENV: "production" },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Tests run as APP_ENV=test: `jskit test` and the browser test servers set it, whatever the shell says, so a test
|
|
2
2
|
// never sends real email or payments and the test databases may be prepared. A shell whose APP_ENV is staging or
|
|
3
|
-
// production
|
|
3
|
+
// production belongs to a staging or production server, and no test runs there.
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const STAGING_AND_PRODUCTION = Object.freeze(["staging", "production"]);
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Sets `env.APP_ENV` to test, or throws, naming the fix, when it says staging or production.
|
|
@@ -11,7 +11,7 @@ const DEPLOYED_ENVIRONMENTS = Object.freeze(["staging", "production"]);
|
|
|
11
11
|
*/
|
|
12
12
|
function useTestAppEnvironment(env, command) {
|
|
13
13
|
const appEnv = String(env.APP_ENV ?? "").trim();
|
|
14
|
-
if (
|
|
14
|
+
if (STAGING_AND_PRODUCTION.includes(appEnv)) {
|
|
15
15
|
throw new Error(
|
|
16
16
|
`${command} runs tests with APP_ENV=test, and APP_ENV is ${appEnv} here: tests never run on a staging or ` +
|
|
17
17
|
"production server. Run them where APP_ENV is unset, development or test."
|