@reshotdev/screenshot 0.0.1-beta.2 ā 0.0.1-beta.20
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/LICENSE +1 -1
- package/README.md +138 -47
- package/package.json +27 -16
- package/src/commands/auth.js +159 -30
- package/src/commands/capture-dom.js +50 -0
- package/src/commands/certify.js +62 -0
- package/src/commands/compose.js +220 -0
- package/src/commands/doctor-release.js +74 -0
- package/src/commands/doctor-target.js +108 -0
- package/src/commands/drifts.js +16 -69
- package/src/commands/import-tests.js +13 -13
- package/src/commands/init.js +16 -277
- package/src/commands/publish.js +484 -257
- package/src/commands/pull.js +302 -35
- package/src/commands/refresh.js +166 -0
- package/src/commands/run.js +292 -12
- package/src/commands/setup-wizard.js +348 -496
- package/src/commands/status.js +334 -126
- package/src/commands/sync.js +28 -236
- package/src/commands/ui.js +1 -1
- package/src/commands/variation.js +194 -0
- package/src/commands/verify-publish.js +46 -0
- package/src/index.js +383 -118
- package/src/lib/api-client.js +172 -60
- package/src/lib/auto-update/refresh.js +598 -0
- package/src/lib/auto-update/scene-runtime.compose.tsx +73 -0
- package/src/lib/auto-update/spec.js +89 -0
- package/src/lib/capture-engine.js +179 -9
- package/src/lib/capture-script-runner.js +639 -214
- package/src/lib/certification.js +887 -0
- package/src/lib/compose-context.js +156 -0
- package/src/lib/compose-pack.js +42 -0
- package/src/lib/compose-runtime.js +34 -0
- package/src/lib/compose-upload.js +142 -0
- package/src/lib/config.js +186 -81
- package/src/lib/dom-capture.js +64 -0
- package/src/lib/ensure-browser.js +147 -0
- package/src/lib/output-path-template.js +3 -3
- package/src/lib/record-cdp.js +288 -16
- package/src/lib/record-clip.js +83 -3
- package/src/lib/record-config.js +1 -5
- package/src/lib/release-doctor.js +321 -0
- package/src/lib/resolve-targets.js +60 -0
- package/src/lib/run-manifest.js +148 -0
- package/src/lib/standalone-mode.js +1 -1
- package/src/lib/storage-providers.js +5 -5
- package/src/lib/style-engine.js +5 -5
- package/src/lib/target-contract.js +292 -0
- package/src/lib/ui-api-helpers.js +118 -0
- package/src/lib/ui-api.js +31 -824
- package/src/lib/ui-asset-cleanup.js +62 -0
- package/src/lib/ui-output-versions.js +165 -0
- package/src/lib/ui-recorder-routes.js +341 -0
- package/src/lib/ui-scenario-metadata.js +161 -0
- package/vendor/compose/dist/auto-update.cjs +5544 -0
- package/vendor/compose/dist/auto-update.mjs +5518 -0
- package/vendor/compose/dist/capture.cjs +1450 -0
- package/vendor/compose/dist/capture.mjs +1416 -0
- package/vendor/compose/dist/eligibility.cjs +5331 -0
- package/vendor/compose/dist/eligibility.mjs +5313 -0
- package/vendor/compose/dist/index.cjs +2046 -0
- package/vendor/compose/dist/index.mjs +1997 -0
- package/vendor/compose/dist/jsx-dev-runtime.cjs +55 -0
- package/vendor/compose/dist/jsx-dev-runtime.mjs +27 -0
- package/vendor/compose/dist/jsx-runtime.cjs +58 -0
- package/vendor/compose/dist/jsx-runtime.mjs +31 -0
- package/vendor/compose/dist/render.cjs +558 -0
- package/vendor/compose/dist/render.mjs +515 -0
- package/vendor/compose/dist/verify-cli.cjs +3806 -0
- package/vendor/compose/dist/verify-cli.mjs +3812 -0
- package/vendor/compose/dist/verify.cjs +3880 -0
- package/vendor/compose/dist/verify.mjs +3858 -0
- package/web/manager/dist/assets/index-D0S2otug.js +507 -0
- package/web/manager/dist/index.html +1 -1
- package/src/commands/ci-run.js +0 -123
- package/src/commands/ci-setup.js +0 -288
- package/src/commands/ingest.js +0 -458
- package/src/commands/setup.js +0 -137
- package/src/commands/validate-docs.js +0 -529
- package/src/lib/playwright-runner.js +0 -252
- package/web/manager/dist/assets/index--ZgioErz.js +0 -507
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
document.documentElement.style.colorScheme = isDark ? 'dark' : 'light';
|
|
17
17
|
})();
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-D0S2otug.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/index-n468W0Wr.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
package/src/commands/ci-run.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
// ci-run.js - Composite command: run + publish in one step (CI-optimized)
|
|
2
|
-
const chalk = require("chalk");
|
|
3
|
-
const fs = require("fs-extra");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const { detectCI, getCIMetadata } = require("../lib/ci-detect");
|
|
6
|
-
|
|
7
|
-
async function ciRunCommand(options = {}) {
|
|
8
|
-
const { config: configPath, tag, message, dryRun, publish: shouldPublish = true } = options;
|
|
9
|
-
|
|
10
|
-
// Disable colors in CI for cleaner logs
|
|
11
|
-
const { isCI, provider } = detectCI();
|
|
12
|
-
if (isCI) {
|
|
13
|
-
process.env.NO_COLOR = "1";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const ciMeta = getCIMetadata();
|
|
17
|
-
|
|
18
|
-
console.log(chalk.cyan("š¤ Reshot CI Run\n"));
|
|
19
|
-
if (isCI) {
|
|
20
|
-
console.log(chalk.gray(` Provider: ${provider || "unknown"}`));
|
|
21
|
-
if (ciMeta.commitSha) {
|
|
22
|
-
console.log(chalk.gray(` Commit: ${ciMeta.commitSha.slice(0, 8)}`));
|
|
23
|
-
}
|
|
24
|
-
if (ciMeta.branch) {
|
|
25
|
-
console.log(chalk.gray(` Branch: ${ciMeta.branch}`));
|
|
26
|
-
}
|
|
27
|
-
console.log();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Override config path if specified
|
|
31
|
-
if (configPath) {
|
|
32
|
-
process.env.RESHOT_CONFIG_PATH = configPath;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const ciResult = {
|
|
36
|
-
run: { success: false, scenariosRun: 0, scenariosFailed: 0 },
|
|
37
|
-
publish: null,
|
|
38
|
-
ci: ciMeta,
|
|
39
|
-
timestamp: new Date().toISOString(),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Step 1: Run capture scenarios
|
|
43
|
-
console.log(chalk.cyan("āāā Step 1: Capture āāā\n"));
|
|
44
|
-
try {
|
|
45
|
-
const runCommand = require("./run");
|
|
46
|
-
const runResult = await runCommand({
|
|
47
|
-
headless: true,
|
|
48
|
-
noExit: true,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
ciResult.run.success = runResult?.success ?? false;
|
|
52
|
-
if (runResult?.results) {
|
|
53
|
-
ciResult.run.scenariosRun = runResult.results.length;
|
|
54
|
-
ciResult.run.scenariosFailed = runResult.results.filter((r) => !r.success).length;
|
|
55
|
-
}
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error(chalk.red(`Capture failed: ${error.message}`));
|
|
58
|
-
ciResult.run.success = false;
|
|
59
|
-
ciResult.run.error = error.message;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Step 2: Publish (unless --no-publish or capture failed)
|
|
63
|
-
if (shouldPublish && ciResult.run.success) {
|
|
64
|
-
console.log(chalk.cyan("\nāāā Step 2: Publish āāā\n"));
|
|
65
|
-
try {
|
|
66
|
-
const publishCommand = require("./publish");
|
|
67
|
-
const publishResult = await publishCommand({
|
|
68
|
-
tag,
|
|
69
|
-
message: message || (ciMeta.commitSha ? `CI publish (${ciMeta.commitSha.slice(0, 8)})` : "CI publish"),
|
|
70
|
-
dryRun,
|
|
71
|
-
force: true, // Skip prompts in CI
|
|
72
|
-
outputJson: true,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
ciResult.publish = {
|
|
76
|
-
success: (publishResult?.assetsFailed || 0) === 0,
|
|
77
|
-
assetsProcessed: publishResult?.assetsProcessed || 0,
|
|
78
|
-
assetsFailed: publishResult?.assetsFailed || 0,
|
|
79
|
-
assetsSkipped: publishResult?.assetsSkipped || 0,
|
|
80
|
-
viewUrl: publishResult?.viewUrl || null,
|
|
81
|
-
};
|
|
82
|
-
} catch (error) {
|
|
83
|
-
console.error(chalk.red(`Publish failed: ${error.message}`));
|
|
84
|
-
ciResult.publish = { success: false, error: error.message };
|
|
85
|
-
}
|
|
86
|
-
} else if (!shouldPublish) {
|
|
87
|
-
console.log(chalk.gray("\n Skipping publish (--no-publish)"));
|
|
88
|
-
} else if (!ciResult.run.success) {
|
|
89
|
-
console.log(chalk.yellow("\n Skipping publish (capture failed)"));
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Write composite result
|
|
93
|
-
const outputDir = path.join(process.cwd(), ".reshot", "output");
|
|
94
|
-
fs.ensureDirSync(outputDir);
|
|
95
|
-
const resultPath = path.join(outputDir, "ci-result.json");
|
|
96
|
-
fs.writeJsonSync(resultPath, ciResult, { spaces: 2 });
|
|
97
|
-
console.log(chalk.gray(`\nš CI result written to: ${resultPath}`));
|
|
98
|
-
|
|
99
|
-
// Summary
|
|
100
|
-
console.log(chalk.cyan("\nāāā CI Summary āāā\n"));
|
|
101
|
-
const runIcon = ciResult.run.success ? chalk.green("ā") : chalk.red("ā");
|
|
102
|
-
console.log(` ${runIcon} Capture: ${ciResult.run.scenariosRun} scenario(s), ${ciResult.run.scenariosFailed} failed`);
|
|
103
|
-
|
|
104
|
-
if (ciResult.publish) {
|
|
105
|
-
const pubIcon = ciResult.publish.success ? chalk.green("ā") : chalk.red("ā");
|
|
106
|
-
console.log(` ${pubIcon} Publish: ${ciResult.publish.assetsProcessed || 0} asset(s)`);
|
|
107
|
-
if (ciResult.publish.viewUrl) {
|
|
108
|
-
console.log(chalk.cyan(` š ${ciResult.publish.viewUrl}`));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
console.log();
|
|
113
|
-
|
|
114
|
-
// Exit with appropriate code
|
|
115
|
-
const overallSuccess = ciResult.run.success && (!ciResult.publish || ciResult.publish.success);
|
|
116
|
-
if (!overallSuccess) {
|
|
117
|
-
process.exitCode = 1;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return ciResult;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
module.exports = ciRunCommand;
|
package/src/commands/ci-setup.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
// ci-setup.js - Set up CI/CD integration
|
|
2
|
-
const inquirer = require('inquirer');
|
|
3
|
-
const chalk = require('chalk');
|
|
4
|
-
const fs = require('fs-extra');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
|
|
7
|
-
const GITHUB_ACTIONS_WORKFLOW = (secretNames) => `name: Reshot Visual Documentation
|
|
8
|
-
|
|
9
|
-
on:
|
|
10
|
-
push:
|
|
11
|
-
branches:
|
|
12
|
-
- main
|
|
13
|
-
- master
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
docs:
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
|
|
19
|
-
steps:
|
|
20
|
-
- name: Checkout code
|
|
21
|
-
uses: actions/checkout@v3
|
|
22
|
-
|
|
23
|
-
- name: Set up Node.js
|
|
24
|
-
uses: actions/setup-node@v3
|
|
25
|
-
with:
|
|
26
|
-
node-version: '18'
|
|
27
|
-
|
|
28
|
-
- name: Install dependencies
|
|
29
|
-
run: npm install
|
|
30
|
-
|
|
31
|
-
- name: Install Reshot CLI
|
|
32
|
-
run: npm install -g @reshot/cli
|
|
33
|
-
|
|
34
|
-
- name: Install Playwright browsers
|
|
35
|
-
run: npx playwright install chromium
|
|
36
|
-
|
|
37
|
-
- name: Install ffmpeg
|
|
38
|
-
run: sudo apt-get update && sudo apt-get install -y ffmpeg
|
|
39
|
-
|
|
40
|
-
# Generate visual assets from docsync.config.json blueprint
|
|
41
|
-
# Only runs if features.visuals is enabled for the project
|
|
42
|
-
- name: Run Reshot scenarios
|
|
43
|
-
env:
|
|
44
|
-
RESHOT_API_KEY: \${{ secrets.${secretNames.apiKey} }}
|
|
45
|
-
RESHOT_PROJECT_ID: \${{ secrets.${secretNames.projectId} }}
|
|
46
|
-
RESHOT_API_BASE_URL: \${{ secrets.${secretNames.baseUrl} }}
|
|
47
|
-
TEST_PASSWORD: \${{ secrets.${secretNames.testPassword} }}
|
|
48
|
-
run: reshot run
|
|
49
|
-
|
|
50
|
-
# Publish three streams to Reshot (respects project feature toggles):
|
|
51
|
-
# Stream A: Visual assets (screenshots/videos) - always enabled
|
|
52
|
-
# Stream B: Documentation files (if docs feature enabled + configured)
|
|
53
|
-
# Stream C: Changelog drafts from commit messages (if changelog feature enabled)
|
|
54
|
-
- name: Publish assets to Reshot
|
|
55
|
-
env:
|
|
56
|
-
RESHOT_API_KEY: \${{ secrets.${secretNames.apiKey} }}
|
|
57
|
-
RESHOT_PROJECT_ID: \${{ secrets.${secretNames.projectId} }}
|
|
58
|
-
RESHOT_API_BASE_URL: \${{ secrets.${secretNames.baseUrl} }}
|
|
59
|
-
TEST_PASSWORD: \${{ secrets.${secretNames.testPassword} }}
|
|
60
|
-
run: reshot publish
|
|
61
|
-
|
|
62
|
-
- name: Upload artifacts (optional)
|
|
63
|
-
uses: actions/upload-artifact@v3
|
|
64
|
-
if: always()
|
|
65
|
-
with:
|
|
66
|
-
name: reshot-output
|
|
67
|
-
path: .reshot/output/
|
|
68
|
-
`;
|
|
69
|
-
|
|
70
|
-
const CIRCLECI_CONFIG = (secretNames) => `version: 2.1
|
|
71
|
-
|
|
72
|
-
jobs:
|
|
73
|
-
docs:
|
|
74
|
-
docker:
|
|
75
|
-
- image: cimg/node:18.0-browsers
|
|
76
|
-
environment:
|
|
77
|
-
RESHOT_API_KEY: \${${secretNames.apiKey}}
|
|
78
|
-
RESHOT_PROJECT_ID: \${${secretNames.projectId}}
|
|
79
|
-
RESHOT_API_BASE_URL: \${${secretNames.baseUrl}}
|
|
80
|
-
TEST_PASSWORD: \${${secretNames.testPassword}}
|
|
81
|
-
steps:
|
|
82
|
-
- checkout
|
|
83
|
-
|
|
84
|
-
- run:
|
|
85
|
-
name: Install dependencies
|
|
86
|
-
command: |
|
|
87
|
-
npm install
|
|
88
|
-
npm install -g @reshot/cli
|
|
89
|
-
|
|
90
|
-
- run:
|
|
91
|
-
name: Install Playwright browsers
|
|
92
|
-
command: npx playwright install chromium
|
|
93
|
-
|
|
94
|
-
- run:
|
|
95
|
-
name: Install ffmpeg
|
|
96
|
-
command: sudo apt-get update && sudo apt-get install -y ffmpeg
|
|
97
|
-
|
|
98
|
-
- run:
|
|
99
|
-
name: Run Reshot scenarios
|
|
100
|
-
command: reshot run
|
|
101
|
-
|
|
102
|
-
- run:
|
|
103
|
-
name: Publish assets to Reshot
|
|
104
|
-
command: reshot publish
|
|
105
|
-
|
|
106
|
-
- store_artifacts:
|
|
107
|
-
path: .reshot/output
|
|
108
|
-
|
|
109
|
-
workflows:
|
|
110
|
-
version: 2
|
|
111
|
-
docs:
|
|
112
|
-
jobs:
|
|
113
|
-
- docs
|
|
114
|
-
`;
|
|
115
|
-
|
|
116
|
-
const GITLAB_CI_CONFIG = (secretNames) => `stages:
|
|
117
|
-
- docs
|
|
118
|
-
|
|
119
|
-
docs:
|
|
120
|
-
stage: docs
|
|
121
|
-
image: node:18
|
|
122
|
-
|
|
123
|
-
variables:
|
|
124
|
-
RESHOT_API_KEY: \$${secretNames.apiKey}
|
|
125
|
-
RESHOT_PROJECT_ID: \$${secretNames.projectId}
|
|
126
|
-
RESHOT_API_BASE_URL: \$${secretNames.baseUrl}
|
|
127
|
-
TEST_PASSWORD: \$${secretNames.testPassword}
|
|
128
|
-
|
|
129
|
-
before_script:
|
|
130
|
-
- apt-get update && apt-get install -y ffmpeg
|
|
131
|
-
- npm install
|
|
132
|
-
- npx playwright install chromium
|
|
133
|
-
- npm install -g @reshot/cli
|
|
134
|
-
|
|
135
|
-
script:
|
|
136
|
-
- reshot run
|
|
137
|
-
- reshot publish
|
|
138
|
-
|
|
139
|
-
artifacts:
|
|
140
|
-
paths:
|
|
141
|
-
- .reshot/output/
|
|
142
|
-
expire_in: 1 week
|
|
143
|
-
|
|
144
|
-
only:
|
|
145
|
-
- main
|
|
146
|
-
- master
|
|
147
|
-
`;
|
|
148
|
-
|
|
149
|
-
async function ciSetupCommand() {
|
|
150
|
-
console.log(chalk.cyan('š§ Setting up CI/CD integration...\n'));
|
|
151
|
-
|
|
152
|
-
// Prompt for CI provider
|
|
153
|
-
const { provider } = await inquirer.prompt([
|
|
154
|
-
{
|
|
155
|
-
type: 'list',
|
|
156
|
-
name: 'provider',
|
|
157
|
-
message: 'Select your CI/CD provider:',
|
|
158
|
-
choices: [
|
|
159
|
-
{ name: 'GitHub Actions', value: 'github' },
|
|
160
|
-
{ name: 'CircleCI', value: 'circleci' },
|
|
161
|
-
{ name: 'GitLab CI', value: 'gitlab' }
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
]);
|
|
165
|
-
|
|
166
|
-
// Prompt for secret names
|
|
167
|
-
console.log(chalk.cyan('\nEnter the names for your CI secrets:'));
|
|
168
|
-
const { apiKeySecret, projectIdSecret, baseUrlSecret, testPasswordSecret } = await inquirer.prompt([
|
|
169
|
-
{
|
|
170
|
-
type: 'input',
|
|
171
|
-
name: 'apiKeySecret',
|
|
172
|
-
message: 'API Key secret name:',
|
|
173
|
-
default: 'RESHOT_API_KEY'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
type: 'input',
|
|
177
|
-
name: 'projectIdSecret',
|
|
178
|
-
message: 'Project ID secret name:',
|
|
179
|
-
default: 'RESHOT_PROJECT_ID'
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
type: 'input',
|
|
183
|
-
name: 'baseUrlSecret',
|
|
184
|
-
message: 'Base URL secret name:',
|
|
185
|
-
default: 'RESHOT_API_BASE_URL'
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
type: 'input',
|
|
189
|
-
name: 'testPasswordSecret',
|
|
190
|
-
message: 'Test password secret name:',
|
|
191
|
-
default: 'TEST_PASSWORD'
|
|
192
|
-
}
|
|
193
|
-
]);
|
|
194
|
-
|
|
195
|
-
const secretNames = {
|
|
196
|
-
apiKey: apiKeySecret,
|
|
197
|
-
projectId: projectIdSecret,
|
|
198
|
-
baseUrl: baseUrlSecret,
|
|
199
|
-
testPassword: testPasswordSecret
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
// Generate workflow file based on provider
|
|
203
|
-
let workflowPath;
|
|
204
|
-
let workflowContent;
|
|
205
|
-
|
|
206
|
-
switch (provider) {
|
|
207
|
-
case 'github':
|
|
208
|
-
workflowPath = path.join(process.cwd(), '.github', 'workflows', 'docsync.yml');
|
|
209
|
-
workflowContent = GITHUB_ACTIONS_WORKFLOW(secretNames);
|
|
210
|
-
break;
|
|
211
|
-
|
|
212
|
-
case 'circleci':
|
|
213
|
-
workflowPath = path.join(process.cwd(), '.circleci', 'config.yml');
|
|
214
|
-
workflowContent = CIRCLECI_CONFIG(secretNames);
|
|
215
|
-
break;
|
|
216
|
-
|
|
217
|
-
case 'gitlab':
|
|
218
|
-
workflowPath = path.join(process.cwd(), '.gitlab-ci.yml');
|
|
219
|
-
workflowContent = GITLAB_CI_CONFIG(secretNames);
|
|
220
|
-
break;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// Check if file already exists
|
|
224
|
-
if (fs.existsSync(workflowPath)) {
|
|
225
|
-
const { overwrite } = await inquirer.prompt([
|
|
226
|
-
{
|
|
227
|
-
type: 'confirm',
|
|
228
|
-
name: 'overwrite',
|
|
229
|
-
message: `${workflowPath} already exists. Overwrite?`,
|
|
230
|
-
default: false
|
|
231
|
-
}
|
|
232
|
-
]);
|
|
233
|
-
|
|
234
|
-
if (!overwrite) {
|
|
235
|
-
console.log(chalk.yellow('\nā Setup cancelled. Existing workflow file was not modified.'));
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Write workflow file
|
|
241
|
-
fs.ensureDirSync(path.dirname(workflowPath));
|
|
242
|
-
fs.writeFileSync(workflowPath, workflowContent);
|
|
243
|
-
|
|
244
|
-
console.log(chalk.green(`\nā Workflow file created: ${workflowPath}`));
|
|
245
|
-
|
|
246
|
-
// Print instructions
|
|
247
|
-
console.log(chalk.cyan('\nš Next Steps:\n'));
|
|
248
|
-
|
|
249
|
-
switch (provider) {
|
|
250
|
-
case 'github':
|
|
251
|
-
console.log('1. Go to your GitHub repository settings');
|
|
252
|
-
console.log('2. Navigate to ' + chalk.bold('Secrets and variables > Actions'));
|
|
253
|
-
console.log('3. Add the following secrets:\n');
|
|
254
|
-
console.log(` ${chalk.bold(secretNames.apiKey)} (Project API key for CLI uploads)`);
|
|
255
|
-
console.log(` ${chalk.bold(secretNames.projectId)} (Project ID for metadata)`);
|
|
256
|
-
console.log(` ${chalk.bold(secretNames.baseUrl)} (API base URL, e.g. https://api.reshot.dev/api)`);
|
|
257
|
-
console.log(` ${chalk.bold(secretNames.testPassword)} (Any additional test credential you reference)`);
|
|
258
|
-
console.log('\n4. Commit and push the workflow file to trigger the action');
|
|
259
|
-
break;
|
|
260
|
-
|
|
261
|
-
case 'circleci':
|
|
262
|
-
console.log('1. Go to your CircleCI project settings');
|
|
263
|
-
console.log('2. Navigate to ' + chalk.bold('Environment Variables'));
|
|
264
|
-
console.log('3. Add the following variables:\n');
|
|
265
|
-
console.log(` ${chalk.bold(secretNames.apiKey)}`);
|
|
266
|
-
console.log(` ${chalk.bold(secretNames.projectId)}`);
|
|
267
|
-
console.log(` ${chalk.bold(secretNames.baseUrl)}`);
|
|
268
|
-
console.log(` ${chalk.bold(secretNames.testPassword)}`);
|
|
269
|
-
console.log('\n4. Commit and push the config file to trigger the pipeline');
|
|
270
|
-
break;
|
|
271
|
-
|
|
272
|
-
case 'gitlab':
|
|
273
|
-
console.log('1. Go to your GitLab project settings');
|
|
274
|
-
console.log('2. Navigate to ' + chalk.bold('CI/CD > Variables'));
|
|
275
|
-
console.log('3. Add the following variables:\n');
|
|
276
|
-
console.log(` ${chalk.bold(secretNames.apiKey)}`);
|
|
277
|
-
console.log(` ${chalk.bold(secretNames.projectId)}`);
|
|
278
|
-
console.log(` ${chalk.bold(secretNames.baseUrl)}`);
|
|
279
|
-
console.log(` ${chalk.bold(secretNames.testPassword)}`);
|
|
280
|
-
console.log('\n4. Commit and push the config file to trigger the pipeline');
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
console.log();
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
module.exports = ciSetupCommand;
|
|
288
|
-
|