Skip to content

Commit

Permalink
Force commonjs and added examples (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnadeau authored Mar 10, 2023
1 parent 4642242 commit 8ba4241
Show file tree
Hide file tree
Showing 14 changed files with 732 additions and 3 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.github/
ci/
coverage/
examples/
test/
**/*.test.ts
.babelrc
Expand Down
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ esbuild.build({
'isomorphic-fetch',
'graphql-request'
],
format: 'esm',
format: 'cjs',
logLevel: "info",
metafile: true,
minify: true,
Expand Down
2 changes: 2 additions & 0 deletions examples/javascript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules

10 changes: 10 additions & 0 deletions examples/javascript/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const weaviate = require("weaviate-ts-client")

const client = weaviate.client({
scheme: "http",
host: "localhost:8080",
});

client.misc.metaGetter()
.do()
.then((res) => console.log(`res: ${JSON.stringify(res)}`))
315 changes: 315 additions & 0 deletions examples/javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "weaviate-js-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"weaviate-ts-client": "latest"
},
"scripts": {
"start": "node index.js"
},
"author": "",
"license": "ISC"
}
2 changes: 2 additions & 0 deletions examples/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
10 changes: 10 additions & 0 deletions examples/typescript/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import weaviate from "weaviate-ts-client"

const client = weaviate.client({
scheme: "http",
host: "localhost:8080",
});

client.misc.metaGetter()
.do()
.then((res: any) => console.log(`res: ${JSON.stringify(res)}`))
Loading

0 comments on commit 8ba4241

Please sign in to comment.