Skip to content

Commit

Permalink
fix: Move @tanstack/start build to separate packages, keep sub modules (
Browse files Browse the repository at this point in the history
#3206)

* fix: no sub modules

* Revert "fix: no sub modules"

This reverts commit 7186b92.

* fix: start package, builds, tests

* fix: router manifest dir name

* fix: lockfile
  • Loading branch information
tannerlinsley authored Jan 22, 2025
1 parent b16c2c1 commit f9fb1bd
Show file tree
Hide file tree
Showing 111 changed files with 2,350 additions and 308 deletions.
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@
"@tanstack/valibot-adapter": "workspace:*",
"@tanstack/arktype-adapter": "workspace:*",
"@tanstack/start": "workspace:*",
"@tanstack/start-client": "workspace:*",
"@tanstack/start-server": "workspace:*",
"@tanstack/start-api-routes": "workspace:*",
"@tanstack/start-server-functions-fetcher": "workspace:*",
"@tanstack/start-server-functions-handler": "workspace:*",
"@tanstack/start-server-functions-client": "workspace:*",
"@tanstack/start-server-functions-ssr": "workspace:*",
"@tanstack/start-server-functions-server": "workspace:*",
"@tanstack/start-router-manifest": "workspace:*",
"@tanstack/start-config": "workspace:*",
"@tanstack/start-plugin": "workspace:*",
"@tanstack/eslint-plugin-router": "workspace:*",
"@tanstack/server-functions-plugin": "workspace:*",
Expand Down
33 changes: 33 additions & 0 deletions packages/start-api-routes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
> 🤫 we're cooking up something special!
<img src="https://static.scarf.sh/a.png?x-pxid=d988eb79-b0fc-4a2b-8514-6a1ab932d188" />

# TanStack Start

![TanStack Router Header](https://github.com/tanstack/router/raw/main/media/header.png)

🤖 Type-safe router w/ built-in caching & URL state management for React!

<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
</a><a href="https://npmjs.com/package/@tanstack/react-router" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/router.svg" />
</a><a href="https://bundlephobia.com/result?p=@tanstack/react-router" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-router" />
</a><a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a><a href="https://github.com/tanstack/router/discussions">
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
</a><a href="https://bestofjs.org/projects/router"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=tanstack%2Frouter%26since=daily" /></a><a href="https://github.com/tanstack/router" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/tanstack/router.svg?style=social&label=Star" />
</a><a href="https://twitter.com/tan_stack" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social&label=Follow @TanStack" />
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow @TannerLinsley" />
</a>

Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)

## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
31 changes: 31 additions & 0 deletions packages/start-api-routes/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
...pluginReact.configs.recommended,
files: ['**/*.{ts,tsx}'],
},
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'@eslint-react/no-unstable-context-value': 'off',
'@eslint-react/no-unstable-default-props': 'off',
'@eslint-react/dom/no-missing-button-type': 'off',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
},
{
files: ['**/__tests__/**'],
rules: {
'@typescript-eslint/no-unnecessary-condition': 'off',
},
},
]
78 changes: 78 additions & 0 deletions packages/start-api-routes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"name": "@tanstack/start-api-routes",
"version": "1.97.3",
"description": "Modern and scalable routing for React applications",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
"directory": "packages/start"
},
"homepage": "https://tanstack.com/start",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
"react",
"location",
"router",
"routing",
"async",
"async router",
"typescript"
],
"scripts": {
"clean": "rimraf ./dist && rimraf ./coverage",
"test": "pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
"test:unit": "exit 0; vitest",
"test:eslint": "eslint ./src",
"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js",
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
"test:types:ts57": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"engines": {
"node": ">=12"
},
"dependencies": {
"@tanstack/react-router": "workspace:^",
"@tanstack/start-server": "workspace:^",
"@vitejs/plugin-react": "^4.3.4",
"vinxi": "0.5.1"
},
"devDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.7.2"
},
"peerDependencies": {
"react": ">=18.0.0 || >=19.0.0",
"react-dom": ">=18.0.0 || >=19.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventHandler, toWebRequest } from '@tanstack/start/server'
import { eventHandler, toWebRequest } from '@tanstack/start-server'
import vinxiFileRoutes from 'vinxi/routes'
import type { ResolveParams } from '@tanstack/react-router'

Expand Down Expand Up @@ -150,7 +150,7 @@ function findRoute<TPayload = unknown>(
* @example
* ```ts
* // app/foo.ts
* import { createAPIRoute } from '@tanstack/start/api'
* import { createAPIRoute } from '@tanstack/start-api-routes'
* const fooBarRoute = createAPIRoute('/api/foo/$bar')({
* GET: ({ params }) => {
* return new Response(JSON.stringify({ params }))
Expand All @@ -161,7 +161,7 @@ function findRoute<TPayload = unknown>(
* import {
* createStartAPIHandler,
* defaultAPIRoutesHandler
* } from '@tanstack/start/api'
* } from '@tanstack/start-api-routes'
*
* export default createStartAPIHandler(
* defaultAPIRoutesHandler({
Expand Down Expand Up @@ -305,7 +305,7 @@ function toTSRFileBasedRoutes(
* import {
* createStartAPIHandler,
* defaultAPIFileRouteHandler
* } from '@tanstack/start/api'
* } from '@tanstack/start-api-routes'
*
* export default createStartAPIHandler(defaultAPIFileRouteHandler)
* ```
Expand Down
8 changes: 8 additions & 0 deletions packages/start-api-routes/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx",
"module": "esnext"
},
"include": ["src", "vite.config.ts"]
}
22 changes: 22 additions & 0 deletions packages/start-api-routes/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import { tanstackViteConfig } from '@tanstack/config/vite'
import react from '@vitejs/plugin-react'
import packageJson from './package.json'
import type { ViteUserConfig } from 'vitest/config'

