Skip to content

Commit 51926d7

Browse files
feat: allow installing package directly from github (#522)
1 parent 7626655 commit 51926d7

File tree

3 files changed

+53
-42
lines changed

3 files changed

+53
-42
lines changed

package.json

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,53 @@
11
{
22
"name": "openai",
33
"version": "4.19.1",
4-
"description": "Client library for the OpenAI API",
4+
"description": "The official TypeScript library for the OpenAI API",
55
"author": "OpenAI <[email protected]>",
66
"types": "dist/index.d.ts",
77
"main": "dist/index.js",
88
"type": "commonjs",
99
"repository": "github:openai/openai-node",
1010
"license": "Apache-2.0",
1111
"private": false,
12+
"scripts": {
13+
"test": "bin/check-test-server && yarn jest",
14+
"build": "bash ./build",
15+
"prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1",
16+
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
17+
"format": "prettier --write --cache --cache-strategy metadata . !dist",
18+
"prepare": "npm run build",
19+
"tsn": "ts-node -r tsconfig-paths/register",
20+
"lint": "eslint --ext ts,js .",
21+
"fix": "eslint --fix --ext ts,js ."
22+
},
23+
"dependencies": {
24+
"@types/node": "^18.11.18",
25+
"@types/node-fetch": "^2.6.4",
26+
"abort-controller": "^3.0.0",
27+
"agentkeepalive": "^4.2.1",
28+
"digest-fetch": "^1.3.0",
29+
"form-data-encoder": "1.7.2",
30+
"formdata-node": "^4.3.2",
31+
"node-fetch": "^2.6.7",
32+
"web-streams-polyfill": "^3.2.1"
33+
},
34+
"devDependencies": {
35+
"@types/jest": "^29.4.0",
36+
"@typescript-eslint/eslint-plugin": "^6.7.0",
37+
"@typescript-eslint/parser": "^6.7.0",
38+
"eslint": "^8.49.0",
39+
"eslint-plugin-prettier": "^4.0.0",
40+
"eslint-plugin-unused-imports": "^2.0.0",
41+
"jest": "^29.4.0",
42+
"openai": "file:.",
43+
"prettier": "rattrayalex/prettier#postfix-ternaries",
44+
"ts-jest": "^29.1.0",
45+
"ts-morph": "^19.0.0",
46+
"ts-node": "^10.5.0",
47+
"tsc-multi": "^1.1.0",
48+
"tsconfig-paths": "^4.0.0",
49+
"typescript": "^4.8.2"
50+
},
1251
"sideEffects": [
1352
"./_shims/index.js",
1453
"./_shims/index.mjs",
@@ -75,43 +114,5 @@
75114
"default": "./dist/*.mjs"
76115
}
77116
},
78-
"scripts": {
79-
"test": "bin/check-test-server && yarn jest",
80-
"build": "bash ./build",
81-
"prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1",
82-
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
83-
"format": "prettier --write --cache --cache-strategy metadata . !dist",
84-
"tsn": "ts-node -r tsconfig-paths/register",
85-
"lint": "eslint --ext ts,js .",
86-
"fix": "eslint --fix --ext ts,js ."
87-
},
88-
"dependencies": {
89-
"@types/node": "^18.11.18",
90-
"@types/node-fetch": "^2.6.4",
91-
"abort-controller": "^3.0.0",
92-
"agentkeepalive": "^4.2.1",
93-
"digest-fetch": "^1.3.0",
94-
"form-data-encoder": "1.7.2",
95-
"formdata-node": "^4.3.2",
96-
"node-fetch": "^2.6.7",
97-
"web-streams-polyfill": "^3.2.1"
98-
},
99-
"devDependencies": {
100-
"@types/jest": "^29.4.0",
101-
"@typescript-eslint/eslint-plugin": "^6.7.0",
102-
"@typescript-eslint/parser": "^6.7.0",
103-
"eslint": "^8.49.0",
104-
"eslint-plugin-prettier": "^4.0.0",
105-
"eslint-plugin-unused-imports": "^2.0.0",
106-
"jest": "^29.4.0",
107-
"openai": "link:.",
108-
"prettier": "rattrayalex/prettier#postfix-ternaries",
109-
"ts-jest": "^29.1.0",
110-
"ts-morph": "^19.0.0",
111-
"ts-node": "^10.5.0",
112-
"tsc-multi": "^1.1.0",
113-
"tsconfig-paths": "^4.0.0",
114-
"typescript": "^4.8.2"
115-
},
116117
"bin": "./bin/cli"
117118
}

scripts/make-dist-package-json.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ for (const key of ['types', 'main', 'module']) {
1616
delete pkgJson.devDependencies;
1717
delete pkgJson.scripts.prepack;
1818
delete pkgJson.scripts.prepublishOnly;
19+
delete pkgJson.scripts.postinstall;
1920

2021
console.log(JSON.stringify(pkgJson, null, 2));

yarn.lock

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3062,9 +3062,18 @@ onetime@^5.1.2:
30623062
dependencies:
30633063
mimic-fn "^2.1.0"
30643064

3065-
"openai@link:.":
3066-
version "0.0.0"
3067-
uid ""
3065+
"openai@file:.":
3066+
version "4.19.1"
3067+
dependencies:
3068+
"@types/node" "^18.11.18"
3069+
"@types/node-fetch" "^2.6.4"
3070+
abort-controller "^3.0.0"
3071+
agentkeepalive "^4.2.1"
3072+
digest-fetch "^1.3.0"
3073+
form-data-encoder "1.7.2"
3074+
formdata-node "^4.3.2"
3075+
node-fetch "^2.6.7"
3076+
web-streams-polyfill "^3.2.1"
30683077

30693078
optionator@^0.9.3:
30703079
version "0.9.3"

0 commit comments

Comments
 (0)