mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): add ultracite, oxlint, fumadocs addons (#427)
This commit is contained in:
@@ -7,7 +7,7 @@ export const addPackageDependency = async (opts: {
|
||||
dependencies?: AvailableDependencies[];
|
||||
devDependencies?: AvailableDependencies[];
|
||||
projectDir: string;
|
||||
}): Promise<void> => {
|
||||
}) => {
|
||||
const { dependencies = [], devDependencies = [], projectDir } = opts;
|
||||
|
||||
const pkgJsonPath = path.join(projectDir, "package.json");
|
||||
|
||||
@@ -6,9 +6,7 @@ import { isTelemetryEnabled } from "./telemetry";
|
||||
const POSTHOG_API_KEY = process.env.POSTHOG_API_KEY || "";
|
||||
const POSTHOG_HOST = process.env.POSTHOG_HOST;
|
||||
|
||||
export async function trackProjectCreation(
|
||||
config: ProjectConfig,
|
||||
): Promise<void> {
|
||||
export async function trackProjectCreation(config: ProjectConfig) {
|
||||
const posthog = new PostHog(POSTHOG_API_KEY, {
|
||||
host: POSTHOG_HOST,
|
||||
flushAt: 1,
|
||||
|
||||
@@ -6,9 +6,7 @@ import { getLatestCLIVersion } from "./get-latest-cli-version";
|
||||
|
||||
const BTS_CONFIG_FILE = "bts.jsonc";
|
||||
|
||||
export async function writeBtsConfig(
|
||||
projectConfig: ProjectConfig,
|
||||
): Promise<void> {
|
||||
export async function writeBtsConfig(projectConfig: ProjectConfig) {
|
||||
const btsConfig: BetterTStackConfig = {
|
||||
version: getLatestCLIVersion(),
|
||||
createdAt: new Date().toISOString(),
|
||||
@@ -94,7 +92,7 @@ export async function readBtsConfig(
|
||||
export async function updateBtsConfig(
|
||||
projectDir: string,
|
||||
updates: Partial<Pick<BetterTStackConfig, "addons" | "webDeploy">>,
|
||||
): Promise<void> {
|
||||
) {
|
||||
try {
|
||||
const configPath = path.join(projectDir, BTS_CONFIG_FILE);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { log } from "@clack/prompts";
|
||||
import { execa } from "execa";
|
||||
|
||||
export async function openUrl(url: string): Promise<void> {
|
||||
export async function openUrl(url: string) {
|
||||
const platform = process.platform;
|
||||
let command: string;
|
||||
let args: string[] = [];
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function fetchSponsors(
|
||||
return sponsors;
|
||||
}
|
||||
|
||||
export function displaySponsors(sponsors: SponsorEntry[]): void {
|
||||
export function displaySponsors(sponsors: SponsorEntry[]) {
|
||||
if (sponsors.length === 0) {
|
||||
log.info("No sponsors found. You can be the first one! ✨");
|
||||
outro(
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function processTemplate(
|
||||
srcPath: string,
|
||||
destPath: string,
|
||||
context: ProjectConfig,
|
||||
): Promise<void> {
|
||||
) {
|
||||
try {
|
||||
const templateContent = await fs.readFile(srcPath, "utf-8");
|
||||
const template = handlebars.compile(templateContent);
|
||||
|
||||
Reference in New Issue
Block a user