Skip to content

Commit b318d1d

Browse files
committed
Merge branch 'master' into dev
2 parents af0f2c1 + c1756b8 commit b318d1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+31686
-23430
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repository
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@v2
47+
uses: github/codeql-action/init@v3
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below)
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@v2
61+
uses: github/codeql-action/autobuild@v3
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -71,6 +71,6 @@ jobs:
7171
# ./location_of_script_within_repo/buildscript.sh
7272

7373
- name: Perform CodeQL Analysis
74-
uses: github/codeql-action/analyze@v2
74+
uses: github/codeql-action/analyze@v3
7575
with:
7676
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: 'Checkout Repository'
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@v2
20+
uses: actions/dependency-review-action@v3

.github/workflows/test.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Testing
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- main
49

510
jobs:
611
unit-test:
@@ -9,11 +14,12 @@ jobs:
914
matrix:
1015
node-version: [20.x]
1116
steps:
12-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1318
- name: Use Node.js ${{ matrix.node-version }}
14-
uses: actions/setup-node@v2
19+
uses: actions/setup-node@v3
1520
with:
1621
node-version: ${{ matrix.node-version }}
22+
cache: 'npm'
1723
- name: Install dependencies
1824
run: npm install
1925
- name: Run Unit Tests
@@ -24,11 +30,12 @@ jobs:
2430
matrix:
2531
node-version: [20.x]
2632
steps:
27-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v4
2834
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v2
35+
uses: actions/setup-node@v3
3036
with:
3137
node-version: ${{ matrix.node-version }}
38+
cache: 'npm'
3239
- name: Install git
3340
run: |
3441
sudo apt-get update
@@ -44,3 +51,21 @@ jobs:
4451
run: npm run build
4552
- name: Run E2E Tests
4653
run: npm run test:e2e
54+
prettier:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
- name: Use Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: '20.x'
62+
cache: 'npm'
63+
- name: Install dependencies
64+
run: npm ci
65+
- name: Run Prettier
66+
run: npm run format:check
67+
- name: Prettier Output
68+
if: failure()
69+
run: |
70+
echo "Prettier check failed. Please run 'npm run format' to fix formatting issues."
71+
exit 1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ uncaughtExceptions.log
1111
src/*.json
1212
.idea
1313
test.ts
14-
notes.md
14+
notes.md
15+
.nvmrc

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@ Create a `.env` file and add OpenCommit config variables there like this:
109109
OCO_AI_PROVIDER=<openai (default), anthropic, azure, ollama, gemini, flowise, deepseek, aimlapi>
110110
OCO_API_KEY=<your OpenAI API token> // or other LLM provider API token
111111
OCO_API_URL=<may be used to set proxy path to OpenAI api>
112+
OCO_API_CUSTOM_HEADERS=<JSON string of custom HTTP headers to include in API requests>
112113
OCO_TOKENS_MAX_INPUT=<max model token limit (default: 4096)>
113114
OCO_TOKENS_MAX_OUTPUT=<max response tokens (default: 500)>
114115
OCO_DESCRIPTION=<postface a message with ~3 sentences description of the changes>
115116
OCO_EMOJI=<boolean, add GitMoji>
116-
OCO_MODEL=<either 'gpt-4o', 'gpt-4', 'gpt-4-turbo', 'gpt-3.5-turbo' (default), 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview' or any Anthropic or Ollama model or any string basically, but it should be a valid model name>
117+
OCO_MODEL=<either 'gpt-4o-mini' (default), 'gpt-4o', 'gpt-4', 'gpt-4-turbo', 'gpt-3.5-turbo', 'gpt-3.5-turbo-0125', 'gpt-4-1106-preview', 'gpt-4-turbo-preview' or 'gpt-4-0125-preview' or any Anthropic or Ollama model or any string basically, but it should be a valid model name>
117118
OCO_LANGUAGE=<locale, scroll to the bottom to see options>
118119
OCO_MESSAGE_TEMPLATE_PLACEHOLDER=<message template placeholder, default: '$msg'>
119120
OCO_PROMPT_MODULE=<either conventional-commit or @commitlint, default: conventional-commit>
@@ -132,6 +133,18 @@ Simply set any of the variables above like this:
132133
oco config set OCO_MODEL=gpt-4o-mini
133134
```
134135

136+
To see all available configuration parameters and their accepted values:
137+
138+
```sh
139+
oco config describe
140+
```
141+
142+
To see details for a specific parameter:
143+
144+
```sh
145+
oco config describe OCO_MODEL
146+
```
147+
135148
Configure [GitMoji](https://gitmoji.dev/) to preface a message.
136149

137150
```sh

jest.config.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,33 @@ const config: Config = {
99
testTimeout: 100_000,
1010
coverageProvider: 'v8',
1111
moduleDirectories: ['node_modules', 'src'],
12-
preset: 'ts-jest/presets/js-with-ts-esm',
12+
preset: 'ts-jest/presets/default-esm',
1313
setupFilesAfterEnv: ['<rootDir>/test/jest-setup.ts'],
1414
testEnvironment: 'node',
1515
testRegex: ['.*\\.test\\.ts$'],
16-
transformIgnorePatterns: ['node_modules/(?!cli-testing-library)'],
16+
// Tell Jest to ignore the specific duplicate package.json files
17+
// that are causing Haste module naming collisions
18+
modulePathIgnorePatterns: [
19+
'<rootDir>/test/e2e/prompt-module/data/'
20+
],
21+
transformIgnorePatterns: [
22+
'node_modules/(?!(cli-testing-library|@clack|cleye)/.*)'
23+
],
1724
transform: {
18-
'^.+\\.(ts|tsx)$': [
25+
'^.+\\.(ts|tsx|js|jsx|mjs)$': [
1926
'ts-jest',
2027
{
2128
diagnostics: false,
22-
useESM: true
29+
useESM: true,
30+
tsconfig: {
31+
module: 'ESNext',
32+
target: 'ES2022'
33+
}
2334
}
2435
]
36+
},
37+
moduleNameMapper: {
38+
'^(\\.{1,2}/.*)\\.js$': '$1'
2539
}
2640
};
2741

0 commit comments

Comments
 (0)