createStartProject() — ui Function Reference
Architecture documentation for the createStartProject() function in create-project.ts from the ui codebase.
Entity Profile
Dependency Diagram
graph TD a91ea13e_5803_048b_5539_8d46c24f175a["createStartProject()"] f570a109_148e_1b68_ffd0_6e7f2f8ca03d["create-project.ts"] a91ea13e_5803_048b_5539_8d46c24f175a -->|defined in| f570a109_148e_1b68_ffd0_6e7f2f8ca03d ee4c31b0_cc12_35da_90d1_168cb9e6c7f0["createProject()"] ee4c31b0_cc12_35da_90d1_168cb9e6c7f0 -->|calls| a91ea13e_5803_048b_5539_8d46c24f175a style a91ea13e_5803_048b_5539_8d46c24f175a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/src/utils/create-project.ts lines 365–436
async function createStartProject(
projectPath: string,
options: {
packageManager: string
}
) {
const createSpinner = spinner(
`Creating a new TanStack Start project. This may take a few minutes.`
).start()
try {
// Get the template.
const templatePath = path.join(os.tmpdir(), `shadcn-template-${Date.now()}`)
await fs.ensureDir(templatePath)
const response = await fetch(GITHUB_TEMPLATE_URL)
if (!response.ok) {
throw new Error(`Failed to download template: ${response.statusText}`)
}
// Write the tar file.
const tarPath = path.resolve(templatePath, "template.tar.gz")
await fs.writeFile(tarPath, Buffer.from(await response.arrayBuffer()))
await execa("tar", [
"-xzf",
tarPath,
"-C",
templatePath,
"--strip-components=2",
"ui-main/templates/start-app",
])
const extractedPath = path.resolve(templatePath, "start-app")
await fs.move(extractedPath, projectPath)
await fs.remove(templatePath)
// Remove pnpm-lock.yaml if using a different package manager.
if (options.packageManager !== "pnpm") {
const lockFilePath = path.join(projectPath, "pnpm-lock.yaml")
if (fs.existsSync(lockFilePath)) {
await fs.remove(lockFilePath)
}
}
// Run install.
await execa(options.packageManager, ["install"], {
cwd: projectPath,
})
// Write project name to the package.json.
const packageJsonPath = path.join(projectPath, "package.json")
if (fs.existsSync(packageJsonPath)) {
const packageJsonContent = await fs.readFile(packageJsonPath, "utf8")
const packageJson = JSON.parse(packageJsonContent)
packageJson.name = projectPath.split("/").pop()
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2))
}
// Try git init.
await execa("git", ["--version"], { cwd: projectPath })
await execa("git", ["init"], { cwd: projectPath })
await execa("git", ["add", "-A"], { cwd: projectPath })
await execa("git", ["commit", "-m", "Initial commit"], {
cwd: projectPath,
})
createSpinner?.succeed("Creating a new TanStack Start project.")
} catch (error) {
createSpinner?.fail(
"Something went wrong creating a new TanStack Start project."
)
handleError(error)
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does createStartProject() do?
createStartProject() is a function in the ui codebase, defined in packages/shadcn/src/utils/create-project.ts.
Where is createStartProject() defined?
createStartProject() is defined in packages/shadcn/src/utils/create-project.ts at line 365.
What calls createStartProject()?
createStartProject() is called by 1 function(s): createProject.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free