Skip to content

Commit

Permalink
Merge pull request #1 from awhiteside1/structure
Browse files Browse the repository at this point in the history
Setup Packages
  • Loading branch information
awhiteside1 authored Sep 16, 2024
2 parents 6f28f01 + e5280ee commit a7cc62c
Show file tree
Hide file tree
Showing 36 changed files with 4,594 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Workflow
on:
push:

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use 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: Lint
run: pnpm lint
- name: Build
run: pnpm build
135 changes: 135 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

**/dist/
dist/
.idea/
Empty file added .npmrc
Empty file.
37 changes: 37 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"files": {
"ignoreUnknown": true
},
"vcs": {
"clientKind": "git",
"useIgnoreFile": true,
"enabled": true,
"defaultBranch": "main"
},
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"formatWithErrors": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"json": {
"formatter": {
"enabled": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded",
"jsxQuoteStyle": "double"
}
}
}
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "payload-llm-plugins",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "biome check .",
"build": "pnpm run -r build",
"clean": "find . -type d -name \"dist\" -exec rm -r {} +"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"vite": "^5.4.5",
"vite-tsconfig-paths": "^5.0.1",
"@biomejs/biome": "^1.9.1",
"@tsconfig/next": "^2.0.3",
"@tsconfig/node-lts": "^20.1.3",
"tsx": "^4.19.1",
"vitest": "^2.1.1",
"typescript": "^5.6.2",
"unbuild": "^2.0.0",
"payload": "^3.0.0-beta.106"
}
}
8 changes: 8 additions & 0 deletions packages/chat/e2e/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect } from 'vitest'
import { adder } from '../src'

describe('Semantic Search', () => {
it('should work', () => {
expect(adder(1, 1)).toEqual(2)
})
})
21 changes: 21 additions & 0 deletions packages/chat/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@payload-llm-plugins/chat",
"type": "module",
"types": "./dist/index.d.ts",
"module": "./dist/index.mjs",
"files": ["dist/"],
"exports": {
".": {
"types": "./src/index.ts",
"default": "./dist/index.mjs"
}
},
"scripts": {
"test": "vitest --run",
"bench": "vitest --run bench",
"build:stub": "unbuild --stub",
"build": "unbuild",
"postinstall": "pnpm build:stub"
},
"devDependencies": {}
}
1 change: 1 addition & 0 deletions packages/chat/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const adder = (a: number, b: number) => a + b
8 changes: 8 additions & 0 deletions packages/chat/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.lib.json" },
{ "path": "./tsconfig.test.json" }
]
}
13 changes: 13 additions & 0 deletions packages/chat/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["./tsconfig.json"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"noEmit": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["**/*.spec.ts", "**/*.bench.ts", "./dist/**", "vite.config.ts"]
}
10 changes: 10 additions & 0 deletions packages/chat/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["./tsconfig.json"],
"compilerOptions": {
"noEmit": true,
"target": "ESNext",
"types": ["vitest/globals"]
},
"include": ["**/*.spec.ts", "**/*.bench.ts", "vite.config.ts", "e2e"],
"exclude": ["./dist/**"]
}
10 changes: 10 additions & 0 deletions packages/chat/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'vitest/config'

export default defineConfig({
plugins: [tsconfigPaths()],

test: {
globals: true,
},
})
8 changes: 8 additions & 0 deletions packages/llm-tools/e2e/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect } from 'vitest'
import { adder } from '../src'

describe('Semantic Search', () => {
it('should work', () => {
expect(adder(1, 1)).toEqual(2)
})
})
21 changes: 21 additions & 0 deletions packages/llm-tools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@payload-llm-plugins/llm-tools",
"type": "module",
"types": "./dist/index.d.ts",
"module": "./dist/index.mjs",
"files": ["dist/"],
"exports": {
".": {
"types": "./src/index.ts",
"default": "./dist/index.mjs"
}
},
"scripts": {
"test": "vitest --run",
"bench": "vitest --run bench",
"build:stub": "unbuild --stub",
"build": "unbuild",
"postinstall": "pnpm build:stub"
},
"devDependencies": {}
}
1 change: 1 addition & 0 deletions packages/llm-tools/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const adder = (a: number, b: number) => a + b
8 changes: 8 additions & 0 deletions packages/llm-tools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"references": [
{ "path": "./tsconfig.lib.json" },
{ "path": "./tsconfig.test.json" }
]
}
13 changes: 13 additions & 0 deletions packages/llm-tools/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": ["./tsconfig.json"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"noEmit": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*.ts"],
"exclude": ["**/*.spec.ts", "**/*.bench.ts", "./dist/**", "vite.config.ts"]
}
10 changes: 10 additions & 0 deletions packages/llm-tools/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["./tsconfig.json"],
"compilerOptions": {
"noEmit": true,
"target": "ESNext",
"types": ["vitest/globals"]
},
"include": ["**/*.spec.ts", "**/*.bench.ts", "vite.config.ts", "e2e"],
"exclude": ["./dist/**"]
}
10 changes: 10 additions & 0 deletions packages/llm-tools/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'vitest/config'

export default defineConfig({
plugins: [tsconfigPaths()],

test: {
globals: true,
},
})
8 changes: 8 additions & 0 deletions packages/llm-utils/e2e/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect } from 'vitest'
import { adder } from '../src'

describe('Semantic Search', () => {
it('should work', () => {
expect(adder(1, 1)).toEqual(2)
})
})
Loading

0 comments on commit a7cc62c

Please sign in to comment.