@anvil-works/anvil-cli 0.5.3 → 0.5.4

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.
Files changed (2) hide show
  1. package/dist/cli.js +16 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -51793,17 +51793,19 @@ var __webpack_exports__ = {};
51793
51793
  function normalizePickerQuery(term) {
51794
51794
  return (term || "").trim();
51795
51795
  }
51796
- function getCheckoutPickerDelayMs(anvilUrl) {
51797
- const raw = process.env.ANVIL_CHECKOUT_PICKER_DELAY_MS;
51798
- const fromEnv = null == raw ? NaN : Number(raw);
51799
- if (null != raw && Number.isFinite(fromEnv) && fromEnv >= 0) return fromEnv;
51800
- return /localhost|127\.0\.0\.1/.test(anvilUrl) ? 250 : 0;
51796
+ function parseNonNegativeMs(raw) {
51797
+ if (null == raw) return null;
51798
+ const parsed = Number(raw);
51799
+ if (!Number.isFinite(parsed) || parsed < 0) return null;
51800
+ return parsed;
51801
+ }
51802
+ function getCheckoutPickerDelayMs() {
51803
+ const fromEnv = parseNonNegativeMs(process.env.ANVIL_CHECKOUT_PICKER_DELAY_MS);
51804
+ if (null != fromEnv) return fromEnv;
51805
+ return 0;
51801
51806
  }
51802
- function getCheckoutPickerPaginationDelayMs(anvilUrl) {
51803
- const raw = process.env.ANVIL_CHECKOUT_PICKER_PAGINATION_DELAY_MS;
51804
- const fromEnv = null == raw ? NaN : Number(raw);
51805
- if (null != raw && Number.isFinite(fromEnv) && fromEnv >= 0) return fromEnv;
51806
- return /localhost|127\.0\.0\.1/.test(anvilUrl) ? 1000 : 0;
51807
+ function getCheckoutPickerPaginationDelayMs() {
51808
+ return getCheckoutPickerDelayMs();
51807
51809
  }
51808
51810
  function getCheckoutPickerMaxRows() {
51809
51811
  const raw = process.env.ANVIL_CHECKOUT_PICKER_MAX_ROWS;
@@ -51846,8 +51848,8 @@ var __webpack_exports__ = {};
51846
51848
  const staleTimeMs = options.staleTimeMs ?? 30000;
51847
51849
  const maxAutoPagesPerCall = options.maxAutoPagesPerCall ?? 8;
51848
51850
  const initialQuery = normalizePickerQuery(options.initialQuery);
51849
- const simulatedDelayMs = getCheckoutPickerDelayMs(anvilUrl);
51850
- const paginationDelayMs = getCheckoutPickerPaginationDelayMs(anvilUrl);
51851
+ const simulatedDelayMs = getCheckoutPickerDelayMs();
51852
+ const paginationDelayMs = getCheckoutPickerPaginationDelayMs();
51851
51853
  const cache = new Map();
51852
51854
  const getState = (query)=>{
51853
51855
  const existing = cache.get(query);
@@ -51976,8 +51978,8 @@ var __webpack_exports__ = {};
51976
51978
  const pageSize = 20;
51977
51979
  const staleTimeMs = 30000;
51978
51980
  const debounceMs = 180;
51979
- const simulatedDelayMs = getCheckoutPickerDelayMs(anvilUrl);
51980
- const paginationDelayMs = getCheckoutPickerPaginationDelayMs(anvilUrl);
51981
+ const simulatedDelayMs = getCheckoutPickerDelayMs();
51982
+ const paginationDelayMs = getCheckoutPickerPaginationDelayMs();
51981
51983
  const maxVisibleRows = getCheckoutPickerMaxRows();
51982
51984
  const cache = new Map();
51983
51985
  let query = normalizePickerQuery(initialQuery);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-works/anvil-cli",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "CLI tool for developing Anvil apps locally",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",