Skip to content

Commit

Permalink
remove from LlamaIndexTS
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusschiesser committed Mar 13, 2024
1 parent d919422 commit 403fc6f
Show file tree
Hide file tree
Showing 17 changed files with 4,887 additions and 28 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": true,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/hot-windows-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-llama": patch
---

fix missing .env value, improve docs and error message
26 changes: 9 additions & 17 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
{
"root": false,
"extends": [
"prettier"
],
"rules": {
"turbo/no-undeclared-env-vars": [
"max-params": [
"error",
{
"allowList": [
"OPENAI_API_KEY",
"LLAMA_CLOUD_API_KEY",
"npm_config_user_agent",
"http_proxy",
"https_proxy",
"MODEL",
"NEXT_PUBLIC_CHAT_API",
"NEXT_PUBLIC_MODEL"
]
}
]
}
}
4
],
"prefer-const": "error",
},
}
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bugfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Bugfix
title: ""
description: Write something like "We notice ... behavior when ... happens instead of ..."
body:
- type: textarea
id: description
attributes:
label: Details
description: More details about the bug
placeholder: The bug might be in ... file
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Feature Request
title: ""
description: Write something like "Write an api endpoint that does "..." in the "..." file".
body:
- type: textarea
id: description
attributes:
label: Details
description: More details
placeholder: The new endpoint should use the ... class from ... file because it contains ... logic
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Refactor
title: ""
description: Write something like "Modify the ... api endpoint to use ... version and ... framework"
body:
- type: textarea
id: description
attributes:
label: Details
description: More details
placeholder: We are migrating this function to ... version because ...
65 changes: 65 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: E2E Tests
on:
push:
branches: [main]
pull_request:
branches: [main]

env:
POETRY_VERSION: "1.6.1"

jobs:
e2e:
name: create-llama
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
node-version: [18, 20]
python-version: ["3.11"]
os: [macos-latest, windows-latest]
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
- uses: pnpm/action-setup@v2
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
working-directory: .
- name: Build create-llama
run: pnpm run build
working-directory: .
- name: Pack
run: pnpm pack --pack-destination ./output
working-directory: .
- name: Extract Pack
run: tar -xvzf ./output/*.tgz -C ./output
working-directory: .
- name: Run Playwright tests
run: pnpm exec playwright test
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
working-directory: .
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./playwright-report/
retention-days: 30
29 changes: 29 additions & 0 deletions .github/workflows/lint_on_push_or_pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint on push or pull request

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm run lint
- name: Run Prettier
run: pnpm run format
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnpm-store
.pnp.js

# testing
coverage

# next.js
.next/
out/
build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# build
dist/
lib/

# e2e
.cache
test-results/
playwright-report/
blob-report/
playwright/.cache/
.tsbuildinfo
e2e/cache

# intellij
**/.idea
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm format
pnpm lint
3 changes: 3 additions & 0 deletions .pretter.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ["prettier-plugin-organize-imports"],
};
6 changes: 0 additions & 6 deletions helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from "fs/promises";
import os from "os";
import path from "path";
import { bold, cyan } from "picocolors";
import { version } from "../../core/package.json";
import { copy } from "../helpers/copy";
import { callPackageManager } from "../helpers/install";
import { templatesDir } from "./dir";
Expand Down Expand Up @@ -156,11 +155,6 @@ export const installTSTemplate = async ({
packageJson.name = appName;
packageJson.version = "0.1.0";

packageJson.dependencies = {
...packageJson.dependencies,
llamaindex: version,
};

if (framework === "nextjs" && customApiPath) {
console.log(
"\nUsing external API with custom API path:",
Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
],
"scripts": {
"clean": "rimraf --glob ./dist ./templates/**/__pycache__ ./templates/**/node_modules ./templates/**/poetry.lock",
"format": "prettier --ignore-unknown --cache --check .",
"format:write": "prettier --ignore-unknown --write .",
"dev": "ncc build ./index.ts -w -o dist/",
"build": "npm run clean && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register",
"lint": "eslint . --ignore-pattern dist --ignore-pattern e2e/cache",
"e2e": "playwright test",
"prepublishOnly": "cd ../../ && pnpm run build:release"
"prepare": "husky",
"release": "pnpm run build && changeset publish",
"new-version": "pnpm run build && changeset version"
},
"devDependencies": {
"@playwright/test": "^1.41.1",
Expand Down Expand Up @@ -53,7 +57,14 @@
"terminal-link": "^3.0.0",
"update-check": "1.5.4",
"validate-npm-package-name": "3.0.0",
"wait-port": "^1.1.0"
"wait-port": "^1.1.0",
"@changesets/cli": "^2.27.1",
"eslint": "^8.56.0",
"husky": "^9.0.10",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"typescript": "^5.3.3",
"eslint-config-prettier": "^8.10.0"
},
"engines": {
"node": ">=16.14.0"
Expand Down
Loading

0 comments on commit 403fc6f

Please sign in to comment.