@hot-updater/test-utils 1.2.0-rc.10 → 1.2.0-rc.12

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/node.cjs CHANGED
@@ -20911,12 +20911,21 @@ const renderClackLog = (calls, { columns = 80 } = {}) => {
20911
20911
  }
20912
20912
  return (0, node_util.stripVTControlCharacters)(text).replace(/\n+$/, "").split("\n");
20913
20913
  };
20914
+ const graphemes = new Intl.Segmenter();
20915
+ const WIDE_PATTERN = /[\u1100-\u115F\u2E80-\u303E\u3041-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uA000-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFF60\uFFE0-\uFFE6\u{20000}-\u{3FFFD}]|\p{Emoji_Presentation}/u;
20914
20916
  /**
20915
- * The lines wider than `columns`, which a terminal that wide wraps, but for
20916
- * a line that is one word after clack's gutter, such as a URL, which no
20917
- * line break could shorten.
20917
+ * The columns a line takes in a terminal, as East Asian Width counts them,
20918
+ * not its bytes or code units: `│`, `■`, and `…` take one each, a wide
20919
+ * character or an emoji two, and a combining mark none. The CLI keeps its
20920
+ * own count; this one is the specs' measure of it.
20918
20921
  */
20919
- const linesWiderThan = (lines, columns = 80) => lines.filter((line) => [...line].length > columns && /\s/u.test(line.slice(3).trim()));
20922
+ const displayColumns = (line) => [...graphemes.segment((0, node_util.stripVTControlCharacters)(line))].reduce((columns, { segment }) => columns + (/^[\p{M}\p{Cf}\p{Cc}]+$/u.test(segment) ? 0 : WIDE_PATTERN.test(segment) ? 2 : 1), 0);
20923
+ /**
20924
+ * The lines wider than `columns` display columns, which a terminal that
20925
+ * wide wraps, but for a line that is one word after clack's gutter, such
20926
+ * as a URL, which no line break could shorten.
20927
+ */
20928
+ const linesWiderThan = (lines, columns = 80) => lines.filter((line) => displayColumns(line) > columns && /\s/u.test(line.slice(3).trim()));
20920
20929
  //#endregion
20921
20930
  //#region src/setupHandlerIntegrationTestSuite.ts
20922
20931
  const TEST_ADMIN_AUTH_TOKEN = "hot-updater-test-token";
@@ -21190,6 +21199,7 @@ exports.cleanupServer = cleanupServer;
21190
21199
  exports.createD1TestDatabase = createD1TestDatabase;
21191
21200
  exports.createReleaseCatalogTestStorage = createReleaseCatalogTestStorage;
21192
21201
  exports.createTestDbPath = createTestDbPath;
21202
+ exports.displayColumns = displayColumns;
21193
21203
  exports.findOpenPort = findOpenPort;
21194
21204
  exports.formatRuntimeLogs = formatRuntimeLogs;
21195
21205
  exports.hasCommand = hasCommand;
package/dist/node.d.cts CHANGED
@@ -124,9 +124,16 @@ declare const renderClackLog: (calls: readonly ClackLogCall[], { columns }?: {
124
124
  columns?: number;
125
125
  }) => string[];
126
126
  /**
127
- * The lines wider than `columns`, which a terminal that wide wraps, but for
128
- * a line that is one word after clack's gutter, such as a URL, which no
129
- * line break could shorten.
127
+ * The columns a line takes in a terminal, as East Asian Width counts them,
128
+ * not its bytes or code units: `│`, `■`, and `…` take one each, a wide
129
+ * character or an emoji two, and a combining mark none. The CLI keeps its
130
+ * own count; this one is the specs' measure of it.
131
+ */
132
+ declare const displayColumns: (line: string) => number;
133
+ /**
134
+ * The lines wider than `columns` display columns, which a terminal that
135
+ * wide wraps, but for a line that is one word after clack's gutter, such
136
+ * as a URL, which no line break could shorten.
130
137
  */
131
138
  declare const linesWiderThan: (lines: readonly string[], columns?: number) => string[];
132
139
  //#endregion
@@ -176,4 +183,4 @@ declare const pgExecutor: (pool: Pool$1) => SqlExecutor;
176
183
  declare const pgBatchExecutor: (pool: Pool$1) => SqlExecutor;
177
184
  declare const mysqlExecutor: (pool: Pool) => SqlExecutor;
178
185
  //#endregion
