gagen 0.3.3 → 0.4.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 +37 -131
- package/esm/_dnt.polyfills.d.ts +99 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +127 -1
- package/esm/artifact.d.ts +1 -1
- package/esm/artifact.d.ts.map +1 -1
- package/esm/artifact.js +1 -1
- package/esm/cli.d.ts +4 -0
- package/esm/cli.d.ts.map +1 -0
- package/esm/cli.js +48 -0
- package/esm/job.d.ts.map +1 -1
- package/esm/job.js +3 -2
- package/esm/mod.d.ts +8 -2
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +13 -2
- package/esm/step.d.ts +4 -2
- package/esm/step.d.ts.map +1 -1
- package/esm/step.js +8 -1
- package/esm/workflow.d.ts +1 -1
- package/esm/workflow.d.ts.map +1 -1
- package/esm/workflow.js +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ initial code is more easily maintainable.
|
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
#!/usr/bin/env -S deno run --allow-read=ci.generated.yml --allow-write=ci.generated.yml
|
|
20
|
-
import { conditions,
|
|
20
|
+
import { conditions, step, workflow } from "gagen";
|
|
21
21
|
|
|
22
22
|
const checkout = step({
|
|
23
23
|
uses: "actions/checkout@v6",
|
|
@@ -47,7 +47,7 @@ const lint = step
|
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
// only specify the leaf steps — the other steps are pulled in automatically
|
|
50
|
-
|
|
50
|
+
workflow({
|
|
51
51
|
name: "ci",
|
|
52
52
|
on: ["push", "pull_request"],
|
|
53
53
|
jobs: [{
|
|
@@ -100,10 +100,28 @@ up to date:
|
|
|
100
100
|
```ts
|
|
101
101
|
const lintStep = step({
|
|
102
102
|
name: "Lint CI generation",
|
|
103
|
+
// alternatively, use `npx gagen --lint` to lint all the files
|
|
104
|
+
// in the `.github/workflows` folder
|
|
103
105
|
run: "./.github/workflows/ci.ts --lint",
|
|
104
106
|
});
|
|
105
107
|
```
|
|
106
108
|
|
|
109
|
+
## CLI
|
|
110
|
+
|
|
111
|
+
If you store your generations scripts beside your `.yml` files in the
|
|
112
|
+
`.github/workflows` folder, then you can automatically run all these scripts by
|
|
113
|
+
using the `gagen` binary:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
# generate the output
|
|
117
|
+
npx gagen
|
|
118
|
+
|
|
119
|
+
# lint the output
|
|
120
|
+
npx gagen --lint
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The requires your scripts to use the `writeOrLint` function.
|
|
124
|
+
|
|
107
125
|
## Dependency pinning—the output is a lockfile
|
|
108
126
|
|
|
109
127
|
By default, `writeOrLint` pins action references to their resolved commit hashes
|
|
@@ -237,7 +255,7 @@ const runner = os.equals("linux").then("ubuntu-latest")
|
|
|
237
255
|
// => matrix.os == 'linux' && 'ubuntu-latest' || matrix.os == 'macos' && 'macos-latest' || 'windows-latest'
|
|
238
256
|
|
|
239
257
|
// use in job config
|
|
240
|
-
|
|
258
|
+
workflow({
|
|
241
259
|
// ...,
|
|
242
260
|
jobs: [
|
|
243
261
|
{ id: "build", runsOn: runner, steps: [test] },
|
|
@@ -262,7 +280,7 @@ const test = step.dependsOn(build).if(expr("matrix.job").equals("test"))({
|
|
|
262
280
|
});
|
|
263
281
|
|
|
264
282
|
// only test is passed — checkout and build inherit its condition
|
|
265
|
-
|
|
283
|
+
workflow({
|
|
266
284
|
...,
|
|
267
285
|
jobs: [
|
|
268
286
|
{ id: "test", runsOn: "ubuntu-latest", steps: [test] },
|
|
@@ -282,7 +300,7 @@ const bench = step.dependsOn(checkout).if(jobExpr.equals("bench"))({
|
|
|
282
300
|
run: "cargo bench",
|
|
283
301
|
});
|
|
284
302
|
|
|
285
|
-
|
|
303
|
+
workflow({
|
|
286
304
|
...,
|
|
287
305
|
jobs: [
|
|
288
306
|
{ id: "test", runsOn: "ubuntu-latest", steps: [test, bench] },
|
|
@@ -297,7 +315,7 @@ Steps can declare outputs. When a job references another job's outputs, the
|
|
|
297
315
|
`needs` dependency is inferred automatically.
|
|
298
316
|
|
|
299
317
|
```ts
|
|
300
|
-
import {
|
|
318
|
+
import { job, step, workflow } from "gagen";
|
|
301
319
|
|
|
302
320
|
const checkStep = step({
|
|
303
321
|
id: "check",
|
|
@@ -315,7 +333,7 @@ const preBuild = job("pre_build", {
|
|
|
315
333
|
|
|
316
334
|
// preBuild.outputs.skip is an ExpressionValue — using it in the `if`
|
|
317
335
|
// automatically adds needs: [pre_build] to this job
|
|
318
|
-
const wf =
|
|
336
|
+
const wf = workflow({
|
|
319
337
|
name: "ci",
|
|
320
338
|
on: ["push", "pull_request"],
|
|
321
339
|
jobs: [
|
|
@@ -344,7 +362,7 @@ const integrate = step.dependsOn(buildA, buildB)({
|
|
|
344
362
|
run: "make all",
|
|
345
363
|
});
|
|
346
364
|
|
|
347
|
-
|
|
365
|
+
workflow({
|
|
348
366
|
...,
|
|
349
367
|
jobs: [
|
|
350
368
|
{ id: "ci", runsOn: "ubuntu-latest", steps: [integrate] },
|
|
@@ -371,7 +389,7 @@ const checkout = step.comesAfter(setupDeno)({ uses: "actions/checkout@v6" });
|
|
|
371
389
|
const build = step.dependsOn(checkout)({ run: "cargo build" });
|
|
372
390
|
const lint = step.dependsOn(setupDeno, checkout)({ run: "deno lint" });
|
|
373
391
|
|
|
374
|
-
|
|
392
|
+
workflow({
|
|
375
393
|
...,
|
|
376
394
|
jobs: [
|
|
377
395
|
{ id: "ci", runsOn: "ubuntu-latest", steps: [build, lint] },
|
|
@@ -392,7 +410,7 @@ Error: Cycle detected in step ordering: A → B → A
|
|
|
392
410
|
`defineMatrix()` gives you typed access to matrix values:
|
|
393
411
|
|
|
394
412
|
```ts
|
|
395
|
-
import {
|
|
413
|
+
import { workflow, defineMatrix } from "gagen";
|
|
396
414
|
|
|
397
415
|
const matrix = defineMatrix({
|
|
398
416
|
include: [
|
|
@@ -404,7 +422,7 @@ const matrix = defineMatrix({
|
|
|
404
422
|
matrix.runner; // ExpressionValue("matrix.runner") — autocompletes
|
|
405
423
|
matrix.foo; // TypeScript error — not a matrix key
|
|
406
424
|
|
|
407
|
-
|
|
425
|
+
workflow({
|
|
408
426
|
...,
|
|
409
427
|
jobs: [
|
|
410
428
|
{
|
|
@@ -417,83 +435,17 @@ createWorkflow({
|
|
|
417
435
|
});
|
|
418
436
|
```
|
|
419
437
|
|
|
420
|
-
Also works with key-value arrays:
|
|
421
|
-
|
|
422
|
-
```ts
|
|
423
|
-
const matrix = defineMatrix({
|
|
424
|
-
os: ["linux", "macos"],
|
|
425
|
-
node: [18, 20],
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
matrix.os.equals("linux"); // condition for use in step `if`
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
### Matrix exclude
|
|
432
|
-
|
|
433
|
-
Pass an `exclude` array to remove specific combinations:
|
|
434
|
-
|
|
435
|
-
```ts
|
|
436
|
-
const matrix = defineMatrix({
|
|
437
|
-
os: ["linux", "macos"],
|
|
438
|
-
node: [18, 20],
|
|
439
|
-
exclude: [{ os: "macos", node: 18 }],
|
|
440
|
-
});
|
|
441
|
-
|
|
442
|
-
// matrix.os and matrix.node are still typed — exclude is not a key
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
## Permissions
|
|
446
|
-
|
|
447
|
-
Type-safe workflow and job permissions:
|
|
448
|
-
|
|
449
|
-
```ts
|
|
450
|
-
import { createWorkflow } from "gagen";
|
|
451
|
-
|
|
452
|
-
const wf = createWorkflow({
|
|
453
|
-
name: "ci",
|
|
454
|
-
on: ["push", "pull_request"],
|
|
455
|
-
permissions: { contents: "read", packages: "write" },
|
|
456
|
-
});
|
|
457
|
-
|
|
458
|
-
// or use a scalar value
|
|
459
|
-
const wf2 = createWorkflow({
|
|
460
|
-
name: "ci",
|
|
461
|
-
on: ["push", "pull_request"],
|
|
462
|
-
permissions: "read-all",
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
// job-level permissions
|
|
466
|
-
createWorkflow({
|
|
467
|
-
...,
|
|
468
|
-
jobs: [
|
|
469
|
-
{
|
|
470
|
-
id: "deploy",
|
|
471
|
-
runsOn: "ubuntu-latest",
|
|
472
|
-
permissions: { contents: "read", "id-token": "write" },
|
|
473
|
-
steps: [deploy],
|
|
474
|
-
},
|
|
475
|
-
],
|
|
476
|
-
});
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
Permission scopes (`contents`, `packages`, `id-token`, etc.) and levels (`read`,
|
|
480
|
-
`write`, `none`) are fully typed.
|
|
481
|
-
|
|
482
438
|
## Artifacts
|
|
483
439
|
|
|
484
440
|
Link upload and download artifact steps across jobs with automatic `needs`
|
|
485
441
|
inference:
|
|
486
442
|
|
|
487
443
|
```ts
|
|
488
|
-
import {
|
|
489
|
-
createWorkflow,
|
|
490
|
-
defineArtifact,
|
|
491
|
-
step,
|
|
492
|
-
} from "gagen";
|
|
444
|
+
import { artifact, step, workflow } from "gagen";
|
|
493
445
|
|
|
494
|
-
const
|
|
446
|
+
const buildOutput = artifact("build-output");
|
|
495
447
|
|
|
496
|
-
const wf =
|
|
448
|
+
const wf = workflow({
|
|
497
449
|
name: "CI",
|
|
498
450
|
on: ["push", "pull_request"],
|
|
499
451
|
jobs: [
|
|
@@ -502,7 +454,7 @@ const wf = createWorkflow({
|
|
|
502
454
|
runsOn: "ubuntu-latest",
|
|
503
455
|
steps: [
|
|
504
456
|
step({ name: "Build", run: "make build" }),
|
|
505
|
-
|
|
457
|
+
buildOutput.upload({ path: "dist/" }),
|
|
506
458
|
],
|
|
507
459
|
},
|
|
508
460
|
// `needs: [build]` is inferred automatically from the artifact link
|
|
@@ -510,11 +462,11 @@ const wf = createWorkflow({
|
|
|
510
462
|
id: "deploy",
|
|
511
463
|
runsOn: "ubuntu-latest",
|
|
512
464
|
steps: [
|
|
513
|
-
|
|
514
|
-
|
|
465
|
+
buildOutput.download({ dirPath: "output/" }),
|
|
466
|
+
{
|
|
515
467
|
name: "Deploy",
|
|
516
468
|
run: "make deploy",
|
|
517
|
-
}
|
|
469
|
+
},
|
|
518
470
|
],
|
|
519
471
|
},
|
|
520
472
|
],
|
|
@@ -527,54 +479,8 @@ optional `dirPath` (the directory to download into).
|
|
|
527
479
|
The artifact version and default retention days can be configured:
|
|
528
480
|
|
|
529
481
|
```ts
|
|
530
|
-
const
|
|
482
|
+
const buildOutput = artifact("build-output", {
|
|
531
483
|
version: "v3",
|
|
532
484
|
retentionDays: 5,
|
|
533
485
|
});
|
|
534
486
|
```
|
|
535
|
-
|
|
536
|
-
## Job configuration
|
|
537
|
-
|
|
538
|
-
```ts
|
|
539
|
-
const matrix = defineMatrix({
|
|
540
|
-
include: [
|
|
541
|
-
{ runner: "ubuntu-latest" },
|
|
542
|
-
{ runner: "macos-latest" },
|
|
543
|
-
],
|
|
544
|
-
});
|
|
545
|
-
|
|
546
|
-
createWorkflow({
|
|
547
|
-
...,
|
|
548
|
-
jobs: [
|
|
549
|
-
{
|
|
550
|
-
id: "build",
|
|
551
|
-
name: "Build",
|
|
552
|
-
runsOn: matrix.runner,
|
|
553
|
-
timeoutMinutes: 60,
|
|
554
|
-
defaults: { run: { shell: "bash" } },
|
|
555
|
-
env: { CARGO_TERM_COLOR: "always" },
|
|
556
|
-
permissions: { contents: "read" },
|
|
557
|
-
concurrency: { group: "build-${{ github.ref }}", cancelInProgress: true },
|
|
558
|
-
strategy: { matrix, failFast: true },
|
|
559
|
-
steps: [test],
|
|
560
|
-
},
|
|
561
|
-
],
|
|
562
|
-
});
|
|
563
|
-
```
|
|
564
|
-
|
|
565
|
-
## Step configuration
|
|
566
|
-
|
|
567
|
-
```ts
|
|
568
|
-
step({
|
|
569
|
-
name: "Deploy",
|
|
570
|
-
id: "deploy",
|
|
571
|
-
uses: "actions/deploy@v1",
|
|
572
|
-
with: { token: "${{ secrets.GITHUB_TOKEN }}" },
|
|
573
|
-
env: { NODE_ENV: "production" },
|
|
574
|
-
if: "github.ref == 'refs/heads/main'",
|
|
575
|
-
shell: "bash",
|
|
576
|
-
workingDirectory: "./app",
|
|
577
|
-
continueOnError: true,
|
|
578
|
-
timeoutMinutes: 10,
|
|
579
|
-
});
|
|
580
|
-
```
|
package/esm/_dnt.polyfills.d.ts
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
+
* but instead of using npm to install additional dependencies,
|
|
4
|
+
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
+
*
|
|
6
|
+
* Note that this code might be imported multiple times
|
|
7
|
+
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
+
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
+
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
+
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
+
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
+
*/
|
|
13
|
+
import { createRequire } from "node:module";
|
|
14
|
+
import { type URL } from "node:url";
|
|
15
|
+
declare global {
|
|
16
|
+
interface ImportMeta {
|
|
17
|
+
/** A string representation of the fully qualified module URL. When the
|
|
18
|
+
* module is loaded locally, the value will be a file URL (e.g.
|
|
19
|
+
* `file:///path/module.ts`).
|
|
20
|
+
*
|
|
21
|
+
* You can also parse the string as a URL to determine more information about
|
|
22
|
+
* how the current module was loaded. For example to determine if a module was
|
|
23
|
+
* local or not:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* const url = new URL(import.meta.url);
|
|
27
|
+
* if (url.protocol === "file:") {
|
|
28
|
+
* console.log("this module was loaded locally");
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
url: string;
|
|
33
|
+
/**
|
|
34
|
+
* A function that returns resolved specifier as if it would be imported
|
|
35
|
+
* using `import(specifier)`.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* console.log(import.meta.resolve("./foo.js"));
|
|
39
|
+
* // file:///dev/foo.js
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param specifier The module specifier to resolve relative to `parent`.
|
|
43
|
+
* @param parent The absolute parent module URL to resolve from.
|
|
44
|
+
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
45
|
+
*/
|
|
46
|
+
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
47
|
+
/** A flag that indicates if the current module is the main module that was
|
|
48
|
+
* called when starting the program under Deno.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* if (import.meta.main) {
|
|
52
|
+
* // this was loaded as the main module, maybe do some bootstrapping
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
main: boolean;
|
|
57
|
+
/** The absolute path of the current module.
|
|
58
|
+
*
|
|
59
|
+
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
60
|
+
*
|
|
61
|
+
* Example:
|
|
62
|
+
* ```
|
|
63
|
+
* // Unix
|
|
64
|
+
* console.log(import.meta.filename); // /home/alice/my_module.ts
|
|
65
|
+
*
|
|
66
|
+
* // Windows
|
|
67
|
+
* console.log(import.meta.filename); // C:\alice\my_module.ts
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
filename: string;
|
|
71
|
+
/** The absolute path of the directory containing the current module.
|
|
72
|
+
*
|
|
73
|
+
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
74
|
+
*
|
|
75
|
+
* * Example:
|
|
76
|
+
* ```
|
|
77
|
+
* // Unix
|
|
78
|
+
* console.log(import.meta.dirname); // /home/alice
|
|
79
|
+
*
|
|
80
|
+
* // Windows
|
|
81
|
+
* console.log(import.meta.dirname); // C:\alice
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
dirname: string;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
type NodeRequest = ReturnType<typeof createRequire>;
|
|
88
|
+
type NodeModule = NonNullable<NodeRequest["main"]>;
|
|
89
|
+
interface ImportMetaPonyfillCommonjs {
|
|
90
|
+
(require: NodeRequest, module: NodeModule): ImportMeta;
|
|
91
|
+
}
|
|
92
|
+
interface ImportMetaPonyfillEsmodule {
|
|
93
|
+
(importMeta: ImportMeta): ImportMeta;
|
|
94
|
+
}
|
|
95
|
+
interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
|
|
96
|
+
}
|
|
97
|
+
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
98
|
+
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
99
|
+
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
1
100
|
declare global {
|
|
2
101
|
interface Object {
|
|
3
102
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC;AAgBxB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd;;;;WAIG;QACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;KAC5C;CACF;AAED,OAAO,EAAE,CAAC"}
|
package/esm/_dnt.polyfills.js
CHANGED
|
@@ -1,3 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
+
* but instead of using npm to install additional dependencies,
|
|
4
|
+
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
+
*
|
|
6
|
+
* Note that this code might be imported multiple times
|
|
7
|
+
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
+
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
+
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
+
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
+
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
+
*/
|
|
13
|
+
//@ts-ignore
|
|
14
|
+
import { createRequire } from "node:module";
|
|
15
|
+
//@ts-ignore
|
|
16
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
17
|
+
//@ts-ignore
|
|
18
|
+
import { dirname } from "node:path";
|
|
19
|
+
const defineGlobalPonyfill = (symbolFor, fn) => {
|
|
20
|
+
if (!Reflect.has(globalThis, Symbol.for(symbolFor))) {
|
|
21
|
+
Object.defineProperty(globalThis, Symbol.for(symbolFor), {
|
|
22
|
+
configurable: true,
|
|
23
|
+
get() {
|
|
24
|
+
return fn;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export let import_meta_ponyfill_commonjs = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ??
|
|
30
|
+
(() => {
|
|
31
|
+
const moduleImportMetaWM = new WeakMap();
|
|
32
|
+
return (require, module) => {
|
|
33
|
+
let importMetaCache = moduleImportMetaWM.get(module);
|
|
34
|
+
if (importMetaCache == null) {
|
|
35
|
+
const importMeta = Object.assign(Object.create(null), {
|
|
36
|
+
url: pathToFileURL(module.filename).href,
|
|
37
|
+
main: require.main == module,
|
|
38
|
+
resolve: (specifier, parentURL = importMeta.url) => {
|
|
39
|
+
return pathToFileURL((importMeta.url === parentURL
|
|
40
|
+
? require
|
|
41
|
+
: createRequire(parentURL))
|
|
42
|
+
.resolve(specifier)).href;
|
|
43
|
+
},
|
|
44
|
+
filename: module.filename,
|
|
45
|
+
dirname: module.path,
|
|
46
|
+
});
|
|
47
|
+
moduleImportMetaWM.set(module, importMeta);
|
|
48
|
+
importMetaCache = importMeta;
|
|
49
|
+
}
|
|
50
|
+
return importMetaCache;
|
|
51
|
+
};
|
|
52
|
+
})());
|
|
53
|
+
defineGlobalPonyfill("import-meta-ponyfill-commonjs", import_meta_ponyfill_commonjs);
|
|
54
|
+
export let import_meta_ponyfill_esmodule = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ??
|
|
55
|
+
((importMeta) => {
|
|
56
|
+
const resolveFunStr = String(importMeta.resolve);
|
|
57
|
+
const shimWs = new WeakSet();
|
|
58
|
+
//@ts-ignore
|
|
59
|
+
const mainUrl = ("file:///" + process.argv[1].replace(/\\/g, "/"))
|
|
60
|
+
.replace(/\/{3,}/, "///");
|
|
61
|
+
const commonShim = (importMeta) => {
|
|
62
|
+
if (typeof importMeta.main !== "boolean") {
|
|
63
|
+
importMeta.main = importMeta.url === mainUrl;
|
|
64
|
+
}
|
|
65
|
+
if (typeof importMeta.filename !== "string") {
|
|
66
|
+
importMeta.filename = fileURLToPath(importMeta.url);
|
|
67
|
+
importMeta.dirname = dirname(importMeta.filename);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
if (
|
|
71
|
+
// v16.2.0+, v14.18.0+: Add support for WHATWG URL object to parentURL parameter.
|
|
72
|
+
resolveFunStr === "undefined" ||
|
|
73
|
+
// v20.0.0+, v18.19.0+"" This API now returns a string synchronously instead of a Promise.
|
|
74
|
+
resolveFunStr.startsWith("async")
|
|
75
|
+
// enable by --experimental-import-meta-resolve flag
|
|
76
|
+
) {
|
|
77
|
+
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
78
|
+
if (!shimWs.has(importMeta)) {
|
|
79
|
+
shimWs.add(importMeta);
|
|
80
|
+
const importMetaUrlRequire = {
|
|
81
|
+
url: importMeta.url,
|
|
82
|
+
require: createRequire(importMeta.url),
|
|
83
|
+
};
|
|
84
|
+
importMeta.resolve = function resolve(specifier, parentURL = importMeta.url) {
|
|
85
|
+
return pathToFileURL((importMetaUrlRequire.url === parentURL
|
|
86
|
+
? importMetaUrlRequire.require
|
|
87
|
+
: createRequire(parentURL)).resolve(specifier)).href;
|
|
88
|
+
};
|
|
89
|
+
commonShim(importMeta);
|
|
90
|
+
}
|
|
91
|
+
return importMeta;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
/// native support
|
|
96
|
+
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
97
|
+
if (!shimWs.has(importMeta)) {
|
|
98
|
+
shimWs.add(importMeta);
|
|
99
|
+
commonShim(importMeta);
|
|
100
|
+
}
|
|
101
|
+
return importMeta;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return import_meta_ponyfill_esmodule(importMeta);
|
|
105
|
+
}));
|
|
106
|
+
defineGlobalPonyfill("import-meta-ponyfill-esmodule", import_meta_ponyfill_esmodule);
|
|
107
|
+
export let import_meta_ponyfill = ((...args) => {
|
|
108
|
+
const _MODULE = (() => {
|
|
109
|
+
if (typeof require === "function" && typeof module === "object") {
|
|
110
|
+
return "commonjs";
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// eval("typeof import.meta");
|
|
114
|
+
return "esmodule";
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
if (_MODULE === "commonjs") {
|
|
118
|
+
//@ts-ignore
|
|
119
|
+
import_meta_ponyfill = (r, m) => import_meta_ponyfill_commonjs(r, m);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
//@ts-ignore
|
|
123
|
+
import_meta_ponyfill = (im) => import_meta_ponyfill_esmodule(im);
|
|
124
|
+
}
|
|
125
|
+
//@ts-ignore
|
|
126
|
+
return import_meta_ponyfill(...args);
|
|
127
|
+
});
|
|
1
128
|
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
2
129
|
if (!Object.hasOwn) {
|
|
3
130
|
Object.defineProperty(Object, "hasOwn", {
|
|
@@ -12,4 +139,3 @@ if (!Object.hasOwn) {
|
|
|
12
139
|
writable: true,
|
|
13
140
|
});
|
|
14
141
|
}
|
|
15
|
-
export {};
|
package/esm/artifact.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ export declare class Artifact {
|
|
|
17
17
|
upload(config: UploadConfig): Step;
|
|
18
18
|
download(config?: DownloadConfig): Step;
|
|
19
19
|
}
|
|
20
|
-
export declare function
|
|
20
|
+
export declare function artifact(name: string, options?: ArtifactOptions): Artifact;
|
|
21
21
|
//# sourceMappingURL=artifact.d.ts.map
|
package/esm/artifact.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../src/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,QAAQ;;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAKV,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe;IAMnD,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAkBlC,QAAQ,CAAC,MAAM,GAAE,cAAmB,GAAG,IAAI;CAgB5C;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../src/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,QAAQ;;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAKV,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe;IAMnD,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAkBlC,QAAQ,CAAC,MAAM,GAAE,cAAmB,GAAG,IAAI;CAgB5C;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,eAAe,GACxB,QAAQ,CAEV"}
|
package/esm/artifact.js
CHANGED
|
@@ -58,6 +58,6 @@ export class Artifact {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
_Artifact_version = new WeakMap(), _Artifact_retentionDays = new WeakMap(), _Artifact_uploadStep = new WeakMap();
|
|
61
|
-
export function
|
|
61
|
+
export function artifact(name, options) {
|
|
62
62
|
return new Artifact(name, options);
|
|
63
63
|
}
|
package/esm/cli.d.ts
ADDED
package/esm/cli.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,qBAAqB,CAAC;AAM7B,wBAAsB,MAAM,kBA6B3B"}
|
package/esm/cli.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./_dnt.polyfills.js";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import process from "node:process";
|
|
7
|
+
export async function runCli() {
|
|
8
|
+
const workflowsDir = findWorkflowsDir();
|
|
9
|
+
if (workflowsDir == null) {
|
|
10
|
+
console.error("No .github/workflows directory found.");
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
const entries = fs.readdirSync(workflowsDir);
|
|
14
|
+
const extensions = [".ts", ".js", ".mts", ".mjs", ".cts", ".cjs"];
|
|
15
|
+
const tsFiles = entries
|
|
16
|
+
.filter((f) => extensions.some((ext) => f.endsWith(ext)))
|
|
17
|
+
.sort();
|
|
18
|
+
if (tsFiles.length === 0) {
|
|
19
|
+
console.error("No script files found in .github/workflows");
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
const isLinting = process.argv.includes("--lint");
|
|
23
|
+
for (const file of tsFiles) {
|
|
24
|
+
const fullPath = resolve(workflowsDir, file);
|
|
25
|
+
const content = fs.readFileSync(fullPath, "utf8");
|
|
26
|
+
if (!content.includes("writeOrLint"))
|
|
27
|
+
continue;
|
|
28
|
+
const label = isLinting ? "Linting" : "Generating";
|
|
29
|
+
const color = isLinting ? "\x1b[36m" : "\x1b[32m";
|
|
30
|
+
console.error(`${color}${label}\x1b[0m ${file}`);
|
|
31
|
+
await import(pathToFileURL(fullPath).href);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function findWorkflowsDir() {
|
|
35
|
+
let dir = resolve(".");
|
|
36
|
+
while (true) {
|
|
37
|
+
const candidate = join(dir, ".github", "workflows");
|
|
38
|
+
if (fs.existsSync(candidate))
|
|
39
|
+
return candidate;
|
|
40
|
+
const parent = dirname(dir);
|
|
41
|
+
if (parent === dir)
|
|
42
|
+
return undefined;
|
|
43
|
+
dir = parent;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).main) {
|
|
47
|
+
await runCli();
|
|
48
|
+
}
|
package/esm/job.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,eAAe,EAGhB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"job.d.ts","sourceRoot":"","sources":["../src/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WAAW,GAAG,cAAc,CAAC;AAsRlD,qBAAa,GAAI,YAAW,gBAAgB;;IAK1C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAM;gBAO/D,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;KAC3C;IAuBH,IAAI,EAAE,IAAI,MAAM,CAEf;IAkCD,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;IA2B9B,UAAU,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE;IAgDxD,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAoKvE;AA6kBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQhD;AAID,wBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,CAUnD"}
|
package/esm/job.js
CHANGED
|
@@ -12,7 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
12
12
|
var _Job_instances, _Job_id, _Job_config, _Job_leafItems, _Job_outputDefs, _Job_cachedGraph, _Job_cachedLeafSteps, _Job_buildGraph;
|
|
13
13
|
import { Condition, ExpressionValue, isAlwaysFalse, isAlwaysTrue, } from "./expression.js";
|
|
14
14
|
import { Matrix } from "./matrix.js";
|
|
15
|
-
import { serializeConditionLike, serializeConfigValues, Step, StepRef, toCondition, unwrapSteps, } from "./step.js";
|
|
15
|
+
import { normalizeStepLike, serializeConditionLike, serializeConfigValues, Step, StepRef, toCondition, unwrapSteps, } from "./step.js";
|
|
16
16
|
function ensureEntry(graph, step) {
|
|
17
17
|
let entry = graph.get(step);
|
|
18
18
|
if (!entry) {
|
|
@@ -93,7 +93,8 @@ function propagatableConfigIf(step) {
|
|
|
93
93
|
* collected in `deferredAfterDeps` and resolved later, so that comesAfter
|
|
94
94
|
* only adds ordering edges for steps already present in the graph.
|
|
95
95
|
*/
|
|
96
|
-
function flattenStepLike(
|
|
96
|
+
function flattenStepLike(rawItem, graph, isLeaf, leafSteps, deferredAfterDeps, contextCondition) {
|
|
97
|
+
const item = normalizeStepLike(rawItem);
|
|
97
98
|
if (item instanceof StepRef) {
|
|
98
99
|
const step = item.step;
|
|
99
100
|
// AND this StepRef's condition with the parent context
|
package/esm/mod.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { Step, step, StepRef } from "./step.js";
|
|
|
3
3
|
export type { ConditionLike, ConfigValue, StepBuilder, StepConfig, StepFunction, StepLike, } from "./step.js";
|
|
4
4
|
export { Job, job } from "./job.js";
|
|
5
5
|
export type { JobConfig, JobDef, ReusableJobConfig, ReusableJobDef, RunsOn, ServiceContainer, StepsJobConfig, StepsJobDef, } from "./job.js";
|
|
6
|
-
export {
|
|
6
|
+
export { isLinting, Workflow, workflow } from "./workflow.js";
|
|
7
7
|
export type { WorkflowCallInput, WorkflowCallOutput, WorkflowCallSecret, WorkflowCallTrigger, WorkflowConfig, WorkflowTriggers, } from "./workflow.js";
|
|
8
8
|
export { concat, Condition, conditions, defineExprObj, ElseIfBuilder, expr, ExpressionValue, fromJSON, hashFiles, join, literal, ThenBuilder, toJSON, } from "./expression.js";
|
|
9
9
|
export type { ComparisonOp, ConcatPart, ExpressionSource, ExprMap, ExprOf, TernaryValue, } from "./expression.js";
|
|
@@ -11,6 +11,12 @@ export { formatPinComments, parsePinComments, pinYamlContent, resolveRef, unpinP
|
|
|
11
11
|
export type { PinEntry, RefResolver } from "./pin.js";
|
|
12
12
|
export { defineMatrix, Matrix } from "./matrix.js";
|
|
13
13
|
export type { PermissionLevel, Permissions, PermissionScope, } from "./permissions.js";
|
|
14
|
-
export { Artifact,
|
|
14
|
+
export { Artifact, artifact } from "./artifact.js";
|
|
15
15
|
export type { ArtifactOptions, DownloadConfig, UploadConfig, } from "./artifact.js";
|
|
16
|
+
import { workflow as workflow_ } from "./workflow.js";
|
|
17
|
+
import { artifact as artifact_ } from "./artifact.js";
|
|
18
|
+
/** @deprecated Use `workflow` instead. */
|
|
19
|
+
export declare const createWorkflow: typeof workflow_;
|
|
20
|
+
/** @deprecated Use `artifact` instead. */
|
|
21
|
+
export declare const defineArtifact: typeof artifact_;
|
|
16
22
|
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,YAAY,EACV,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;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S,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,0CAA0C;AAC1C,eAAO,MAAM,cAAc,EAAE,OAAO,SAAqB,CAAC;AAC1D,0CAA0C;AAC1C,eAAO,MAAM,cAAc,EAAE,OAAO,SAAqB,CAAC"}
|
package/esm/mod.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import "./_dnt.polyfills.js";
|
|
2
2
|
export { Step, step, StepRef } from "./step.js";
|
|
3
3
|
export { Job, job } from "./job.js";
|
|
4
|
-
export {
|
|
4
|
+
export { isLinting, Workflow, workflow } from "./workflow.js";
|
|
5
5
|
export { concat, Condition, conditions, defineExprObj, ElseIfBuilder, expr, ExpressionValue, fromJSON, hashFiles, join, literal, ThenBuilder, toJSON, } from "./expression.js";
|
|
6
6
|
export { formatPinComments, parsePinComments, pinYamlContent, resolveRef, unpinParsedYaml, } from "./pin.js";
|
|
7
7
|
export { defineMatrix, Matrix } from "./matrix.js";
|
|
8
|
-
export { Artifact,
|
|
8
|
+
export { Artifact, artifact } from "./artifact.js";
|
|
9
|
+
// deprecated re-exports
|
|
10
|
+
import { workflow as workflow_ } from "./workflow.js";
|
|
11
|
+
import { artifact as artifact_ } from "./artifact.js";
|
|
12
|
+
/** @deprecated Use `workflow` instead. */
|
|
13
|
+
export const createWorkflow = workflow_;
|
|
14
|
+
/** @deprecated Use `artifact` instead. */
|
|
15
|
+
export const defineArtifact = artifact_;
|
|
16
|
+
// run the cli
|
|
17
|
+
if (globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).main) {
|
|
18
|
+
import("./cli.js").then((mod) => mod.runCli());
|
|
19
|
+
}
|
package/esm/step.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface StepConfig<O extends string = never> {
|
|
|
16
16
|
readonly outputs?: readonly O[];
|
|
17
17
|
}
|
|
18
18
|
export declare function resetStepCounter(): void;
|
|
19
|
-
export type StepLike = Step<string> | StepRef<string
|
|
19
|
+
export type StepLike = Step<string> | StepRef<string> | StepConfig;
|
|
20
20
|
export declare class Step<O extends string = never> implements ExpressionSource {
|
|
21
21
|
#private;
|
|
22
22
|
readonly config: StepConfig<O>;
|
|
@@ -68,8 +68,10 @@ export declare class StepRef<O extends string = never> {
|
|
|
68
68
|
export declare function serializeConditionLike(c: ConditionLike): string;
|
|
69
69
|
export declare function toCondition(c: ConditionLike): Condition;
|
|
70
70
|
export declare function serializeConfigValues(record: Record<string, ConfigValue>): Record<string, string | number | boolean>;
|
|
71
|
+
/** Normalizes a StepLike to a Step or StepRef, auto-wrapping plain objects. */
|
|
72
|
+
export declare function normalizeStepLike(item: StepLike): Step<string> | StepRef<string>;
|
|
71
73
|
/** Extracts the underlying Step from a StepLike (Step or StepRef). */
|
|
72
|
-
export declare function unwrapStep(item:
|
|
74
|
+
export declare function unwrapStep(item: StepLike): Step<string>;
|
|
73
75
|
/** Extracts all underlying leaf Steps from a StepLike (recursively for composites). */
|
|
74
76
|
export declare function unwrapSteps(item: StepLike): Step<string>[];
|
|
75
77
|
//# sourceMappingURL=step.d.ts.map
|
package/esm/step.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../src/step.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,CAAC;AAEtE,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,I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AAG,OAAO,CAAC,CAM3C;AAID,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,GACb,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAGhC;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAGvD;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAM1D"}
|
package/esm/step.js
CHANGED
|
@@ -290,9 +290,16 @@ export function serializeConfigValues(record) {
|
|
|
290
290
|
return result;
|
|
291
291
|
}
|
|
292
292
|
// --- helpers ---
|
|
293
|
+
/** Normalizes a StepLike to a Step or StepRef, auto-wrapping plain objects. */
|
|
294
|
+
export function normalizeStepLike(item) {
|
|
295
|
+
if (item instanceof Step || item instanceof StepRef)
|
|
296
|
+
return item;
|
|
297
|
+
return new Step(item);
|
|
298
|
+
}
|
|
293
299
|
/** Extracts the underlying Step from a StepLike (Step or StepRef). */
|
|
294
300
|
export function unwrapStep(item) {
|
|
295
|
-
|
|
301
|
+
const normalized = normalizeStepLike(item);
|
|
302
|
+
return normalized instanceof StepRef ? normalized.step : normalized;
|
|
296
303
|
}
|
|
297
304
|
/** Extracts all underlying leaf Steps from a StepLike (recursively for composites). */
|
|
298
305
|
export function unwrapSteps(item) {
|
package/esm/workflow.d.ts
CHANGED
|
@@ -83,5 +83,5 @@ export declare class Workflow {
|
|
|
83
83
|
export declare const isLinting: boolean;
|
|
84
84
|
/** Gets if pins should be re-resolved when using `writeOrLint` on a workflow. */
|
|
85
85
|
export declare function isUpdatingPins(): boolean;
|
|
86
|
-
export declare function
|
|
86
|
+
export declare function workflow(config: WorkflowConfig): Workflow;
|
|
87
87
|
//# sourceMappingURL=workflow.d.ts.map
|
package/esm/workflow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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AAK,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,CAAC;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACnE,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;CACzB;AAED,qBAAa,QAAQ;;gBAIP,MAAM,EAAE,cAAc;IAqBlC,YAAY,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAgFnD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAIpE,WAAW,CACT,OAAO,EAAE;QACP,QAAQ,EAAE,GAAG,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,GAAG;YAAE,OAAO,EAAE,WAAW,CAAA;SAAE,CAAC;KAC9C,GACA,IAAI;CAmDR;AAED,0EAA0E;AAC1E,eAAO,MAAM,SAAS,EAAE,OAAyC,CAAC;AAElE,iFAAiF;AACjF,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ,CAEzD"}
|
package/esm/workflow.js
CHANGED
|
@@ -167,7 +167,7 @@ export const isLinting = process.argv.includes("--lint");
|
|
|
167
167
|
export function isUpdatingPins() {
|
|
168
168
|
return process.argv.includes("--update-pins");
|
|
169
169
|
}
|
|
170
|
-
export function
|
|
170
|
+
export function workflow(config) {
|
|
171
171
|
return new Workflow(config);
|
|
172
172
|
}
|
|
173
173
|
// --- trigger serialization ---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gagen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Generate complex GitHub Actions YAML files using a declarative API.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "node test_runner.js"
|
|
21
21
|
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"gagen": "./esm/cli.js"
|
|
24
|
+
},
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"@types/node": "^20.9.0",
|
|
24
27
|
"picocolors": "^1.0.0",
|