Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Feature/ts tsup #73

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:
extends: google
ignorePatterns:
- examples/chat-react/
- dist/
parserOptions:
ecmaVersion: latest
sourceType: module
Expand Down
17 changes: 17 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { JestConfigWithTsJest } from 'ts-jest';


const config: JestConfigWithTsJest = {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
moduleNameMapper: {
'^@mistralai/mistralai$': '<rootDir>/src/index.ts',
},
modulePathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDIr>/examples/'
],
};

export default config;

3,543 changes: 3,387 additions & 156 deletions package-lock.json

Large diffs are not rendered by default.

27 changes: 20 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,39 @@
"author": "[email protected]",
"license": "ISC",
"type": "module",
"main": "src/client.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"clean": "rimraf ./dist",
"build": "npm run clean && tsup",
"lint": "./node_modules/.bin/eslint .",
"test": "node --experimental-vm-modules node_modules/.bin/jest"
},
"jest": {
"testPathIgnorePatterns": ["examples"]
"fix": "./node_modules/.bin/eslint . --fix",
"test": "jest"
},
"repository": {
"type": "git",
"url": "https://github.com/mistralai/client-js"
},
"types": "src/client.d.ts",
"dependencies": {
"node-fetch": "^2.6.7"
},
"devDependencies": {
"@babel/preset-env": "^7.24.5",
"@babel/preset-typescript": "^7.24.1",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.10",
"@types/node-fetch": "^2.6.11",
"eslint": "^8.55.0",
"eslint-config-google": "^0.14.0",
"jest": "^29.7.0",
"jest-mock": "^29.7.0",
"prettier": "2.8.8",
"jest": "^29.7.0"
"rimraf": "^5.0.7",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tsup": "^8.0.2",
"typescript": "^5.4.5"
}
}
194 changes: 0 additions & 194 deletions src/client.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as MistralClient } from './mistral-client';
Loading