179
- export { ClackLogCall, ClackLogMethod, D1TestResult, MockedReactNativeProjectRoot, RELEASE_CATALOG_DOWNLOAD_HASH, RELEASE_CATALOG_MANIFEST_URIS, RELEASE_CATALOG_STORAGE_FIXTURES, RuntimeChild, RuntimeLogs, SpawnRuntimeOptions, TEST_ADMIN_AUTH_TOKEN, assertCommandAvailable, assertDockerComposeAvailable, assertDockerDaemonAvailable, assertEnvFlagEnabled, cleanupServer, createD1TestDatabase, createReleaseCatalogTestStorage, createTestDbPath, findOpenPort, formatRuntimeLogs, hasCommand, hasDockerCompose, hasDockerDaemon, killPort, linesWiderThan, mockReactNativeProjectRoot, mysqlExecutor, pgBatchExecutor, pgExecutor, pgliteBatchExecutor, pgliteExecutor, recordedClackCalls, releaseCatalogArtifact, releaseCatalogArtifactFiles, releaseCatalogDownloadUrl, renderClackLog, runCheckedCommand, spawnRuntime, spawnServerProcess, sqliteBatchExecutor, sqliteExecutor, startHttpTestServer, stopRuntime, waitForHttpOk, waitForServer };
186
+ export { ClackLogCall, ClackLogMethod, D1TestResult, MockedReactNativeProjectRoot, RELEASE_CATALOG_DOWNLOAD_HASH, RELEASE_CATALOG_MANIFEST_URIS, RELEASE_CATALOG_STORAGE_FIXTURES, RuntimeChild, RuntimeLogs, SpawnRuntimeOptions, TEST_ADMIN_AUTH_TOKEN, assertCommandAvailable, assertDockerComposeAvailable, assertDockerDaemonAvailable, assertEnvFlagEnabled, cleanupServer, createD1TestDatabase, createReleaseCatalogTestStorage, createTestDbPath, displayColumns, findOpenPort, formatRuntimeLogs, hasCommand, hasDockerCompose, hasDockerDaemon, killPort, linesWiderThan, mockReactNativeProjectRoot, mysqlExecutor, pgBatchExecutor, pgExecutor, pgliteBatchExecutor, pgliteExecutor, recordedClackCalls, releaseCatalogArtifact, releaseCatalogArtifactFiles, releaseCatalogDownloadUrl, renderClackLog, runCheckedCommand, spawnRuntime, spawnServerProcess, sqliteBatchExecutor, sqliteExecutor, startHttpTestServer, stopRuntime, waitForHttpOk, waitForServer };
package/dist/node.d.mts CHANGED
@@ -124,9 +124,16 @@ declare const renderClackLog: (calls: readonly ClackLogCall[], { columns }?: {
124
124
  columns?: number;
125
125
  }) => string[];
126
126
  /**
127
- * The lines wider than `columns`, which a terminal that wide wraps, but for
128
- * a line that is one word after clack's gutter, such as a URL, which no
129
- * line break could shorten.
127
+ * The columns a line takes in a terminal, as East Asian Width counts them,
128
+ * not its bytes or code units: `│`, `■`, and `…` take one each, a wide
129
+ * character or an emoji two, and a combining mark none. The CLI keeps its
130
+ * own count; this one is the specs' measure of it.
131
+ */
132
+ declare const displayColumns: (line: string) => number;
133
+ /**
134
+ * The lines wider than `columns` display columns, which a terminal that
135
+ * wide wraps, but for a line that is one word after clack's gutter, such
136
+ * as a URL, which no line break could shorten.
130
137
  */
131
138
  declare const linesWiderThan: (lines: readonly string[], columns?: number) => string[];
132
139
  //#endregion
@@ -176,4 +183,4 @@ declare const pgExecutor: (pool: Pool$1) => SqlExecutor;
176
183
  declare const pgBatchExecutor: (pool: Pool$1) => SqlExecutor;
177
184
  declare const mysqlExecutor: (pool: Pool) => SqlExecutor;
178
185
  //#endregion
