@anvil-works/anvil-cli 0.5.1 → 0.5.3

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/dist/index.js CHANGED
@@ -12328,15 +12328,15 @@ var __webpack_exports__ = {};
12328
12328
  const terminatorPosition = argv.indexOf('--');
12329
12329
  return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
12330
12330
  }
12331
- const { env } = external_node_process_namespaceObject;
12331
+ const { env: supports_color_env } = external_node_process_namespaceObject;
12332
12332
  let flagForceColor;
12333
12333
  if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
12334
12334
  else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
12335
12335
  function envForceColor() {
12336
- if ('FORCE_COLOR' in env) {
12337
- if ('true' === env.FORCE_COLOR) return 1;
12338
- if ('false' === env.FORCE_COLOR) return 0;
12339
- return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
12336
+ if ('FORCE_COLOR' in supports_color_env) {
12337
+ if ('true' === supports_color_env.FORCE_COLOR) return 1;
12338
+ if ('false' === supports_color_env.FORCE_COLOR) return 0;
12339
+ return 0 === supports_color_env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(supports_color_env.FORCE_COLOR, 10), 3);
12340
12340
  }
12341
12341
  }
12342
12342
  function translateLevel(level) {
@@ -12357,47 +12357,47 @@ var __webpack_exports__ = {};
12357
12357
  if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
12358
12358
  if (hasFlag('color=256')) return 2;
12359
12359
  }
12360
- if ('TF_BUILD' in env && 'AGENT_NAME' in env) return 1;
12360
+ if ('TF_BUILD' in supports_color_env && 'AGENT_NAME' in supports_color_env) return 1;
12361
12361
  if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
12362
12362
  const min = forceColor || 0;
12363
- if ('dumb' === env.TERM) return min;
12363
+ if ('dumb' === supports_color_env.TERM) return min;
12364
12364
  if ('win32' === external_node_process_namespaceObject.platform) {
12365
12365
  const osRelease = external_node_os_namespaceObject.release().split('.');
12366
12366
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
12367
12367
  return 1;
12368
12368
  }
12369
- if ('CI' in env) {
12369
+ if ('CI' in supports_color_env) {
12370
12370
  if ([
12371
12371
  'GITHUB_ACTIONS',
12372
12372
  'GITEA_ACTIONS',
12373
12373
  'CIRCLECI'
12374
- ].some((key)=>key in env)) return 3;
12374
+ ].some((key)=>key in supports_color_env)) return 3;
12375
12375
  if ([
12376
12376
  'TRAVIS',
12377
12377
  'APPVEYOR',
12378
12378
  'GITLAB_CI',
12379
12379
  'BUILDKITE',
12380
12380
  'DRONE'
12381
- ].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
12381
+ ].some((sign)=>sign in supports_color_env) || 'codeship' === supports_color_env.CI_NAME) return 1;
12382
12382
  return min;
12383
12383
  }
