@vzn/vx-ci 0.0.645 → 0.0.646

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 CHANGED
@@ -8,7 +8,7 @@ page and names the run's cache scope; `gitlab()` names the run's cache
8
8
  scope on GitLab CI ([below](#gitlab-ci)).
9
9
 
10
10
  ```sh
11
- npm install -D @vzn/vx @vzn/vx-ci # or: pnpm add -D -w · yarn add -D (-W on Yarn 1) · bun add -d
11
+ bun add -d @vzn/vx @vzn/vx-ci
12
12
  ```
13
13
 
14
14
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx-ci",
3
- "version": "0.0.645",
3
+ "version": "0.0.646",
4
4
  "license": "MIT",
5
5
  "description": "GitHub Actions and GitLab CI integration for vx — a job summary on Actions and the branch cache scope on both.",
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "peerDependencies": {
37
- "@vzn/vx": "^0.0.645"
37
+ "@vzn/vx": "^0.0.646"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",
package/src/index.ts CHANGED
@@ -8,9 +8,32 @@
8
8
  // On a GitHub Actions runner (GITHUB_STEP_SUMMARY set) every `vx run`
9
9
  // appends a job summary: verdict, stats, failures, and the per-task table.
10
10
  // Anywhere else the plugin declines and costs nothing.
11
- export { github, type GithubPluginOptions } from './plugin.js'
12
- export { gitlab, type GitlabPluginOptions } from './gitlab.js'
13
- export { renderJobSummary } from './summary.js'
11
+ import { createRequire } from 'node:module'
12
+ import type { RunSummaryRecord, VxPlugin } from '@vzn/vx'
13
+ import type { GithubPluginOptions } from './plugin.js'
14
+ import type { GitlabPluginOptions } from './gitlab.js'
15
+
16
+ export type { GithubPluginOptions, GitlabPluginOptions }
17
+
18
+ // Every run evaluates `.vx/workspace.ts`, and off CI both factories
19
+ // decline: this file is all a laptop loads (five files were ~1.1 ms of
20
+ // every run). Each module loads on its own CI, by `require` as the
21
+ // factories are synchronous.
22
+ const load = createRequire(import.meta.url)
23
+
24
+ export function github(options?: GithubPluginOptions): VxPlugin | undefined {
25
+ if (process.env['GITHUB_ACTIONS'] !== 'true') return undefined
26
+ return (load('./plugin.js') as typeof import('./plugin.js')).github(options)
27
+ }
28
+
29
+ export function gitlab(options?: GitlabPluginOptions): VxPlugin | undefined {
30
+ if (process.env['GITLAB_CI'] !== 'true') return undefined
31
+ return (load('./gitlab.js') as typeof import('./gitlab.js')).gitlab(options)
32
+ }
33
+
34
+ export function renderJobSummary(summary: RunSummaryRecord, title?: string): string {
35
+ return (load('./summary.js') as typeof import('./summary.js')).renderJobSummary(summary, title)
36
+ }
14
37
 
15
38
  // The Checks API helpers are the plugin's own; only the transport type
16
39
  // the options name is public (1.0 freezes what this file exports).