@vertaaux/cli 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +345 -0
- package/dist/auth/ci-token.d.ts +49 -0
- package/dist/auth/ci-token.d.ts.map +1 -0
- package/dist/auth/ci-token.js +83 -0
- package/dist/auth/device-flow.d.ts +66 -0
- package/dist/auth/device-flow.d.ts.map +1 -0
- package/dist/auth/device-flow.js +156 -0
- package/dist/auth/token-store.d.ts +53 -0
- package/dist/auth/token-store.d.ts.map +1 -0
- package/dist/auth/token-store.js +78 -0
- package/dist/baseline/diff.d.ts +57 -0
- package/dist/baseline/diff.d.ts.map +1 -0
- package/dist/baseline/diff.js +152 -0
- package/dist/baseline/hash.d.ts +54 -0
- package/dist/baseline/hash.d.ts.map +1 -0
- package/dist/baseline/hash.js +66 -0
- package/dist/baseline/manager.d.ts +89 -0
- package/dist/baseline/manager.d.ts.map +1 -0
- package/dist/baseline/manager.js +157 -0
- package/dist/cache/index.d.ts +8 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +7 -0
- package/dist/cache/route-cache.d.ts +119 -0
- package/dist/cache/route-cache.d.ts.map +1 -0
- package/dist/cache/route-cache.js +213 -0
- package/dist/ci/changed-routes.d.ts +95 -0
- package/dist/ci/changed-routes.d.ts.map +1 -0
- package/dist/ci/changed-routes.js +304 -0
- package/dist/ci/github-api.d.ts +68 -0
- package/dist/ci/github-api.d.ts.map +1 -0
- package/dist/ci/github-api.js +138 -0
- package/dist/ci/gitlab-api.d.ts +75 -0
- package/dist/ci/gitlab-api.d.ts.map +1 -0
- package/dist/ci/gitlab-api.js +180 -0
- package/dist/ci/index.d.ts +6 -0
- package/dist/ci/index.d.ts.map +1 -0
- package/dist/ci/index.js +4 -0
- package/dist/commands/audit.d.ts +58 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +862 -0
- package/dist/commands/baseline.d.ts +22 -0
- package/dist/commands/baseline.d.ts.map +1 -0
- package/dist/commands/baseline.js +210 -0
- package/dist/commands/comment.d.ts +14 -0
- package/dist/commands/comment.d.ts.map +1 -0
- package/dist/commands/comment.js +363 -0
- package/dist/commands/diff.d.ts +24 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +196 -0
- package/dist/commands/doctor.d.ts +58 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +338 -0
- package/dist/commands/download.d.ts +12 -0
- package/dist/commands/download.d.ts.map +1 -0
- package/dist/commands/download.js +183 -0
- package/dist/commands/explain.d.ts +62 -0
- package/dist/commands/explain.d.ts.map +1 -0
- package/dist/commands/explain.js +302 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +212 -0
- package/dist/commands/login.d.ts +14 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +222 -0
- package/dist/commands/policy.d.ts +13 -0
- package/dist/commands/policy.d.ts.map +1 -0
- package/dist/commands/policy.js +347 -0
- package/dist/commands/upload.d.ts +12 -0
- package/dist/commands/upload.d.ts.map +1 -0
- package/dist/commands/upload.js +158 -0
- package/dist/config/defaults.d.ts +21 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +49 -0
- package/dist/config/loader.d.ts +66 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +167 -0
- package/dist/config/schema.d.ts +55 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +6 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1090 -0
- package/dist/interactive/fix-wizard.d.ts +44 -0
- package/dist/interactive/fix-wizard.d.ts.map +1 -0
- package/dist/interactive/fix-wizard.js +286 -0
- package/dist/interactive/init-wizard.d.ts +32 -0
- package/dist/interactive/init-wizard.d.ts.map +1 -0
- package/dist/interactive/init-wizard.js +193 -0
- package/dist/interactive/prompts.d.ts +62 -0
- package/dist/interactive/prompts.d.ts.map +1 -0
- package/dist/interactive/prompts.js +78 -0
- package/dist/monorepo/detector.d.ts +70 -0
- package/dist/monorepo/detector.d.ts.map +1 -0
- package/dist/monorepo/detector.js +278 -0
- package/dist/monorepo/index.d.ts +9 -0
- package/dist/monorepo/index.d.ts.map +1 -0
- package/dist/monorepo/index.js +8 -0
- package/dist/monorepo/workspace.d.ts +142 -0
- package/dist/monorepo/workspace.d.ts.map +1 -0
- package/dist/monorepo/workspace.js +171 -0
- package/dist/output/envelope.d.ts +21 -0
- package/dist/output/envelope.d.ts.map +1 -0
- package/dist/output/envelope.js +27 -0
- package/dist/output/factory.d.ts +73 -0
- package/dist/output/factory.d.ts.map +1 -0
- package/dist/output/factory.js +60 -0
- package/dist/output/formats.d.ts +11 -0
- package/dist/output/formats.d.ts.map +1 -0
- package/dist/output/formats.js +41 -0
- package/dist/output/html.d.ts +45 -0
- package/dist/output/html.d.ts.map +1 -0
- package/dist/output/html.js +607 -0
- package/dist/output/human.d.ts +41 -0
- package/dist/output/human.d.ts.map +1 -0
- package/dist/output/human.js +274 -0
- package/dist/output/json.d.ts +42 -0
- package/dist/output/json.d.ts.map +1 -0
- package/dist/output/json.js +37 -0
- package/dist/output/junit.d.ts +56 -0
- package/dist/output/junit.d.ts.map +1 -0
- package/dist/output/junit.js +135 -0
- package/dist/output/markdown.d.ts +77 -0
- package/dist/output/markdown.d.ts.map +1 -0
- package/dist/output/markdown.js +411 -0
- package/dist/output/sarif.d.ts +160 -0
- package/dist/output/sarif.d.ts.map +1 -0
- package/dist/output/sarif.js +207 -0
- package/dist/policy/evaluator.d.ts +111 -0
- package/dist/policy/evaluator.d.ts.map +1 -0
- package/dist/policy/evaluator.js +362 -0
- package/dist/policy/index.d.ts +15 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +11 -0
- package/dist/policy/loader.d.ts +97 -0
- package/dist/policy/loader.d.ts.map +1 -0
- package/dist/policy/loader.js +281 -0
- package/dist/policy/schema.d.ts +297 -0
- package/dist/policy/schema.d.ts.map +1 -0
- package/dist/policy/schema.js +230 -0
- package/dist/quality-gate/evaluator.d.ts +58 -0
- package/dist/quality-gate/evaluator.d.ts.map +1 -0
- package/dist/quality-gate/evaluator.js +274 -0
- package/dist/quality-gate/index.d.ts +10 -0
- package/dist/quality-gate/index.d.ts.map +1 -0
- package/dist/quality-gate/index.js +7 -0
- package/dist/quality-gate/types.d.ts +103 -0
- package/dist/quality-gate/types.d.ts.map +1 -0
- package/dist/quality-gate/types.js +23 -0
- package/dist/templates/azure-devops.d.ts +25 -0
- package/dist/templates/azure-devops.d.ts.map +1 -0
- package/dist/templates/azure-devops.js +109 -0
- package/dist/templates/circleci.d.ts +28 -0
- package/dist/templates/circleci.d.ts.map +1 -0
- package/dist/templates/circleci.js +86 -0
- package/dist/templates/github-actions.d.ts +81 -0
- package/dist/templates/github-actions.d.ts.map +1 -0
- package/dist/templates/github-actions.js +393 -0
- package/dist/templates/gitlab-ci.d.ts +26 -0
- package/dist/templates/gitlab-ci.d.ts.map +1 -0
- package/dist/templates/gitlab-ci.js +70 -0
- package/dist/templates/index.d.ts +72 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +112 -0
- package/dist/templates/jenkins.d.ts +26 -0
- package/dist/templates/jenkins.d.ts.map +1 -0
- package/dist/templates/jenkins.js +110 -0
- package/dist/ui/banner.d.ts +31 -0
- package/dist/ui/banner.d.ts.map +1 -0
- package/dist/ui/banner.js +84 -0
- package/dist/ui/diagnostics.d.ts +39 -0
- package/dist/ui/diagnostics.d.ts.map +1 -0
- package/dist/ui/diagnostics.js +153 -0
- package/dist/ui/spinner.d.ts +61 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +101 -0
- package/dist/ui/table.d.ts +63 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +236 -0
- package/dist/utils/client.d.ts +82 -0
- package/dist/utils/client.d.ts.map +1 -0
- package/dist/utils/client.js +128 -0
- package/dist/utils/detect-env.d.ts +59 -0
- package/dist/utils/detect-env.d.ts.map +1 -0
- package/dist/utils/detect-env.js +115 -0
- package/dist/utils/exit-codes.d.ts +47 -0
- package/dist/utils/exit-codes.d.ts.map +1 -0
- package/dist/utils/exit-codes.js +61 -0
- package/dist/utils/logger.d.ts +87 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +185 -0
- package/dist/utils/sanitize.d.ts +36 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +64 -0
- package/dist/utils/validators.d.ts +41 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/utils/validators.js +123 -0
- package/package.json +63 -0
- package/schemas/vertaaux.config.schema.json +103 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/quality-gate/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAE9C,wEAAwE;IACxE,UAAU,EAAE,eAAe,CAAC;IAE5B,6CAA6C;IAC7C,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,uEAAuE;IACvE,cAAc,EAAE,OAAO,CAAC;IAExB,kDAAkD;IAClD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,CAAC;IACjD,sCAAsC;IACtC,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACvC,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;IAEhB,0CAA0C;IAC1C,QAAQ,EAAE,YAAY,CAAC;IAEvB,2CAA2C;IAC3C,UAAU,EAAE,aAAa,EAAE,CAAC;IAE5B,mCAAmC;IACnC,OAAO,EAAE;QACP,SAAS,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5D,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC;IAEF,0CAA0C;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,EAAE,iBAMzC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quality gate type definitions.
|
|
3
|
+
*
|
|
4
|
+
* Quality gates control when CI builds should fail based on audit results.
|
|
5
|
+
* Key principle: Fail only on NEW issues (not existing technical debt).
|
|
6
|
+
*
|
|
7
|
+
* Implements CICD-06: Fail on new issues only, not existing technical debt.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Default quality gate configuration.
|
|
11
|
+
*
|
|
12
|
+
* Defaults are designed to be adoption-friendly:
|
|
13
|
+
* - Only fail on errors (not warnings/info)
|
|
14
|
+
* - Only fail on NEW errors (existing debt allowed)
|
|
15
|
+
* - No score thresholds by default (opt-in)
|
|
16
|
+
*/
|
|
17
|
+
export const DEFAULT_QUALITY_GATE_CONFIG = {
|
|
18
|
+
failOn: "error",
|
|
19
|
+
thresholds: {},
|
|
20
|
+
maxNew: { error: 0, warning: Infinity, info: Infinity },
|
|
21
|
+
failOnExisting: false,
|
|
22
|
+
bypassLabels: [],
|
|
23
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure DevOps pipeline template generator for VertaaUX.
|
|
3
|
+
*
|
|
4
|
+
* Generates azure-pipelines.yml configuration with native Azure integrations:
|
|
5
|
+
* - SARIF output published to CodeAnalysisLogs for Advanced Security
|
|
6
|
+
* - JUnit output for test results integration
|
|
7
|
+
*
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/azure/devops/repos/security/github-advanced-security-code-scanning-third-party
|
|
9
|
+
*/
|
|
10
|
+
export interface AzureDevOpsOptions {
|
|
11
|
+
/** URL to audit (optional, can be set in config) */
|
|
12
|
+
auditUrl?: string;
|
|
13
|
+
/** Severity threshold for CI failure */
|
|
14
|
+
failOn?: "error" | "warning" | "info" | "none";
|
|
15
|
+
/** Minimum score threshold (0 = disabled) */
|
|
16
|
+
threshold?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generate Azure DevOps pipeline template for VertaaUX integration.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Configuration options
|
|
22
|
+
* @returns YAML template content
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateAzureDevOpsTemplate(options?: AzureDevOpsOptions): string;
|
|
25
|
+
//# sourceMappingURL=azure-devops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-devops.d.ts","sourceRoot":"","sources":["../../src/templates/azure-devops.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAgGpF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure DevOps pipeline template generator for VertaaUX.
|
|
3
|
+
*
|
|
4
|
+
* Generates azure-pipelines.yml configuration with native Azure integrations:
|
|
5
|
+
* - SARIF output published to CodeAnalysisLogs for Advanced Security
|
|
6
|
+
* - JUnit output for test results integration
|
|
7
|
+
*
|
|
8
|
+
* @see https://learn.microsoft.com/en-us/azure/devops/repos/security/github-advanced-security-code-scanning-third-party
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Generate Azure DevOps pipeline template for VertaaUX integration.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Configuration options
|
|
14
|
+
* @returns YAML template content
|
|
15
|
+
*/
|
|
16
|
+
export function generateAzureDevOpsTemplate(options = {}) {
|
|
17
|
+
const { auditUrl, failOn = "error", threshold } = options;
|
|
18
|
+
// Build audit command with options
|
|
19
|
+
const auditArgs = [];
|
|
20
|
+
if (auditUrl) {
|
|
21
|
+
auditArgs.push(`--url "${auditUrl}"`);
|
|
22
|
+
}
|
|
23
|
+
if (failOn !== "none") {
|
|
24
|
+
auditArgs.push(`--fail-on ${failOn}`);
|
|
25
|
+
}
|
|
26
|
+
if (threshold && threshold > 0) {
|
|
27
|
+
auditArgs.push(`--threshold ${threshold}`);
|
|
28
|
+
}
|
|
29
|
+
const auditSuffix = auditArgs.length > 0 ? ` ${auditArgs.join(" ")}` : "";
|
|
30
|
+
return `# VertaaUX Accessibility & UX Audit
|
|
31
|
+
# https://vertaaux.ai
|
|
32
|
+
#
|
|
33
|
+
# Azure DevOps Pipeline template with Advanced Security integration.
|
|
34
|
+
# Requires VERTAAUX_API_KEY variable in pipeline settings or variable group.
|
|
35
|
+
|
|
36
|
+
trigger:
|
|
37
|
+
- main
|
|
38
|
+
- master
|
|
39
|
+
|
|
40
|
+
pr:
|
|
41
|
+
- main
|
|
42
|
+
- master
|
|
43
|
+
|
|
44
|
+
pool:
|
|
45
|
+
vmImage: 'ubuntu-latest'
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- task: NodeTool@0
|
|
49
|
+
displayName: 'Install Node.js 20'
|
|
50
|
+
inputs:
|
|
51
|
+
versionSpec: '20.x'
|
|
52
|
+
|
|
53
|
+
- script: npm install -g @vertaaux/cli
|
|
54
|
+
displayName: 'Install VertaaUX CLI'
|
|
55
|
+
|
|
56
|
+
- script: |
|
|
57
|
+
vertaa audit \\
|
|
58
|
+
--format sarif \\
|
|
59
|
+
--output $(Build.ArtifactStagingDirectory)/results.sarif${auditSuffix}
|
|
60
|
+
displayName: 'Run VertaaUX Audit (SARIF)'
|
|
61
|
+
env:
|
|
62
|
+
VERTAAUX_API_KEY: $(VERTAAUX_API_KEY)
|
|
63
|
+
continueOnError: true
|
|
64
|
+
|
|
65
|
+
- script: |
|
|
66
|
+
vertaa audit \\
|
|
67
|
+
--format junit \\
|
|
68
|
+
--output $(Build.ArtifactStagingDirectory)/vertaaux-junit.xml${auditSuffix}
|
|
69
|
+
displayName: 'Run VertaaUX Audit (JUnit)'
|
|
70
|
+
env:
|
|
71
|
+
VERTAAUX_API_KEY: $(VERTAAUX_API_KEY)
|
|
72
|
+
continueOnError: true
|
|
73
|
+
|
|
74
|
+
# Publish SARIF for Azure DevOps Advanced Security
|
|
75
|
+
# The artifact name 'CodeAnalysisLogs' is required for Advanced Security integration
|
|
76
|
+
- task: PublishBuildArtifacts@1
|
|
77
|
+
displayName: 'Publish SARIF for Advanced Security'
|
|
78
|
+
inputs:
|
|
79
|
+
pathToPublish: $(Build.ArtifactStagingDirectory)/results.sarif
|
|
80
|
+
artifactName: CodeAnalysisLogs
|
|
81
|
+
condition: always()
|
|
82
|
+
|
|
83
|
+
# Publish JUnit test results
|
|
84
|
+
- task: PublishTestResults@2
|
|
85
|
+
displayName: 'Publish Test Results'
|
|
86
|
+
inputs:
|
|
87
|
+
testResultsFormat: 'JUnit'
|
|
88
|
+
testResultsFiles: '$(Build.ArtifactStagingDirectory)/vertaaux-junit.xml'
|
|
89
|
+
testRunTitle: 'VertaaUX Audit Results'
|
|
90
|
+
condition: always()
|
|
91
|
+
|
|
92
|
+
# Generate and publish HTML report
|
|
93
|
+
- script: |
|
|
94
|
+
vertaa audit \\
|
|
95
|
+
--format html \\
|
|
96
|
+
--output $(Build.ArtifactStagingDirectory)/vertaaux-report.html${auditSuffix}
|
|
97
|
+
displayName: 'Generate HTML Report'
|
|
98
|
+
env:
|
|
99
|
+
VERTAAUX_API_KEY: $(VERTAAUX_API_KEY)
|
|
100
|
+
condition: always()
|
|
101
|
+
|
|
102
|
+
- task: PublishBuildArtifacts@1
|
|
103
|
+
displayName: 'Publish HTML Report'
|
|
104
|
+
inputs:
|
|
105
|
+
pathToPublish: $(Build.ArtifactStagingDirectory)/vertaaux-report.html
|
|
106
|
+
artifactName: VertaaUX-Report
|
|
107
|
+
condition: always()
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CircleCI template generator for VertaaUX.
|
|
3
|
+
*
|
|
4
|
+
* Generates .circleci/config.yml job configuration with native CircleCI integrations:
|
|
5
|
+
* - store_test_results for JUnit integration
|
|
6
|
+
* - store_artifacts for HTML report
|
|
7
|
+
*
|
|
8
|
+
* Note: CircleCI doesn't have native PR comment support.
|
|
9
|
+
* Use GitHub API or `gh pr comment` for PR comments.
|
|
10
|
+
*
|
|
11
|
+
* @see https://circleci.com/docs/collect-test-data/
|
|
12
|
+
*/
|
|
13
|
+
export interface CircleCIOptions {
|
|
14
|
+
/** URL to audit (optional, can be set in config) */
|
|
15
|
+
auditUrl?: string;
|
|
16
|
+
/** Severity threshold for CI failure */
|
|
17
|
+
failOn?: "error" | "warning" | "info" | "none";
|
|
18
|
+
/** Minimum score threshold (0 = disabled) */
|
|
19
|
+
threshold?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generate CircleCI template for VertaaUX integration.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Configuration options
|
|
25
|
+
* @returns YAML template content
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateCircleCITemplate(options?: CircleCIOptions): string;
|
|
28
|
+
//# sourceMappingURL=circleci.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleci.d.ts","sourceRoot":"","sources":["../../src/templates/circleci.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,eAAoB,GAAG,MAAM,CAsE9E"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CircleCI template generator for VertaaUX.
|
|
3
|
+
*
|
|
4
|
+
* Generates .circleci/config.yml job configuration with native CircleCI integrations:
|
|
5
|
+
* - store_test_results for JUnit integration
|
|
6
|
+
* - store_artifacts for HTML report
|
|
7
|
+
*
|
|
8
|
+
* Note: CircleCI doesn't have native PR comment support.
|
|
9
|
+
* Use GitHub API or `gh pr comment` for PR comments.
|
|
10
|
+
*
|
|
11
|
+
* @see https://circleci.com/docs/collect-test-data/
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Generate CircleCI template for VertaaUX integration.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Configuration options
|
|
17
|
+
* @returns YAML template content
|
|
18
|
+
*/
|
|
19
|
+
export function generateCircleCITemplate(options = {}) {
|
|
20
|
+
const { auditUrl, failOn = "error", threshold } = options;
|
|
21
|
+
// Build audit command with options
|
|
22
|
+
const auditArgs = [];
|
|
23
|
+
if (auditUrl) {
|
|
24
|
+
auditArgs.push(`--url "${auditUrl}"`);
|
|
25
|
+
}
|
|
26
|
+
if (failOn !== "none") {
|
|
27
|
+
auditArgs.push(`--fail-on ${failOn}`);
|
|
28
|
+
}
|
|
29
|
+
if (threshold && threshold > 0) {
|
|
30
|
+
auditArgs.push(`--threshold ${threshold}`);
|
|
31
|
+
}
|
|
32
|
+
const auditSuffix = auditArgs.length > 0 ? ` \\\n ${auditArgs.join(" \\\n ")}` : "";
|
|
33
|
+
return `# VertaaUX Accessibility & UX Audit
|
|
34
|
+
# https://vertaaux.ai
|
|
35
|
+
#
|
|
36
|
+
# Add this job to your .circleci/config.yml
|
|
37
|
+
# Requires VERTAAUX_API_KEY environment variable in project settings.
|
|
38
|
+
#
|
|
39
|
+
# Note: CircleCI doesn't have native PR comment support.
|
|
40
|
+
# To add PR comments, use GitHub API or add a step with:
|
|
41
|
+
# gh pr comment --body "$(cat comment.md)"
|
|
42
|
+
|
|
43
|
+
version: 2.1
|
|
44
|
+
|
|
45
|
+
jobs:
|
|
46
|
+
vertaaux-audit:
|
|
47
|
+
docker:
|
|
48
|
+
- image: cimg/node:20.0
|
|
49
|
+
steps:
|
|
50
|
+
- checkout
|
|
51
|
+
|
|
52
|
+
- run:
|
|
53
|
+
name: Install VertaaUX CLI
|
|
54
|
+
command: npm install -g @vertaaux/cli
|
|
55
|
+
|
|
56
|
+
- run:
|
|
57
|
+
name: Run VertaaUX Audit
|
|
58
|
+
command: |
|
|
59
|
+
mkdir -p test-results artifacts
|
|
60
|
+
vertaa audit \\
|
|
61
|
+
--format junit \\
|
|
62
|
+
--output test-results/vertaaux.xml${auditSuffix}
|
|
63
|
+
|
|
64
|
+
- run:
|
|
65
|
+
name: Generate HTML Report
|
|
66
|
+
command: |
|
|
67
|
+
vertaa audit \\
|
|
68
|
+
--format html \\
|
|
69
|
+
--output artifacts/vertaaux-report.html${auditSuffix}
|
|
70
|
+
when: always
|
|
71
|
+
|
|
72
|
+
# Store test results for CircleCI Test Insights
|
|
73
|
+
- store_test_results:
|
|
74
|
+
path: test-results
|
|
75
|
+
|
|
76
|
+
# Store HTML report as artifact
|
|
77
|
+
- store_artifacts:
|
|
78
|
+
path: artifacts
|
|
79
|
+
destination: vertaaux-reports
|
|
80
|
+
|
|
81
|
+
workflows:
|
|
82
|
+
pr-checks:
|
|
83
|
+
jobs:
|
|
84
|
+
- vertaaux-audit
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Actions workflow template generator.
|
|
3
|
+
*
|
|
4
|
+
* Generates production-ready GitHub Actions workflows for VertaaUX integration
|
|
5
|
+
* with SARIF upload for Code Scanning, artifact storage, and PR comments.
|
|
6
|
+
*
|
|
7
|
+
* @see https://docs.github.com/en/actions
|
|
8
|
+
* @see https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Options for workflow generation.
|
|
12
|
+
*/
|
|
13
|
+
export interface WorkflowOptions {
|
|
14
|
+
/** Target URL to audit (optional, can be set in config) */
|
|
15
|
+
auditUrl?: string;
|
|
16
|
+
/** Severity level that causes workflow to fail */
|
|
17
|
+
failOn?: "error" | "warning" | "info" | "none";
|
|
18
|
+
/** Minimum score threshold (0-100) */
|
|
19
|
+
threshold?: number;
|
|
20
|
+
/** Upload SARIF results to GitHub Code Scanning */
|
|
21
|
+
uploadSarif?: boolean;
|
|
22
|
+
/** Upload HTML report and artifacts */
|
|
23
|
+
uploadArtifacts?: boolean;
|
|
24
|
+
/** Post PR comment with results summary */
|
|
25
|
+
postComment?: boolean;
|
|
26
|
+
/** Node.js version to use */
|
|
27
|
+
nodeVersion?: string;
|
|
28
|
+
/** Enable caching for node_modules, browsers, and route results */
|
|
29
|
+
enableCaching?: boolean;
|
|
30
|
+
/** Generate monorepo matrix workflow */
|
|
31
|
+
monorepo?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Generate a production-ready GitHub Actions workflow for VertaaUX.
|
|
35
|
+
*
|
|
36
|
+
* Features:
|
|
37
|
+
* - Triggers on pull_request and push to main/master
|
|
38
|
+
* - SARIF upload for inline Code Scanning annotations
|
|
39
|
+
* - HTML report and artifact upload
|
|
40
|
+
* - PR comment with results summary using sticky comments
|
|
41
|
+
* - Proper exit code handling for CI gating
|
|
42
|
+
*
|
|
43
|
+
* @param options - Workflow generation options
|
|
44
|
+
* @returns YAML workflow content
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const workflow = generateGitHubActionsWorkflow({
|
|
49
|
+
* auditUrl: 'https://example.com',
|
|
50
|
+
* failOn: 'warning',
|
|
51
|
+
* uploadSarif: true,
|
|
52
|
+
* postComment: true,
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function generateGitHubActionsWorkflow(options?: WorkflowOptions): string;
|
|
57
|
+
/**
|
|
58
|
+
* Generate a minimal GitHub Actions workflow (basic SARIF upload only).
|
|
59
|
+
*
|
|
60
|
+
* @returns YAML workflow content
|
|
61
|
+
*/
|
|
62
|
+
export declare function generateMinimalWorkflow(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Generate a monorepo-aware GitHub Actions workflow.
|
|
65
|
+
*
|
|
66
|
+
* This workflow first detects all auditable apps in the monorepo,
|
|
67
|
+
* then runs audits in parallel using a matrix strategy.
|
|
68
|
+
*
|
|
69
|
+
* @param options - Workflow generation options
|
|
70
|
+
* @returns YAML workflow content
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const workflow = generateMonorepoWorkflow({
|
|
75
|
+
* failOn: 'warning',
|
|
76
|
+
* uploadSarif: true,
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function generateMonorepoWorkflow(options?: Omit<WorkflowOptions, "monorepo">): string;
|
|
81
|
+
//# sourceMappingURL=github-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-actions.d.ts","sourceRoot":"","sources":["../../src/templates/github-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/C,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAiKR;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAM,GAC9C,MAAM,CA8KR"}
|