@batijs/cli 0.0.583 → 0.0.587
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/boilerplates/@batijs/auth0/files/$.env.js +5 -5
- package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/auth0/files/$wrangler.jsonc.js +3 -3
- package/dist/boilerplates/@batijs/authjs/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/authjs/files/server/authjs-handler.ts +2 -2
- package/dist/boilerplates/@batijs/aws/files/$README.md.js +5 -5
- package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/aws/files/$package.json.js +7 -7
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/cloudflare/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/d1/files/$wrangler.jsonc.js +3 -3
- package/dist/boilerplates/@batijs/d1-kysely/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/express/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/kysely/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/kysely/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/kysely/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/oxlint/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/photon/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/photon/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +3 -3
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/prisma/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/react/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/react/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$.env.js +4 -4
- package/dist/boilerplates/@batijs/sentry/files/$README.md.js +5 -5
- package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/sentry/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +7 -7
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +5 -5
- package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +5 -5
- package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/shared/files/$README.md.js +7 -7
- package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +3 -3
- package/dist/boilerplates/@batijs/shared-db/files/server/db-middleware.ts +1 -1
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/shared-server/files/server/create-todo-handler.ts +1 -1
- package/dist/boilerplates/@batijs/shared-todo/types/pages/todo/+data.d.ts +1 -3
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/sqlite/files/$.env.js +3 -3
- package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +5 -5
- package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +6 -6
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +4 -4
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/server/telefunc-handler.ts +2 -4
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/trpc/files/server/trpc-handler.ts +1 -1
- package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +3 -3
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/ts-rest/files/server/ts-rest-handler.ts +1 -1
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +3 -3
- package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$README.md.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +5 -5
- package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +3 -3
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +5 -5
- package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +5 -5
- package/dist/{chunk-WIRXYZ5Z.js → chunk-RACOWJAZ.js} +66832 -66688
- package/dist/index.js +92 -69
- package/package.json +6 -6
- package/dist/boilerplates/@batijs/prettier/files/.prettierrc +0 -3
package/dist/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import { createRequire as createRequire_BATI_CLI } from 'module';
|
|
|
3
3
|
const require = createRequire_BATI_CLI(import.meta.url);
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
bir,
|
|
6
|
+
S_s,
|
|
7
|
+
Sir,
|
|
9
8
|
export_which,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
kst,
|
|
10
|
+
mhe,
|
|
11
|
+
uUs,
|
|
12
|
+
x_s
|
|
13
|
+
} from "./chunk-RACOWJAZ.js";
|
|
14
14
|
import "./chunk-IAWYWZSL.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
@@ -206,8 +206,8 @@ async function mergeDts({
|
|
|
206
206
|
filepath,
|
|
207
207
|
meta
|
|
208
208
|
}) {
|
|
209
|
-
const previousAst =
|
|
210
|
-
const currentAst =
|
|
209
|
+
const previousAst = mhe(previousContent);
|
|
210
|
+
const currentAst = mhe(fileContent);
|
|
211
211
|
for (const imp of previousAst.imports.$items) {
|
|
212
212
|
currentAst.imports[imp.local] = imp;
|
|
213
213
|
}
|
|
@@ -224,7 +224,7 @@ async function mergeDts({
|
|
|
224
224
|
currentAst.$ast.body.splice(index, 0, node);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
const res = await
|
|
227
|
+
const res = await S_s(currentAst.generate().code, meta, {
|
|
228
228
|
filepath
|
|
229
229
|
});
|
|
230
230
|
return clearExports(res.code, meta);
|
|
@@ -248,7 +248,7 @@ async function executeOperationFile(op, {
|
|
|
248
248
|
}) {
|
|
249
249
|
const code = await readFile(op.sourceAbsolute, { encoding: "utf-8" });
|
|
250
250
|
const filepath = relative(op.source, op.sourceAbsolute);
|
|
251
|
-
const result = await
|
|
251
|
+
const result = await S_s(code, meta, {
|
|
252
252
|
filepath
|
|
253
253
|
});
|
|
254
254
|
let fileContent = result.code;
|
|
@@ -332,7 +332,7 @@ async function transformFileAfterExec(filepath, fileContent) {
|
|
|
332
332
|
case ".js":
|
|
333
333
|
case ".tsx":
|
|
334
334
|
case ".jsx":
|
|
335
|
-
return
|
|
335
|
+
return kst(fileContent, {
|
|
336
336
|
filepath
|
|
337
337
|
});
|
|
338
338
|
case ".env":
|
|
@@ -1270,7 +1270,7 @@ function execRules(fts, rulesMessages2) {
|
|
|
1270
1270
|
return messages;
|
|
1271
1271
|
}
|
|
1272
1272
|
|
|
1273
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1273
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/key.js
|
|
1274
1274
|
var isUpKey = (key, keybindings = []) => (
|
|
1275
1275
|
// The up key
|
|
1276
1276
|
key.name === "up" || // Vim keybinding: hjkl keys map to left/down/up/right
|
|
@@ -1287,7 +1287,7 @@ var isBackspaceKey = (key) => key.name === "backspace";
|
|
|
1287
1287
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
1288
1288
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
1289
1289
|
|
|
1290
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1290
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/errors.js
|
|
1291
1291
|
var AbortPromptError = class extends Error {
|
|
1292
1292
|
name = "AbortPromptError";
|
|
1293
1293
|
message = "Prompt was aborted";
|
|
@@ -1310,10 +1310,10 @@ var ValidationError = class extends Error {
|
|
|
1310
1310
|
name = "ValidationError";
|
|
1311
1311
|
};
|
|
1312
1312
|
|
|
1313
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1313
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
1314
1314
|
import { AsyncResource as AsyncResource2 } from "async_hooks";
|
|
1315
1315
|
|
|
1316
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1316
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
1317
1317
|
import { AsyncLocalStorage, AsyncResource } from "async_hooks";
|
|
1318
1318
|
var hookStorage = new AsyncLocalStorage();
|
|
1319
1319
|
function createStore(rl) {
|
|
@@ -1419,7 +1419,7 @@ var effectScheduler = {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
1421
|
|
|
1422
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1422
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
1423
1423
|
function useState(defaultValue) {
|
|
1424
1424
|
return withPointer((pointer) => {
|
|
1425
1425
|
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
@@ -1437,7 +1437,7 @@ function useState(defaultValue) {
|
|
|
1437
1437
|
});
|
|
1438
1438
|
}
|
|
1439
1439
|
|
|
1440
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1440
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
1441
1441
|
function useEffect(cb, depArray) {
|
|
1442
1442
|
withPointer((pointer) => {
|
|
1443
1443
|
const oldDeps = pointer.get();
|
|
@@ -1449,7 +1449,7 @@ function useEffect(cb, depArray) {
|
|
|
1449
1449
|
});
|
|
1450
1450
|
}
|
|
1451
1451
|
|
|
1452
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1452
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/theme.js
|
|
1453
1453
|
import { styleText } from "util";
|
|
1454
1454
|
|
|
1455
1455
|
// ../../node_modules/.pnpm/@inquirer+figures@2.0.3/node_modules/@inquirer/figures/dist/index.js
|
|
@@ -1744,7 +1744,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
1744
1744
|
var dist_default = figures;
|
|
1745
1745
|
var replacements = Object.entries(specialMainSymbols);
|
|
1746
1746
|
|
|
1747
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1747
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/theme.js
|
|
1748
1748
|
var defaultTheme = {
|
|
1749
1749
|
prefix: {
|
|
1750
1750
|
idle: styleText("blue", "?"),
|
|
@@ -1765,7 +1765,7 @@ var defaultTheme = {
|
|
|
1765
1765
|
}
|
|
1766
1766
|
};
|
|
1767
1767
|
|
|
1768
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1768
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
1769
1769
|
function isPlainObject(value) {
|
|
1770
1770
|
if (typeof value !== "object" || value === null)
|
|
1771
1771
|
return false;
|
|
@@ -1793,7 +1793,7 @@ function makeTheme(...themes) {
|
|
|
1793
1793
|
return deepMerge(...themesToMerge);
|
|
1794
1794
|
}
|
|
1795
1795
|
|
|
1796
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1796
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
1797
1797
|
function usePrefix({ status = "idle", theme }) {
|
|
1798
1798
|
const [showLoader, setShowLoader] = useState(false);
|
|
1799
1799
|
const [tick, setTick] = useState(0);
|
|
@@ -1824,7 +1824,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
1824
1824
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
1825
1825
|
}
|
|
1826
1826
|
|
|
1827
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1827
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
1828
1828
|
function useMemo(fn, dependencies) {
|
|
1829
1829
|
return withPointer((pointer) => {
|
|
1830
1830
|
const prev = pointer.get();
|
|
@@ -1837,12 +1837,12 @@ function useMemo(fn, dependencies) {
|
|
|
1837
1837
|
});
|
|
1838
1838
|
}
|
|
1839
1839
|
|
|
1840
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1840
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
1841
1841
|
function useRef(val) {
|
|
1842
1842
|
return useState({ current: val })[0];
|
|
1843
1843
|
}
|
|
1844
1844
|
|
|
1845
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1845
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
1846
1846
|
function useKeypress(userHandler) {
|
|
1847
1847
|
const signal = useRef(userHandler);
|
|
1848
1848
|
signal.current = userHandler;
|
|
@@ -1861,7 +1861,7 @@ function useKeypress(userHandler) {
|
|
|
1861
1861
|
}, []);
|
|
1862
1862
|
}
|
|
1863
1863
|
|
|
1864
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
1864
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/utils.js
|
|
1865
1865
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
1866
1866
|
|
|
1867
1867
|
// ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
@@ -2200,7 +2200,7 @@ function wrapAnsi(string, columns, options) {
|
|
|
2200
2200
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
2201
2201
|
}
|
|
2202
2202
|
|
|
2203
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2203
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/utils.js
|
|
2204
2204
|
function breakLines(content, width) {
|
|
2205
2205
|
return content.split("\n").flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split("\n").map((str) => str.trimEnd())).join("\n");
|
|
2206
2206
|
}
|
|
@@ -2208,7 +2208,7 @@ function readlineWidth() {
|
|
|
2208
2208
|
return (0, import_cli_width.default)({ defaultWidth: 80, output: readline().output });
|
|
2209
2209
|
}
|
|
2210
2210
|
|
|
2211
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2211
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
2212
2212
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
2213
2213
|
const state = useRef({
|
|
2214
2214
|
lastPointer: active,
|
|
@@ -2297,7 +2297,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
2297
2297
|
return pageBuffer.filter((line) => typeof line === "string").join("\n");
|
|
2298
2298
|
}
|
|
2299
2299
|
|
|
2300
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2300
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
2301
2301
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
2302
2302
|
import * as readline2 from "readline";
|
|
2303
2303
|
import { AsyncResource as AsyncResource3 } from "async_hooks";
|
|
@@ -2553,7 +2553,7 @@ var {
|
|
|
2553
2553
|
unload
|
|
2554
2554
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
|
|
2555
2555
|
|
|
2556
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2556
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
2557
2557
|
import { stripVTControlCharacters } from "util";
|
|
2558
2558
|
|
|
2559
2559
|
// ../../node_modules/.pnpm/@inquirer+ansi@2.0.3/node_modules/@inquirer/ansi/dist/index.js
|
|
@@ -2572,7 +2572,7 @@ var cursorTo = (x, y) => {
|
|
|
2572
2572
|
var eraseLine = ESC2 + "2K";
|
|
2573
2573
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
2574
2574
|
|
|
2575
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2575
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
2576
2576
|
var height = (content) => content.split("\n").length;
|
|
2577
2577
|
var lastLine = (content) => content.split("\n").pop() ?? "";
|
|
2578
2578
|
var ScreenManager = class {
|
|
@@ -2632,7 +2632,7 @@ var ScreenManager = class {
|
|
|
2632
2632
|
}
|
|
2633
2633
|
};
|
|
2634
2634
|
|
|
2635
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2635
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
2636
2636
|
var PromisePolyfill = class extends Promise {
|
|
2637
2637
|
// Available starting from Node 22
|
|
2638
2638
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
@@ -2647,7 +2647,8 @@ var PromisePolyfill = class extends Promise {
|
|
|
2647
2647
|
}
|
|
2648
2648
|
};
|
|
2649
2649
|
|
|
2650
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2650
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
2651
|
+
var nativeSetImmediate = globalThis.setImmediate;
|
|
2651
2652
|
function getCallSites() {
|
|
2652
2653
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
2653
2654
|
let result = [];
|
|
@@ -2671,6 +2672,7 @@ function createPrompt(view) {
|
|
|
2671
2672
|
const cleanups = /* @__PURE__ */ new Set();
|
|
2672
2673
|
const output = new import_mute_stream.default();
|
|
2673
2674
|
output.pipe(context.output ?? process.stdout);
|
|
2675
|
+
output.mute();
|
|
2674
2676
|
const rl = readline2.createInterface({
|
|
2675
2677
|
terminal: true,
|
|
2676
2678
|
input,
|
|
@@ -2694,30 +2696,37 @@ function createPrompt(view) {
|
|
|
2694
2696
|
const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
2695
2697
|
rl.on("SIGINT", sigint);
|
|
2696
2698
|
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
|
2697
|
-
const checkCursorPos = () => screen.checkCursorPos();
|
|
2698
|
-
rl.input.on("keypress", checkCursorPos);
|
|
2699
|
-
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
2700
2699
|
return withHooks(rl, (cycle) => {
|
|
2701
2700
|
const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
|
|
2702
2701
|
rl.on("close", hooksCleanup);
|
|
2703
2702
|
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
const
|
|
2711
|
-
|
|
2703
|
+
const startCycle = () => {
|
|
2704
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
|
2705
|
+
rl.input.on("keypress", checkCursorPos);
|
|
2706
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
2707
|
+
cycle(() => {
|
|
2708
|
+
try {
|
|
2709
|
+
const nextView = view(config, (value) => {
|
|
2710
|
+
setImmediate(() => resolve(value));
|
|
2711
|
+
});
|
|
2712
|
+
if (nextView === void 0) {
|
|
2713
|
+
const callerFilename = callSites[1]?.getFileName();
|
|
2714
|
+
throw new Error(`Prompt functions must return a string.
|
|
2712
2715
|
at ${callerFilename}`);
|
|
2716
|
+
}
|
|
2717
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
2718
|
+
screen.render(content, bottomContent);
|
|
2719
|
+
effectScheduler.run();
|
|
2720
|
+
} catch (error2) {
|
|
2721
|
+
reject(error2);
|
|
2713
2722
|
}
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
}
|
|
2723
|
+
});
|
|
2724
|
+
};
|
|
2725
|
+
if ("readableFlowing" in input) {
|
|
2726
|
+
nativeSetImmediate(startCycle);
|
|
2727
|
+
} else {
|
|
2728
|
+
startCycle();
|
|
2729
|
+
}
|
|
2721
2730
|
return Object.assign(promise.then((answer) => {
|
|
2722
2731
|
effectScheduler.clearAll();
|
|
2723
2732
|
return answer;
|
|
@@ -2734,7 +2743,7 @@ function createPrompt(view) {
|
|
|
2734
2743
|
return prompt;
|
|
2735
2744
|
}
|
|
2736
2745
|
|
|
2737
|
-
// ../../node_modules/.pnpm/@inquirer+core@11.1.
|
|
2746
|
+
// ../../node_modules/.pnpm/@inquirer+core@11.1.5_@types+node@20.19.30/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
2738
2747
|
import { styleText as styleText2 } from "util";
|
|
2739
2748
|
var Separator = class {
|
|
2740
2749
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -2749,21 +2758,25 @@ var Separator = class {
|
|
|
2749
2758
|
}
|
|
2750
2759
|
};
|
|
2751
2760
|
|
|
2752
|
-
// ../../node_modules/.pnpm/@inquirer+select@5.
|
|
2761
|
+
// ../../node_modules/.pnpm/@inquirer+select@5.1.0_@types+node@20.19.30/node_modules/@inquirer/select/dist/index.js
|
|
2753
2762
|
import { styleText as styleText3 } from "util";
|
|
2754
2763
|
var selectTheme = {
|
|
2755
2764
|
icon: { cursor: dist_default.pointer },
|
|
2756
2765
|
style: {
|
|
2757
|
-
disabled: (text) => styleText3("dim",
|
|
2766
|
+
disabled: (text) => styleText3("dim", text),
|
|
2758
2767
|
description: (text) => styleText3("cyan", text),
|
|
2759
2768
|
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " \u2022 "))
|
|
2760
2769
|
},
|
|
2770
|
+
i18n: { disabledError: "This option is disabled and cannot be selected." },
|
|
2761
2771
|
indexMode: "hidden",
|
|
2762
2772
|
keybindings: []
|
|
2763
2773
|
};
|
|
2764
2774
|
function isSelectable(item) {
|
|
2765
2775
|
return !Separator.isSeparator(item) && !item.disabled;
|
|
2766
2776
|
}
|
|
2777
|
+
function isNavigable(item) {
|
|
2778
|
+
return !Separator.isSeparator(item);
|
|
2779
|
+
}
|
|
2767
2780
|
function normalizeChoices(choices2) {
|
|
2768
2781
|
return choices2.map((choice) => {
|
|
2769
2782
|
if (Separator.isSeparator(choice))
|
|
@@ -2800,8 +2813,8 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
2800
2813
|
const searchEnabled = !keybindings.includes("vim");
|
|
2801
2814
|
const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
|
|
2802
2815
|
const bounds = useMemo(() => {
|
|
2803
|
-
const first = items.findIndex(
|
|
2804
|
-
const last = items.findLastIndex(
|
|
2816
|
+
const first = items.findIndex(isNavigable);
|
|
2817
|
+
const last = items.findLastIndex(isNavigable);
|
|
2805
2818
|
if (first === -1) {
|
|
2806
2819
|
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
|
2807
2820
|
}
|
|
@@ -2814,11 +2827,19 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
2814
2827
|
}, [config.default, items]);
|
|
2815
2828
|
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
2816
2829
|
const selectedChoice = items[active];
|
|
2830
|
+
const [errorMsg, setError] = useState();
|
|
2817
2831
|
useKeypress((key, rl) => {
|
|
2818
2832
|
clearTimeout(searchTimeoutRef.current);
|
|
2833
|
+
if (errorMsg) {
|
|
2834
|
+
setError(void 0);
|
|
2835
|
+
}
|
|
2819
2836
|
if (isEnterKey(key)) {
|
|
2820
|
-
|
|
2821
|
-
|
|
2837
|
+
if (selectedChoice.disabled) {
|
|
2838
|
+
setError(theme.i18n.disabledError);
|
|
2839
|
+
} else {
|
|
2840
|
+
setStatus("done");
|
|
2841
|
+
done(selectedChoice.value);
|
|
2842
|
+
}
|
|
2822
2843
|
} else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
|
|
2823
2844
|
rl.clearLine(0);
|
|
2824
2845
|
if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
|
|
@@ -2826,7 +2847,7 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
2826
2847
|
let next = active;
|
|
2827
2848
|
do {
|
|
2828
2849
|
next = (next + offset + items.length) % items.length;
|
|
2829
|
-
} while (!
|
|
2850
|
+
} while (!isNavigable(items[next]));
|
|
2830
2851
|
setActive(next);
|
|
2831
2852
|
}
|
|
2832
2853
|
} else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
|
|
@@ -2879,13 +2900,14 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
2879
2900
|
separatorCount++;
|
|
2880
2901
|
return ` ${item.separator}`;
|
|
2881
2902
|
}
|
|
2903
|
+
const cursor = isActive ? theme.icon.cursor : " ";
|
|
2882
2904
|
const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
|
|
2883
2905
|
if (item.disabled) {
|
|
2884
2906
|
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
2885
|
-
|
|
2907
|
+
const disabledCursor = isActive ? theme.icon.cursor : "-";
|
|
2908
|
+
return theme.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);
|
|
2886
2909
|
}
|
|
2887
2910
|
const color = isActive ? theme.style.highlight : (x) => x;
|
|
2888
|
-
const cursor = isActive ? theme.icon.cursor : ` `;
|
|
2889
2911
|
return color(`${cursor} ${indexLabel}${item.name}`);
|
|
2890
2912
|
},
|
|
2891
2913
|
pageSize,
|
|
@@ -2900,6 +2922,7 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
2900
2922
|
page,
|
|
2901
2923
|
" ",
|
|
2902
2924
|
description ? theme.style.description(description) : "",
|
|
2925
|
+
errorMsg ? theme.style.error(errorMsg) : "",
|
|
2903
2926
|
helpLine
|
|
2904
2927
|
].filter(Boolean).join("\n").trimEnd();
|
|
2905
2928
|
return `${lines}${cursorHide}`;
|
|
@@ -3482,7 +3505,7 @@ function kebabCase2(str, joiner) {
|
|
|
3482
3505
|
// package.json
|
|
3483
3506
|
var package_default = {
|
|
3484
3507
|
name: "@batijs/cli",
|
|
3485
|
-
version: "0.0.
|
|
3508
|
+
version: "0.0.587",
|
|
3486
3509
|
type: "module",
|
|
3487
3510
|
scripts: {
|
|
3488
3511
|
"check-types": "tsc --noEmit",
|
|
@@ -3497,7 +3520,7 @@ var package_default = {
|
|
|
3497
3520
|
devDependencies: {
|
|
3498
3521
|
"@batijs/build": "workspace:*",
|
|
3499
3522
|
"@batijs/compile": "workspace:*",
|
|
3500
|
-
"@inquirer/prompts": "^8.
|
|
3523
|
+
"@inquirer/prompts": "^8.3.0",
|
|
3501
3524
|
"@types/node": "^20.19.30",
|
|
3502
3525
|
"@types/which": "^3.0.4",
|
|
3503
3526
|
citty: "^0.2.1",
|
|
@@ -3580,7 +3603,7 @@ printInit();
|
|
|
3580
3603
|
var __filename = fileURLToPath(import.meta.url);
|
|
3581
3604
|
var __dirname = dirname(__filename);
|
|
3582
3605
|
var isWin2 = process.platform === "win32";
|
|
3583
|
-
var pm =
|
|
3606
|
+
var pm = x_s();
|
|
3584
3607
|
function boilerplatesDir() {
|
|
3585
3608
|
if (existsSync2(join(__dirname, "boilerplates", "boilerplates.json"))) {
|
|
3586
3609
|
return join(__dirname, "boilerplates");
|
|
@@ -3691,7 +3714,7 @@ async function hasRemainingSteps(dist) {
|
|
|
3691
3714
|
}
|
|
3692
3715
|
}
|
|
3693
3716
|
function printInit() {
|
|
3694
|
-
const v =
|
|
3717
|
+
const v = uUs();
|
|
3695
3718
|
const version = v.semver.at(-1);
|
|
3696
3719
|
assert(version);
|
|
3697
3720
|
console.log(`
|
|
@@ -3700,8 +3723,8 @@ function printInit() {
|
|
|
3700
3723
|
}
|
|
3701
3724
|
async function printOK(dist, flags2, nextSteps) {
|
|
3702
3725
|
const indent = 1;
|
|
3703
|
-
const list =
|
|
3704
|
-
const cmd =
|
|
3726
|
+
const list = Sir("-", gray2, indent);
|
|
3727
|
+
const cmd = Sir("$", gray2, indent);
|
|
3705
3728
|
const distPretty = prettifyDist(dist);
|
|
3706
3729
|
console.log(`${green(`${bold2("\u2713")} Project created: ${bold2(distPretty)}`)}`);
|
|
3707
3730
|
console.log(list("Vike"));
|
|
@@ -3719,11 +3742,11 @@ ${bold2("Next steps:")}`);
|
|
|
3719
3742
|
if (step.type === "command") {
|
|
3720
3743
|
console.log(cmd(step.step));
|
|
3721
3744
|
} else {
|
|
3722
|
-
console.log(
|
|
3745
|
+
console.log(Sir("\u2022\uFE0F", gray2, indent)(step.step));
|
|
3723
3746
|
}
|
|
3724
3747
|
}
|
|
3725
3748
|
} else if (await hasRemainingSteps(dist)) {
|
|
3726
|
-
console.log(
|
|
3749
|
+
console.log(Sir("\u2022\uFE0F", gray2, indent)(`Check ${bold2("TODO.md")} for remaining steps`));
|
|
3727
3750
|
}
|
|
3728
3751
|
console.log(cmd(`${pm.run} dev`));
|
|
3729
3752
|
console.log("\nHappy coding! \u{1F680}\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.587",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"description": "Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"repository": "https://github.com/vikejs/bati",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@inquirer/prompts": "^8.
|
|
11
|
+
"@inquirer/prompts": "^8.3.0",
|
|
12
12
|
"@types/node": "^20.19.30",
|
|
13
13
|
"@types/which": "^3.0.4",
|
|
14
14
|
"citty": "^0.2.1",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"typescript": "^5.9.3",
|
|
21
21
|
"unplugin-purge-polyfills": "^0.1.0",
|
|
22
22
|
"vite": "^7.3.1",
|
|
23
|
-
"@batijs/
|
|
24
|
-
"@batijs/
|
|
23
|
+
"@batijs/compile": "0.0.587",
|
|
24
|
+
"@batijs/build": "0.0.587"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@batijs/core": "0.0.
|
|
28
|
-
"@batijs/features": "0.0.
|
|
27
|
+
"@batijs/core": "0.0.587",
|
|
28
|
+
"@batijs/features": "0.0.587"
|
|
29
29
|
},
|
|
30
30
|
"bin": "./cli.js",
|
|
31
31
|
"exports": {
|