const config = defineConfig({
plugins: [react()] as ViteUserConfig['plugins'],
test: {
name: packageJson.name,
watch: false,
environment: 'jsdom',
},
})

export default mergeConfig(
config,
tanstackViteConfig({
entry: './src/index.ts',
srcDir: './src',
}),
)
33 changes: 33 additions & 0 deletions packages/start-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
> 🤫 we're cooking up something special!
<img src="https://static.scarf.sh/a.png?x-pxid=d988eb79-b0fc-4a2b-8514-6a1ab932d188" />

# TanStack Start

![TanStack Router Header](https://github.com/tanstack/router/raw/main/media/header.png)

🤖 Type-safe router w/ built-in caching & URL state management for React!

<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
</a><a href="https://npmjs.com/package/@tanstack/react-router" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/router.svg" />
</a><a href="https://bundlephobia.com/result?p=@tanstack/react-router" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-router" />
</a><a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a><a href="https://github.com/tanstack/router/discussions">
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
</a><a href="https://bestofjs.org/projects/router"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=tanstack%2Frouter%26since=daily" /></a><a href="https://github.com/tanstack/router" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/tanstack/router.svg?style=social&label=Star" />
</a><a href="https://twitter.com/tan_stack" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social&label=Follow @TanStack" />
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow @TannerLinsley" />
</a>

Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Query](https://github.com/tannerlinsley/react-query), [React Table](https://github.com/tanstack/react-table), [React Charts](https://github.com/tannerlinsley/react-charts), [React Virtual](https://github.com/tannerlinsley/react-virtual)

## Visit [tanstack.com/router](https://tanstack.com/router) for docs, guides, API and more!
31 changes: 31 additions & 0 deletions packages/start-client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
...pluginReact.configs.recommended,
files: ['**/*.{ts,tsx}'],
},
{
plugins: {
'react-hooks': pluginReactHooks,
},
rules: {
'@eslint-react/no-unstable-context-value': 'off',
'@eslint-react/no-unstable-default-props': 'off',
'@eslint-react/dom/no-missing-button-type': 'off',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
},
{
files: ['**/__tests__/**'],
rules: {
'@typescript-eslint/no-unnecessary-condition': 'off',
},
},
]
80 changes: 80 additions & 0 deletions packages/start-client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "@tanstack/start-client",
"version": "1.97.3",
"description": "Modern and scalable routing for React applications",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
"directory": "packages/start"
},
"homepage": "https://tanstack.com/start",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [
"react",
"location",
"router",
"routing",
"async",
"async router",
"typescript"
],
"scripts": {
"clean": "rimraf ./dist && rimraf ./coverage",
"test": "pnpm test:deps && pnpm test:eslint && pnpm test:types && pnpm test:build && pnpm test:unit",
"test:unit": "vitest",
"test:eslint": "eslint ./src",
"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js",
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
"test:types:ts57": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"engines": {
"node": ">=12"
},
"dependencies": {
"@tanstack/react-router": "workspace:^",
"@tanstack/react-cross-context": "workspace:^",
"tiny-invariant": "^1.3.3",
"jsesc": "^3.0.2",
"vinxi": "^0.5.1"
},
"devDependencies": {
"@types/jsesc": "^3.0.3",
"@vitejs/plugin-react": "^4.3.4",
"esbuild": "^0.24.2",
"@testing-library/react": "^16.1.0"
},
"peerDependencies": {
"react": ">=18.0.0 || >=19.0.0",
"react-dom": ">=18.0.0 || >=19.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f9fb1bd

Please sign in to comment.