Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,16 @@ jobs:
uses: actions/checkout@v6.0.1
with:
fetch-depth: 0
- name: Start Nx Agents
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
- name: Setup Tools
uses: tanstack/config/.github/setup@main
- name: Install Playwright browsers
run: pnpm exec playwright install
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@v4.4.0
with:
main-branch-name: main
- name: Run Checks
run: pnpm run test:pr --parallel=3
- name: Stop Nx Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
preview:
name: Preview
runs-on: ubuntu-latest
Expand All @@ -52,4 +49,5 @@ jobs:
- name: Build Packages
run: pnpm run build:all
- name: Publish Previews
if: ${{ github.repository_owner == 'TanStack' }}
run: pnpx pkg-pr-new publish --pnpm './packages/*' --template './examples/*/*'
6 changes: 6 additions & 0 deletions packages/react-router/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export default [
{
files: ['src/**/*.{ts,tsx}', 'tests/**/*.{ts,tsx}'],
},
{
files: ['llms/rules/**/*.ts'],
rules: {
'no-useless-escape': 'off',
},
},
{
plugins: {
'react-hooks': pluginReactHooks,
Expand Down
34 changes: 21 additions & 13 deletions packages/start-plugin-core/src/rsbuild/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export function TanStackStartRsbuildPluginCore(
)

const isDev = api.context?.command === 'serve'
const isBuild = api.context?.command === 'build'
const defineViteEnv = (key: string, fallback = '') => {
const value = process.env[key] ?? fallback
return defineReplaceEnv(key, value)
Expand All @@ -348,6 +349,13 @@ export function TanStackStartRsbuildPluginCore(
: {}),
...defineViteEnv('VITE_NODE_ENV', 'production'),
...defineViteEnv('VITE_EXTERNAL_PORT', ''),
...(isBuild && startConfig.server.build.staticNodeEnv
? {
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV ?? 'production',
),
}
: {}),
}

const routerPlugins = tanStackStartRouterRsbuild(
Expand Down Expand Up @@ -737,20 +745,20 @@ export function TanStackStartRsbuildPluginCore(
clientOutputDir,
serverOutputDir,
})
if (routeTreeGeneratedPath && routeTreeModuleDeclaration) {
if (fs.existsSync(routeTreeGeneratedPath)) {
const existingTree = fs.readFileSync(
routeTreeGeneratedPath,
'utf-8',
)
if (!existingTree.includes(routeTreeModuleDeclaration)) {
fs.appendFileSync(
routeTreeGeneratedPath,
`\n\n${routeTreeModuleDeclaration}\n`,
)
}
}
if (routeTreeGeneratedPath && routeTreeModuleDeclaration) {
if (fs.existsSync(routeTreeGeneratedPath)) {
const existingTree = fs.readFileSync(
routeTreeGeneratedPath,
'utf-8',
)
if (!existingTree.includes(routeTreeModuleDeclaration)) {
fs.appendFileSync(
routeTreeGeneratedPath,
`\n\n${routeTreeModuleDeclaration}\n`,
)
}
}
}
})
},
},
Expand Down