npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

create-tanstack-app

v1.1.4

Published

A CLI tool to create a Tanstack app

Downloads

236

Readme

Create TanStack App

This CLI tool helps you quickly set up a new TanStack app by downloading and initializing the template from GitHub. It's perfect for building full-stack applications using TanStack's powerful router and full-stack capabilities.

Features:

  • Full-Document SSR
  • Streaming
  • Server Functions (RPCs)
  • Automatic type-safe routing with TanStack Router
  • Deployment-ready app setup

Getting Started

Install

You can use the CLI to set up a new TanStack app directly from GitHub with:

npx create-tanstack-app@latest

This will:

  1. Download the starter template from https://github.com/SH20RAJ/tanstack-start
  2. Initialize the project with all necessary dependencies and configurations.

Dependencies

Your new project will include:

  • TanStack Router: A powerful type-safe routing system for React.
  • Vinxi: A bundler and deployment tool.
  • Vite: For fast build and development.
  • React: Frontend library to build the app.
  • TypeScript: For type safety throughout the app.

Project Structure

Once the setup is complete, your project will have a structure similar to this:

my-app/
├── app/
│   ├── routes/
│   │   └── __root.tsx
│   ├── client.tsx
│   ├── router.tsx
│   ├── routeTree.gen.ts
│   └── ssr.tsx
├── .gitignore
├── app.config.ts
├── package.json
└── tsconfig.json

Running the App

Once the setup is complete, run the following command to start the app:

npm run dev

This will start the development server, and you can start building your app with TanStack's full-stack routing and SSR features.

For more details on how to configure your app, refer to the official TanStack Start Docs.


Make sure that your index.js for this npm package initializes the necessary steps to clone the repo from GitHub and set it up locally. You can use Node's child_process module to clone the repository and run the initial npm setup commands for users. For example:

const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');

const repoUrl = 'https://github.com/SH20RAJ/tanstack-start.git';
const targetDir = path.join(process.cwd(), 'tanstack-app');

try {
  if (!fs.existsSync(targetDir)) {
    console.log('Cloning TanStack app template...');
    execSync(`git clone ${repoUrl} ${targetDir}`, { stdio: 'inherit' });

    console.log('Installing dependencies...');
    execSync('npm install', { cwd: targetDir, stdio: 'inherit' });

    console.log('Setup complete! You can now run "npm run dev" in the project directory.');
  } else {
    console.log('Directory already exists.');
  }
} catch (error) {
  console.error('Error setting up TanStack app:', error);
}