179
- export { ClackLogCall, ClackLogMethod, D1TestResult, MockedReactNativeProjectRoot, RELEASE_CATALOG_DOWNLOAD_HASH, RELEASE_CATALOG_MANIFEST_URIS, RELEASE_CATALOG_STORAGE_FIXTURES, RuntimeChild, RuntimeLogs, SpawnRuntimeOptions, TEST_ADMIN_AUTH_TOKEN, assertCommandAvailable, assertDockerComposeAvailable, assertDockerDaemonAvailable, assertEnvFlagEnabled, cleanupServer, createD1TestDatabase, createReleaseCatalogTestStorage, createTestDbPath, findOpenPort, formatRuntimeLogs, hasCommand, hasDockerCompose, hasDockerDaemon, killPort, linesWiderThan, mockReactNativeProjectRoot, mysqlExecutor, pgBatchExecutor, pgExecutor, pgliteBatchExecutor, pgliteExecutor, recordedClackCalls, releaseCatalogArtifact, releaseCatalogArtifactFiles, releaseCatalogDownloadUrl, renderClackLog, runCheckedCommand, spawnRuntime, spawnServerProcess, sqliteBatchExecutor, sqliteExecutor, startHttpTestServer, stopRuntime, waitForHttpOk, waitForServer };
186
+ export { ClackLogCall, ClackLogMethod, D1TestResult, MockedReactNativeProjectRoot, RELEASE_CATALOG_DOWNLOAD_HASH, RELEASE_CATALOG_MANIFEST_URIS, RELEASE_CATALOG_STORAGE_FIXTURES, RuntimeChild, RuntimeLogs, SpawnRuntimeOptions, TEST_ADMIN_AUTH_TOKEN, assertCommandAvailable, assertDockerComposeAvailable, assertDockerDaemonAvailable, assertEnvFlagEnabled, cleanupServer, createD1TestDatabase, createReleaseCatalogTestStorage, createTestDbPath, displayColumns, findOpenPort, formatRuntimeLogs, hasCommand, hasDockerCompose, hasDockerDaemon, killPort, linesWiderThan, mockReactNativeProjectRoot, mysqlExecutor, pgBatchExecutor, pgExecutor, pgliteBatchExecutor, pgliteExecutor, recordedClackCalls, releaseCatalogArtifact, releaseCatalogArtifactFiles, releaseCatalogDownloadUrl, renderClackLog, runCheckedCommand, spawnRuntime, spawnServerProcess, sqliteBatchExecutor, sqliteExecutor, startHttpTestServer, stopRuntime, waitForHttpOk, waitForServer };
package/dist/node.mjs CHANGED
@@ -20886,12 +20886,21 @@ const renderClackLog = (calls, { columns = 80 } = {}) => {
20886
20886
  }
20887
20887
  return stripVTControlCharacters(text).replace(/\n+$/, "").split("\n");
20888
20888
  };
20889
+ const graphemes = new Intl.Segmenter();
20890
+ const WIDE_PATTERN = /[\u1100-\u115F\u2E80-\u303E\u3041-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uA000-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFF60\uFFE0-\uFFE6\u{20000}-\u{3FFFD}]|\p{Emoji_Presentation}/u;
20889
20891
  /**
20890
- * The lines wider than `columns`, which a terminal that wide wraps, but for
20891
- * a line that is one word after clack's gutter, such as a URL, which no
20892
- * line break could shorten.
20892
+ * The columns a line takes in a terminal, as East Asian Width counts them,
20893
+ * not its bytes or code units: `│`, `■`, and `…` take one each, a wide
20894
+ * character or an emoji two, and a combining mark none. The CLI keeps its
20895
+ * own count; this one is the specs' measure of it.
20893
20896
  */
20894
- const linesWiderThan = (lines, columns = 80) => lines.filter((line) => [...line].length > columns && /\s/u.test(line.slice(3).trim()));
20897
+ const displayColumns = (line) => [...graphemes.segment(stripVTControlCharacters(line))].reduce((columns, { segment }) => columns + (/^[\p{M}\p{Cf}\p{Cc}]+$/u.test(segment) ? 0 : WIDE_PATTERN.test(segment) ? 2 : 1), 0);
20898
+ /**
20899
+ * The lines wider than `columns` display columns, which a terminal that
20900
+ * wide wraps, but for a line that is one word after clack's gutter, such
20901
+ * as a URL, which no line break could shorten.
20902
+ */
20903
+ const linesWiderThan = (lines, columns = 80) => lines.filter((line) => displayColumns(line) > columns && /\s/u.test(line.slice(3).trim()));
20895
20904
  //#endregion
20896
20905
  //#region src/setupHandlerIntegrationTestSuite.ts
20897
20906
  const TEST_ADMIN_AUTH_TOKEN = "hot-updater-test-token";
