@algolia/wizard 0.9.0-rc.87.86 → 0.9.0-rc.93.91
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 +44 -47
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -13,51 +13,6 @@ import { nanoid } from "nanoid";
|
|
|
13
13
|
// src/lib/algoliaCli.ts
|
|
14
14
|
import { spawn } from "node:child_process";
|
|
15
15
|
import { z } from "zod";
|
|
16
|
-
|
|
17
|
-
// src/lib/logger.ts
|
|
18
|
-
import pino from "pino";
|
|
19
|
-
import { join as join2, dirname } from "node:path";
|
|
20
|
-
import { devNull } from "node:os";
|
|
21
|
-
import { mkdirSync, openSync, closeSync } from "node:fs";
|
|
22
|
-
|
|
23
|
-
// src/core/constants.ts
|
|
24
|
-
import { homedir } from "node:os";
|
|
25
|
-
import { join, resolve } from "node:path";
|
|
26
|
-
function rootDir() {
|
|
27
|
-
return process.env.WIZARD_HOME ?? join(homedir(), ".algolia");
|
|
28
|
-
}
|
|
29
|
-
var pinnedRoot;
|
|
30
|
-
function setProjectRoot(cwd) {
|
|
31
|
-
pinnedRoot = resolve(cwd);
|
|
32
|
-
}
|
|
33
|
-
function projectSlug(cwd = pinnedRoot ?? process.cwd()) {
|
|
34
|
-
return resolve(cwd).replace(/[/\\:]+/g, "-").replace(/^-+/, "") || "root";
|
|
35
|
-
}
|
|
36
|
-
function stateDir(cwd = pinnedRoot ?? process.cwd()) {
|
|
37
|
-
return join(rootDir(), projectSlug(cwd));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// src/lib/logger.ts
|
|
41
|
-
var STDERR_FD = 2;
|
|
42
|
-
function resolveDest() {
|
|
43
|
-
const target = process.env.VITEST ? devNull : process.env.WIZARD_LOG ?? join2(stateDir(), "wizard.log");
|
|
44
|
-
try {
|
|
45
|
-
mkdirSync(dirname(target), { recursive: true });
|
|
46
|
-
closeSync(openSync(target, "a"));
|
|
47
|
-
return target;
|
|
48
|
-
} catch {
|
|
49
|
-
return STDERR_FD;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function logDestination() {
|
|
53
|
-
return pino.destination({ dest: resolveDest(), sync: false });
|
|
54
|
-
}
|
|
55
|
-
var logger = pino(
|
|
56
|
-
{ level: process.env.LOG_LEVEL ?? "info" },
|
|
57
|
-
logDestination()
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
// src/lib/algoliaCli.ts
|
|
61
16
|
function npxArgs(args) {
|
|
62
17
|
return ["--yes", "@algolia/cli@latest", ...args];
|
|
63
18
|
}
|
|
@@ -142,7 +97,6 @@ function runAlgoliaCli(args, { onOutput, withoutAdminKey } = {}) {
|
|
|
142
97
|
},
|
|
143
98
|
(err) => {
|
|
144
99
|
useWizard.getState().logEnd(logId, "error");
|
|
145
|
-
logger.warn({ err, args }, "Algolia CLI command failed");
|
|
146
100
|
throw err;
|
|
147
101
|
}
|
|
148
102
|
);
|
|
@@ -200,6 +154,49 @@ function refreshAuthToken() {
|
|
|
200
154
|
return inFlightRefresh;
|
|
201
155
|
}
|
|
202
156
|
|
|
157
|
+
// src/lib/logger.ts
|
|
158
|
+
import pino from "pino";
|
|
159
|
+
import { join as join2, dirname } from "node:path";
|
|
160
|
+
import { devNull } from "node:os";
|
|
161
|
+
import { mkdirSync, openSync, closeSync } from "node:fs";
|
|
162
|
+
|
|
163
|
+
// src/core/constants.ts
|
|
164
|
+
import { homedir } from "node:os";
|
|
165
|
+
import { join, resolve } from "node:path";
|
|
166
|
+
function rootDir() {
|
|
167
|
+
return process.env.WIZARD_HOME ?? join(homedir(), ".algolia");
|
|
168
|
+
}
|
|
169
|
+
var pinnedRoot;
|
|
170
|
+
function setProjectRoot(cwd) {
|
|
171
|
+
pinnedRoot = resolve(cwd);
|
|
172
|
+
}
|
|
173
|
+
function projectSlug(cwd = pinnedRoot ?? process.cwd()) {
|
|
174
|
+
return resolve(cwd).replace(/[/\\:]+/g, "-").replace(/^-+/, "") || "root";
|
|
175
|
+
}
|
|
176
|
+
function stateDir(cwd = pinnedRoot ?? process.cwd()) {
|
|
177
|
+
return join(rootDir(), projectSlug(cwd));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// src/lib/logger.ts
|
|
181
|
+
var STDERR_FD = 2;
|
|
182
|
+
function resolveDest() {
|
|
183
|
+
const target = process.env.VITEST ? devNull : process.env.WIZARD_LOG ?? join2(stateDir(), "wizard.log");
|
|
184
|
+
try {
|
|
185
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
186
|
+
closeSync(openSync(target, "a"));
|
|
187
|
+
return target;
|
|
188
|
+
} catch {
|
|
189
|
+
return STDERR_FD;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function logDestination() {
|
|
193
|
+
return pino.destination({ dest: resolveDest(), sync: false });
|
|
194
|
+
}
|
|
195
|
+
var logger = pino(
|
|
196
|
+
{ level: process.env.LOG_LEVEL ?? "info" },
|
|
197
|
+
logDestination()
|
|
198
|
+
);
|
|
199
|
+
|
|
203
200
|
// src/lib/proxyFetch.ts
|
|
204
201
|
var PROXY_BASE_URL = process.env.PROXY_BASE_URL ?? "https://proxy-624203421261.us-east4.run.app";
|
|
205
202
|
var PROXY_AUTH_REJECTED_HEADER = "x-wizard-proxy-auth";
|
|
@@ -3278,7 +3275,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
3278
3275
|
// package.json
|
|
3279
3276
|
var package_default = {
|
|
3280
3277
|
name: "@algolia/wizard",
|
|
3281
|
-
version: "0.9.0-rc.
|
|
3278
|
+
version: "0.9.0-rc.93.91",
|
|
3282
3279
|
description: "Magically implement Algolia functionality in your codebase",
|
|
3283
3280
|
type: "module",
|
|
3284
3281
|
engines: {
|