Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update nextjs v15, react v19 and eslint v9 #420

Merged
merged 8 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
5 changes: 5 additions & 0 deletions .changeset/swift-donuts-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-llama": patch
---

chore: update eslint 9, nextjs 15, react 19
8 changes: 3 additions & 5 deletions helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ export const installTSTemplate = async ({
console.log("\nUsing static site generation\n");
} else {
if (vectorDb === "milvus") {
nextConfigJson.experimental.serverComponentsExternalPackages =
nextConfigJson.experimental.serverComponentsExternalPackages ?? [];
nextConfigJson.experimental.serverComponentsExternalPackages.push(
"@zilliz/milvus2-sdk-node",
);
nextConfigJson.serverExternalPackages =
nextConfigJson.serverExternalPackages ?? [];
nextConfigJson.serverExternalPackages.push("@zilliz/milvus2-sdk-node");
}
}
await fs.writeFile(
Expand Down
31 changes: 31 additions & 0 deletions templates/types/streaming/express/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import path from "node:path";
import { fileURLToPath } from "node:url";
import tseslint from "typescript-eslint";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
...compat.extends("eslint:recommended", "prettier"),
...tseslint.configs.recommended,
{
ignores: ["prettier.config.cjs"],
},
{ files: ["**/*.{ts}"] },
{
rules: {
"max-params": ["error", 4],
"prefer-const": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
];
10 changes: 0 additions & 10 deletions templates/types/streaming/express/eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion templates/types/streaming/express/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable turbo/no-undeclared-env-vars */
import cors from "cors";
import "dotenv/config";
import express, { Express, Request, Response } from "express";
Expand Down
6 changes: 4 additions & 2 deletions templates/types/streaming/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"format:write": "prettier --ignore-unknown --write .",
"build": "tsup index.ts --format esm --dts",
"start": "node dist/index.js",
"dev": "concurrently \"tsup index.ts --format esm --dts --watch\" \"nodemon --watch dist/index.js\""
"dev": "concurrently \"tsup index.ts --format esm --dts --watch\" \"nodemon --watch dist/index.js\"",
"lint": "eslint ."
},
"dependencies": {
"ai": "3.3.42",
Expand All @@ -33,8 +34,9 @@
"@types/cors": "^2.8.16",
"@types/express": "^4.17.21",
"@types/node": "^20.9.5",
"typescript-eslint": "^8.14.0",
"concurrently": "^8.2.2",
"eslint": "^8.54.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^8.10.0",
"nodemon": "^3.0.1",
"prettier": "^3.2.5",
Expand Down
22 changes: 10 additions & 12 deletions templates/types/streaming/nextjs/next.config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"experimental": {
"outputFileTracingIncludes": {
"/*": ["./cache/**/*"]
},
"outputFileTracingExcludes": {
"/api/files/*": [
".next/**/*",
"node_modules/**/*",
"public/**/*",
"app/**/*"
]
}
"outputFileTracingIncludes": {
"/*": ["./cache/**/*"]
},
"outputFileTracingExcludes": {
"/api/files/*": [
".next/**/*",
"node_modules/**/*",
"public/**/*",
"app/**/*"
]
},
"transpilePackages": ["highlight.js"]
}
12 changes: 6 additions & 6 deletions templates/types/streaming/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"got": "^14.4.1",
"llamaindex": "0.8.2",
"lucide-react": "^0.294.0",
"next": "^14.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"next": "^15.0.3",
"react": "19.0.0-rc-5c56b873-20241107",
"react-dom": "19.0.0-rc-5c56b873-20241107",
"supports-color": "^8.1.1",
"tailwind-merge": "^2.1.0",
"tiktoken": "^1.0.15",
Expand All @@ -46,9 +46,9 @@
"@types/uuid": "^9.0.8",
"autoprefixer": "^10.4.16",
"cross-env": "^7.0.3",
"eslint": "^8.55.0",
"eslint-config-next": "^14.2.4",
"eslint-config-prettier": "^8.10.0",
"eslint": "^9.14.0",
"eslint-config-next": "^15.0.3",
"eslint-config-prettier": "^9.1.0",
"postcss": "^8.4.32",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
Expand Down
3 changes: 2 additions & 1 deletion templates/types/streaming/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
],
"paths": {
"@/*": ["./*"]
}
},
"target": "ES2017"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
Expand Down
Loading