chore: update .idea/workspace.xml and project guidelines

- Refined IntelliJ IDEA settings in `.idea/workspace.xml`, including updates to `ProblemsViewState` and `PropertiesComponent` for project consistency.
- Renamed and expanded `.junie/guidelines.md` to reflect updated best practices, project structure, and development workflows.
This commit is contained in:
Andreas Hilbig 2026-01-28 11:52:20 +01:00
parent 7adaf82c1b
commit 2a82fe6cf2
2 changed files with 87 additions and 63 deletions

111
.idea/workspace.xml generated
View file

@ -5,29 +5,8 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: add tests for schema and API config mocking&#10;&#10;- Added unit tests for schema loader, mocking Config variables and resolvers.&#10;- Added unit tests for Zabbix API configuration, verifying constants derived from Config.&#10;- Mocked relevant modules and filesystem behaviors to enable isolated testing.&#10;- Optimized imports on all files and include this within a new .junie/guidelines.md file"> <list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: add tests for schema and API config mocking&#10;&#10;- Added unit tests for schema loader, mocking Config variables and resolvers.&#10;- Added unit tests for Zabbix API configuration, verifying constants derived from Config.&#10;- Mocked relevant modules and filesystem behaviors to enable isolated testing.&#10;- Optimized imports on all files and include this within a new .junie/guidelines.md file">
<change afterPath="$PROJECT_DIR$/.junie/guidelines.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/test/logger_config.test.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/test/schema_config.test.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/test/zabbix_api_config.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/common_utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/common_utils.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.junie/guidelines.md" beforeDir="false" afterPath="$PROJECT_DIR$/.junie/guidelines.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-hosts.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-hosts.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-templates.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-templates.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-usergroups.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-usergroups.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/execution/host_exporter.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/execution/host_exporter.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/execution/template_deleter.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/execution/template_deleter.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/execution/template_importer.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/execution/template_importer.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/schema/generated/graphql.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/schema/generated/graphql.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/host_importer.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/host_importer.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/host_integration.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/host_integration.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/host_query.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/host_query.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/misc_resolvers.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/misc_resolvers.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/template_deleter.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/template_deleter.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/template_importer.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/template_importer.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/template_integration.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/template_integration.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/template_query.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/template_query.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/user_rights.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/user_rights.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/user_rights_integration.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/user_rights_integration.test.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -65,6 +44,9 @@
<commands /> <commands />
<urls /> <urls />
</component> </component>
<component name="ProblemsViewState">
<option name="selectedTabId" value="CurrentFile" />
</component>
<component name="ProjectColorInfo">{ <component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 2 &quot;associatedIndex&quot;: 2
}</component> }</component>
@ -76,44 +58,45 @@
<option name="openDirectoriesWithSingleClick" value="true" /> <option name="openDirectoriesWithSingleClick" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;NIXITCH_NIXPKGS_CONFIG&quot;: &quot;&quot;, "NIXITCH_NIXPKGS_CONFIG": "",
&quot;NIXITCH_NIX_CONF_DIR&quot;: &quot;&quot;, "NIXITCH_NIX_CONF_DIR": "",
&quot;NIXITCH_NIX_OTHER_STORES&quot;: &quot;&quot;, "NIXITCH_NIX_OTHER_STORES": "",
&quot;NIXITCH_NIX_PATH&quot;: &quot;&quot;, "NIXITCH_NIX_PATH": "",
&quot;NIXITCH_NIX_PROFILES&quot;: &quot;&quot;, "NIXITCH_NIX_PROFILES": "",
&quot;NIXITCH_NIX_REMOTE&quot;: &quot;&quot;, "NIXITCH_NIX_REMOTE": "",
&quot;NIXITCH_NIX_USER_PROFILE_DIR&quot;: &quot;&quot;, "NIXITCH_NIX_USER_PROFILE_DIR": "",
&quot;Node.js.index.ts.executor&quot;: &quot;Run&quot;, "Node.js.index.ts.executor": "Run",
&quot;RunOnceActivity.MCP Project settings loaded&quot;: &quot;true&quot;, "RunOnceActivity.MCP Project settings loaded": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;, "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;, "RunOnceActivity.git.unshallow": "true",
&quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;, "RunOnceActivity.typescript.service.memoryLimit.init": "true",
&quot;com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1&quot;: &quot;true&quot;, "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
&quot;git-widget-placeholder&quot;: &quot;main&quot;, "git-widget-placeholder": "main",
&quot;go.import.settings.migrated&quot;: &quot;true&quot;, "go.import.settings.migrated": "true",
&quot;javascript.preferred.runtime.type.id&quot;: &quot;node&quot;, "javascript.preferred.runtime.type.id": "node",
&quot;junie.onboarding.icon.badge.shown&quot;: &quot;true&quot;, "junie.onboarding.icon.badge.shown": "true",
&quot;last_opened_file_path&quot;: &quot;//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/src&quot;, "last_opened_file_path": "//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/src",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;nodejs_interpreter_path&quot;: &quot;wsl://Ubuntu@/home/ahilbig/.nvm/versions/node/v24.12.0/bin/node&quot;, "nodejs_interpreter_path": "wsl://Ubuntu@/home/ahilbig/.nvm/versions/node/v24.12.0/bin/node",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "nodejs_package_manager_path": "npm",
&quot;npm.codegen.executor&quot;: &quot;Run&quot;, "npm.codegen.executor": "Run",
&quot;npm.compile.executor&quot;: &quot;Run&quot;, "npm.compile.executor": "Run",
&quot;npm.copy-schema.executor&quot;: &quot;Run&quot;, "npm.copy-schema.executor": "Run",
&quot;npm.prod.executor&quot;: &quot;Run&quot;, "npm.prod.executor": "Run",
&quot;npm.test.executor&quot;: &quot;Run&quot;, "npm.test.executor": "Run",
&quot;settings.editor.selected.configurable&quot;: &quot;settings.javascript.runtime&quot;, "settings.editor.selected.configurable": "ml.llm.LLMConfigurable",
&quot;to.speed.mode.migration.done&quot;: &quot;true&quot;, "settings.editor.splitter.proportion": "0.3839406",
&quot;ts.external.directory.path&quot;: &quot;\\\\wsl.localhost\\Ubuntu\\home\\ahilbig\\git\\vcr\\zabbix-graphql-api\\node_modules\\typescript\\lib&quot;, "to.speed.mode.migration.done": "true",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "ts.external.directory.path": "\\\\wsl.localhost\\Ubuntu\\home\\ahilbig\\git\\vcr\\zabbix-graphql-api\\node_modules\\typescript\\lib",
"vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RecapSpentCounter"> <component name="RecapSpentCounter">
<option name="endsOfQuotaMs" value="1768327208764" /> <option name="endsOfQuotaMs" value="1768327208764" />
<option name="spentUsd" value="0.04010335" /> <option name="spentUsd" value="0.04010335" />
@ -382,7 +365,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1769535965695</updated> <updated>1769535965695</updated>
</task> </task>
<option name="localTasksCounter" value="22" /> <task id="LOCAL-00022" summary="chore: add tests for schema and API config mocking&#10;&#10;- Added unit tests for schema loader, mocking Config variables and resolvers.&#10;- Added unit tests for Zabbix API configuration, verifying constants derived from Config.&#10;- Mocked relevant modules and filesystem behaviors to enable isolated testing.&#10;- Optimized imports on all files and include this within a new .junie/guidelines.md file">
<option name="closed" value="true" />
<created>1769582068426</created>
<option name="number" value="00022" />
<option name="presentableId" value="LOCAL-00022" />
<option name="project" value="LOCAL" />
<updated>1769582068426</updated>
</task>
<option name="localTasksCounter" value="23" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">

