Compare commits

..

7 Commits

Author SHA1 Message Date
di-sukharev
1499bbeb18 0.0.20 2023-03-06 22:23:52 +08:00
di-sukharev
ffd5d9967a * 📝 docs(README.md): remove commented out section on Git hook
The section on Git hook was previously commented out, but it is now included in the README.md file.

* 🐛 fix(package.json): change cli file extension from .mjs to .cjs
* 🚀 chore(package.json): remove unnecessary banner from build script
The cli file extension has been changed from .mjs to .cjs to ensure compatibility with Node.js versions that do not support ECMAScript modules. The banner in the build script has been removed as it is no longer necessary with the change in file extension.

* 🐛 fix(githook.ts): change HOOK_PATH to HOOK_URL
The HOOK_PATH variable was changed to HOOK_URL to fix an issue where the symlink was not being created correctly. The HOOK_URL variable now uses the __filename global variable to get the path of the current file.

* 🐛 fix(tsconfig.json): change target to ES2020 and module to CommonJS
The target version of JavaScript has been changed to ES2020 to take advantage of the latest features of the language. The module has been changed to CommonJS to ensure compatibility with Node.js.
2023-03-06 22:23:46 +08:00
di-sukharev
1a32bff538 0.0.19 2023-03-06 22:13:32 +08:00
di-sukharev
297ccac45b * 🐛 fix(package.json): change cli file extension from .cjs to .mjs
* 🐛 fix(githook.ts): change cli file path to match new extension
The cli file extension has been changed from .cjs to .mjs to improve compatibility with Node.js ESM modules. The file path in githook.ts has been updated to match the new extension.
2023-03-06 22:12:37 +08:00
di-sukharev
3859533eff * 🐛 fix(githook.ts): fix HOOK_PATH import URL
The HOOK_PATH import URL was incorrect and has been fixed to point to the correct location.
2023-03-06 21:49:19 +08:00
di-sukharev
757faba0c4 0.0.18 2023-03-06 21:42:05 +08:00
di-sukharev
422d38d51e * 🐛 fix(githook.ts): update HOOK_PATH to point to the correct file path
The HOOK_PATH variable was pointing to the wrong file path, which caused the hook to fail. The file path has been updated to point to the correct file path.
2023-03-06 21:41:58 +08:00
5 changed files with 12 additions and 12 deletions

View File

@@ -83,7 +83,7 @@ To remove description:
opencommit config set description=false
```
<!-- ## Git hook
## Git hook
You can set opencommit as Git [`prepare-commit-msg`](https://git-scm.com/docs/githooks#_prepare_commit_msg) hook. Hook integrates with you IDE Source Control and allows you edit the message before commit.
@@ -106,7 +106,7 @@ To use the hook:
git commit
```
Or follow the process of your IDE Source Control feature, when it calls `git commit` command — OpenCommit will integrate into the flow. -->
Or follow the process of your IDE Source Control feature, when it calls `git commit` command — OpenCommit will integrate into the flow.
## Payments

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "open-commit",
"version": "0.0.17",
"version": "0.0.20",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "open-commit",
"version": "0.0.17",
"version": "0.0.20",
"license": "ISC",
"dependencies": {
"@clack/prompts": "^0.6.1",

View File

@@ -1,6 +1,6 @@
{
"name": "opencommit",
"version": "0.0.17",
"version": "0.0.20",
"description": "AI generates conventional commits with mind-blowing accuracy.",
"keywords": [
"git",

View File

@@ -20,7 +20,7 @@ export const hookCommand = command(
parameters: ['<set/unset>']
},
async (argv) => {
const HOOK_PATH = fileURLToPath(new URL('cli.cjs', import.meta.url));
const HOOK_URL = __filename;
try {
await assertGitRepo();
@@ -39,7 +39,7 @@ export const hookCommand = command(
realPath = null;
}
if (realPath === HOOK_PATH)
if (realPath === HOOK_URL)
return outro(`opencommit is already set as '${HOOK_NAME}'`);
throw new Error(
@@ -48,7 +48,7 @@ export const hookCommand = command(
}
await fs.mkdir(path.dirname(SYMLINK_URL), { recursive: true });
await fs.symlink(HOOK_PATH, SYMLINK_URL, 'file');
await fs.symlink(HOOK_URL, SYMLINK_URL, 'file');
await fs.chmod(SYMLINK_URL, 0o755);
return outro(`${chalk.green('✔')} Hook set`);
@@ -64,7 +64,7 @@ export const hookCommand = command(
}
const realpath = await fs.realpath(SYMLINK_URL);
if (realpath !== HOOK_PATH) {
if (realpath !== HOOK_URL) {
return outro(
`opencommit wasn't previously set as '${HOOK_NAME}' hook, but different hook was, if you want to remove it — do it manually`
);

View File

@@ -3,13 +3,13 @@
/* Projects */
/* Language and Environment */
"target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": [
"ES6"
"ES5"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
/* Modules */
"module": "ESNext" /* Specify what module code is generated. */,
"module": "CommonJS" /* Specify what module code is generated. */,
// "rootDir": "./src" /* Specify the root folder within your source files. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"resolveJsonModule": true /* Enable importing .json files. */,