From a2ca89bfe0b0af3fe737b95d9ce7e4bbb2a8da1e Mon Sep 17 00:00:00 2001
From: Alex Yang <himself65@outlook.com>
Date: Tue, 5 Mar 2024 14:20:58 -0600
Subject: [PATCH] fix: config (#611)

---
 .eslintrc.js                           |  8 ++++
 .github/workflows/publish.yml          |  2 +-
 packages/create-llama/.eslintrc        | 19 ++++++++
 packages/create-llama/tsconfig.json    |  1 +
 packages/eslint-config-custom/index.js | 64 ++------------------------
 turbo.json                             |  4 +-
 6 files changed, 37 insertions(+), 61 deletions(-)
 create mode 100644 packages/create-llama/.eslintrc

diff --git a/.eslintrc.js b/.eslintrc.js
index 4b4b23a92..ca2c266d0 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -11,5 +11,13 @@ module.exports = {
     "max-params": ["error", 4],
     "prefer-const": "error",
   },
+  overrides: [
+    {
+      files: ["examples/**/*.ts"],
+      rules: {
+        "turbo/no-undeclared-env-vars": "off",
+      },
+    },
+  ],
   ignorePatterns: ["dist/", "lib/"],
 };
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 277d1e930..ae1b5c31d 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -21,4 +21,4 @@ jobs:
 
       - name: Publish @llamaindex/core
         run: npx jsr publish
-        working-directory: packages/core
+        working-directory: packages/core --allow-slow-types
diff --git a/packages/create-llama/.eslintrc b/packages/create-llama/.eslintrc
new file mode 100644
index 000000000..a50d5a3c8
--- /dev/null
+++ b/packages/create-llama/.eslintrc
@@ -0,0 +1,19 @@
+{
+  "root": false,
+  "rules": {
+    "turbo/no-undeclared-env-vars": [
+      "error",
+      {
+        "allowList": [
+          "OPENAI_API_KEY",
+          "npm_config_user_agent",
+          "http_proxy",
+          "https_proxy",
+          "MODEL",
+          "NEXT_PUBLIC_CHAT_API",
+          "NEXT_PUBLIC_MODEL"
+        ]
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/packages/create-llama/tsconfig.json b/packages/create-llama/tsconfig.json
index 8be5525be..5d804d06a 100644
--- a/packages/create-llama/tsconfig.json
+++ b/packages/create-llama/tsconfig.json
@@ -10,6 +10,7 @@
     "esModuleInterop": true,
     "forceConsistentCasingInFileNames": true,
     "incremental": true,
+    "outDir": "./lib",
     "tsBuildInfoFile": "./lib/.tsbuildinfo"
   },
   "include": [
diff --git a/packages/eslint-config-custom/index.js b/packages/eslint-config-custom/index.js
index 56bad41be..41427af2b 100644
--- a/packages/eslint-config-custom/index.js
+++ b/packages/eslint-config-custom/index.js
@@ -2,65 +2,6 @@ module.exports = {
   extends: ["next", "turbo", "prettier"],
   rules: {
     "@next/next/no-html-link-for-pages": "off",
-    "turbo/no-undeclared-env-vars": [
-      "error",
-      {
-        allowList: [
-          "LLAMA_CLOUD_API_KEY",
-          "LLAMA_CLOUD_BASE_URL",
-          "OPENAI_API_KEY",
-          "REPLICATE_API_TOKEN",
-          "ANTHROPIC_API_KEY",
-          "ASSEMBLYAI_API_KEY",
-          "TOGETHER_API_KEY",
-          "FIREWORKS_API_KEY",
-          "GROQ_API_KEY",
-
-          "ASTRA_DB_APPLICATION_TOKEN",
-          "ASTRA_DB_ENDPOINT",
-          "ASTRA_DB_NAMESPACE",
-
-          "AZURE_OPENAI_KEY",
-          "AZURE_OPENAI_ENDPOINT",
-          "AZURE_OPENAI_API_VERSION",
-          "AZURE_OPENAI_DEPLOYMENT",
-
-          "OPENAI_API_BASE",
-          "OPENAI_API_VERSION",
-          "OPENAI_API_TYPE",
-          "OPENAI_API_ORGANIZATION",
-
-          "PINECONE_API_KEY",
-          "PINECONE_ENVIRONMENT",
-          "PINECONE_PROJECT_ID",
-          "PINECONE_INDEX_NAME",
-          "PINECONE_CHUNK_SIZE",
-          "PINECONE_INDEX_NAME",
-          "PINECONE_NAMESPACE",
-
-          "AZURE_OPENAI_API_KEY",
-          "AZURE_OPENAI_API_INSTANCE_NAME",
-          "AZURE_OPENAI_API_DEPLOYMENT_NAME",
-
-          "MISTRAL_API_KEY",
-
-          "DEBUG",
-          "no_proxy",
-          "NO_PROXY",
-
-          "NOTION_TOKEN",
-          "MONGODB_URI",
-
-          "PG_CONNECTION_STRING",
-
-          "https_proxy",
-          "npm_config_user_agent",
-          "NEXT_PUBLIC_CHAT_API",
-          "MODEL",
-          "NEXT_PUBLIC_MODEL",
-        ],
-      },
-    ],
   },
   // NOTE I think because we've temporarily removed all of the NextJS stuff
   // from the turborepo not having next in the devDeps causes an error on only
@@ -73,4 +14,9 @@ module.exports = {
       presets: [require.resolve("next/babel")],
     },
   },
+  settings: {
+    react: {
+      version: "999.999.999",
+    },
+  },
 };
diff --git a/turbo.json b/turbo.json
index 1a3afa7f4..49b4a101e 100644
--- a/turbo.json
+++ b/turbo.json
@@ -6,7 +6,9 @@
       "dependsOn": ["^build"],
       "outputs": ["dist/**", "build/**"]
     },
-    "lint": {},
+    "lint": {
+      "inputs": ["packages/eslint-config-custom"]
+    },
     "test": {
       "dependsOn": ["^build"]
     },
-- 
GitLab