aicommits 0.1.4 → 0.1.5

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.
@@ -76,7 +76,7 @@ async function main() {
76
76
  });
77
77
  }
78
78
 
79
- async function generateCommitMessage(prompt) {
79
+ async function generateCommitMessage(prompt: string) {
80
80
  const payload = {
81
81
  model: "text-davinci-003",
82
82
  prompt,
@@ -97,7 +97,7 @@ async function generateCommitMessage(prompt) {
97
97
  body: JSON.stringify(payload),
98
98
  });
99
99
 
100
- const json = await response.json();
100
+ const json: any = await response.json();
101
101
  const aiCommit = json.choices[0].text;
102
102
 
103
103
  return aiCommit.replace(/(\r\n|\n|\r)/gm, "");
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "aicommits",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Writes your git commit messages for you with AI",
5
- "main": "index.js",
5
+ "main": "bin/index.js",
6
6
  "bin": {
7
- "aicommits": "./index.js"
7
+ "aicommits": "bin/index.js"
8
8
  },
9
- "type": "module",
10
9
  "repository": "https://github.com/Nutlope/aicommits",
11
10
  "author": "Hassan El Mghari (@nutlope)",
12
11
  "license": "MIT",
12
+ "scripts": {
13
+ "build": "tsc"
14
+ },
13
15
  "dependencies": {
14
16
  "chalk": "^5.2.0",
15
17
  "inquirer": "^9.1.4",
16
- "node-fetch": "^3.3.0"
18
+ "node-fetch": "^3.3.0",
19
+ "typescript": "^4.9.5"
17
20
  }
18
21
  }
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
4
+ "module": "commonjs" /* Specify what module code is generated. */,
5
+ "outDir": "./bin" /* Specify an output folder for all emitted files. */,
6
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
7
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
8
+ "strict": true /* Enable all strict type-checking options. */,
9
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
10
+ },
11
+ "exclude": ["node_modules"]
12
+ }
package/.example.env.json DELETED
@@ -1 +0,0 @@
1
- { "OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxx" }