Skip to content

Commit e8be385

Browse files
committed
update v to 2.1.0
1 parent 50e7cd3 commit e8be385

2 files changed

Lines changed: 34 additions & 3 deletions

File tree

out/cli.cjs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16272,7 +16272,7 @@ function G3(t, e2) {
1627216272
// package.json
1627316273
var package_default = {
1627416274
name: "opencommit",
16275-
version: "2.0.19",
16275+
version: "2.1.0",
1627616276
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
1627716277
keywords: [
1627816278
"git",
@@ -16313,7 +16313,7 @@ var package_default = {
1631316313
start: "node ./out/cli.cjs",
1631416314
dev: "ts-node ./src/cli.ts",
1631516315
build: "rimraf out && node esbuild.config.js",
16316-
deploy: "npm run build && npm version patch && npm publish --tag latest",
16316+
deploy: "npm run build && npm version patch && git push origin --tags && npm publish --tag latest",
1631716317
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
1631816318
lint: "eslint src --ext ts && tsc --noEmit",
1631916319
format: "prettier --write src"
@@ -21732,6 +21732,17 @@ var OpenAi = class {
2173221732
}
2173321733
};
2173421734
};
21735+
var getOpenCommitLatestVersion = async () => {
21736+
try {
21737+
const { data } = await axios_default.get(
21738+
"https://unpkg.com/opencommit/package.json"
21739+
);
21740+
return data.version;
21741+
} catch (_6) {
21742+
ce("Error while getting the latest version of opencommit");
21743+
return void 0;
21744+
}
21745+
};
2173521746
var api = new OpenAi();
2173621747

2173721748
// src/utils/tokenCount.ts
@@ -22094,6 +22105,25 @@ ${stagedFiles.map((file) => ` ${file}`).join("\n")}`
2209422105
process.exit(0);
2209522106
}
2209622107

22108+
// src/utils/checkIsLatestVersion.ts
22109+
var checkIsLatestVersion = async () => {
22110+
const latestVersion = await getOpenCommitLatestVersion();
22111+
if (latestVersion) {
22112+
const currentVersion = package_default.version;
22113+
if (currentVersion !== latestVersion) {
22114+
console.warn(
22115+
source_default.yellow(
22116+
`
22117+
You are not using the latest stable version of OpenCommit with new features and bug fixes.
22118+
Current version: ${currentVersion}. Latest version: ${latestVersion}.
22119+
\u{1F680} To update run: npm i -g opencommit@latest.
22120+
`
22121+
)
22122+
);
22123+
}
22124+
}
22125+
};
22126+
2209722127
// src/cli.ts
2209822128
var extraArgs = process.argv.slice(2);
2209922129
Z2(
@@ -22106,6 +22136,7 @@ Z2(
2210622136
help: { description: package_default.description }
2210722137
},
2210822138
async () => {
22139+
await checkIsLatestVersion();
2210922140
if (await isHookCalled()) {
2211022141
prepareCommitMessageHook();
2211122142
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"start": "node ./out/cli.cjs",
4242
"dev": "ts-node ./src/cli.ts",
4343
"build": "rimraf out && node esbuild.config.js",
44-
"deploy": "npm run build && npm version patch && npm publish --tag latest",
44+
"deploy": "npm run build:push && npm version patch && git push origin --tags && npm publish --tag latest",
4545
"build:push": "npm run build && git add . && git commit -m 'build' && git push",
4646
"lint": "eslint src --ext ts && tsc --noEmit",
4747
"format": "prettier --write src"

0 commit comments

Comments
 (0)