12384
- if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
12385
- if ('truecolor' === env.COLORTERM) return 3;
12386
- if ('xterm-kitty' === env.TERM) return 3;
12387
- if ('xterm-ghostty' === env.TERM) return 3;
12388
- if ('wezterm' === env.TERM) return 3;
12389
- if ('TERM_PROGRAM' in env) {
12390
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
12391
- switch(env.TERM_PROGRAM){
12384
+ if ('TEAMCITY_VERSION' in supports_color_env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(supports_color_env.TEAMCITY_VERSION) ? 1 : 0;
12385
+ if ('truecolor' === supports_color_env.COLORTERM) return 3;
12386
+ if ('xterm-kitty' === supports_color_env.TERM) return 3;
12387
+ if ('xterm-ghostty' === supports_color_env.TERM) return 3;
12388
+ if ('wezterm' === supports_color_env.TERM) return 3;
12389
+ if ('TERM_PROGRAM' in supports_color_env) {
12390
+ const version = Number.parseInt((supports_color_env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
12391
+ switch(supports_color_env.TERM_PROGRAM){
12392
12392
  case 'iTerm.app':
12393
12393
  return version >= 3 ? 3 : 2;
12394
12394
  case 'Apple_Terminal':
12395
12395
  return 2;
12396
12396
  }
12397
12397
  }
12398
- if (/-256(color)?$/i.test(env.TERM)) return 2;
12399
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
12400
- if ('COLORTERM' in env) return 1;
12398
+ if (/-256(color)?$/i.test(supports_color_env.TERM)) return 2;
12399
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(supports_color_env.TERM)) return 1;
12400
+ if ('COLORTERM' in supports_color_env) return 1;
12401
12401
  return min;
12402
12402
  }
12403
12403
  function createSupportsColor(stream, options = {}) {
@@ -15878,7 +15878,7 @@ var __webpack_exports__ = {};
15878
15878
  function sorted(a, b) {
15879
15879
  return a === b ? 0 : a > b ? 1 : -1;
15880
15880
  }
15881
- function trimmed(input) {
15881
+ function esm_trimmed(input) {
15882
15882
  return input.trim();
15883
15883
  }
15884
15884
  function toNumber(input) {
@@ -15896,7 +15896,7 @@ var __webpack_exports__ = {};
15896
15896
  }
15897
15897
  };
15898
15898
  parseTagList = function(data, customSort = false) {
15899
- const tags = data.split("\n").map(trimmed).filter(Boolean);
15899
+ const tags = data.split("\n").map(esm_trimmed).filter(Boolean);
15900
15900
  if (!customSort) tags.sort(function(tagA, tagB) {
15901
15901
  const partsA = tagA.split(".");
15902
15902
  const partsB = tagB.split(".");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-works/anvil-cli",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "CLI tool for developing Anvil apps locally",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,7 +4,7 @@ REM This script is synced into anvil website static install endpoints; do not ed
4
4
  setlocal
5
5
 
6
6
  set "SCRIPT_URL=%ANVIL_INSTALL_URL%"
7
- if not defined SCRIPT_URL set "SCRIPT_URL=https://anvil.works/install/anvil-cli/install.ps1"
7
+ if not defined SCRIPT_URL set "SCRIPT_URL=https://anvil.works/install-cli.ps1"
8
8
  set "SCRIPT_PATH=%TEMP%\anvil-install-%RANDOM%%RANDOM%.ps1"
9
9
 
10
10
  where curl >nul 2>&1
@@ -13,6 +13,13 @@ if errorlevel 1 (
13
13
  exit /b 1
14
14
  )
15
15
 
16
+ where git >nul 2>&1
17
+ if errorlevel 1 (
18
+ echo Warning: git was not found on PATH.
19
+ echo Warning: anvil checkout and anvil watch workflows require git.
20
+ echo Warning: install will continue, but install git before using those commands.
21
+ )
22
+
16
23
  curl -fsSL "%SCRIPT_URL%" -o "%SCRIPT_PATH%"
17
24
  if errorlevel 1 (
18
25
  echo Error: failed to download installer from %SCRIPT_URL%
@@ -143,6 +143,14 @@ function Ensure-Npm {
143
143
  Fail 'npm is unavailable after Node.js setup'
144
144
  }
145
145
 
146
+ function Warn-IfMissingGit {
147
+ if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
148
+ Write-Info "Warning: git was not found on PATH."
149
+ Write-Info "Warning: anvil checkout and anvil watch workflows require git."
150
+ Write-Info "Warning: install will continue, but install git before using those commands."
151
+ }
152
+ }
153
+
146
154
  function Main {
147
155
  Ensure-Directory -Path $AnvilHome
148
156
  Ensure-Directory -Path $NpmPrefix
@@ -153,6 +161,8 @@ function Main {
153
161
  Add-UserPathSegment -Segment $NodeDir
154
162
  Add-UserPathSegment -Segment $NpmPrefix
155
163
 
164
+ Warn-IfMissingGit
165
+
156
166
  $npm = Ensure-Npm
157
167
 
158
168
  Write-Info 'Installing anvil-cli...'
@@ -173,7 +183,7 @@ function Main {
173
183
 
174
184
  Write-Info ''
175
185
  Write-Info "anvil-cli installed successfully (v$version)"
176
- Write-Info "Next step: run 'anvil onboard'"
186
+ Write-Info "Next step: run 'anvil configure'"
177
187
  Write-Info "If your current terminal cannot find 'anvil', start a new terminal session."
178
188
  }
179
189
 
@@ -21,6 +21,14 @@ need_cmd() {
21
21
  command -v "$1" >/dev/null 2>&1 || fail "Required command not found: $1"
22
22
  }
23
23
 
24
+ warn_if_missing_git() {
25
+ if ! command -v git >/dev/null 2>&1; then
26
+ log "Warning: git was not found on PATH."
27
+ log "Warning: anvil checkout and anvil watch workflows require git."
28
+ log "Warning: install will continue, but install git before using those commands."
29
+ fi
30
+ }
31
+
24
32
  append_path_export() {
25
33
  profile_file="$1"
26
34
  line='export PATH="$HOME/.anvil-cli/npm-global/bin:$HOME/.anvil-cli/node-v20/bin:$PATH"'
@@ -129,6 +137,7 @@ main() {
129
137
  persist_path_hint
130
138
 
131
139
  need_cmd npm
140
+ warn_if_missing_git
132
141
 
133
142
  log "Installing anvil-cli..."
134
143
  npm config set prefix "$NPM_PREFIX" >/dev/null
@@ -144,7 +153,7 @@ main() {
144
153
 
145
154
  log ""
146
155
  log "anvil-cli installed successfully${version:+ (v$version)}"
147
- log "Next step: run 'anvil onboard'"
156
+ log "Next step: run 'anvil configure'"
148
157
  log "If your current shell cannot find 'anvil', open a new terminal session."
149
158
  }
150
159