@@ -21153,4 +21162,4 @@ const mysqlExecutor = (pool) => {
21153
21162
  };
21154
21163
  };
21155
21164
  //#endregion
21156
- export { RELEASE_CATALOG_DOWNLOAD_HASH, RELEASE_CATALOG_MANIFEST_URIS, RELEASE_CATALOG_STORAGE_FIXTURES, TEST_ADMIN_AUTH_TOKEN, assertCommandAvailable, assertDockerComposeAvailable, assertDockerDaemonAvailable, assertEnvFlagEnabled, cleanupServer, createD1TestDatabase, createReleaseCatalogTestStorage, createTestDbPath, findOpenPort, formatRuntimeLogs, hasCommand, hasDockerCompose, hasDockerDaemon, killPort, linesWiderThan, mockReactNativeProjectRoot, mysqlExecutor, pgBatchExecutor, pgExecutor, pgliteBatchExecutor, pgliteExecutor, recordedClackCalls, releaseCatalogArtifact, releaseCatalogArtifactFiles, releaseCatalogDownloadUrl, renderClackLog, runCheckedCommand, spawnRuntime, spawnServerProcess, sqliteBatchExecutor, sqliteExecutor, startHttpTestServer, stopRuntime, waitForHttpOk, waitForServer };
21165
+ export { RELEASE_CATALOG_DOWNLOAD_HASH, RELEASE_CATALOG_MANIFEST_URIS, RELEASE_CATALOG_STORAGE_FIXTURES, TEST_ADMIN_AUTH_TOKEN, assertCommandAvailable, assertDockerComposeAvailable, assertDockerDaemonAvailable, assertEnvFlagEnabled, cleanupServer, createD1TestDatabase, createReleaseCatalogTestStorage, createTestDbPath, displayColumns, findOpenPort, formatRuntimeLogs, hasCommand, hasDockerCompose, hasDockerDaemon, killPort, linesWiderThan, mockReactNativeProjectRoot, mysqlExecutor, pgBatchExecutor, pgExecutor, pgliteBatchExecutor, pgliteExecutor, recordedClackCalls, releaseCatalogArtifact, releaseCatalogArtifactFiles, releaseCatalogDownloadUrl, renderClackLog, runCheckedCommand, spawnRuntime, spawnServerProcess, sqliteBatchExecutor, sqliteExecutor, startHttpTestServer, stopRuntime, waitForHttpOk, waitForServer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/test-utils",
3
- "version": "1.2.0-rc.10",
3
+ "version": "1.2.0-rc.12",
4
4
  "type": "module",
5
5
  "description": "Test utilities for Hot Updater packages",
6
6
  "sideEffects": false,
@@ -50,10 +50,10 @@
50
50
  "mysql2": "*",
51
51
  "pg": "*",
52
52
  "vitest": "^4.0.0",
53
- "@hot-updater/protocol": "^1.2.0-rc.10",
54
- "@hot-updater/plugin-insights": "^1.2.0-rc.10",
55
- "@hot-updater/plugin-core": "^1.2.0-rc.10",
56
- "@hot-updater/server": "^1.2.0-rc.10"
53
+ "@hot-updater/plugin-insights": "^1.2.0-rc.12",
54
+ "@hot-updater/protocol": "^1.2.0-rc.12",
55
+ "@hot-updater/plugin-core": "^1.2.0-rc.12",
56
+ "@hot-updater/server": "^1.2.0-rc.12"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@electric-sql/pglite": {
@@ -84,10 +84,10 @@
84
84
  "typescript": "npm:@typescript/typescript6@6.0.2",
85
85
  "vitest": "4.1.4",
86
86
  "workspace-tools": "^0.41.7",
87
- "@hot-updater/plugin-insights": "1.2.0-rc.10",
88
- "@hot-updater/protocol": "1.2.0-rc.10",
89
- "@hot-updater/plugin-core": "1.2.0-rc.10",
90
- "@hot-updater/server": "1.2.0-rc.10"
87
+ "@hot-updater/plugin-insights": "1.2.0-rc.12",
88
+ "@hot-updater/plugin-core": "1.2.0-rc.12",
89
+ "@hot-updater/server": "1.2.0-rc.12",
90
+ "@hot-updater/protocol": "1.2.0-rc.12"
91
91
  },
92
92
  "inlinedDependencies": {
93
93
  "@nodelib/fs.scandir": "2.1.5",