-
Notifications
You must be signed in to change notification settings - Fork 368
Feature/modify env location #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
stephansama
wants to merge
42
commits into
di-sukharev:dev
from
stephansama:feature/modify-env-location
Closed
Feature/modify env location #479
stephansama
wants to merge
42
commits into
di-sukharev:dev
from
stephansama:feature/modify-env-location
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change allows opencommit to locate commitlint installed globally (with opencommit), which is useful for project that does not use node.js environment or dose not have opencommit and @commitlint installed locally.
feat(commitlint): add additional search path for @commitlint
This update introduces a new structure for generating commit messages by defining a constant for commit types and consolidating the logic into a single function. The changes enhance readability and maintainability while ensuring consistent formatting based on the OCO_OMIT_SCOPE configuration.
…ve-consistency-handling refactor(prompts): streamline commit message generation logic
…and improve configurations Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
feat(package.json): add overrides for ajv and whatwg-url packages fix(deepseek.ts): correct import path for OpenAiEngine and OpenAiConfig
Fix the punycode deprecated message from the source (survives building from eslint.config.ts).
chore: update GitHub Actions workflows to use latest action versions and improve configurations
Extends di-sukharev#445 to other providers which many provides deepseek
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
… improved clarity and consistency The commitlint configuration and prompts have been refactored to enhance clarity and maintain consistency throughout the codebase. The type assertion for commitLintConfig is updated to use 'as any' for better type handling. Additionally, formatting adjustments are made in the prompts to ensure proper readability and alignment with the defined conventions. These changes aim to streamline the commit message generation process and improve overall code maintainability.
…ved file management Including rimraf in the project allows for easier and more efficient removal of files and directories, enhancing the development workflow, especially for tasks like cleaning up build artifacts.
Resolves persistent `ReferenceError: exports is not defined` errors encountered during unit tests (`unit-test (20.x)` job) in the GitHub Actions CI environment. These errors occurred specifically when importing `cli-testing-library` in the global Jest setup file (`test/jest-setup.ts`), despite tests passing locally with the same Node.js version (v20.19.0). After iterative testing, the following Jest configuration combination was identified as necessary to ensure consistent ESM handling and test success in both local and CI environments: - Set preset to `ts-jest/presets/default-esm` for stricter ESM rules. - Configured `transformIgnorePatterns` to ensure Jest transforms specific ESM dependencies (`cli-testing-library`, `@clack`, `cleye`) within `node_modules`. - Expanded the `transform` pattern (`^.+\\.(ts|tsx|js|jsx|mjs)$`) to explicitly cover various script types handled by `ts-jest`. - Included explicit `tsconfig` overrides (`module: 'ESNext'`, `target: 'ES2022'`) within the `ts-jest` transform options to resolve potential environment discrepancies. - Retained `moduleNameMapper` for `.js` imports for reliable module resolution. - Ensured `cli-testing-library` imports remain in the global setup (`test/jest-setup.ts`). - Removed test cache clearing from the `test:unit` script in `package.json`. This configuration now passes reliably across environments.
The space normalization logic is updated to replace only multiple spaces and tabs with a single space, while preserving newlines. This change ensures that the formatting of the content is maintained, especially when dealing with empty line requirements and max line length.
…ved file management Including rimraf in the project allows for easier and more efficient removal of files and directories, enhancing the development workflow, especially for tasks like cleaning up build artifacts.
Resolves persistent `ReferenceError: exports is not defined` errors encountered during unit tests (`unit-test (20.x)` job) in the GitHub Actions CI environment. These errors occurred specifically when importing `cli-testing-library` in the global Jest setup file (`test/jest-setup.ts`), despite tests passing locally with the same Node.js version (v20.19.0). After iterative testing, the following Jest configuration combination was identified as necessary to ensure consistent ESM handling and test success in both local and CI environments: - Set preset to `ts-jest/presets/default-esm` for stricter ESM rules. - Configured `transformIgnorePatterns` to ensure Jest transforms specific ESM dependencies (`cli-testing-library`, `@clack`, `cleye`) within `node_modules`. - Expanded the `transform` pattern (`^.+\\.(ts|tsx|js|jsx|mjs)$`) to explicitly cover various script types handled by `ts-jest`. - Included explicit `tsconfig` overrides (`module: 'ESNext'`, `target: 'ES2022'`) within the `ts-jest` transform options to resolve potential environment discrepancies. - Retained `moduleNameMapper` for `.js` imports for reliable module resolution. - Ensured `cli-testing-library` imports remain in the global setup (`test/jest-setup.ts`). - Removed test cache clearing from the `test:unit` script in `package.json`. This configuration now passes reliably across environments.
The space normalization logic is updated to replace only multiple spaces and tabs with a single space, while preserving newlines. This change ensures that the formatting of the content is maintained, especially when dealing with empty line requirements and max line length.
refactor(commitlint): update commitlint configuration and prompts
Add OCO_API_CUSTOM_HEADERS variable to README, config enum, and env parsing to allow JSON string of custom headers. Validate that custom headers are valid JSON in config validator. Extend AiEngineConfig with customHeaders and pass headers to OllamaEngine and OpenAiEngine clients when creating requests. Parse custom headers in utils/engine and warn on invalid format. Add unit tests to ensure OCO_API_CUSTOM_HEADERS is handled correctly and merged from env over global config. This enables users to send additional headers such as Authorization or tracing headers with LLM API calls.
Use OpenAI.ClientOptions for stronger typing and clarity Extract custom headers parsing into parseCustomHeaders util Simplify getEngine by delegating header parsing to helper Improve maintainability and reduce code duplication
- export parseCustomHeaders from src/utils/engine.ts - use parseCustomHeaders in OpenAiEngine for config.customHeaders - remove try/catch and inline JSON.parse logic - update config test to expect headers as object and drop JSON.parse Centralize header parsing for reuse and simplify engine code Update tests to match new header format for clarity
Add OCO_API_CUSTOM_HEADERS
…ue for better usability
- Fixed Jest configuration error by removing duplicate modulePathIgnorePatterns property - Consolidated the ignore patterns into a single declaration - This resolves the TypeScript compilation error preventing tests from running
- Added OCO_GITPUSH='true' environment variable to all e2e test commands - Fixed ESM module import issues in commitlint tests by using process.cwd() - Replaced import.meta.url usage with relative paths from project root - All e2e tests now properly test the git push prompt functionality
…meter info This commit adds a new 'describe' mode to the config command, allowing users to get detailed information about configuration parameters. It includes: 1. New CONFIG_MODES.describe enum value 2. Functions to generate and print help messages for config parameters 3. Updated configCommand to handle the new 'describe' mode 4. README updates to document the new 'describe' functionality
When user wants one line commits the system prompt and the user/assistant one-shot example were contradicting each other, confusing the LLM. This fix modifies the assistant output so that prompt and one-shot are consistent.
feat(config): add 'describe' mode to config command for detailed parameter info
fix(prompts.ts): edited contradictory assistant output
feat(cli.ts): enhance fgm flag to include description and default value for better usability
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes issue
#305