@algolia/wizard 0.52.0-rc.151.366 → 0.52.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.
Files changed (2) hide show
  1. package/dist/main.js +11 -137
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -3651,7 +3651,7 @@ async function runAnalysis(mode, extraInstructions = []) {
3651
3651
  // package.json
3652
3652
  var package_default = {
3653
3653
  name: "@algolia/wizard",
3654
- version: "0.52.0-rc.151.366",
3654
+ version: "0.52.0",
3655
3655
  description: "Magically implement Algolia functionality in your codebase",
3656
3656
  type: "module",
3657
3657
  engines: {
@@ -6462,122 +6462,8 @@ function delay(ms) {
6462
6462
  });
6463
6463
  }
6464
6464
 
6465
- // package.json with { type: 'json' }
6466
- var package_default2 = {
6467
- name: "@algolia/wizard",
6468
- version: "0.52.0-rc.151.366",
6469
- description: "Magically implement Algolia functionality in your codebase",
6470
- type: "module",
6471
- engines: {
6472
- node: ">=24"
6473
- },
6474
- bin: {
6475
- wizard: "dist/main.js"
6476
- },
6477
- files: [
6478
- "dist",
6479
- "docs"
6480
- ],
6481
- scripts: {
6482
- "build:proxy": "node scripts/build.mjs proxy",
6483
- build: "node scripts/build.mjs",
6484
- "dev:proxy": "touch .env && NODE_OPTIONS=--use-system-ca tsx watch --env-file=.env src/proxy/index.ts",
6485
- dev: "touch .env && tsx --env-file=.env ./src/main.tsx",
6486
- "env:load": "pnpm exec -- varlock load",
6487
- prepare: "husky",
6488
- prepublishOnly: "pnpm build",
6489
- reset: "tsx ./scripts/reset-state.ts",
6490
- "test:fixtures": "touch .env && tsx --env-file=.env ./fixtures/run-fixtures.ts",
6491
- "test:tools": "tsx ./tool-evals/toolEval.ts",
6492
- "test:tools:improve": "tsx ./tool-evals/improveFromPlan.ts",
6493
- test: "vitest",
6494
- typecheck: "tsc --noEmit -p tsconfig.json"
6495
- },
6496
- keywords: [],
6497
- author: "",
6498
- license: "ISC",
6499
- packageManager: "pnpm@11.9.0+sha512.bd682d5d03fe525ef7c9fd6780c6884d1e756ac4c9c9fe00c538782824310dcf90e3ddc4f53835f06dfaebd5085e41855e0bcbb3b60de2ac5bbab89e5036f03b",
6500
- devDependencies: {
6501
- "@clack/prompts": "^1.6.0",
6502
- "@types/ioredis-mock": "^8.2.7",
6503
- "@types/node": "^25.9.1",
6504
- "@types/react": "^19.2.16",
6505
- esbuild: "^0.28.0",
6506
- husky: "^9.1.7",
6507
- "ink-testing-library": "^4.0.0",
6508
- "ioredis-mock": "^8.13.1",
6509
- "lint-staged": "^17.0.8",
6510
- tsx: "^4.22.3",
6511
- typescript: "^6.0.3",
6512
- vitest: "^4.1.8"
6513
- },
6514
- dependencies: {
6515
- "@ai-sdk/anthropic": "^3.0.81",
6516
- "@ai-sdk/openai-compatible": "^2.0.47",
6517
- "@hono/node-server": "^2.0.10",
6518
- "@segment/analytics-node": "^3.1.0",
6519
- ai: "^6.0.190",
6520
- "cross-keychain": "^1.1.0",
6521
- dotenv: "^17.4.2",
6522
- hono: "^4.12.27",
6523
- ink: "^7.0.5",
6524
- "ink-picture": "^2.1.0",
6525
- "ink-spinner": "^5.0.0",
6526
- ioredis: "^5.11.1",
6527
- nanoid: "^5.1.15",
6528
- pino: "^10.3.1",
6529
- react: "^19.2.7",
6530
- "terminal-link": "^5.0.0",
6531
- varlock: "^1.5.1",
6532
- zod: "^4.4.3",
6533
- zustand: "^5.0.14"
6534
- }
6535
- };
6536
-
6537
- // src/lib/checkVersion.ts
6538
- function isReleaseCandidate(version) {
6539
- return version.includes("rc");
6540
- }
6541
- function parseVersion(version) {
6542
- const [major = 0, minor = 0, patch = 0] = version.split("-")[0].split(".").map((part) => Number.parseInt(part, 10) || 0);
6543
- return [major, minor, patch];
6544
- }
6545
- function isOlder(local, remote) {
6546
- const a = parseVersion(local);
6547
- const b = parseVersion(remote);
6548
- for (let i = 0; i < 3; i++) {
6549
- if (a[i] !== b[i]) return a[i] < b[i];
6550
- }
6551
- return false;
6552
- }
6553
- async function checkVersion() {
6554
- if (isReleaseCandidate(package_default2.version)) return false;
6555
- try {
6556
- const res = await fetch(
6557
- "https://registry.npmjs.org/@algolia/wizard/latest",
6558
- { signal: AbortSignal.timeout(3e3) }
6559
- );
6560
- if (!res.ok) {
6561
- throw Error(`npmjs registry responded ${res.status}`);
6562
- }
6563
- const { version } = await res.json();
6564
- if (typeof version !== "string") {
6565
- throw Error("npmjs registry returned no version");
6566
- }
6567
- return isOlder(package_default2.version, version);
6568
- } catch {
6569
- logger.error("Could not resolve remote version number from npmjs registry");
6570
- return false;
6571
- }
6572
- }
6573
-
6574
6465
  // src/main.tsx
6575
6466
  import { jsx as jsx20 } from "react/jsx-runtime";
6576
- async function exitProcessWithError(store, instance, message) {
6577
- store.setError(message);
6578
- await instance.waitUntilExit();
6579
- process.exit(1);
6580
- }
6581
6467
  async function startup() {
6582
6468
  setProjectRoot(process.cwd());
6583
6469
  let args;
@@ -6630,14 +6516,6 @@ async function run(opts) {
6630
6516
  const store = useWizard.getState();
6631
6517
  const instance = render(/* @__PURE__ */ jsx20(App, {}), { incrementalRendering: true });
6632
6518
  await store.waitForStart();
6633
- const wizardOutdated = await checkVersion();
6634
- if (wizardOutdated) {
6635
- await exitProcessWithError(
6636
- store,
6637
- instance,
6638
- "You have loaded an old version of the Wizard. Please use @algolia/wizard@latest"
6639
- );
6640
- }
6641
6519
  store.syncSteps(
6642
6520
  workflow.steps.map((s) => ({
6643
6521
  id: s.id,
@@ -6653,20 +6531,18 @@ async function run(opts) {
6653
6531
  try {
6654
6532
  await runAuthLogin();
6655
6533
  } catch (err) {
6656
- await exitProcessWithError(
6657
- store,
6658
- instance,
6659
- err instanceof Error ? err.message : String(err)
6660
- );
6534
+ store.setError(err instanceof Error ? err.message : String(err));
6535
+ await instance.waitUntilExit();
6536
+ process.exit(1);
6661
6537
  }
6662
6538
  store.endAuth();
6663
6539
  user = await getUser();
6664
6540
  if (!user) {
6665
- await exitProcessWithError(
6666
- store,
6667
- instance,
6541
+ store.setError(
6668
6542
  "Authentication completed but no Algolia user was returned. Try running `npx @algolia/cli@latest auth login` directly."
6669
6543
  );
6544
+ await instance.waitUntilExit();
6545
+ process.exit(1);
6670
6546
  }
6671
6547
  }
6672
6548
  store.setUser(user);
@@ -6676,14 +6552,12 @@ async function run(opts) {
6676
6552
  app = await ensureApplication(
6677
6553
  resumableState ? runAppId(resumableState) : void 0
6678
6554
  );
6679
- runWorkflow(workflow, app.id, { skipResumePrompt, resumableState });
6680
6555
  } catch (err) {
6681
- await exitProcessWithError(
6682
- store,
6683
- instance,
6684
- err instanceof Error ? err.message : String(err)
6685
- );
6556
+ store.setError(err instanceof Error ? err.message : String(err));
6557
+ await instance.waitUntilExit();
6558
+ process.exit(1);
6686
6559
  }
6560
+ runWorkflow(workflow, app.id, { skipResumePrompt, resumableState });
6687
6561
  }
6688
6562
  await requestTerminalSize();
6689
6563
  var started = await startup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.52.0-rc.151.366",
3
+ "version": "0.52.0",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {