Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/happy-emus-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@langchain/eslint": patch
---

internal(eslint): create internal Eslint package and upgrade to Eslint v9
2 changes: 1 addition & 1 deletion .github/workflows/check-broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- name: Build scripts
run: pnpm build --filter @langchain/scripts
- name: Check broken links
run: pnpm --filter core_docs check:broken-links:ci
run: pnpm check:broken-links:ci
2 changes: 1 addition & 1 deletion .github/workflows/deploy-api-refs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build All Projects
run: pnpm build --filter=!examples --filter=!api_refs --filter=!core_docs --filter=!create-langchain-integration
run: pnpm build --filter=!examples --filter=!api_refs --filter=!create-langchain-integration
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-api-refs-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build All Projects
run: pnpm build --filter=!examples --filter=!api_refs --filter=!core_docs --filter=!create-langchain-integration
run: pnpm build --filter=!examples --filter=!api_refs --filter=!create-langchain-integration
- name: Build Project Artifacts
run: |
if [ ${{ github.ref }} = 'refs/heads/main' ]; then
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": ["AILLM", "Upstash"],
"cSpell.enabledFileTypes": {
"mdx": true
"mdx": true,
"typescript": false,
"javascript": false,
"typescriptreact": false,
"javascriptreact": false
},
"editor.formatOnSave": true,
"files.exclude": {
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ and in generated documentation.
##### Note: you only need to follow these steps if you are building the docs site locally

1. [Quarto](https://quarto.org/) - package that converts Jupyter notebooks (`.ipynb` files) into `.mdx` files for serving in Docusaurus.
2. `pnpm build --filter=core_docs` - It's as simple as that! (or you can simply run `pnpm build` from `docs/core_docs/`)
2. `pnpm build` - It's as simple as that! (or you can simply run `pnpm build` from `docs/core_docs/`)

All notebooks are converted to `.md` files and automatically gitignored. If you would like to create a non notebook doc, it must be a `.mdx` file.

Expand Down
13 changes: 13 additions & 0 deletions dependency_range_tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
- ../libs/providers/langchain-openai:/libs/langchain-openai
- ../libs/providers/langchain-anthropic:/libs/langchain-anthropic
- ../libs/providers/langchain-cohere:/libs/langchain-cohere
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/langchain/test-with-latest-deps.sh
langchain-lowest-deps:
Expand All @@ -29,6 +30,7 @@ services:
- ../libs/providers/langchain-openai:/libs/langchain-openai
- ../libs/providers/langchain-anthropic:/libs/langchain-anthropic
- ../libs/providers/langchain-cohere:/libs/langchain-cohere
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/langchain/test-with-lowest-deps.sh

Expand All @@ -46,6 +48,7 @@ services:
- ./scripts/with_standard_tests/community/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/langchain-community:/libs/langchain-community
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/community/test-with-latest-deps.sh
community-lowest-deps:
Expand All @@ -61,6 +64,7 @@ services:
- ./scripts/with_standard_tests/community/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/langchain-community:/libs/langchain-community
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/community/test-with-lowest-deps.sh
community-npm-install:
Expand All @@ -75,6 +79,7 @@ services:
- ./scripts/with_standard_tests/community/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/langchain-community:/libs/langchain-community
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/community/npm-install.sh

Expand All @@ -92,6 +97,7 @@ services:
- ./scripts/with_standard_tests/openai/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-openai:/libs/providers/langchain-openai
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/openai/test-with-latest-deps.sh
openai-lowest-deps:
Expand All @@ -107,6 +113,7 @@ services:
- ./scripts/with_standard_tests/openai/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-openai:/libs/providers/langchain-openai
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/openai/test-with-lowest-deps.sh

Expand All @@ -124,6 +131,7 @@ services:
- ./scripts/with_standard_tests/anthropic/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-anthropic:/libs/providers/langchain-anthropic
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/anthropic/test-with-latest-deps.sh
anthropic-lowest-deps:
Expand All @@ -139,6 +147,7 @@ services:
- ./scripts/with_standard_tests/anthropic/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-anthropic:/libs/providers/langchain-anthropic
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/anthropic/test-with-lowest-deps.sh

Expand All @@ -156,6 +165,7 @@ services:
- ./scripts/with_standard_tests/google-vertexai/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-google-vertexai:/libs/providers/langchain-google-vertexai
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/google-vertexai/test-with-latest-deps.sh
google-vertexai-lowest-deps:
Expand All @@ -171,6 +181,7 @@ services:
- ./scripts/with_standard_tests/google-vertexai/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-google-vertexai:/libs/providers/langchain-google-vertexai
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/google-vertexai/test-with-lowest-deps.sh

Expand All @@ -188,6 +199,7 @@ services:
- ./scripts/with_standard_tests/cohere/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-cohere:/libs/providers/langchain-cohere
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/cohere/test-with-latest-deps.sh
cohere-lowest-deps:
Expand All @@ -203,5 +215,6 @@ services:
- ./scripts/with_standard_tests/cohere/node/package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/providers/langchain-cohere:/libs/providers/langchain-cohere
- ../internal:/internal
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/cohere/test-with-lowest-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const currentPackageJson = JSON.parse(
);
currentPackageJson.pnpm = { overrides: {} };

const INTERNAL_PACKAGES = ["@langchain/eslint"];

if (
currentPackageJson.peerDependencies?.["@langchain/core"] &&
!currentPackageJson.peerDependencies["@langchain/core"].includes("rc")
Expand Down Expand Up @@ -34,6 +36,15 @@ for (const [depName, depVersion] of workspaceDependencies) {
}

const libName = depName.split("/")[1];

if (INTERNAL_PACKAGES.includes(depName)) {
/**
* reference the workspace dependency as a file path
*/
currentPackageJson.devDependencies[depName] = `file:/internal/${libName}`;
continue;
}

/**
* reference the workspace dependency as a file path
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const semver = require("semver");

const communityPackageJsonPath = "package.json";

const INTERNAL_PACKAGES = ["@langchain/eslint"];

const currentPackageJson = JSON.parse(
fs.readFileSync(communityPackageJsonPath)
);
Expand Down Expand Up @@ -40,6 +42,15 @@ for (const [depName, depVersion] of workspaceDependencies) {
}

const libName = depName.split("/")[1];

if (INTERNAL_PACKAGES.includes(depName)) {
/**
* reference the workspace dependency as a file path
*/
currentPackageJson.devDependencies[depName] = `file:/internal/${libName}`;
continue;
}

/**
* reference the workspace dependency as a file path
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/core_docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"lint:eslint": "NODE_OPTIONS=--max-old-space-size=4096 eslint --cache --ext .ts,.js src/",
"lint:eslint": "eslint --cache --ext .ts,.js src/",
"lint": "pnpm lint:eslint",
"lint:fix": "pnpm lint --fix",
"precommit": "lint-staged",
Expand Down
8 changes: 8 additions & 0 deletions environment_tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-esm:
image: node:20
Expand All @@ -48,6 +49,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-tsc:
image: node:20
Expand All @@ -73,6 +75,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-cjs:
image: node:20
Expand All @@ -98,6 +101,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-cf:
image: node:20
Expand All @@ -123,6 +127,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-vercel:
image: node:20
Expand All @@ -148,6 +153,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-vite:
image: node:20
Expand All @@ -173,6 +179,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-entrypoint.sh
test-exports-bun:
image: oven/bun
Expand All @@ -195,6 +202,7 @@ services:
- ../libs/langchain-scripts:/langchain-scripts
- ../libs/langchain-textsplitters:/langchain-textsplitters
- ../internal/build:/langchain-build
- ../internal/eslint:/langchain-eslint
command: bash /scripts/docker-bun-entrypoint.sh
success:
image: alpine:3.14
Expand Down
1 change: 1 addition & 0 deletions environment_tests/scripts/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const dockerPackages: WorkspacePackage[] = [
path: "/langchain-textsplitters",
},
{ pkg: { name: "@langchain/build" }, path: "/langchain-build" },
{ pkg: { name: "@langchain/eslint" }, path: "/langchain-eslint" },
];

class EnvironmentTestRunner {
Expand Down
56 changes: 0 additions & 56 deletions examples/.eslintrc.cjs

This file was deleted.

18 changes: 18 additions & 0 deletions examples/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { langchainConfig, type ConfigArray } from "@langchain/eslint";

const config: ConfigArray = [
...langchainConfig,
{
files: ["src/**/*.ts"],
rules: {
"no-process-env": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-floating-promises": "off",
"no-instanceof/no-instanceof": "off",
"@typescript-eslint/no-misused-promises": "off",
},
},
];

export default config;
Loading
Loading