Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nhaouari/obsidian-textgenerator-p…
Browse files Browse the repository at this point in the history
…lugin
  • Loading branch information
haouarihk committed Mar 8, 2024
2 parents 9dfe414 + 92169f0 commit 4e62a5c
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 134 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ root = true
[*]
charset = utf-8
insert_final_newline = true
indent_style = tab
indent_size = 4
tab_width = 4
indent_style = space
indent_size = 2
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Continuous Integration

# This action works with pull requests and pushes on the main branch
on:
pull_request:
push:
branches: [master]

jobs:
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Run Prettier
id: prettier-run
uses: rutajdash/prettier-cli-action@v1.0.0
with:
config_path: ./.prettierrc
file_pattern: "**/*.{ts,tsx,js,md,mdx,css,yaml}"

# This step only runs if prettier finds errors causing the previous step to fail
# This steps lists the files where errors were found
- name: Prettier Output
if: ${{ failure() }}
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{steps.prettier-run.outputs.prettier_output}}"
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pnpm-lock.yaml
postcss.config.js
tailwind.config.js
src/lib/async-handlebars-helper
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
246 changes: 124 additions & 122 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,123 +1,125 @@
{
"name": "obsidian-textgenerator-plugin",
"version": "0.7.5",
"description": "Text generator is a handy plugin that helps you generate text content using GPT-3 (OpenAI).",
"main": "main.js",
"scripts": {
"dev": "npm run build:css && node esbuild.config.mjs",
"build": "npm run build:css && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"eslint": "eslint --fix ./src/**/*.{js,jsx,ts,tsx,json}",
"build:css": "postcss ./src/css/global.css -o styles.css",
"dev:css": "postcss ./src/css/global.css -o styles.css --watch"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@total-typescript/ts-reset": "^0.5.1",
"@types/debug": "^4.1.8",
"@types/lodash.get": "^4.4.7",
"@types/lodash.set": "^4.3.7",
"@types/node": "^16.18.38",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/react-syntax-highlighter": "^15.5.7",
"@types/semver": "^7.5.0",
"@types/three": "^0.155.0",
"@types/turndown": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"builtin-modules": "^3.3.0",
"daisyui": "^3.9.3",
"electron": "^27.0.4",
"esbuild": "0.13.12",
"esbuild-plugin-wasm": "^1.1.0",
"eslint-plugin-tailwindcss": "^3.13.0",
"obsidian": "1.5.7-1",
"prettier": "^3.0.3",
"tslib": "2.6.2",
"typescript": "5.2.2"
},
"dependencies": {
"@chakra-ui/system": "^2.6.2",
"@codemirror/language": "^6.8.0",
"@codemirror/state": "^6.2.1",
"@codemirror/view": "^6.14.1",
"@dqbd/tiktoken": "^1.0.7",
"@emotion/react": "^11",
"@google-ai/generativelanguage": "^1.0.0",
"@huggingface/inference": "^2.6.1",
"@langchain/core": "^0.1.39",
"@langchain/google-genai": "^0.0.9",
"@langchain/openai": "^0.0.15",
"@mozilla/readability": "^0.4.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-slot": "^1.0.2",
"@react-icons/all-files": "^4.1.0",
"@rjsf/core": "^5.15.1",
"@rjsf/utils": "^5.15.1",
"@rjsf/validator-ajv8": "^5.15.1",
"@tabler/icons-react": "^2.25.0",
"@tailwindcss/forms": "^0.5.7",
"@types/lodash.merge": "^4.6.7",
"@vanakat/plugin-api": "^0.1.0",
"ansi-to-html": "^0.7.2",
"autoprefixer": "^10.4.14",
"chakra-react-select": "^4.7.6",
"cheminfo-types": "^1.7.2",
"chromadb": "^1.5.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"compute-cosine-similarity": "^1.0.0",
"cssnano": "^6.0.1",
"debounce": "^2.0.0",
"debug": "^2.6.9",
"esbuild-wasm": "^0.17.19",
"framer-motion": "^5.6.0",
"func-cache": "^2.2.62",
"handlebars": "^4.7.7",
"handlebars-async-helpers": "^1.0.6",
"json-schema": "^0.4.0",
"json5": "^2.2.3",
"langchain": "^0.1.23",
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2",
"lodash.set": "^4.3.2",
"lucide-react": "^0.263.1",
"monaco-editor": "^0.44.0",
"natural": "^5.2.4",
"obsidian-dataview": "^0.5.56",
"postcss-cli": "^10.1.0",
"postcss-import": "^15.1.0",
"pretty-error": "^4.0.0",
"react": "^18.2.0",
"react-confirm-alert": "^3.0.6",
"react-dom": "^18.2.0",
"react-dropdown-tree-select": "^2.8.0",
"react-force-graph": "^1.43.0",
"react-force-graph-3d": "^1.23.0",
"react-markdown": "^8.0.7",
"react-router-dom": "^6.16.0",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"replicate": "^0.16.1",
"request": "^2.88.2",
"rss-parser": "^3.13.0",
"safe-await": "^2.0.0",
"semver": "^7.5.4",
"sse": "github:mpetazzoni/sse.js",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",
"tailwindcss-animate": "^1.0.7",
"tesseract.js": "^4.1.1",
"text-spinners": "^1.0.5",
"three": "^0.155.0",
"turndown": "^7.1.2",
"usehooks-ts": "^2.9.1",
"youtube-transcript": "^1.0.6",
"zod": "^3.21.4",
"zustand": "^4.3.9"
}
}
"name": "obsidian-textgenerator-plugin",
"version": "0.7.5",
"description": "Text generator is a handy plugin that helps you generate text content using GPT-3 (OpenAI).",
"main": "main.js",
"scripts": {
"dev": "npm run build:css && node esbuild.config.mjs",
"build": "npm run build:css && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"eslint": "eslint --fix ./src/**/*.{js,jsx,ts,tsx,json}",
"build:css": "postcss ./src/css/global.css -o styles.css",
"dev:css": "postcss ./src/css/global.css -o styles.css --watch",
"prettier:check": "prettier --check \"**/*.{ts,tsx,js,md,mdx,css,yaml}\"",
"prettier:format": "prettier --write \"**/*.{ts,tsx,js,md,mdx,css,yaml}\""
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@total-typescript/ts-reset": "^0.5.1",
"@types/debug": "^4.1.8",
"@types/lodash.get": "^4.4.7",
"@types/lodash.set": "^4.3.7",
"@types/node": "^16.18.38",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/react-syntax-highlighter": "^15.5.7",
"@types/semver": "^7.5.0",
"@types/three": "^0.155.0",
"@types/turndown": "^5.0.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"builtin-modules": "^3.3.0",
"daisyui": "^3.9.3",
"electron": "^27.0.4",
"esbuild": "0.13.12",
"esbuild-plugin-wasm": "^1.1.0",
"eslint-plugin-tailwindcss": "^3.13.0",
"obsidian": "1.5.7-1",
"prettier": "^3.0.3",
"tslib": "2.6.2",
"typescript": "5.2.2"
},
"dependencies": {
"@chakra-ui/system": "^2.6.2",
"@codemirror/language": "^6.8.0",
"@codemirror/state": "^6.2.1",
"@codemirror/view": "^6.14.1",
"@dqbd/tiktoken": "^1.0.7",
"@emotion/react": "^11",
"@google-ai/generativelanguage": "^1.0.0",
"@huggingface/inference": "^2.6.1",
"@langchain/core": "^0.1.39",
"@langchain/google-genai": "^0.0.9",
"@langchain/openai": "^0.0.15",
"@mozilla/readability": "^0.4.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-slot": "^1.0.2",
"@react-icons/all-files": "^4.1.0",
"@rjsf/core": "^5.15.1",
"@rjsf/utils": "^5.15.1",
"@rjsf/validator-ajv8": "^5.15.1",
"@tabler/icons-react": "^2.25.0",
"@tailwindcss/forms": "^0.5.7",
"@types/lodash.merge": "^4.6.7",
"@vanakat/plugin-api": "^0.1.0",
"ansi-to-html": "^0.7.2",
"autoprefixer": "^10.4.14",
"chakra-react-select": "^4.7.6",
"cheminfo-types": "^1.7.2",
"chromadb": "^1.5.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"compute-cosine-similarity": "^1.0.0",
"cssnano": "^6.0.1",
"debounce": "^2.0.0",
"debug": "^2.6.9",
"esbuild-wasm": "^0.17.19",
"framer-motion": "^5.6.0",
"func-cache": "^2.2.62",
"handlebars": "^4.7.7",
"handlebars-async-helpers": "^1.0.6",
"json-schema": "^0.4.0",
"json5": "^2.2.3",
"langchain": "^0.1.23",
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2",
"lodash.set": "^4.3.2",
"lucide-react": "^0.263.1",
"monaco-editor": "^0.44.0",
"natural": "^5.2.4",
"obsidian-dataview": "^0.5.56",
"postcss-cli": "^10.1.0",
"postcss-import": "^15.1.0",
"pretty-error": "^4.0.0",
"react": "^18.2.0",
"react-confirm-alert": "^3.0.6",
"react-dom": "^18.2.0",
"react-dropdown-tree-select": "^2.8.0",
"react-force-graph": "^1.43.0",
"react-force-graph-3d": "^1.23.0",
"react-markdown": "^8.0.7",
"react-router-dom": "^6.16.0",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"replicate": "^0.16.1",
"request": "^2.88.2",
"rss-parser": "^3.13.0",
"safe-await": "^2.0.0",
"semver": "^7.5.4",
"sse": "github:mpetazzoni/sse.js",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",
"tailwindcss-animate": "^1.0.7",
"tesseract.js": "^4.1.1",
"text-spinners": "^1.0.5",
"three": "^0.155.0",
"turndown": "^7.1.2",
"usehooks-ts": "^2.9.1",
"youtube-transcript": "^1.0.6",
"zod": "^3.21.4",
"zustand": "^4.3.9"
}
}
16 changes: 7 additions & 9 deletions src/models/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,13 @@ export class ExampleModal extends FuzzySuggestModal<PromptTemplate> {
}

getItemText(template: PromptTemplate): string {
return (
template.tags +
((!template.name || !template.id) ? template.path || "" : "") +
(template.name || "") +
this.getItemPackageId(template) +
template.author +
(template.id || "") +
(template.description || "")
);
return `${template.tags || ""} \
${!template.name && !template.id ? template.path || "" : ""} \
${template.id || ""} \
${template.name || ""} \
${this.getItemPackageId(template)} \
${template.author || ""} \
${template.description || ""}`;
}

getItemPackageId(template: PromptTemplate): string {
Expand Down

0 comments on commit 4e62a5c

Please sign in to comment.