create-better-t-stack 2.33.3 → 2.33.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Better T Stack
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createBtsCli } from "./src-Bkn3LM_8.js";
2
+ import { createBtsCli } from "./src-B-ppWkkE.js";
3
3
 
4
4
  //#region src/cli.ts
5
5
  createBtsCli().run();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { builder, createBtsCli, docs, init, router, sponsors } from "./src-Bkn3LM_8.js";
2
+ import { builder, createBtsCli, docs, init, router, sponsors } from "./src-B-ppWkkE.js";
3
3
 
4
4
  export { builder, createBtsCli, docs, init, router, sponsors };
@@ -68,7 +68,6 @@ const dependencyVersionMap = {
68
68
  "@tauri-apps/cli": "^2.4.0",
69
69
  "@biomejs/biome": "^2.2.0",
70
70
  oxlint: "^1.8.0",
71
- ultracite: "5.1.1",
72
71
  husky: "^9.1.7",
73
72
  "lint-staged": "^16.1.2",
74
73
  tsx: "^4.19.2",
@@ -320,7 +319,7 @@ function getAddonDisplay(addon) {
320
319
  break;
321
320
  case "ruler":
322
321
  label = "Ruler";
323
- hint = "Install and apply BTS rules to editors";
322
+ hint = "Centralize your AI rules";
324
323
  break;
325
324
  case "husky":
326
325
  label = "Husky";
@@ -1202,7 +1201,7 @@ const getLatestCLIVersion = () => {
1202
1201
  */
1203
1202
  function isTelemetryEnabled() {
1204
1203
  const BTS_TELEMETRY_DISABLED = process.env.BTS_TELEMETRY_DISABLED;
1205
- const BTS_TELEMETRY = "1";
1204
+ const BTS_TELEMETRY = "0";
1206
1205
  if (BTS_TELEMETRY_DISABLED !== void 0) return BTS_TELEMETRY_DISABLED !== "1";
1207
1206
  if (BTS_TELEMETRY !== void 0) return BTS_TELEMETRY === "1";
1208
1207
  return true;
@@ -1210,8 +1209,8 @@ function isTelemetryEnabled() {
1210
1209
 
1211
1210
  //#endregion
1212
1211
  //#region src/utils/analytics.ts
1213
- const POSTHOG_API_KEY = "phc_8ZUxEwwfKMajJLvxz1daGd931dYbQrwKNficBmsdIrs";
1214
- const POSTHOG_HOST = "https://us.i.posthog.com";
1212
+ const POSTHOG_API_KEY = "random";
1213
+ const POSTHOG_HOST = "random";
1215
1214
  async function trackProjectCreation(config, disableAnalytics = false) {
1216
1215
  if (!isTelemetryEnabled() || disableAnalytics) return;
1217
1216
  const sessionId = `cli_${crypto.randomUUID().replace(/-/g, "")}`;
@@ -1733,188 +1732,6 @@ async function setupFumadocs(config) {
1733
1732
  }
1734
1733
  }
1735
1734
 
1736
- //#endregion
1737
- //#region src/helpers/setup/starlight-setup.ts
1738
- async function setupStarlight(config) {
1739
- const { packageManager, projectDir } = config;
1740
- const s = spinner();
1741
- try {
1742
- s.start("Setting up Starlight docs...");
1743
- const starlightArgs = [
1744
- "docs",
1745
- "--template",
1746
- "starlight",
1747
- "--no-install",
1748
- "--add",
1749
- "tailwind",
1750
- "--no-git",
1751
- "--skip-houston"
1752
- ];
1753
- const starlightArgsString = starlightArgs.join(" ");
1754
- const commandWithArgs = `create-astro@latest ${starlightArgsString}`;
1755
- const starlightInitCommand = getPackageExecutionCommand(packageManager, commandWithArgs);
1756
- await execa(starlightInitCommand, {
1757
- cwd: path.join(projectDir, "apps"),
1758
- env: { CI: "true" },
1759
- shell: true
1760
- });
1761
- s.stop("Starlight docs setup successfully!");
1762
- } catch (error) {
1763
- s.stop(pc.red("Failed to set up Starlight docs"));
1764
- if (error instanceof Error) consola.error(pc.red(error.message));
1765
- }
1766
- }
1767
-
1768
- //#endregion
1769
- //#region src/helpers/setup/tauri-setup.ts
1770
- async function setupTauri(config) {
1771
- const { packageManager, frontend, projectDir } = config;
1772
- const s = spinner();
1773
- const clientPackageDir = path.join(projectDir, "apps/web");
1774
- if (!await fs.pathExists(clientPackageDir)) return;
1775
- try {
1776
- s.start("Setting up Tauri desktop app support...");
1777
- await addPackageDependency({
1778
- devDependencies: ["@tauri-apps/cli"],
1779
- projectDir: clientPackageDir
1780
- });
1781
- const clientPackageJsonPath = path.join(clientPackageDir, "package.json");
1782
- if (await fs.pathExists(clientPackageJsonPath)) {
1783
- const packageJson = await fs.readJson(clientPackageJsonPath);
1784
- packageJson.scripts = {
1785
- ...packageJson.scripts,
1786
- tauri: "tauri",
1787
- "desktop:dev": "tauri dev",
1788
- "desktop:build": "tauri build"
1789
- };
1790
- await fs.writeJson(clientPackageJsonPath, packageJson, { spaces: 2 });
1791
- }
1792
- frontend.includes("tanstack-router");
1793
- const hasReactRouter = frontend.includes("react-router");
1794
- const hasNuxt = frontend.includes("nuxt");
1795
- const hasSvelte = frontend.includes("svelte");
1796
- frontend.includes("solid");
1797
- const hasNext = frontend.includes("next");
1798
- const devUrl = hasReactRouter || hasSvelte ? "http://localhost:5173" : hasNext ? "http://localhost:3001" : "http://localhost:3001";
1799
- const frontendDist = hasNuxt ? "../.output/public" : hasSvelte ? "../build" : hasNext ? "../.next" : hasReactRouter ? "../build/client" : "../dist";
1800
- const tauriArgs = [
1801
- "init",
1802
- `--app-name=${path.basename(projectDir)}`,
1803
- `--window-title=${path.basename(projectDir)}`,
1804
- `--frontend-dist=${frontendDist}`,
1805
- `--dev-url=${devUrl}`,
1806
- `--before-dev-command=\"${packageManager} run dev\"`,
1807
- `--before-build-command=\"${packageManager} run build\"`
1808
- ];
1809
- const tauriArgsString = tauriArgs.join(" ");
1810
- const commandWithArgs = `@tauri-apps/cli@latest ${tauriArgsString}`;
1811
- const tauriInitCommand = getPackageExecutionCommand(packageManager, commandWithArgs);
1812
- await execa(tauriInitCommand, {
1813
- cwd: clientPackageDir,
1814
- env: { CI: "true" },
1815
- shell: true
1816
- });
1817
- s.stop("Tauri desktop app support configured successfully!");
1818
- } catch (error) {
1819
- s.stop(pc.red("Failed to set up Tauri"));
1820
- if (error instanceof Error) consola$1.error(pc.red(error.message));
1821
- }
1822
- }
1823
-
1824
- //#endregion
1825
- //#region src/helpers/setup/ultracite-setup.ts
1826
- const EDITORS = {
1827
- vscode: {
1828
- label: "VSCode / Cursor / Windsurf",
1829
- hint: "Visual Studio Code editor configuration"
1830
- },
1831
- zed: {
1832
- label: "Zed",
1833
- hint: "Zed editor configuration"
1834
- }
1835
- };
1836
- const RULES = {
1837
- "vscode-copilot": {
1838
- label: "VS Code Copilot",
1839
- hint: "GitHub Copilot integration for VS Code"
1840
- },
1841
- cursor: {
1842
- label: "Cursor",
1843
- hint: "Cursor AI editor configuration"
1844
- },
1845
- windsurf: {
1846
- label: "Windsurf",
1847
- hint: "Windsurf editor configuration"
1848
- },
1849
- zed: {
1850
- label: "Zed",
1851
- hint: "Zed editor rules"
1852
- },
1853
- claude: {
1854
- label: "Claude",
1855
- hint: "Claude AI integration"
1856
- },
1857
- codex: {
1858
- label: "Codex",
1859
- hint: "Codex AI integration"
1860
- }
1861
- };
1862
- async function setupUltracite(config, hasHusky) {
1863
- const { packageManager, projectDir } = config;
1864
- try {
1865
- log.info("Setting up Ultracite...");
1866
- await setupBiome(projectDir);
1867
- const editors = await multiselect({
1868
- message: "Choose editors",
1869
- options: Object.entries(EDITORS).map(([key, editor]) => ({
1870
- value: key,
1871
- label: editor.label,
1872
- hint: editor.hint
1873
- })),
1874
- required: false
1875
- });
1876
- if (isCancel(editors)) return exitCancelled("Operation cancelled");
1877
- const rules = await multiselect({
1878
- message: "Choose rules",
1879
- options: Object.entries(RULES).map(([key, rule]) => ({
1880
- value: key,
1881
- label: rule.label,
1882
- hint: rule.hint
1883
- })),
1884
- required: false
1885
- });
1886
- if (isCancel(rules)) return exitCancelled("Operation cancelled");
1887
- const ultraciteArgs = [
1888
- "init",
1889
- "--pm",
1890
- packageManager
1891
- ];
1892
- if (editors.length > 0) ultraciteArgs.push("--editors", ...editors);
1893
- if (rules.length > 0) ultraciteArgs.push("--rules", ...rules);
1894
- if (hasHusky) ultraciteArgs.push("--features", "husky", "lint-staged");
1895
- const ultraciteArgsString = ultraciteArgs.join(" ");
1896
- const commandWithArgs = `ultracite@latest ${ultraciteArgsString} --skip-install`;
1897
- const ultraciteInitCommand = getPackageExecutionCommand(packageManager, commandWithArgs);
1898
- await execa(ultraciteInitCommand, {
1899
- cwd: projectDir,
1900
- env: { CI: "true" },
1901
- shell: true
1902
- });
1903
- if (hasHusky) await addPackageDependency({
1904
- devDependencies: ["husky", "lint-staged"],
1905
- projectDir
1906
- });
1907
- await addPackageDependency({
1908
- devDependencies: ["ultracite"],
1909
- projectDir
1910
- });
1911
- log.success("Ultracite setup successfully!");
1912
- } catch (error) {
1913
- log.error(pc.red("Failed to set up Ultracite"));
1914
- if (error instanceof Error) console.error(pc.red(error.message));
1915
- }
1916
- }
1917
-
1918
1735
  //#endregion
1919
1736
  //#region src/utils/template-processor.ts
1920
1737
  /**
@@ -2373,6 +2190,184 @@ async function addRulerScriptToPackageJson(projectDir, packageManager) {
2373
2190
  await fs.writeJson(rootPackageJsonPath, packageJson, { spaces: 2 });
2374
2191
  }
2375
2192
 
2193
+ //#endregion
2194
+ //#region src/helpers/setup/starlight-setup.ts
2195
+ async function setupStarlight(config) {
2196
+ const { packageManager, projectDir } = config;
2197
+ const s = spinner();
2198
+ try {
2199
+ s.start("Setting up Starlight docs...");
2200
+ const starlightArgs = [
2201
+ "docs",
2202
+ "--template",
2203
+ "starlight",
2204
+ "--no-install",
2205
+ "--add",
2206
+ "tailwind",
2207
+ "--no-git",
2208
+ "--skip-houston"
2209
+ ];
2210
+ const starlightArgsString = starlightArgs.join(" ");
2211
+ const commandWithArgs = `create-astro@latest ${starlightArgsString}`;
2212
+ const starlightInitCommand = getPackageExecutionCommand(packageManager, commandWithArgs);
2213
+ await execa(starlightInitCommand, {
2214
+ cwd: path.join(projectDir, "apps"),
2215
+ env: { CI: "true" },
2216
+ shell: true
2217
+ });
2218
+ s.stop("Starlight docs setup successfully!");
2219
+ } catch (error) {
2220
+ s.stop(pc.red("Failed to set up Starlight docs"));
2221
+ if (error instanceof Error) consola.error(pc.red(error.message));
2222
+ }
2223
+ }
2224
+
2225
+ //#endregion
2226
+ //#region src/helpers/setup/tauri-setup.ts
2227
+ async function setupTauri(config) {
2228
+ const { packageManager, frontend, projectDir } = config;
2229
+ const s = spinner();
2230
+ const clientPackageDir = path.join(projectDir, "apps/web");
2231
+ if (!await fs.pathExists(clientPackageDir)) return;
2232
+ try {
2233
+ s.start("Setting up Tauri desktop app support...");
2234
+ await addPackageDependency({
2235
+ devDependencies: ["@tauri-apps/cli"],
2236
+ projectDir: clientPackageDir
2237
+ });
2238
+ const clientPackageJsonPath = path.join(clientPackageDir, "package.json");
2239
+ if (await fs.pathExists(clientPackageJsonPath)) {
2240
+ const packageJson = await fs.readJson(clientPackageJsonPath);
2241
+ packageJson.scripts = {
2242
+ ...packageJson.scripts,
2243
+ tauri: "tauri",
2244
+ "desktop:dev": "tauri dev",
2245
+ "desktop:build": "tauri build"
2246
+ };
2247
+ await fs.writeJson(clientPackageJsonPath, packageJson, { spaces: 2 });
2248
+ }
2249
+ frontend.includes("tanstack-router");
2250
+ const hasReactRouter = frontend.includes("react-router");
2251
+ const hasNuxt = frontend.includes("nuxt");
2252
+ const hasSvelte = frontend.includes("svelte");
2253
+ frontend.includes("solid");
2254
+ const hasNext = frontend.includes("next");
2255
+ const devUrl = hasReactRouter || hasSvelte ? "http://localhost:5173" : hasNext ? "http://localhost:3001" : "http://localhost:3001";
2256
+ const frontendDist = hasNuxt ? "../.output/public" : hasSvelte ? "../build" : hasNext ? "../.next" : hasReactRouter ? "../build/client" : "../dist";
2257
+ const tauriArgs = [
2258
+ "init",
2259
+ `--app-name=${path.basename(projectDir)}`,
2260
+ `--window-title=${path.basename(projectDir)}`,
2261
+ `--frontend-dist=${frontendDist}`,
2262
+ `--dev-url=${devUrl}`,
2263
+ `--before-dev-command=\"${packageManager} run dev\"`,
2264
+ `--before-build-command=\"${packageManager} run build\"`
2265
+ ];
2266
+ const tauriArgsString = tauriArgs.join(" ");
2267
+ const commandWithArgs = `@tauri-apps/cli@latest ${tauriArgsString}`;
2268
+ const tauriInitCommand = getPackageExecutionCommand(packageManager, commandWithArgs);
2269
+ await execa(tauriInitCommand, {
2270
+ cwd: clientPackageDir,
2271
+ env: { CI: "true" },
2272
+ shell: true
2273
+ });
2274
+ s.stop("Tauri desktop app support configured successfully!");
2275
+ } catch (error) {
2276
+ s.stop(pc.red("Failed to set up Tauri"));
2277
+ if (error instanceof Error) consola$1.error(pc.red(error.message));
2278
+ }
2279
+ }
2280
+
2281
+ //#endregion
2282
+ //#region src/helpers/setup/ultracite-setup.ts
2283
+ const EDITORS = {
2284
+ vscode: {
2285
+ label: "VSCode / Cursor / Windsurf",
2286
+ hint: "Visual Studio Code editor configuration"
2287
+ },
2288
+ zed: {
2289
+ label: "Zed",
2290
+ hint: "Zed editor configuration"
2291
+ }
2292
+ };
2293
+ const RULES = {
2294
+ "vscode-copilot": {
2295
+ label: "VS Code Copilot",
2296
+ hint: "GitHub Copilot integration for VS Code"
2297
+ },
2298
+ cursor: {
2299
+ label: "Cursor",
2300
+ hint: "Cursor AI editor configuration"
2301
+ },
2302
+ windsurf: {
2303
+ label: "Windsurf",
2304
+ hint: "Windsurf editor configuration"
2305
+ },
2306
+ zed: {
2307
+ label: "Zed",
2308
+ hint: "Zed editor rules"
2309
+ },
2310
+ claude: {
2311
+ label: "Claude",
2312
+ hint: "Claude AI integration"
2313
+ },
2314
+ codex: {
2315
+ label: "Codex",
2316
+ hint: "Codex AI integration"
2317
+ }
2318
+ };
2319
+ async function setupUltracite(config, hasHusky) {
2320
+ const { packageManager, projectDir } = config;
2321
+ try {
2322
+ log.info("Setting up Ultracite...");
2323
+ await setupBiome(projectDir);
2324
+ const editors = await multiselect({
2325
+ message: "Choose editors",
2326
+ options: Object.entries(EDITORS).map(([key, editor]) => ({
2327
+ value: key,
2328
+ label: editor.label,
2329
+ hint: editor.hint
2330
+ })),
2331
+ required: false
2332
+ });
2333
+ if (isCancel(editors)) return exitCancelled("Operation cancelled");
2334
+ const rules = await multiselect({
2335
+ message: "Choose rules",
2336
+ options: Object.entries(RULES).map(([key, rule]) => ({
2337
+ value: key,
2338
+ label: rule.label,
2339
+ hint: rule.hint
2340
+ })),
2341
+ required: false
2342
+ });
2343
+ if (isCancel(rules)) return exitCancelled("Operation cancelled");
2344
+ const ultraciteArgs = [
2345
+ "init",
2346
+ "--pm",
2347
+ packageManager
2348
+ ];
2349
+ if (editors.length > 0) ultraciteArgs.push("--editors", ...editors);
2350
+ if (rules.length > 0) ultraciteArgs.push("--rules", ...rules);
2351
+ if (hasHusky) ultraciteArgs.push("--features", "husky", "lint-staged");
2352
+ const ultraciteArgsString = ultraciteArgs.join(" ");
2353
+ const commandWithArgs = `ultracite@latest ${ultraciteArgsString} --skip-install`;
2354
+ const ultraciteInitCommand = getPackageExecutionCommand(packageManager, commandWithArgs);
2355
+ await execa(ultraciteInitCommand, {
2356
+ cwd: projectDir,
2357
+ env: { CI: "true" },
2358
+ shell: true
2359
+ });
2360
+ if (hasHusky) await addPackageDependency({
2361
+ devDependencies: ["husky", "lint-staged"],
2362
+ projectDir
2363
+ });
2364
+ log.success("Ultracite setup successfully!");
2365
+ } catch (error) {
2366
+ log.error(pc.red("Failed to set up Ultracite"));
2367
+ if (error instanceof Error) console.error(pc.red(error.message));
2368
+ }
2369
+ }
2370
+
2376
2371
  //#endregion
2377
2372
  //#region src/utils/ts-morph.ts
2378
2373
  const tsProject = new Project({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.33.3",
3
+ "version": "2.33.5",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,15 +43,17 @@
43
43
  "url": "git+https://github.com/AmanVarshney01/create-better-t-stack.git",
44
44
  "directory": "apps/cli"
45
45
  },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
46
49
  "homepage": "https://better-t-stack.dev/",
47
50
  "scripts": {
48
51
  "build": "tsdown",
49
52
  "dev": "tsdown --watch",
50
53
  "check-types": "tsc --noEmit",
51
54
  "check": "biome check --write .",
52
- "test": "bun run build && vitest run",
53
- "test:with-build": "bun run build && WITH_BUILD=1 vitest run",
54
- "prepublishOnly": "npm run build"
55
+ "test": "bun run build && vitest --ui",
56
+ "test:with-build": "bun run build && WITH_BUILD=1 vitest --ui"
55
57
  },
56
58
  "exports": {
57
59
  ".": {
@@ -76,8 +78,10 @@
76
78
  "devDependencies": {
77
79
  "@types/fs-extra": "^11.0.4",
78
80
  "@types/node": "^24.2.1",
81
+ "@vitest/ui": "^3.2.4",
79
82
  "tsdown": "^0.14.1",
80
83
  "typescript": "^5.9.2",
81
84
  "vitest": "^3.2.4"
82
- }
85
+ },
86
+ "gitHead": "e7f893d76bbf05e7f0954418dd5ead15f8bf3146"
83
87
  }