@foliwake/cli 0.7.0 → 0.8.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @foliwake/cli
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 8f83657: With the engine registered, an explicit `FOLIWAKE_SERVER` now wins over `FOLIWAKE_CONFIG`: a command goes to
8
+ `--server`, then `--config`, then `FOLIWAKE_CONFIG` only while `FOLIWAKE_SERVER` is unset, then the folder's
9
+ `.foliwake/connection.json`, `FOLIWAKE_SERVER`, `./foliwake.config.json`, the last `login`, else locally. The
10
+ engine's Docker image sets `FOLIWAKE_CONFIG` for its own commands; a CI job or operator naming a server in the
11
+ container now reaches it without clearing that variable.
12
+ - Updated dependencies [3edc810]
13
+ - Updated dependencies [7e70573]
14
+ - @foliwake/core-contract@0.8.0
15
+ - create-foliwake@0.8.0
16
+ - @foliwake/block-kit@0.8.0
17
+ - @foliwake/blocks-contract@0.8.0
18
+ - @foliwake/server@0.8.0
19
+ - @foliwake/site-check@0.8.0
20
+
3
21
  ## 0.7.0
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -96,9 +96,10 @@ platform's checks (`@foliwake/site-check`) find in it.
96
96
 
97
97
  The Foliwake engine (its checkout or Docker image) is the same `foliwake` command with this package as an oclif
98
98
  plugin: it registers its local runtime with `registerLocalRuntime()` from `@foliwake/cli/local-runtime` before
99
- oclif loads the commands. Then the same commands also run on that computer: `--server`, then `--config` or
100
- `FOLIWAKE_CONFIG`, then `.foliwake/connection.json`, then `FOLIWAKE_SERVER`, then `./foliwake.config.json`,
101
- then the default server, else the local configuration. `--config` and `--content` are shown and work, the engine
99
+ oclif loads the commands. Then the same commands also run on that computer: `--server`, then `--config`, then
100
+ `FOLIWAKE_CONFIG` unless `FOLIWAKE_SERVER` is set, then `.foliwake/connection.json`, then `FOLIWAKE_SERVER`, then
101
+ `./foliwake.config.json`, then the default server, else the local configuration. An explicit `FOLIWAKE_SERVER`
102
+ thus reaches its server even where `FOLIWAKE_CONFIG` is set for the engine's own commands (its Docker image). `--config` and `--content` are shown and work, the engine
102
103
  serves `dev` (local content, and `--remote` with its block catalog), `operation recover --break-lock` removes a
103
104
  local state lock, and `--timings` reports the engine's phase timings. The hook is for the engine; its shape may
104
105
  change with it.
@@ -1,6 +1,9 @@
1
1
  // Where a core command's calls go: a server, or with the engine's runtime registered, this computer.
2
- // --server, then --config or $FOLIWAKE_CONFIG (local), then the folder's .foliwake/connection.json, then
3
- // $FOLIWAKE_SERVER, then ./foliwake.config.json in this folder (local), then the last `login`, else local.
2
+ // --server, then --config (local), then $FOLIWAKE_CONFIG (local) unless $FOLIWAKE_SERVER is set, then the
3
+ // folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then ./foliwake.config.json in this folder
4
+ // (local), then the last `login`, else local.
5
+ // An explicit $FOLIWAKE_SERVER wins over $FOLIWAKE_CONFIG: the engine's Docker image sets FOLIWAKE_CONFIG for
6
+ // its own commands, and a CI job or an operator naming a server must reach it (flags still win over both).
4
7
  // Without the engine nothing is local: null when nothing names a server.
5
8
  import { localRuntime } from './local-runtime.js';
6
9
  import { ServerAddressError, resolveTarget } from './remote/servers.js';
@@ -12,7 +15,7 @@ export function chooseTarget({ server, config }, env = process.env, cwd = proces
12
15
  if (server !== undefined && config !== undefined) {
13
16
  throw new ServerAddressError('Use either --server or --config, not both.');
14
17
  }
15
- if (server === undefined && (config !== undefined || setting('CONFIG', env)))
18
+ if (server === undefined && (config !== undefined || configFromEnv(env)))
16
19
  return 'local';
17
20
  const target = resolveTarget({ server }, env, cwd);
18
21
  if (target && target.from !== 'login')
@@ -21,3 +24,7 @@ export function chooseTarget({ server, config }, env = process.env, cwd = proces
21
24
  return 'local';
22
25
  return target ?? 'local';
23
26
  }
27
+ /** $FOLIWAKE_CONFIG names the local configuration only while $FOLIWAKE_SERVER names no server. */
28
+ function configFromEnv(env) {
29
+ return Boolean(setting('CONFIG', env)) && !setting('SERVER', env);
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foliwake/cli",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "The foliwake command without the engine: sign in to a Foliwake server and run its commands there (site status, sync, preview, publish, code deploy, branches, releases, sources, credentials, CI keys), and develop blocks against a remote preview.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -98,12 +98,12 @@
98
98
  "@oclif/core": "4.14.0",
99
99
  "chokidar": "6.0.0",
100
100
  "parse5": "7.3.0",
101
- "@foliwake/blocks-contract": "0.7.0",
102
- "@foliwake/server": "0.7.0",
103
- "@foliwake/core-contract": "0.7.0",
104
- "@foliwake/site-check": "0.7.0",
105
- "create-foliwake": "0.7.0",
106
- "@foliwake/block-kit": "0.7.0"
101
+ "@foliwake/block-kit": "0.8.0",
102
+ "@foliwake/blocks-contract": "0.8.0",
103
+ "@foliwake/core-contract": "0.8.0",
104
+ "@foliwake/site-check": "0.8.0",
105
+ "create-foliwake": "0.8.0",
106
+ "@foliwake/server": "0.8.0"
107
107
  },
108
108
  "files": [
109
109
  "dist/",