Skip to content

Commit f350e2d

Browse files
committed
Commit changes:
- Refactor into a monorepo composed for four packages: - @weaviate/core: shared functionality - @weaviate/node: Node-client that uses `grpc-js` and `fs` - @weaviate/web: Browser-client that uses `nice-grpc` and `FileReader` - @weaviate/test: Tests the public APIs of the core/node pkgs - Replace `jest` with `vitest` - Use `pnpm` for managing the monorepo - Use dependency injection to pipe node/browser deps into the common functionality of the client
1 parent 589a0ab commit f350e2d

File tree

256 files changed

+9932
-1573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+9932
-1573
lines changed

.github/workflows/main.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ jobs:
6363
with:
6464
username: ${{secrets.DOCKER_USERNAME}}
6565
password: ${{secrets.DOCKER_PASSWORD}}
66+
- name: "Transpile the package"
67+
run: npm run build
6668
- name: "Install dependencies"
6769
run: |
6870
npm ci
6971
ci/run_dependencies.sh ${{ matrix.versions.weaviate }}
7072
- name: "Run tests without authentication tests"
7173
run: WEAVIATE_VERSION=${{ matrix.versions.weaviate }} npm test
72-
- name: "Transpile the package"
73-
run: npm run build
7474
- name: "Stop Weaviate"
7575
run: ci/stop_dependencies.sh ${{ matrix.versions.weaviate }}
7676

@@ -94,6 +94,8 @@ jobs:
9494
with:
9595
username: ${{secrets.DOCKER_USERNAME}}
9696
password: ${{secrets.DOCKER_PASSWORD}}
97+
- name: "Transpile the package"
98+
run: npm run build
9799
- name: "Install dependencies"
98100
run: |
99101
npm ci

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
npm run lint:staged

.prettierignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
src/proto/**/*.ts
2-
src/dist/**/*
3-
src/docs/**/*.js
1+
**/proto/**/*.ts
2+
**/dist/**/*
3+
**/docs/**/*.js

package-lock.json

