openai-api-mock 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +6 -3
- package/{readme.md → README.md} +7 -0
- package/dist/index.cjs.js +2265 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +2265 -0
- package/dist/index.es.js.map +1 -0
- package/jest.config.js +2 -2
- package/package.json +15 -6
- package/vite.config.js +36 -0
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openai-api-mock",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "A Node.js module for mocking OpenAI API responses in a development environment",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,14 +21,22 @@
|
|
|
21
21
|
"ai",
|
|
22
22
|
"artificial intelligence",
|
|
23
23
|
"machine learning"
|
|
24
|
-
],
|
|
24
|
+
],
|
|
25
25
|
"scripts": {
|
|
26
|
+
"build": "vite build",
|
|
26
27
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
27
28
|
"coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage"
|
|
28
29
|
},
|
|
29
30
|
"author": "Chiheb Nabil",
|
|
30
31
|
"license": "MIT",
|
|
31
|
-
"main": "./
|
|
32
|
+
"main": "./dist/index.cjs.js",
|
|
33
|
+
"module": "./dist/index.es.js",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"import": "./dist/index.es.js",
|
|
37
|
+
"require": "./dist/index.cjs.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
32
40
|
"dependencies": {
|
|
33
41
|
"@faker-js/faker": "^9.0.0",
|
|
34
42
|
"nock": "^13.5.4"
|
|
@@ -36,9 +44,10 @@
|
|
|
36
44
|
"devDependencies": {
|
|
37
45
|
"jest": "^29.7.0",
|
|
38
46
|
"node-fetch": "^3.3.2",
|
|
39
|
-
"openai": "^4.52.4"
|
|
47
|
+
"openai": "^4.52.4",
|
|
48
|
+
"vite": "^6.2.0"
|
|
40
49
|
},
|
|
41
50
|
"engines": {
|
|
42
|
-
"node": ">=
|
|
51
|
+
"node": ">=18.0.0"
|
|
43
52
|
}
|
|
44
|
-
}
|
|
53
|
+
}
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import { builtinModules } from 'module';
|
|
3
|
+
|
|
4
|
+
// Get all Node.js built-in modules
|
|
5
|
+
const builtins = builtinModules.filter(m => !m.startsWith('_'));
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
build: {
|
|
9
|
+
lib: {
|
|
10
|
+
entry: './src/index.js',
|
|
11
|
+
name: 'openai-api-mock',
|
|
12
|
+
formats: ['es', 'cjs'],
|
|
13
|
+
fileName: (format) => `index.${format}.js`
|
|
14
|
+
},
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
external: [
|
|
17
|
+
...builtins.map(m => `node:${m}`),
|
|
18
|
+
...builtins,
|
|
19
|
+
'nock',
|
|
20
|
+
'node-fetch',
|
|
21
|
+
'openai'
|
|
22
|
+
],
|
|
23
|
+
output: {
|
|
24
|
+
// Provide global variables to use in UMD build
|
|
25
|
+
globals: {
|
|
26
|
+
nock: 'nock',
|
|
27
|
+
'node-fetch': 'fetch',
|
|
28
|
+
openai: 'OpenAI'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
target: 'node16',
|
|
33
|
+
sourcemap: true,
|
|
34
|
+
minify: false
|
|
35
|
+
}
|
|
36
|
+
});
|