@moewolf/moe-icons-cli 0.0.25 → 0.0.27

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.
@@ -0,0 +1,2 @@
1
+ /** Wait for a bounded interval and detach the abort listener on either outcome. */
2
+ export declare function abortableSleep(milliseconds: number, signal?: AbortSignal): Promise<void>;
@@ -0,0 +1,20 @@
1
+ import { CliError } from "../errors/index.js";
2
+ /** Wait for a bounded interval and detach the abort listener on either outcome. */
3
+ export function abortableSleep(milliseconds, signal) {
4
+ return new Promise((resolve, reject) => {
5
+ if (signal?.aborted) {
6
+ reject(new CliError("CANCELLED", "login cancelled"));
7
+ return;
8
+ }
9
+ const onAbort = () => {
10
+ clearTimeout(timer);
11
+ signal?.removeEventListener("abort", onAbort);
12
+ reject(new CliError("CANCELLED", "login cancelled"));
13
+ };
14
+ const timer = setTimeout(() => {
15
+ signal?.removeEventListener("abort", onAbort);
16
+ resolve();
17
+ }, milliseconds);
18
+ signal?.addEventListener("abort", onAbort, { once: true });
19
+ });
20
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "catalogVersion": "0.0.26",
4
- "sourceVersion": "0.0.26",
5
- "sourceCommit": "5a7bf7bded1677745924e16ce1661ee031a84171",
6
- "generatorCommit": "a8aa1df7bb76fb9445a101d4e250e14a9b32943b",
3
+ "catalogVersion": "0.0.28",
4
+ "sourceVersion": "0.0.28",
5
+ "sourceCommit": "7cf1d95d1b5e485a461ff6ad06d507789f5d745f",
6
+ "generatorCommit": "f1cfaf7dc9adfac9ee3ea8505a42766588825735",
7
7
  "manifestSchemaVersion": 2,
8
8
  "styleGroups": [
9
9
  {
package/dist/core/auth.js CHANGED
@@ -5,6 +5,7 @@ import { requestJson } from "../api/client.js";
5
5
  import { selectedStore, rememberFileStore, stateRoot } from "../auth/session-policy.cjs";
6
6
  import { resolve } from "node:path";
7
7
  import { boundedResponse } from "../auth/transport.js";
8
+ import { abortableSleep } from "../auth/abortable-sleep.js";
8
9
  import { CliError } from "../errors/index.js";
9
10
  const DEFAULT_API_BASE_URL = "https://api.moeicons.com";
10
11
  const DEFAULT_WEBSITE_ORIGIN = "https://moeicons.com";
@@ -173,10 +174,7 @@ export async function runLoginUseCase(context, deps = {}) {
173
174
  const session = await loginWithDeviceSession(auth0Config(context), {
174
175
  request,
175
176
  openBrowser: browserOpener,
176
- sleep: deps.sleep ?? ((milliseconds, signal) => new Promise((resolve, reject) => {
177
- const timer = setTimeout(resolve, milliseconds);
178
- signal?.addEventListener("abort", () => { clearTimeout(timer); reject(new CliError("CANCELLED", "login cancelled")); }, { once: true });
179
- })),
177
+ sleep: deps.sleep ?? abortableSleep,
180
178
  tokenStore,
181
179
  now: () => context.now().getTime(),
182
180
  }, context.signal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moewolf/moe-icons-cli",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Moeicons CLI: install React, Vue, Vanilla, or Assets icon targets, manage releases and login, and expose an MCP server.",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",
@@ -74,5 +74,5 @@
74
74
  "fflate": "^0.8.2",
75
75
  "jsonc-parser": "^3.3.1"
76
76
  },
77
- "payloadHash": "3ca6ea17be63d6fe5006d6d7cc51fb9b1dc4d0e94363b08993c20b16ca5e515d"
77
+ "payloadHash": "bceb4360ff15e64d82cae132d4c839d3ce5148869d9988733fbab1757149b843"
78
78
  }