Compare commits

...

2 Commits

Author SHA1 Message Date
Marcus Schiesser b82031eb64 chore: build main package to run e2e tests 2025-08-05 11:37:53 +08:00
Marcus Schiesser cc567d6023 chore: add e2e tests and use monorepo for TS 2025-08-05 11:27:59 +08:00
13 changed files with 3386 additions and 4353 deletions
-1
View File
@@ -28,7 +28,6 @@ jobs:
with:
node-version-file: "ts/llama_cloud_services/.nvmrc"
- name: Install dependencies
working-directory: ts/llama_cloud_services/
run: pnpm install --no-frozen-lockfile
- name: Run lint
working-directory: ts/llama_cloud_services/
-1
View File
@@ -22,7 +22,6 @@ jobs:
node-version-file: "ts/llama_cloud_services/.nvmrc"
- name: Install dependencies
working-directory: ts/llama_cloud_services
run: pnpm install --no-frozen-lockfile
- name: Build tarball
+7 -2
View File
@@ -30,8 +30,13 @@ jobs:
with:
node-version-file: "ts/llama_cloud_services/.nvmrc"
- name: Install dependencies
working-directory: ts/llama_cloud_services/
run: pnpm install --no-frozen-lockfile
- name: Run tests
- name: Run Build
working-directory: ts/llama_cloud_services/
run: pnpm build
- name: Run Tests
working-directory: ts/llama_cloud_services/
run: pnpm test
- name: Run e2e tests
working-directory: ts/e2e-tests/
run: pnpm test
+3226 -787
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
packages:
- "ts/**"
+23
View File
@@ -0,0 +1,23 @@
{
"name": "@llamaindex/llama-cloud-services-e2e-tests",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"test": "pnpm run test:node16 && pnpm run test:nodenext && pnpm run test:bundler",
"build": "pnpm run build:node16 && pnpm run build:nodenext && pnpm run build:bundler",
"build:node16": "tsc -p src/tsconfig.node16.json --outDir dist/node16",
"test:node16": "pnpm run build:node16 && node --test dist/node16/index.e2e.js",
"build:nodenext": "tsc -p src/tsconfig.nodenext.json --outDir dist/nodenext",
"test:nodenext": "pnpm run build:nodenext && node --test dist/nodenext/index.e2e.js",
"build:bundler": "tsc -p src/tsconfig.bundler.json --outDir dist/bundler",
"test:bundler": "pnpm run build:bundler && node --test dist/bundler/index.e2e.js",
"build:node": "tsc -p src/tsconfig.node.json --outDir dist/node",
"test:node": "pnpm run build:node && node --test dist/node/index.e2e.js"
},
"devDependencies": {
"@types/node": "^24.0.13",
"llama-cloud-services": "workspace:*",
"typescript": "^5.9.2"
}
}
+38
View File
@@ -0,0 +1,38 @@
import { ok } from "node:assert";
import { test } from "node:test";
import { LlamaCloudIndex } from "llama-cloud-services";
import { LlamaParseReader } from "llama-cloud-services";
test("LlamaIndex module resolution test", async (t) => {
await t.test("works with ES module", () => {
const index = new LlamaCloudIndex({
name: "test-index",
projectName: "Default",
});
const reader = new LlamaParseReader({
resultType: "markdown",
verbose: false,
});
ok(index !== undefined);
ok(reader !== undefined);
});
await t.test("works with dynamic imports", async () => {
const mod = await import("llama-cloud-services"); // simulates commonjs
ok(mod !== undefined);
const index = new mod.LlamaCloudIndex({
name: "test-index",
projectName: "Default",
});
ok(index !== undefined);
});
await t.test("all imports work", () => {
const allImports = [
LlamaCloudIndex,
];
ok(allImports.filter(Boolean).length === allImports.length);
});
});
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"target": "esnext",
"outDir": "dist",
"rootDir": ".",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist"]
}
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "node",
"target": "esnext",
"outDir": "dist",
"rootDir": ".",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist"]
}
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "node16",
"moduleResolution": "node16",
"target": "esnext",
"outDir": "dist",
"rootDir": ".",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist"]
}
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"target": "esnext",
"outDir": "dist",
"rootDir": ".",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist"]
}
+34
View File
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"verbatimModuleSyntax": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noUncheckedIndexedAccess": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": true,
"strict": true,
"skipLibCheck": true,
"rootDir": "./src",
"outDir": "./dist/type",
"tsBuildInfoFile": "./dist/.tsbuildinfo",
"incremental": true,
"lib": [
"ES2022",
"DOM",
"DOM.Iterable",
"DOM.AsyncIterable"
],
"types": [
"node"
]
},
"include": [
"./src"
],
"exclude": [
"node_modules"
]
}
File diff suppressed because it is too large Load Diff