{"id":17056329,"url":"https://github.com/biophoton/nx-validators","last_synced_at":"2026-04-30T18:32:25.708Z","repository":{"id":191414039,"uuid":"684510141","full_name":"BioPhoton/nx-validators","owner":"BioPhoton","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-28T11:16:57.000Z","size":1633,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-23T06:41:24.434Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BioPhoton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T09:25:14.000Z","updated_at":"2024-04-17T10:43:23.000Z","dependencies_parsed_at":"2024-11-30T00:41:31.702Z","dependency_job_id":"011e6392-0916-44f6-bc6b-2427337f833c","html_url":"https://github.com/BioPhoton/nx-validators","commit_stats":null,"previous_names":["push-based/nx-validators"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BioPhoton/nx-validators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioPhoton%2Fnx-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioPhoton%2Fnx-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioPhoton%2Fnx-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioPhoton%2Fnx-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BioPhoton","download_url":"https://codeload.github.com/BioPhoton/nx-validators/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioPhoton%2Fnx-validators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32473804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T10:24:05.071Z","updated_at":"2026-04-30T18:32:25.691Z","avatar_url":"https://github.com/BioPhoton.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workspace Validation\n\n## Getting Started\n\nWorkspace validation utilizes the power of [Nx generators](https://nx.dev/core-features/plugin-features/use-code-generators) behind the scenes. To initiate the migration validation, run the following command:\n\n```\nnx g @nx-validators/migration-kit:validate-workspace\n```\n\n## How does it work?\n\n![validation-process.png](packages/migration-kit/docs/images/validation-process.png)\n\n```mermaid\nflowchart TB\n\nA[1. Validation] --\u003e A1[Prompt: Run All?]\nA1 --\u003e|yes| A2[Select All]\nA1 --\u003e|no| A3[Prompt: Select Validations]\nA3 --\u003e A4[Run Selected Validations]\nA2 --\u003e A4\nA4 --\u003e A5[Run Validators]\n\nB[2. Result] --\u003e B1[Create a structure based on validations]\nB1 --\u003e B2[For each validator]\nB2 --\u003e B3[no-run]\nB2 --\u003e B4[success]\nB2 --\u003e B5[failed/error]\n\nC[3. Report] --\u003e C1[Generate report based on result]\nC1 --\u003e C2[json]\nC1 --\u003e C3[console]\n\nD[4. Solution] --\u003e D1[For each failed validator]\nD1 --\u003e D2[provide link to documentation]\nD2 --\u003e D3[manual Fix]\nD2 --\u003e|optional| D4[automatic Fix by using migrations]\n```\n### 1) Validation Phase\n\n**The first phase** is responsible for running all generators that verify if the workspace adheres to the rules and conventions specified in the **Internal Nx Framework**.\n\nThe validators dictionary structure looks like this:\n\n```typescript\nexport const WORKSPACE_VALIDATIONS: WorkspaceValidation = {\n    'validation-one': {\n        name: 'Validation One',\n        description: 'Validate multiple rules to align a context',\n        validatorIds: ['validator-one', 'validator-two'],\n    },\n    'validation-two': {\n        name: 'Validation Two',\n        description: 'Validate multiple rules to align a context',\n        validatorIds: ['validator-three'],\n    },\n};\n```\n\nThe structure explained:\n\n-   A `Workspace Validation` consists of multiple `Validation` sets.\n-   A `Validation` represents a state that needs to be followed to be compliant with the **Internal Nx Architecture**.\n-   A `Validator` is implemented as an [Nx generator](https://nx.dev/core-features/plugin-features/use-code-generators) and validates one specific rule. It includes documentation with explanations and solutions to address the `Validation`.\n\nFor the complete implementation of this structure, refer to the file [workspace-validations.ts](packages/migration-kit/src/workspace-validation/validate-workspace/workspace-validations.ts).\n\n### 2) Result Phase\n\n**The second phase** provides the output of the first phase. It generates a result for each validator, allowing us to report and propose solutions for failed validations.\n\nThe result structure is as follows:\n\n```typescript\nconst result = {\n    created: 1690288298447,\n    validationResults: {\n        'validation-one': {\n            name: 'Validation One',\n            description: 'Validate multiple rules to align a context',\n            status: 'failed',\n            validatorResults: {\n                'validator-generator-id-one': {\n                    status: 'failed',\n                    data: ['Validator started', 'Cannot find file test.ts', 'Validator failed'],\n                    documentation:\n                        'packages/migration-kit/src/workspace-validation/validators/validator-generator-id-one/README.md',\n                },\n                'validator-generator-id-two': {\n                    status: 'success',\n                    data: ['Validator started', 'Workspace is respecting the lint configurations'],\n                    documentation:\n                        'packages/migration-kit/src/workspace-validation/validators/validator-generator-id-two/README.md',\n                },\n            },\n        },\n        'validation-two': {\n            name: 'Validation Two',\n            description: 'Validate multiple rules to align a context',\n            status: 'success',\n            validatorResults: {\n                'validator-generator-id-three': {\n                    status: 'failed',\n                    data: ['Validator started', 'Cannot request the server http://....', 'Validator error'],\n                    documentation:\n                        '/tree/master/Client/migration-kit/src/workspace-validation/validators/validator-generator-id-thee/README.md',\n                },\n            },\n        },\n    },\n};\n```\n\n### 3) Report Phase\n\nBased on the above result, we can generate a list of reports. You can configure the reports when executing the `validate-workspace` generator:\n\n```\nnx g @nx-validators/migration-kit:validate-workspace --reports=json,console\n```\n\nThe available report formats are:\n\n-   `JSON`: The json report mirrors the structure of the result above.\n-   `CONSOLE`: The console report also displays the result in a similar format.\n\nAdditional report formats like `HTML` and `Markdown` are yet to be implemented.\n\n### 4) Solution Phase\n\nFollowing the validation result, for each `Validator` that failed, we propose documentation related to the `Validator` containing solutions to address the issues.\n\nYou can find the list of Validators and documentation here: [Validators List](packages/migration-kit/src/workspace-validation/validators/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiophoton%2Fnx-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiophoton%2Fnx-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiophoton%2Fnx-validators/lists"}