mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-14 16:18:02 -05:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea271276c4 | ||
|
|
12f7e7eaf9 | ||
|
|
6490532818 | ||
|
|
e0e953dab8 | ||
|
|
75fa04efd4 | ||
|
|
93019139fb | ||
|
|
ce47c1fe81 | ||
|
|
a880dd6bd2 | ||
|
|
f193bb1d96 | ||
|
|
4cc34dfa5f | ||
|
|
d034238505 | ||
|
|
25acb1c219 | ||
|
|
44c9d48eae | ||
|
|
702eab9ec0 | ||
|
|
e8be3858ab | ||
|
|
50e7cd3576 |
36
out/cli.cjs
36
out/cli.cjs
@@ -16272,7 +16272,7 @@ function G3(t, e2) {
|
|||||||
// package.json
|
// package.json
|
||||||
var package_default = {
|
var package_default = {
|
||||||
name: "opencommit",
|
name: "opencommit",
|
||||||
version: "2.0.19",
|
version: "2.2.3",
|
||||||
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
||||||
keywords: [
|
keywords: [
|
||||||
"git",
|
"git",
|
||||||
@@ -16313,8 +16313,9 @@ var package_default = {
|
|||||||
start: "node ./out/cli.cjs",
|
start: "node ./out/cli.cjs",
|
||||||
dev: "ts-node ./src/cli.ts",
|
dev: "ts-node ./src/cli.ts",
|
||||||
build: "rimraf out && node esbuild.config.js",
|
build: "rimraf out && node esbuild.config.js",
|
||||||
deploy: "npm run build && npm version patch && npm publish --tag latest",
|
deploy: "npm run build:push && npm version patch && npm run postversion",
|
||||||
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
|
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
|
||||||
|
postversion: "npm run build && git add . && git commit --amend --no-edit && git push && git push --tags && npm publish --tag latest",
|
||||||
lint: "eslint src --ext ts && tsc --noEmit",
|
lint: "eslint src --ext ts && tsc --noEmit",
|
||||||
format: "prettier --write src"
|
format: "prettier --write src"
|
||||||
},
|
},
|
||||||
@@ -21732,6 +21733,17 @@ var OpenAi = class {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
var getOpenCommitLatestVersion = async () => {
|
||||||
|
try {
|
||||||
|
const { data } = await axios_default.get(
|
||||||
|
"https://unpkg.com/opencommit/package.json"
|
||||||
|
);
|
||||||
|
return data.version;
|
||||||
|
} catch (_6) {
|
||||||
|
ce("Error while getting the latest version of opencommit");
|
||||||
|
return void 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
var api = new OpenAi();
|
var api = new OpenAi();
|
||||||
|
|
||||||
// src/utils/tokenCount.ts
|
// src/utils/tokenCount.ts
|
||||||
@@ -22094,6 +22106,25 @@ ${stagedFiles.map((file) => ` ${file}`).join("\n")}`
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// src/utils/checkIsLatestVersion.ts
|
||||||
|
var checkIsLatestVersion = async () => {
|
||||||
|
const latestVersion = await getOpenCommitLatestVersion();
|
||||||
|
if (latestVersion) {
|
||||||
|
const currentVersion = package_default.version;
|
||||||
|
if (currentVersion !== latestVersion) {
|
||||||
|
console.warn(
|
||||||
|
source_default.yellow(
|
||||||
|
`
|
||||||
|
You are not using the latest stable version of OpenCommit with new features and bug fixes.
|
||||||
|
Current version: ${currentVersion}. Latest version: ${latestVersion}.
|
||||||
|
\u{1F680} To update run: npm i -g opencommit@latest.
|
||||||
|
`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// src/cli.ts
|
// src/cli.ts
|
||||||
var extraArgs = process.argv.slice(2);
|
var extraArgs = process.argv.slice(2);
|
||||||
Z2(
|
Z2(
|
||||||
@@ -22106,6 +22137,7 @@ Z2(
|
|||||||
help: { description: package_default.description }
|
help: { description: package_default.description }
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
|
await checkIsLatestVersion();
|
||||||
if (await isHookCalled()) {
|
if (await isHookCalled()) {
|
||||||
prepareCommitMessageHook();
|
prepareCommitMessageHook();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "opencommit",
|
"name": "opencommit",
|
||||||
"version": "2.0.19",
|
"version": "2.2.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "opencommit",
|
"name": "opencommit",
|
||||||
"version": "2.0.19",
|
"version": "2.2.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "opencommit",
|
"name": "opencommit",
|
||||||
"version": "2.0.19",
|
"version": "2.2.4",
|
||||||
"description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
|
"description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"git",
|
"git",
|
||||||
@@ -41,8 +41,9 @@
|
|||||||
"start": "node ./out/cli.cjs",
|
"start": "node ./out/cli.cjs",
|
||||||
"dev": "ts-node ./src/cli.ts",
|
"dev": "ts-node ./src/cli.ts",
|
||||||
"build": "rimraf out && node esbuild.config.js",
|
"build": "rimraf out && node esbuild.config.js",
|
||||||
"deploy": "npm run build && npm version patch && npm publish --tag latest",
|
"deploy": "npm run build:push && npm version patch && npm run postversion",
|
||||||
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
|
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
|
||||||
|
"postversion": "npm run build && git add . && git commit --amend --no-edit && git push && git push --tags && npm publish --tag latest",
|
||||||
"lint": "eslint src --ext ts && tsc --noEmit",
|
"lint": "eslint src --ext ts && tsc --noEmit",
|
||||||
"format": "prettier --write src"
|
"format": "prettier --write src"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { configCommand } from './commands/config';
|
|||||||
import { hookCommand, isHookCalled } from './commands/githook.js';
|
import { hookCommand, isHookCalled } from './commands/githook.js';
|
||||||
import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook';
|
import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook';
|
||||||
import { commit } from './commands/commit';
|
import { commit } from './commands/commit';
|
||||||
// import { checkIsLatestVersion } from './utils/checkIsLatestVersion';
|
import { checkIsLatestVersion } from './utils/checkIsLatestVersion';
|
||||||
|
|
||||||
const extraArgs = process.argv.slice(2);
|
const extraArgs = process.argv.slice(2);
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ cli(
|
|||||||
help: { description: packageJSON.description }
|
help: { description: packageJSON.description }
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
// await checkIsLatestVersion();
|
await checkIsLatestVersion();
|
||||||
|
|
||||||
if (await isHookCalled()) {
|
if (await isHookCalled()) {
|
||||||
prepareCommitMessageHook();
|
prepareCommitMessageHook();
|
||||||
|
|||||||
Reference in New Issue
Block a user