@batijs/cli 0.0.540 → 0.0.542
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/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/auth0/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/auth0/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/auth0/files/$wrangler.jsonc.js +1 -1
- package/dist/boilerplates/@batijs/authjs/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/authjs/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/aws/bati.config.js +11 -6
- package/dist/boilerplates/@batijs/aws/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/aws/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/biome/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/biome/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/bati.config.js +10 -6
- package/dist/boilerplates/@batijs/cloudflare/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/cloudflare/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/compiled/bati.config.js +10 -5
- package/dist/boilerplates/@batijs/compiled/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/compiled/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/d1/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/d1/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/d1/files/$wrangler.jsonc.js +1 -1
- package/dist/boilerplates/@batijs/d1-sqlite/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/d1-sqlite/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/drizzle/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/drizzle/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/eslint/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/eslint/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/express/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/express/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/fastify/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/fastify/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/google-analytics/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/google-analytics/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/h3/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/h3/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/hono/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/hono/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/mantine/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/mantine/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/mantine/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/oxlint/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/oxlint/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/photon/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/photon/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/photon/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/plausible.io/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/plausible.io/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/pnpm/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/pnpm/files/$pnpm-workspace.yaml.js +1 -1
- package/dist/boilerplates/@batijs/prettier/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/prettier/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/prisma/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/prisma/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/prisma/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/prisma/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/react/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/react/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/react/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/react-sentry/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/react-sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/sentry/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/sentry/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/sentry/files/pages/$+client.ts.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/shadcn-ui/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/shadcn-ui/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/shared/bati.config.js +10 -6
- package/dist/boilerplates/@batijs/shared/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/shared/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/shared-db/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/shared-server/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/shared-server/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/shared-todo/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/solid/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/solid/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/solid/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/solid-sentry/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/solid-sentry/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/sqlite/files/$.env.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$TODO.md.js +1 -1
- package/dist/boilerplates/@batijs/sqlite/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/bati.config.js +10 -5
- package/dist/boilerplates/@batijs/tailwindcss/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/tailwindcss/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/telefunc/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/telefunc/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/trpc/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/trpc/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/trpc/types/trpc/client.d.ts +3 -3
- package/dist/boilerplates/@batijs/ts-rest/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/ts-rest/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vercel/bati.config.js +9 -5
- package/dist/boilerplates/@batijs/vercel/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vercel/files/pages/$+config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vue/bati.config.js +8 -5
- package/dist/boilerplates/@batijs/vue/files/$README.md.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$package.json.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$tsconfig.json.js +1 -1
- package/dist/boilerplates/@batijs/vue/files/$vite.config.ts.js +1 -1
- package/dist/boilerplates/@batijs/vue-sentry/bati.config.js +5 -5
- package/dist/boilerplates/@batijs/vue-sentry/files/$package.json.js +1 -1
- package/dist/{chunk-ZGTQTIS7.js → chunk-X4G6MHMH.js} +1 -1
- package/dist/index.js +93 -11
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
e9s,
|
|
11
11
|
export_which,
|
|
12
12
|
jme
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-X4G6MHMH.js";
|
|
14
14
|
import "./chunk-IAWYWZSL.js";
|
|
15
15
|
import {
|
|
16
16
|
__commonJS,
|
|
@@ -188,7 +188,7 @@ var require_lib = __commonJS({
|
|
|
188
188
|
// index.ts
|
|
189
189
|
import { execSync } from "child_process";
|
|
190
190
|
import { existsSync as existsSync2, rmSync } from "fs";
|
|
191
|
-
import { access, constants, lstat, readdir, readFile as readFile2 } from "fs/promises";
|
|
191
|
+
import { access, constants, lstat, readdir, readFile as readFile2, writeFile as writeFile2 } from "fs/promises";
|
|
192
192
|
import { dirname, join, parse as parse2 } from "path";
|
|
193
193
|
import { fileURLToPath } from "url";
|
|
194
194
|
|
|
@@ -4707,7 +4707,7 @@ var {
|
|
|
4707
4707
|
// package.json
|
|
4708
4708
|
var package_default = {
|
|
4709
4709
|
name: "@batijs/cli",
|
|
4710
|
-
version: "0.0.
|
|
4710
|
+
version: "0.0.542",
|
|
4711
4711
|
type: "module",
|
|
4712
4712
|
scripts: {
|
|
4713
4713
|
"check-types": "tsc --noEmit",
|
|
@@ -4824,26 +4824,84 @@ async function loadBoilerplates(dir) {
|
|
|
4824
4824
|
})
|
|
4825
4825
|
);
|
|
4826
4826
|
}
|
|
4827
|
-
function toArg(flag,
|
|
4827
|
+
function toArg(flag, feature) {
|
|
4828
4828
|
if (!flag) return {};
|
|
4829
4829
|
return {
|
|
4830
4830
|
[flag]: {
|
|
4831
4831
|
type: "boolean",
|
|
4832
4832
|
required: false,
|
|
4833
|
-
description
|
|
4833
|
+
description: feature?.description,
|
|
4834
|
+
invisible: feature?.disabled
|
|
4834
4835
|
}
|
|
4835
4836
|
};
|
|
4836
4837
|
}
|
|
4837
|
-
function
|
|
4838
|
+
async function generateKnipConfig(dist, boilerplates) {
|
|
4839
|
+
const aggregated = {
|
|
4840
|
+
entry: [],
|
|
4841
|
+
ignore: [],
|
|
4842
|
+
ignoreDependencies: [],
|
|
4843
|
+
vite: true
|
|
4844
|
+
};
|
|
4845
|
+
for (const bl of boilerplates) {
|
|
4846
|
+
if (bl.config.knip) {
|
|
4847
|
+
if (bl.config.knip.entry) {
|
|
4848
|
+
aggregated.entry.push(...bl.config.knip.entry);
|
|
4849
|
+
}
|
|
4850
|
+
if (bl.config.knip.ignore) {
|
|
4851
|
+
aggregated.ignore.push(...bl.config.knip.ignore);
|
|
4852
|
+
}
|
|
4853
|
+
if (bl.config.knip.ignoreDependencies) {
|
|
4854
|
+
aggregated.ignoreDependencies.push(...bl.config.knip.ignoreDependencies);
|
|
4855
|
+
}
|
|
4856
|
+
if (bl.config.knip.vite === false) {
|
|
4857
|
+
aggregated.vite = false;
|
|
4858
|
+
}
|
|
4859
|
+
}
|
|
4860
|
+
}
|
|
4861
|
+
try {
|
|
4862
|
+
const pkgJsonPath = join(dist, "package.json");
|
|
4863
|
+
const pkgJson = JSON.parse(await readFile2(pkgJsonPath, "utf-8"));
|
|
4864
|
+
const scriptsValues = Object.values(pkgJson.scripts ?? {});
|
|
4865
|
+
if (scriptsValues.some((s2) => s2.includes("tsx "))) {
|
|
4866
|
+
aggregated.ignoreDependencies.push("tsx");
|
|
4867
|
+
}
|
|
4868
|
+
if (scriptsValues.some((s2) => s2.includes("cross-env "))) {
|
|
4869
|
+
aggregated.ignoreDependencies.push("cross-env");
|
|
4870
|
+
}
|
|
4871
|
+
} catch {
|
|
4872
|
+
}
|
|
4873
|
+
await writeFile2(
|
|
4874
|
+
join(dist, "knip.json"),
|
|
4875
|
+
JSON.stringify(
|
|
4876
|
+
{
|
|
4877
|
+
$schema: "https://unpkg.com/knip@5/schema.json",
|
|
4878
|
+
entry: aggregated.entry,
|
|
4879
|
+
ignore: aggregated.ignore,
|
|
4880
|
+
ignoreDependencies: aggregated.ignoreDependencies,
|
|
4881
|
+
rules: {
|
|
4882
|
+
types: "off",
|
|
4883
|
+
binaries: "off",
|
|
4884
|
+
exports: "off"
|
|
4885
|
+
},
|
|
4886
|
+
vite: aggregated.vite
|
|
4887
|
+
},
|
|
4888
|
+
void 0,
|
|
4889
|
+
2
|
|
4890
|
+
),
|
|
4891
|
+
"utf-8"
|
|
4892
|
+
);
|
|
4893
|
+
}
|
|
4894
|
+
function findFeature(key) {
|
|
4838
4895
|
const feat = features.find((f2) => f2.flag === key);
|
|
4839
4896
|
if (!feat) return;
|
|
4840
4897
|
if (feat.description) {
|
|
4841
|
-
return feat
|
|
4898
|
+
return feat;
|
|
4842
4899
|
} else if (feat.label && feat.url) {
|
|
4843
|
-
return `Include ${feat.label} - ${feat.url}
|
|
4900
|
+
return { ...feat, description: `Include ${feat.label} - ${feat.url}` };
|
|
4844
4901
|
} else if (feat.label) {
|
|
4845
|
-
return `Include ${feat.label}
|
|
4902
|
+
return { ...feat, description: `Include ${feat.label}` };
|
|
4846
4903
|
}
|
|
4904
|
+
return feat;
|
|
4847
4905
|
}
|
|
4848
4906
|
async function hasRemainingSteps(dist) {
|
|
4849
4907
|
try {
|
|
@@ -4906,6 +4964,12 @@ var defaultDef = {
|
|
|
4906
4964
|
type: "boolean",
|
|
4907
4965
|
description: "If true, does not execute `git init`",
|
|
4908
4966
|
required: false
|
|
4967
|
+
},
|
|
4968
|
+
knip: {
|
|
4969
|
+
type: "boolean",
|
|
4970
|
+
// Hidden flag used by E2E tests to generate knip.json during scaffolding
|
|
4971
|
+
invisible: true,
|
|
4972
|
+
required: false
|
|
4909
4973
|
}
|
|
4910
4974
|
};
|
|
4911
4975
|
function yn(value, default_) {
|
|
@@ -5123,7 +5187,7 @@ async function run() {
|
|
|
5123
5187
|
version: package_default.version,
|
|
5124
5188
|
description: package_default.description
|
|
5125
5189
|
},
|
|
5126
|
-
args: Object.assign({}, defaultDef, ...cliFlags.map((k) => toArg(k,
|
|
5190
|
+
args: Object.assign({}, defaultDef, ...cliFlags.map((k) => toArg(k, findFeature(k)))),
|
|
5127
5191
|
async run({ args }) {
|
|
5128
5192
|
await checkArguments(args);
|
|
5129
5193
|
const sources = [];
|
|
@@ -5176,6 +5240,9 @@ async function run() {
|
|
|
5176
5240
|
for (const onafter of hooksMap.get("after") ?? []) {
|
|
5177
5241
|
await onafter(args.project, meta);
|
|
5178
5242
|
}
|
|
5243
|
+
if (args.knip) {
|
|
5244
|
+
await generateKnipConfig(args.project, filteredBoilerplates);
|
|
5245
|
+
}
|
|
5179
5246
|
if (!args["skip-git"]) {
|
|
5180
5247
|
gitInit(args.project);
|
|
5181
5248
|
}
|
|
@@ -5184,7 +5251,22 @@ async function run() {
|
|
|
5184
5251
|
await printOK(args.project, flags2, nextSteps);
|
|
5185
5252
|
}
|
|
5186
5253
|
});
|
|
5187
|
-
await runMain(main2
|
|
5254
|
+
await runMain(main2, {
|
|
5255
|
+
showUsage(cmd, parent) {
|
|
5256
|
+
const args = cmd.args;
|
|
5257
|
+
return showUsage(
|
|
5258
|
+
{
|
|
5259
|
+
...cmd,
|
|
5260
|
+
// filter invisible args
|
|
5261
|
+
args: Object.fromEntries(
|
|
5262
|
+
Object.entries(args).map(([k, v]) => v.invisible ? null : [k, v]).filter(Boolean)
|
|
5263
|
+
// biome-ignore lint/suspicious/noExplicitAny: cast
|
|
5264
|
+
)
|
|
5265
|
+
},
|
|
5266
|
+
parent
|
|
5267
|
+
);
|
|
5268
|
+
}
|
|
5269
|
+
});
|
|
5188
5270
|
}
|
|
5189
5271
|
run().then(() => {
|
|
5190
5272
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.542",
|
|
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",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"typescript": "^5.9.3",
|
|
20
20
|
"unplugin-purge-polyfills": "^0.1.0",
|
|
21
21
|
"vite": "^7.2.6",
|
|
22
|
-
"@batijs/
|
|
23
|
-
"@batijs/
|
|
22
|
+
"@batijs/compile": "0.0.542",
|
|
23
|
+
"@batijs/build": "0.0.542"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@batijs/core": "0.0.
|
|
27
|
-
"@batijs/features": "0.0.
|
|
26
|
+
"@batijs/core": "0.0.542",
|
|
27
|
+
"@batijs/features": "0.0.542"
|
|
28
28
|
},
|
|
29
29
|
"bin": "./cli.js",
|
|
30
30
|
"exports": {
|