Skip to content

Commit 1fed8e4

Browse files
committed
✨バッケージ更新とGoogle Gemini対応
tsconfig.jsonの設定を更新し、srcディレクトリを含めました。i18nの日本語設定を整え、CLIのインポート順を整理しました。ESLint設定を新しい形式に移行し、不要なファイルを削除しました。 .npmrc、.github/copilot-instructions.md、devcontainer.json、eslint.config.jsを追加しました。
1 parent ef97793 commit 1fed8e4

21 files changed

Lines changed: 66918 additions & 32822 deletions

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"dbaeumer.vscode-eslint",
11+
"esbenp.prettier-vscode"
12+
]
13+
}
14+
}
15+
16+
// Features to add to the dev container. More info: https://containers.dev/features.
17+
// "features": {},
18+
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
// "forwardPorts": [],
21+
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
// "postCreateCommand": "yarn install",
24+
25+
// Configure tool-specific properties.
26+
// "customizations": {},
27+
28+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
29+
// "remoteUser": "root"
30+
}
31+
// 鍵についてはssh-add -l で確認
32+
// 環境変数http_proxyや~/.gitconfigは、コンテナ作成時の値が自動的に登録されている。
33+
// # Devコンテナでgit commitするときに必要な設定
34+
// scp -p user@example.com:.ssh/config ~/.ssh/
35+
// sudo sh -c "apt update && apt install git-secrets connect-proxy"
36+
// # OpenCommitの設定
37+
// scp -p user@example.com:.opencommit /home/node/
38+

.eslintrc.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/copilot-instructions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- 新たに生成するコメントは日本語にしてください。ただし元のコメントが英語の場合は英語にしてください。
2+
- コード変更時に元からあるコメントは、そのまま残してください。
3+
- JavaScriptやTypeScriptで行末のセミコロンは省略してください。

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
legacy-peer-deps=true
2+
cache=.npm
3+
#prefer-offline=true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ To remove preface emojis:
168168
oco config set OCO_EMOJI=false
169169
```
170170

171-
### Switch to Azure OpenAI
171+
### Using Azure OpenAI
172172

173173
By default OpenCommit uses [OpenAI](https://openai.com).
174174

eslint.config.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// @ts-check
2+
// from https://typescript-eslint.io/getting-started/
3+
4+
import eslint from '@eslint/js';
5+
import tseslint from 'typescript-eslint';
6+
import eslintConfigPrettier from 'eslint-config-prettier';
7+
8+
export default tseslint.config({
9+
files: ['**/*.ts'],
10+
ignores: ['**/node_modules/**', '**/dist/**', '**/.github/**'],
11+
extends: [
12+
eslint.configs.recommended,
13+
...tseslint.configs.recommended,
14+
eslintConfigPrettier,
15+
],
16+
rules: {
17+
"max-lines-per-function": ["warn", {"max": 75}], //GitLab25
18+
"max-lines": ["warn", {"max": 500}], //GitLab250
19+
//"complexity": ["error", { "max": 5 }], //GitLab5
20+
"import/order": "off",
21+
"sort-imports": "warn",
22+
"@typescript-eslint/no-non-null-assertion": "off",
23+
"@typescript-eslint/no-unused-vars": ["error", {
24+
"argsIgnorePattern": "^_",
25+
"varsIgnorePattern": "^[A-Z]"
26+
}],
27+
/** 命名規則 */
28+
"@typescript-eslint/naming-convention": [
29+
"error",
30+
{ // classやtypeなどは頭大文字
31+
"selector": "typeLike",
32+
"format": ["PascalCase"]
33+
},
34+
{ // グローバル定数はアッパーケース
35+
"selector": "variable",
36+
"modifiers": ["global", "const"],
37+
"format": ["camelCase", "UPPER_CASE"]
38+
},
39+
{ // 変数名はキャメルケース
40+
"selector": "variable",
41+
"format": ["camelCase", "UPPER_CASE"]
42+
}
43+
],
44+
// 未使用の変数や関数は宣言禁止、ただし大文字で始まっているものはクラスなので許す
45+
"no-unused-vars": ["error", {
46+
"argsIgnorePattern": "^_",
47+
"varsIgnorePattern": "^[A-Z]"
48+
}],
49+
"no-console": "error"
50+
},
51+
});

opencommit.code-workspace

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,47 @@
11
{
2-
"folders": [
3-
{
4-
"path": "."
5-
}
6-
],
7-
"settings": {},
8-
"launch": {
9-
"version": "0.2.0",
10-
"configurations": []
11-
}
2+
"folders": [
3+
{
4+
"path": "."
5+
}
6+
],
7+
"settings": {},
8+
"launch": {
9+
"version": "0.2.0",
10+
"configurations": [
11+
{ // https://www.npmjs.com/package/tsx#debugging-method-1-run-tsx-directly-from-vscode
12+
"name": "Node TypeScript テスト",
13+
"type": "node",
14+
"request": "launch",
15+
//"envFile": "${workspaceFolder}/.env.debug",
16+
// Debug current file in VSCode
17+
"program": "${workspaceFolder}/src/cli.ts", //"${file}",
18+
//"stopOnEntry": true,
19+
/*
20+
Path to tsx binary
21+
Assuming locally installed
22+
*/
23+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",
24+
/*
25+
Open terminal when debugging starts (Optional)
26+
Useful to see console.logs
27+
*/
28+
"console": "integratedTerminal",
29+
"internalConsoleOptions": "neverOpen", //デバッグ セッション中の [デバッグ コンソール] パネルの表示/非表示を制御
30+
//"outputCapture": "std", //LogがDEBUG CONSOLEに出る
31+
// Files to exclude from debugger (e.g. call stack)
32+
"skipFiles": [
33+
// Node.js internal core modules
34+
"<node_internals>/**",
35+
// Ignore all dependencies (optional)
36+
"${workspaceFolder}/node_modules/**",
37+
],
38+
},
39+
]
40+
},
41+
"extensions": {
42+
"recommendations": [
43+
"dbaeumer.vscode-eslint",
44+
"esbenp.prettier-vscode"
45+
]
46+
}
1247
}

0 commit comments

Comments
 (0)