@algolia/wizard 0.55.0 → 0.57.0-rc.151.376
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/main.js +146 -16
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -3811,7 +3811,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
3811
3811
|
// package.json
|
|
3812
3812
|
var package_default = {
|
|
3813
3813
|
name: "@algolia/wizard",
|
|
3814
|
-
version: "0.
|
|
3814
|
+
version: "0.57.0-rc.151.376",
|
|
3815
3815
|
description: "Magically implement Algolia functionality in your codebase",
|
|
3816
3816
|
type: "module",
|
|
3817
3817
|
engines: {
|
|
@@ -4461,11 +4461,11 @@ function frameworksForDoc(language) {
|
|
|
4461
4461
|
}
|
|
4462
4462
|
function baseInstructions(input) {
|
|
4463
4463
|
return [
|
|
4464
|
-
`Target Algolia index
|
|
4464
|
+
`Target Algolia index: "${input.targetIndex}"`,
|
|
4465
4465
|
`Project languages and frameworks: ${JSON.stringify(input.language)}`,
|
|
4466
4466
|
"Make minimal, idiomatic changes; do not touch unrelated code.",
|
|
4467
4467
|
`Commands run through a shell on ${process.platform}. Write commands that work there.`,
|
|
4468
|
-
"Use the project's own tooling for every command \u2014 its package manager, task runner, and test/lint commands.
|
|
4468
|
+
"Use the project's own tooling for every command \u2014 its package manager, task runner, and test/lint commands.",
|
|
4469
4469
|
"runShell needs the developer to approve each command, so give every call a clear `explanation` naming what it does and any side effect. If a command is rejected, do not retry it \u2014 take a different approach or report the limitation."
|
|
4470
4470
|
];
|
|
4471
4471
|
}
|
|
@@ -4521,11 +4521,15 @@ function ingestionInstructions(input) {
|
|
|
4521
4521
|
];
|
|
4522
4522
|
}
|
|
4523
4523
|
function searchInstructions(input) {
|
|
4524
|
+
const entity = input.findings.confirmedEntities ? input.findings.confirmedEntities[0].name : null;
|
|
4525
|
+
const attributes = input.findings.confirmedEntities ? input.findings.confirmedEntities[0].attributes : null;
|
|
4526
|
+
const entitySchemaMessage = entity && attributes ? `The following entity schema should be used to build the UI: ${JSON.stringify({ entity, attributes })}` : null;
|
|
4524
4527
|
const doc = getFrameworkSpecificDoc(frameworksForDoc(input.language));
|
|
4525
4528
|
return [
|
|
4526
4529
|
"Implement an in-app Algolia search experience.",
|
|
4530
|
+
entitySchemaMessage ?? "",
|
|
4527
4531
|
`Build the search UI for ${input.searchUiTarget}.`,
|
|
4528
|
-
"
|
|
4532
|
+
"Create search UI only. Do not create or modify ingestion scripts, rake/manage/CLI tasks, migrations, seeders, or other data-loading code, even if the data looks incomplete.",
|
|
4529
4533
|
...doc ? [
|
|
4530
4534
|
"Follow the Algolia SDK reference below for client setup, search UI wiring, and Insights instrumentation \u2014 Insights is required, not optional; prefer the reference over prior knowledge:",
|
|
4531
4535
|
doc
|
|
@@ -4533,7 +4537,7 @@ function searchInstructions(input) {
|
|
|
4533
4537
|
"No bundled Algolia SDK reference exists for this stack, so rely on the project's own conventions and Algolia's official client for its language. Do not invent APIs \u2014 keep to the documented search endpoint and its parameters."
|
|
4534
4538
|
],
|
|
4535
4539
|
`Create the search experience as its own component in a new file, following the project's existing component conventions (location, naming, styling approach). Do not write it inline into an existing file.`,
|
|
4536
|
-
`Import and render
|
|
4540
|
+
`Import and render the new component in ${input.searchLocation ? `"${input.searchLocation}"` : "the best, always-rendered layout location (e.g. a header/nav component)"} so it is reachable across the app \u2014 at least a working search input and results panel against the target index.`,
|
|
4537
4541
|
"If a search box already exists, replace its usage with an import and render of your new component; remove the old implementation.",
|
|
4538
4542
|
"When rendering results with an existing shared component (e.g. a card), import and reuse that component rather than inlining its markup \u2014 inlining silently drops the styles and behavior its own file provides.",
|
|
4539
4543
|
"Meet WCAG AA contrast (4.5:1 body text, 3:1 large text/icons) between the panel's text and its own background, and give the input and the active result a focus indicator visible against whatever sits behind it. Style the panel through the widget's class and CSS-variable overrides (or, when hand-built, the app's existing theme tokens) \u2014 never assume a light surface or reuse the surrounding page's colors unchanged inside the panel.",
|
|
@@ -4552,7 +4556,7 @@ function verificationInstructions(input) {
|
|
|
4552
4556
|
return [
|
|
4553
4557
|
"Verify the Algolia implementation changes.",
|
|
4554
4558
|
`Verification tools found in the codebase: ${JSON.stringify(input.findings.verification ?? [])}.`,
|
|
4555
|
-
"Run the project's own checks (lint, type check, tests) via runShell, using the
|
|
4559
|
+
"Run the project's own checks (lint, type check, tests) via runShell, using the project's commands \u2014 its task runner, manifest scripts, etc. Run every check that applies, not just the first.",
|
|
4556
4560
|
"If a check fails because packages or modules are missing, install the dependencies via runShell and re-run it rather than changing the code.",
|
|
4557
4561
|
"For issues caused by the implementation, make minimal fixes with writeFile and re-run the checks.",
|
|
4558
4562
|
"Do not make speculative fixes when no checks exist, a check cannot run, or failures are unrelated to these changes \u2014 note the limitation in your summary.",
|
|
@@ -6636,8 +6640,122 @@ function delay(ms) {
|
|
|
6636
6640
|
});
|
|
6637
6641
|
}
|
|
6638
6642
|
|
|
6643
|
+
// package.json with { type: 'json' }
|
|
6644
|
+
var package_default2 = {
|
|
6645
|
+
name: "@algolia/wizard",
|
|
6646
|
+
version: "0.57.0-rc.151.376",
|
|
6647
|
+
description: "Magically implement Algolia functionality in your codebase",
|
|
6648
|
+
type: "module",
|
|
6649
|
+
engines: {
|
|
6650
|
+
node: ">=24"
|
|
6651
|
+
},
|
|
6652
|
+
bin: {
|
|
6653
|
+
wizard: "dist/main.js"
|
|
6654
|
+
},
|
|
6655
|
+
files: [
|
|
6656
|
+
"dist",
|
|
6657
|
+
"docs"
|
|
6658
|
+
],
|
|
6659
|
+
scripts: {
|
|
6660
|
+
"build:proxy": "node scripts/build.mjs proxy",
|
|
6661
|
+
build: "node scripts/build.mjs",
|
|
6662
|
+
"dev:proxy": "touch .env && NODE_OPTIONS=--use-system-ca tsx watch --env-file=.env src/proxy/index.ts",
|
|
6663
|
+
dev: "touch .env && tsx --env-file=.env ./src/main.tsx",
|
|
6664
|
+
"env:load": "pnpm exec -- varlock load",
|
|
6665
|
+
prepare: "husky",
|
|
6666
|
+
prepublishOnly: "pnpm build",
|
|
6667
|
+
reset: "tsx ./scripts/reset-state.ts",
|
|
6668
|
+
"test:fixtures": "touch .env && tsx --env-file=.env ./fixtures/run-fixtures.ts",
|
|
6669
|
+
"test:tools": "tsx ./tool-evals/toolEval.ts",
|
|
6670
|
+
"test:tools:improve": "tsx ./tool-evals/improveFromPlan.ts",
|
|
6671
|
+
test: "vitest",
|
|
6672
|
+
typecheck: "tsc --noEmit -p tsconfig.json"
|
|
6673
|
+
},
|
|
6674
|
+
keywords: [],
|
|
6675
|
+
author: "",
|
|
6676
|
+
license: "ISC",
|
|
6677
|
+
packageManager: "pnpm@11.9.0+sha512.bd682d5d03fe525ef7c9fd6780c6884d1e756ac4c9c9fe00c538782824310dcf90e3ddc4f53835f06dfaebd5085e41855e0bcbb3b60de2ac5bbab89e5036f03b",
|
|
6678
|
+
devDependencies: {
|
|
6679
|
+
"@clack/prompts": "^1.6.0",
|
|
6680
|
+
"@types/ioredis-mock": "^8.2.7",
|
|
6681
|
+
"@types/node": "^25.9.1",
|
|
6682
|
+
"@types/react": "^19.2.16",
|
|
6683
|
+
esbuild: "^0.28.0",
|
|
6684
|
+
husky: "^9.1.7",
|
|
6685
|
+
"ink-testing-library": "^4.0.0",
|
|
6686
|
+
"ioredis-mock": "^8.13.1",
|
|
6687
|
+
"lint-staged": "^17.0.8",
|
|
6688
|
+
tsx: "^4.22.3",
|
|
6689
|
+
typescript: "^6.0.3",
|
|
6690
|
+
vitest: "^4.1.8"
|
|
6691
|
+
},
|
|
6692
|
+
dependencies: {
|
|
6693
|
+
"@ai-sdk/anthropic": "^3.0.81",
|
|
6694
|
+
"@ai-sdk/openai-compatible": "^2.0.47",
|
|
6695
|
+
"@hono/node-server": "^2.0.10",
|
|
6696
|
+
"@segment/analytics-node": "^3.1.0",
|
|
6697
|
+
ai: "^6.0.190",
|
|
6698
|
+
"cross-keychain": "^1.1.0",
|
|
6699
|
+
dotenv: "^17.4.2",
|
|
6700
|
+
hono: "^4.12.27",
|
|
6701
|
+
ink: "^7.0.5",
|
|
6702
|
+
"ink-picture": "^2.1.0",
|
|
6703
|
+
"ink-spinner": "^5.0.0",
|
|
6704
|
+
ioredis: "^5.11.1",
|
|
6705
|
+
nanoid: "^5.1.15",
|
|
6706
|
+
pino: "^10.3.1",
|
|
6707
|
+
react: "^19.2.7",
|
|
6708
|
+
"terminal-link": "^5.0.0",
|
|
6709
|
+
varlock: "^1.5.1",
|
|
6710
|
+
zod: "^4.4.3",
|
|
6711
|
+
zustand: "^5.0.14"
|
|
6712
|
+
}
|
|
6713
|
+
};
|
|
6714
|
+
|
|
6715
|
+
// src/lib/checkVersion.ts
|
|
6716
|
+
function isReleaseCandidate(version) {
|
|
6717
|
+
return version.includes("rc");
|
|
6718
|
+
}
|
|
6719
|
+
function parseVersion(version) {
|
|
6720
|
+
const [major = 0, minor = 0, patch = 0] = version.split("-")[0].split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
6721
|
+
return [major, minor, patch];
|
|
6722
|
+
}
|
|
6723
|
+
function isOlder(local, remote) {
|
|
6724
|
+
const a = parseVersion(local);
|
|
6725
|
+
const b = parseVersion(remote);
|
|
6726
|
+
for (let i = 0; i < 3; i++) {
|
|
6727
|
+
if (a[i] !== b[i]) return a[i] < b[i];
|
|
6728
|
+
}
|
|
6729
|
+
return false;
|
|
6730
|
+
}
|
|
6731
|
+
async function checkVersion() {
|
|
6732
|
+
if (isReleaseCandidate(package_default2.version)) return false;
|
|
6733
|
+
try {
|
|
6734
|
+
const res = await fetch(
|
|
6735
|
+
"https://registry.npmjs.org/@algolia/wizard/latest",
|
|
6736
|
+
{ signal: AbortSignal.timeout(3e3) }
|
|
6737
|
+
);
|
|
6738
|
+
if (!res.ok) {
|
|
6739
|
+
throw Error(`npmjs registry responded ${res.status}`);
|
|
6740
|
+
}
|
|
6741
|
+
const { version } = await res.json();
|
|
6742
|
+
if (typeof version !== "string") {
|
|
6743
|
+
throw Error("npmjs registry returned no version");
|
|
6744
|
+
}
|
|
6745
|
+
return isOlder(package_default2.version, version);
|
|
6746
|
+
} catch {
|
|
6747
|
+
logger.error("Could not resolve remote version number from npmjs registry");
|
|
6748
|
+
return false;
|
|
6749
|
+
}
|
|
6750
|
+
}
|
|
6751
|
+
|
|
6639
6752
|
// src/main.tsx
|
|
6640
6753
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
6754
|
+
async function exitProcessWithError(store, instance, message) {
|
|
6755
|
+
store.setError(message);
|
|
6756
|
+
await instance.waitUntilExit();
|
|
6757
|
+
process.exit(1);
|
|
6758
|
+
}
|
|
6641
6759
|
async function startup() {
|
|
6642
6760
|
setProjectRoot(process.cwd());
|
|
6643
6761
|
let args;
|
|
@@ -6690,6 +6808,14 @@ async function run(opts) {
|
|
|
6690
6808
|
const store = useWizard.getState();
|
|
6691
6809
|
const instance = render(/* @__PURE__ */ jsx20(App, {}), { incrementalRendering: true });
|
|
6692
6810
|
await store.waitForStart();
|
|
6811
|
+
const wizardOutdated = await checkVersion();
|
|
6812
|
+
if (wizardOutdated) {
|
|
6813
|
+
await exitProcessWithError(
|
|
6814
|
+
store,
|
|
6815
|
+
instance,
|
|
6816
|
+
"You have loaded an old version of the Wizard. Please use @algolia/wizard@latest"
|
|
6817
|
+
);
|
|
6818
|
+
}
|
|
6693
6819
|
store.syncSteps(
|
|
6694
6820
|
workflow.steps.map((s) => ({
|
|
6695
6821
|
id: s.id,
|
|
@@ -6705,18 +6831,20 @@ async function run(opts) {
|
|
|
6705
6831
|
try {
|
|
6706
6832
|
await runAuthLogin();
|
|
6707
6833
|
} catch (err) {
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6834
|
+
await exitProcessWithError(
|
|
6835
|
+
store,
|
|
6836
|
+
instance,
|
|
6837
|
+
err instanceof Error ? err.message : String(err)
|
|
6838
|
+
);
|
|
6711
6839
|
}
|
|
6712
6840
|
store.endAuth();
|
|
6713
6841
|
user = await getUser();
|
|
6714
6842
|
if (!user) {
|
|
6715
|
-
|
|
6843
|
+
await exitProcessWithError(
|
|
6844
|
+
store,
|
|
6845
|
+
instance,
|
|
6716
6846
|
"Authentication completed but no Algolia user was returned. Try running `npx @algolia/cli@latest auth login` directly."
|
|
6717
6847
|
);
|
|
6718
|
-
await instance.waitUntilExit();
|
|
6719
|
-
process.exit(1);
|
|
6720
6848
|
}
|
|
6721
6849
|
}
|
|
6722
6850
|
store.setUser(user);
|
|
@@ -6726,12 +6854,14 @@ async function run(opts) {
|
|
|
6726
6854
|
app = await ensureApplication(
|
|
6727
6855
|
resumableState ? runAppId(resumableState) : void 0
|
|
6728
6856
|
);
|
|
6857
|
+
runWorkflow(workflow, app.id, { skipResumePrompt, resumableState });
|
|
6729
6858
|
} catch (err) {
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6859
|
+
await exitProcessWithError(
|
|
6860
|
+
store,
|
|
6861
|
+
instance,
|
|
6862
|
+
err instanceof Error ? err.message : String(err)
|
|
6863
|
+
);
|
|
6733
6864
|
}
|
|
6734
|
-
runWorkflow(workflow, app.id, { skipResumePrompt, resumableState });
|
|
6735
6865
|
}
|
|
6736
6866
|
await requestTerminalSize();
|
|
6737
6867
|
var started = await startup();
|