Lines changed: 102 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
{
2-
"name": "weaviate-client",
2+
"name": "@weaviate/client",
33
"version": "3.6.2",
44
"description": "JS/TS client for Weaviate",
5-
"main": "dist/node/cjs/index.js",
65
"type": "module",
7-
"exports": {
8-
".": {
9-
"types": {
10-
"require": "./dist/node/cjs/index.d.ts",
11-
"default": "./dist/node/esm/index.d.ts"
12-
},
13-
"default": {
14-
"require": "./dist/node/cjs/index.js",
15-
"default": "./dist/node/esm/index.js"
16-
}
17-
}
18-
},
196
"engines": {
20-
"node": ">=18.0.0"
7+
"node": ">=20.0.0"
218
},
9+
"private": true,
10+
"workspaces": [
11+
"packages/*"
12+
],
2213
"scripts": {
23-
"test": "jest --no-cache --useStderr --runInBand --detectOpenHandles",
24-
"test:coverage": "npm run test -- --coverage",
25-
"build": "npm run build:node",
26-
"build:web": "tsup",
27-
"build:cjs": "tsc --module commonjs --moduleResolution node10 --outDir dist/node/cjs && touch dist/node/cjs/package.json && echo '{\"type\": \"commonjs\"}' > dist/node/cjs/package.json",
28-
"build:esm": "tsc --outDir dist/node/esm && touch dist/node/esm/package.json && echo '{\"type\": \"module\"}' > dist/node/esm/package.json",
29-
"build:node": "npm run lint && npm run build:cjs && npm run build:esm && prettier --write --no-error-on-unmatched-pattern '**/dist/**/*.{ts,js}'",
14+
"test": "pnpm --filter @weaviate/test test",
3015
"prepack": "npm run build",
3116
"lint": "eslint --ext .ts,.js .",
3217
"lint:fix": "npm run lint -- --fix",
18+
"lint:staged": "npm run format:check && npm run lint -- --cache",
3319
"format": "prettier --write --no-error-on-unmatched-pattern '**/*.{ts,js}' '!dist/**'",
3420
"format:check": "prettier --check --no-error-on-unmatched-pattern '**/*.{ts,js}' '!dist/**'",
3521
"format:dist": "prettier --write --no-error-on-unmatched-pattern '**/dist/**/*.{ts,js}'",
3622
"refresh-schema": "./tools/refresh_schema.sh",
3723
"refresh-protos": "./tools/refresh_protos.sh",
38-
"docs": "typedoc --plugin typedoc-plugin-extras --favicon public/favicon.ico --out docs/ src/"
24+
"docs": "typedoc --plugin typedoc-plugin-extras --favicon public/favicon.ico --out docs/ ./packages/core/src ./packages/node/src ./packages/web/src",
25+
"build:core": "cd packages/core && npm run build",
26+
"build:web": "cd packages/web && npm run build",
27+
"build:node": "cd packages/node && npm run build",
28+
"build:all": "npm run build:core && npm run build:web && npm run build:node"
3929
},
4030
"repository": {
4131
"type": "git",
@@ -50,58 +40,20 @@
5040
"url": "https://github.com/weaviate/typescript-client/issues"
5141
},
5242
"homepage": "https://github.com/weaviate/typescript-client#readme",
53-
"dependencies": {
54-
"abort-controller-x": "^0.4.3",
55-
"graphql": "^16.10.0",
56-
"graphql-request": "^6.1.0",
57-
"long": "^5.2.4",
58-
"nice-grpc": "^2.1.11",
59-
"nice-grpc-client-middleware-retry": "^3.1.10",
60-
"nice-grpc-common": "^2.0.2",
61-
"nice-grpc-web": "^3.3.7",
62-
"uuid": "^9.0.1"
63-
},
6443
"devDependencies": {
65-
"@babel/core": "^7.20.12",
66-
"@babel/preset-typescript": "^7.18.6",
67-
"@babel/runtime": "^7.20.7",
68-
"@curveball/bodyparser": "0.5.0",
69-
"@curveball/core": "0.20.0",
70-
"@curveball/kernel": "0.20.1",
71-
"@rollup/plugin-babel": "^5.3.1",
72-
"@testcontainers/weaviate": "^10.14.0",
73-
"@types/express": "^4.17.21",
74-
"@types/isomorphic-fetch": "^0.0.36",
75-
"@types/jest": "^29.4.0",
76-
"@types/node": "^18.14.0",
77-
"@types/uuid": "^9.0.1",
7844
"@typescript-eslint/eslint-plugin": "^6.21.0",
7945
"@typescript-eslint/parser": "^6.21.0",
80-
"babel-jest": "^29.4.3",
81-
"eslint": "^8.35.0",
82-
"eslint-config-prettier": "^8.7.0",
46+
"eslint": "^8.57.1",
47+
"eslint-config-prettier": "^8.10.0",
8348
"eslint-plugin-prettier": "^4.2.1",
84-
"express": "^4.19.2",
85-
"grpc-tools": "^1.12.4",
8649
"husky": "^8.0.3",
87-
"jest": "^29.4.3",
88-
"lint-staged": "^13.2.0",
89-
"openapi-typescript": "^5.4.1",
90-
"prettier": "^2.8.4",
50+
"lint-staged": "^13.3.0",
51+
"openapi-typescript": "^5.4.2",
52+
"prettier": "^2.8.8",
9153
"prettier-plugin-organize-imports": "^3.2.4",
92-
"protobufjs": "^7.2.6",
93-
"ts-jest": "^29.0.5",
94-
"ts-node": "^10.9.2",
95-
"ts-proto": "^1.163.0",
96-
"tsup": "^8.0.2",
97-
"typedoc": "^0.26.0",
98-
"typedoc-plugin-extras": "^3.0.0",
99-
"typescript": "^5.3.3"
100-
},
101-
"lint-staged": {
102-
"*.{ts,js}": [
103-
"npm run format:check",
104-
"npm run lint -- --cache"
105-
]
54+
"ts-proto": "^1.181.2",
55+
"typedoc": "^0.26.11",
56+
"typedoc-plugin-extras": "^3.1.0",
57+
"typescript": "^5.8.3"
10658
}
10759
}

0 commit comments

Comments
 (0)