@scrymore/scry-deployer 0.1.1 → 0.2.1
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 +4 -1
- package/lib/coverage.js +14 -1
- package/lib/templates.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -184,7 +184,7 @@ The CLI is configured through a combination of command-line options and environm
|
|
|
184
184
|
| `--api-url` | `STORYBOOK_DEPLOYER_API_URL` | Base URL for the deployment service API. | No | `https://api.default-service.com/v1` |
|
|
185
185
|
| `--project` | `STORYBOOK_DEPLOYER_PROJECT` | The project name/identifier. | No | `main` |
|
|
186
186
|
| `--version` | `STORYBOOK_DEPLOYER_VERSION` | The version identifier for the deployment. | No | `latest` |
|
|
187
|
-
| `--with-analysis` | `STORYBOOK_DEPLOYER_WITH_ANALYSIS` | Enable Storybook analysis (story crawling + screenshots).
|
|
187
|
+
| `--with-analysis` | `STORYBOOK_DEPLOYER_WITH_ANALYSIS` | Enable Storybook analysis (story crawling + screenshots). Enabled by default in generated workflows. | No | `false` |
|
|
188
188
|
| `--stories-dir` | `STORYBOOK_DEPLOYER_STORIES_DIR` | Path to stories directory (optional, auto-detects .stories.* files). | No | Auto-detect |
|
|
189
189
|
| `--screenshots-dir` | `STORYBOOK_DEPLOYER_SCREENSHOTS_DIR` | Directory for captured screenshots. | No | `./screenshots` |
|
|
190
190
|
| `--storybook-url` | `STORYBOOK_DEPLOYER_STORYBOOK_URL` | URL of running Storybook server for screenshot capture. | No | `http://localhost:6006` |
|
|
@@ -431,6 +431,8 @@ If you're installing from GitHub, the workflow file is already included.
|
|
|
431
431
|
|
|
432
432
|
**Note:** The `SCRY_VIEW_URL` is where users will access your deployed Storybook (e.g., `https://view.scrymore.com/{project}/pr-{number}/`). This is separate from `SCRY_API_URL`, which is the backend API endpoint used for uploads.
|
|
433
433
|
|
|
434
|
+
**Note:** Generated workflows include `--with-analysis` by default for build processing service integration. To disable, add `STORYBOOK_DEPLOYER_WITH_ANALYSIS` as a repository variable set to `false`.
|
|
435
|
+
|
|
434
436
|
**Step 3: Configure GitHub Actions Secrets (Optional)**
|
|
435
437
|
|
|
436
438
|
If your backend requires authentication:
|
|
@@ -508,6 +510,7 @@ The PR preview workflow uses these environment variables (configured via GitHub
|
|
|
508
510
|
| `SCRY_API_URL` | GitHub Variable | **Yes** | Backend API endpoint for uploads |
|
|
509
511
|
| `SCRY_VIEW_URL` | GitHub Variable | No | Base URL where users view Storybooks (default: `https://view.scrymore.com`) |
|
|
510
512
|
| `SCRY_API_KEY` | GitHub Secret | No | API authentication key (if required) |
|
|
513
|
+
| `STORYBOOK_DEPLOYER_WITH_ANALYSIS` | GitHub Variable | No | Set to `false` to disable build processing service integration (enabled by default in generated workflows) |
|
|
511
514
|
|
|
512
515
|
**Important:** `SCRY_API_URL` (where files are uploaded) and `SCRY_VIEW_URL` (where users view the deployed Storybook) are two different URLs:
|
|
513
516
|
- **API URL**: Backend service endpoint (e.g., `https://api.scrymore.com`)
|
package/lib/coverage.js
CHANGED
|
@@ -81,7 +81,20 @@ async function runCoverageAnalysis(options) {
|
|
|
81
81
|
// Allow local override for E2E testing before package publication.
|
|
82
82
|
// Example:
|
|
83
83
|
// SCRY_SBCOV_CMD="node /abs/path/to/scry-sbcov/dist/cli/index.js"
|
|
84
|
-
|
|
84
|
+
//
|
|
85
|
+
// Default: resolve the CLI from the installed dependency to avoid npx cache
|
|
86
|
+
// issues where `npx -y` might resolve a stale older version.
|
|
87
|
+
let defaultSbcovCmd = 'npx -y @scrymore/scry-sbcov';
|
|
88
|
+
try {
|
|
89
|
+
const sbcovCli = require.resolve('@scrymore/scry-sbcov/dist/cli/index.js');
|
|
90
|
+
defaultSbcovCmd = `node ${shellEscape(sbcovCli)}`;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// Fall back to npx if resolve fails (e.g. not installed as dependency)
|
|
93
|
+
if (error.code !== 'MODULE_NOT_FOUND') {
|
|
94
|
+
console.warn('[scry-deployer] Unexpected error resolving @scrymore/scry-sbcov, falling back to npx:', error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const sbcovCommandPrefix = (process.env.SCRY_SBCOV_CMD || defaultSbcovCmd).trim();
|
|
85
98
|
const npxCommand = `${sbcovCommandPrefix} ${cliArgs.map(shellEscape).join(' ')}`;
|
|
86
99
|
|
|
87
100
|
// Debug logging to show the exact command being executed
|
package/lib/templates.js
CHANGED
|
@@ -103,6 +103,7 @@ ${cache}
|
|
|
103
103
|
\${{ vars.SCRY_COVERAGE_ENABLED == 'false' && '--no-coverage' || '' }} \\
|
|
104
104
|
\${{ vars.SCRY_COVERAGE_FAIL_ON_THRESHOLD == 'true' && '--coverage-fail-on-threshold' || '' }} \\
|
|
105
105
|
\${{ vars.SCRY_COVERAGE_EXECUTE == 'false' && '' || '--coverage-execute' }} \\
|
|
106
|
+
--with-analysis \\
|
|
106
107
|
--coverage-base \${{ vars.SCRY_COVERAGE_BASE || github.event.before }}
|
|
107
108
|
env:
|
|
108
109
|
STORYBOOK_DEPLOYER_API_URL: \${{ vars.SCRY_API_URL }}
|
|
@@ -167,6 +168,7 @@ ${cache}
|
|
|
167
168
|
\${{ vars.SCRY_COVERAGE_ENABLED == 'false' && '--no-coverage' || '' }} \\
|
|
168
169
|
\${{ vars.SCRY_COVERAGE_FAIL_ON_THRESHOLD == 'true' && '--coverage-fail-on-threshold' || '' }} \\
|
|
169
170
|
\${{ vars.SCRY_COVERAGE_EXECUTE == 'false' && '' || '--coverage-execute' }} \\
|
|
171
|
+
--with-analysis \\
|
|
170
172
|
--coverage-base \${{ vars.SCRY_COVERAGE_BASE || format('origin/{0}', github.base_ref) }}
|
|
171
173
|
|
|
172
174
|
# Construct deployment URL using VIEW_URL (where users access the deployed Storybook)
|