Skip to content

Commit

Permalink
♻️ Refactoring and Feature Enhancements (.devcontainer/devcontainer.j…
Browse files Browse the repository at this point in the history
…son, chatgpt-mattermost-bot.code-workspace, dist/MultiInstance.mjs, eslint.config.js, package.json, src/BotService.ts, src/MattermostClient.ts, src/MultiInstance.ts, src/OpenAIWrapper.ts, src/postMessage.ts): Improved development environment, strengthened error handling, o3-mini support, detailed token usage display, and enhanced support for multiple bots.

This commit improves the development environment's Dockerfile configuration, adjusts ESLint settings to improve code quality, strengthens error handling, adds detailed token usage information to log output, adds support for multiple bots, and makes the Mattermost client configuration more flexible.  These changes are expected to improve development efficiency, enable earlier error detection, and enhance application robustness.
  • Loading branch information
takuya-o committed Feb 3, 2025
1 parent 41d241a commit d1a3b62
Show file tree
Hide file tree
Showing 11 changed files with 1,828 additions and 2,338 deletions.
49 changes: 33 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
},
"containerEnv": {
"TZ": "${localEnv:TZ:JST-9}" // ホストの環境変数TZの値がnullの場合、'JST-9'を設定
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
"packages": "git-secrets,connect-proxy,netcat-openbsd"
}
},

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Configure tool-specific properties.
// "customizations": {},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm ci"

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
// 鍵についてはssh-add -l で確認
// 環境変数http_proxyや~/.gitconfigは、コンテナ作成時の値が自動的に登録されている。
// 新しいイメージを持ってきたら
// ID=$(docker ps |awk '$2~/^vsc-/{print $1}')
// docker exec -u=root $ID sh -c "apt update && apt install git-secrets connect-proxy netcat-openbsd"
// docker cp ~/.ssh/config $ID:/home/node/.ssh/
// もしくは、コンテナ内で
// scp -p [email protected]:.ssh/config ~/.ssh/
// が必要
// 鍵についてはssh-add -l で確認
// 環境変数http_proxyや~/.gitconfigは、コンテナ作成時の値が自動的に登録されている。
Loading

0 comments on commit d1a3b62

Please sign in to comment.