View file

@ -1,4 +1,37 @@
# Junie Guidelines # Project Guidelines
- Always include "Optimize imports" as a step in the plan before executing any commits or finishing a task (via `submit`). This document provides concise information and best practices for developers working on the Zabbix GraphQL API project.
- This ensures consistency with the project's IntelliJ IDEA settings (`OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT` is enabled).
## Tech Stack
- **Runtime**: Node.js (v18+)
- **Language**: TypeScript (ESM)
- **API**: GraphQL (Apollo Server 4)
- **Testing**: Jest
- **Deployment**: Docker
## Project Structure
- `src/api/`: GraphQL server configuration, schema loading, and root resolvers (see `createResolvers` in `resolvers.ts`).
- `src/datasources/`: Modular classes for interacting with various Zabbix API components (hosts, items, etc.).
- `src/execution/`: Business logic for complex, multi-step operations (importers, exporters, deleters).
- `src/model/`: Shared data models and enumerations.
- `src/test/`: Unit and integration tests.
- `schema/`: GraphQL Schema Definition Language (SDL) files.
## Common Scripts
- `npm run start`: Launches the development server with `tsx` and `nodemon` for hot-reloading.
- `npm run test`: Executes the Jest test suite.
- `npm run codegen`: Generates TypeScript types based on the GraphQL schema definitions.
- `npm run compile`: Compiles TypeScript source files into the `dist/` directory.
- `npm run prod`: Prepares the schema and runs the compiled production build.
## Best Practices & Standards
- **ESM & Imports**: The project uses ECMAScript Modules (ESM). Always use the `.js` extension when importing local files (e.g., `import { Config } from "../common_utils.js";`), even though the source files are `.ts`.
- **Configuration**: Always use the `Config` class to access environment variables. Avoid direct `process.env` calls.
- **Type Safety**: Leverage types generated via `npm run codegen` for resolvers and data handling to ensure consistency with the schema.
- **Import Optimization**:
- Always optimize imports before committing.
- Project setting `OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT` is enabled.
- Junie should include "Optimize imports" as a step in every plan.
- **Modular Datasources**: When adding support for new Zabbix features, create a new datasource class in `src/datasources/` extending `ZabbixRESTDataSource`.
- **Schema Organization**: Place GraphQL SDL files in the `schema/` directory. Use descriptive comments in SDL as they are used for API documentation.
- **Testing**: Write reproduction tests for bugs and cover new features with both unit and integration tests in `src/test/`.