@fern-api/generator-cli 0.9.55 → 0.10.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/dist/cli.js +115 -70
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7166,7 +7166,7 @@ var require_require_directory = __commonJS({
|
|
|
7166
7166
|
"../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js"(exports2, module2) {
|
|
7167
7167
|
"use strict";
|
|
7168
7168
|
var fs3 = require("fs");
|
|
7169
|
-
var
|
|
7169
|
+
var join19 = require("path").join;
|
|
7170
7170
|
var resolve8 = require("path").resolve;
|
|
7171
7171
|
var dirname6 = require("path").dirname;
|
|
7172
7172
|
var defaultOptions2 = {
|
|
@@ -7203,7 +7203,7 @@ var require_require_directory = __commonJS({
|
|
|
7203
7203
|
}
|
|
7204
7204
|
path5 = !path5 ? dirname6(m.filename) : resolve8(dirname6(m.filename), path5);
|
|
7205
7205
|
fs3.readdirSync(path5).forEach(function(filename) {
|
|
7206
|
-
var joined =
|
|
7206
|
+
var joined = join19(path5, filename), files, key, obj;
|
|
7207
7207
|
if (fs3.statSync(joined).isDirectory() && options.recurse) {
|
|
7208
7208
|
files = requireDirectory(m, joined, options);
|
|
7209
7209
|
if (Object.keys(files).length) {
|
|
@@ -30483,9 +30483,9 @@ function resolve(...paths) {
|
|
|
30483
30483
|
}
|
|
30484
30484
|
|
|
30485
30485
|
// src/cli.ts
|
|
30486
|
-
var
|
|
30486
|
+
var import_fs18 = __toESM(require("fs"));
|
|
30487
30487
|
var import_promises19 = require("fs/promises");
|
|
30488
|
-
var
|
|
30488
|
+
var import_path27 = __toESM(require("path"));
|
|
30489
30489
|
|
|
30490
30490
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
|
|
30491
30491
|
var YError = class _YError extends Error {
|
|
@@ -40614,18 +40614,48 @@ var consolePipelineLogger = {
|
|
|
40614
40614
|
};
|
|
40615
40615
|
|
|
40616
40616
|
// src/pipeline/PostGenerationPipeline.ts
|
|
40617
|
-
var
|
|
40617
|
+
var import_child_process8 = require("child_process");
|
|
40618
40618
|
|
|
40619
40619
|
// src/pipeline/github/constants.ts
|
|
40620
40620
|
var FERN_BOT_NAME2 = "fern-api";
|
|
40621
40621
|
var FERN_BOT_EMAIL2 = "115122769+fern-api[bot]@users.noreply.github.com";
|
|
40622
40622
|
var FERN_BOT_LOGIN2 = "fern-api[bot]";
|
|
40623
40623
|
|
|
40624
|
-
// src/pipeline/
|
|
40624
|
+
// src/pipeline/github/stripGeneratedWorkflows.ts
|
|
40625
40625
|
var import_child_process4 = require("child_process");
|
|
40626
|
-
var
|
|
40626
|
+
var import_fs14 = require("fs");
|
|
40627
|
+
var import_path22 = require("path");
|
|
40628
|
+
var GITHUB_WORKFLOWS_DIR = ".github/workflows";
|
|
40629
|
+
function stripGeneratedWorkflows(outputDir, logger) {
|
|
40630
|
+
(0, import_fs14.rmSync)((0, import_path22.join)(outputDir, GITHUB_WORKFLOWS_DIR), { recursive: true, force: true });
|
|
40631
|
+
(0, import_child_process4.execFileSync)("git", ["rm", "-r", "-q", "--cached", "--ignore-unmatch", "--", GITHUB_WORKFLOWS_DIR], {
|
|
40632
|
+
cwd: outputDir,
|
|
40633
|
+
stdio: "pipe"
|
|
40634
|
+
});
|
|
40635
|
+
if (!hasTrackedWorkflows(outputDir)) {
|
|
40636
|
+
logger.debug(`Removed generated ${GITHUB_WORKFLOWS_DIR} (workflows disabled)`);
|
|
40637
|
+
return;
|
|
40638
|
+
}
|
|
40639
|
+
(0, import_child_process4.execFileSync)("git", ["checkout", "HEAD", "--", GITHUB_WORKFLOWS_DIR], { cwd: outputDir, stdio: "pipe" });
|
|
40640
|
+
logger.debug(`Restored ${GITHUB_WORKFLOWS_DIR} from HEAD (workflows disabled)`);
|
|
40641
|
+
}
|
|
40642
|
+
function hasTrackedWorkflows(outputDir) {
|
|
40643
|
+
try {
|
|
40644
|
+
const output = (0, import_child_process4.execFileSync)("git", ["ls-tree", "-r", "--name-only", "HEAD", "--", GITHUB_WORKFLOWS_DIR], {
|
|
40645
|
+
cwd: outputDir,
|
|
40646
|
+
stdio: "pipe"
|
|
40647
|
+
});
|
|
40648
|
+
return output.toString().trim().length > 0;
|
|
40649
|
+
} catch {
|
|
40650
|
+
return false;
|
|
40651
|
+
}
|
|
40652
|
+
}
|
|
40653
|
+
|
|
40654
|
+
// src/pipeline/steps/AutoVersionStep.ts
|
|
40655
|
+
var import_child_process5 = require("child_process");
|
|
40656
|
+
var import_fs16 = require("fs");
|
|
40627
40657
|
var import_promises16 = require("fs/promises");
|
|
40628
|
-
var
|
|
40658
|
+
var import_path24 = require("path");
|
|
40629
40659
|
|
|
40630
40660
|
// ../commons/logging-execa/lib/loggingExeca.js
|
|
40631
40661
|
var import_execa = __toESM(require_execa(), 1);
|
|
@@ -40683,9 +40713,9 @@ async function loggingExeca(logger, executable, args = [], { doNotPipeOutput = f
|
|
|
40683
40713
|
}
|
|
40684
40714
|
|
|
40685
40715
|
// src/autoversion/AutoVersioningService.ts
|
|
40686
|
-
var
|
|
40716
|
+
var import_fs15 = require("fs");
|
|
40687
40717
|
var import_promises15 = require("fs/promises");
|
|
40688
|
-
var
|
|
40718
|
+
var import_path23 = require("path");
|
|
40689
40719
|
var import_semver = __toESM(require_semver2());
|
|
40690
40720
|
var AutoVersioningException = class extends Error {
|
|
40691
40721
|
/**
|
|
@@ -41557,8 +41587,8 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41557
41587
|
);
|
|
41558
41588
|
return;
|
|
41559
41589
|
}
|
|
41560
|
-
const goModPath = (0,
|
|
41561
|
-
if (!(0,
|
|
41590
|
+
const goModPath = (0, import_path23.join)(workingDirectory, "go.mod");
|
|
41591
|
+
if (!(0, import_fs15.existsSync)(goModPath)) {
|
|
41562
41592
|
this.logger.debug(`No go.mod found in ${workingDirectory}, skipping Go module path update`);
|
|
41563
41593
|
return;
|
|
41564
41594
|
}
|
|
@@ -41628,7 +41658,7 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41628
41658
|
const results = [];
|
|
41629
41659
|
const entries2 = await (0, import_promises15.readdir)(dir);
|
|
41630
41660
|
for (const entry of entries2) {
|
|
41631
|
-
const fullPath = (0,
|
|
41661
|
+
const fullPath = (0, import_path23.join)(dir, entry);
|
|
41632
41662
|
const entryStat = await (0, import_promises15.lstat)(fullPath);
|
|
41633
41663
|
if (entryStat.isSymbolicLink()) {
|
|
41634
41664
|
continue;
|
|
@@ -41660,7 +41690,7 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41660
41690
|
* literals (e.g. the X-Fern-SDK-Name header value) in all .go files.
|
|
41661
41691
|
*/
|
|
41662
41692
|
async addSuffixToGoFiles(repoRoot, modulePath, suffix) {
|
|
41663
|
-
const goFiles = await this.walkDirectory(repoRoot, (filePath) => (0,
|
|
41693
|
+
const goFiles = await this.walkDirectory(repoRoot, (filePath) => (0, import_path23.extname)(filePath) === ".go");
|
|
41664
41694
|
await this.processInParallel(goFiles, (filePath) => this.addSuffixToGoFile(filePath, modulePath, suffix));
|
|
41665
41695
|
}
|
|
41666
41696
|
/**
|
|
@@ -41706,7 +41736,7 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41706
41736
|
async addSuffixToMarkdownFiles(repoRoot, modulePath, suffix) {
|
|
41707
41737
|
const markdownFiles = await this.walkDirectory(
|
|
41708
41738
|
repoRoot,
|
|
41709
|
-
(filePath) => (0,
|
|
41739
|
+
(filePath) => (0, import_path23.extname)(filePath).toLowerCase() === ".md"
|
|
41710
41740
|
);
|
|
41711
41741
|
await this.processInParallel(
|
|
41712
41742
|
markdownFiles,
|
|
@@ -42345,7 +42375,7 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42345
42375
|
}
|
|
42346
42376
|
async readVersionFromMetadata() {
|
|
42347
42377
|
try {
|
|
42348
|
-
const output = (0,
|
|
42378
|
+
const output = (0, import_child_process5.execFileSync)("git", ["show", "HEAD~1:.fern/metadata.json"], {
|
|
42349
42379
|
cwd: this.outputDir,
|
|
42350
42380
|
encoding: "utf-8",
|
|
42351
42381
|
stdio: "pipe"
|
|
@@ -42388,7 +42418,7 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42388
42418
|
*/
|
|
42389
42419
|
readVersionFromMetadataAtHead() {
|
|
42390
42420
|
try {
|
|
42391
|
-
const output = (0,
|
|
42421
|
+
const output = (0, import_child_process5.execFileSync)("git", ["show", "HEAD:.fern/metadata.json"], {
|
|
42392
42422
|
cwd: this.outputDir,
|
|
42393
42423
|
encoding: "utf-8",
|
|
42394
42424
|
stdio: "pipe"
|
|
@@ -42406,11 +42436,11 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42406
42436
|
* the diff, matching LocalTaskHandler.generateDiffFile() behavior.
|
|
42407
42437
|
*/
|
|
42408
42438
|
gitDiffHead() {
|
|
42409
|
-
(0,
|
|
42439
|
+
(0, import_child_process5.execFileSync)("git", ["add", "-N", "."], {
|
|
42410
42440
|
cwd: this.outputDir,
|
|
42411
42441
|
stdio: "pipe"
|
|
42412
42442
|
});
|
|
42413
|
-
return (0,
|
|
42443
|
+
return (0, import_child_process5.execFileSync)("git", ["diff", "HEAD", "--", ".", ":(exclude).fern/metadata.json"], {
|
|
42414
42444
|
cwd: this.outputDir,
|
|
42415
42445
|
encoding: "utf-8",
|
|
42416
42446
|
stdio: "pipe",
|
|
@@ -42449,7 +42479,7 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42449
42479
|
return false;
|
|
42450
42480
|
}
|
|
42451
42481
|
try {
|
|
42452
|
-
(0,
|
|
42482
|
+
(0, import_child_process5.execFileSync)("git", ["cat-file", "-e", `${sha}^{commit}`], {
|
|
42453
42483
|
cwd: this.outputDir,
|
|
42454
42484
|
stdio: "pipe"
|
|
42455
42485
|
});
|
|
@@ -42467,7 +42497,7 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42467
42497
|
const start = this.commitExists(currentGenerationSha) ? currentGenerationSha : "HEAD";
|
|
42468
42498
|
let log;
|
|
42469
42499
|
try {
|
|
42470
|
-
log = (0,
|
|
42500
|
+
log = (0, import_child_process5.execFileSync)("git", ["log", "--first-parent", "--format=%H%x00%s", start], {
|
|
42471
42501
|
cwd: this.outputDir,
|
|
42472
42502
|
encoding: "utf-8",
|
|
42473
42503
|
stdio: "pipe",
|
|
@@ -42509,7 +42539,7 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42509
42539
|
}
|
|
42510
42540
|
}
|
|
42511
42541
|
gitDiff(from, to) {
|
|
42512
|
-
return (0,
|
|
42542
|
+
return (0, import_child_process5.execFileSync)("git", ["diff", from, to, "--", ".", ":(exclude).fern/metadata.json"], {
|
|
42513
42543
|
cwd: this.outputDir,
|
|
42514
42544
|
encoding: "utf-8",
|
|
42515
42545
|
stdio: "pipe",
|
|
@@ -42522,12 +42552,12 @@ var AutoVersionStep = class extends BaseStep {
|
|
|
42522
42552
|
const fullMessage = body.length > 0 ? `${COMMIT_MARKER} ${subject}
|
|
42523
42553
|
|
|
42524
42554
|
${body}` : `${COMMIT_MARKER} ${subject}`;
|
|
42525
|
-
(0,
|
|
42526
|
-
(0,
|
|
42555
|
+
(0, import_child_process5.execFileSync)("git", ["add", "-A"], { cwd: this.outputDir, stdio: "pipe" });
|
|
42556
|
+
(0, import_child_process5.execFileSync)("git", ["commit", "--allow-empty", "-m", fullMessage], {
|
|
42527
42557
|
cwd: this.outputDir,
|
|
42528
42558
|
stdio: "pipe"
|
|
42529
42559
|
});
|
|
42530
|
-
return (0,
|
|
42560
|
+
return (0, import_child_process5.execFileSync)("git", ["rev-parse", "HEAD"], {
|
|
42531
42561
|
cwd: this.outputDir,
|
|
42532
42562
|
encoding: "utf-8",
|
|
42533
42563
|
stdio: "pipe"
|
|
@@ -42535,9 +42565,9 @@ ${body}` : `${COMMIT_MARKER} ${subject}`;
|
|
|
42535
42565
|
}
|
|
42536
42566
|
async prependChangelogEntry(params) {
|
|
42537
42567
|
const { version: version2, entry } = params;
|
|
42538
|
-
const changelogPath = (0,
|
|
42568
|
+
const changelogPath = (0, import_path24.join)(this.outputDir, "changelog.md");
|
|
42539
42569
|
let existing = "";
|
|
42540
|
-
if ((0,
|
|
42570
|
+
if ((0, import_fs16.existsSync)(changelogPath)) {
|
|
42541
42571
|
existing = await (0, import_promises16.readFile)(changelogPath, "utf-8");
|
|
42542
42572
|
}
|
|
42543
42573
|
await (0, import_promises16.writeFile)(changelogPath, prependChangelogBlock({ existingContent: existing, version: version2, entry }), "utf-8");
|
|
@@ -42736,7 +42766,7 @@ function nonEmpty(value) {
|
|
|
42736
42766
|
}
|
|
42737
42767
|
|
|
42738
42768
|
// src/pipeline/steps/GenerationCommitStep.ts
|
|
42739
|
-
var
|
|
42769
|
+
var import_child_process6 = require("child_process");
|
|
42740
42770
|
var GenerationCommitStep = class extends BaseStep {
|
|
42741
42771
|
constructor(outputDir, logger, config, cliVersion, generatorVersions) {
|
|
42742
42772
|
super(outputDir, logger);
|
|
@@ -42767,7 +42797,7 @@ var GenerationCommitStep = class extends BaseStep {
|
|
|
42767
42797
|
const reason = error instanceof ReplayPrepareError ? error.reason : String(error);
|
|
42768
42798
|
if (headBeforePrepare != null) {
|
|
42769
42799
|
try {
|
|
42770
|
-
(0,
|
|
42800
|
+
(0, import_child_process6.execFileSync)("git", ["reset", "--hard", headBeforePrepare], {
|
|
42771
42801
|
cwd: this.outputDir,
|
|
42772
42802
|
stdio: "pipe"
|
|
42773
42803
|
});
|
|
@@ -42803,7 +42833,7 @@ var GenerationCommitStep = class extends BaseStep {
|
|
|
42803
42833
|
};
|
|
42804
42834
|
function tryRevParse(cwd2, rev) {
|
|
42805
42835
|
try {
|
|
42806
|
-
return (0,
|
|
42836
|
+
return (0, import_child_process6.execFileSync)("git", ["rev-parse", "--verify", rev], {
|
|
42807
42837
|
cwd: cwd2,
|
|
42808
42838
|
encoding: "utf-8",
|
|
42809
42839
|
stdio: "pipe"
|
|
@@ -42815,7 +42845,7 @@ function tryRevParse(cwd2, rev) {
|
|
|
42815
42845
|
|
|
42816
42846
|
// src/pipeline/steps/GithubStep.ts
|
|
42817
42847
|
var import_promises17 = require("fs/promises");
|
|
42818
|
-
var
|
|
42848
|
+
var import_path25 = require("path");
|
|
42819
42849
|
|
|
42820
42850
|
// src/pipeline/github/createReplayBranch.ts
|
|
42821
42851
|
async function createReplayBranch(repository, branchName, commitMessage, replayConflictInfo, logger) {
|
|
@@ -43284,7 +43314,9 @@ var GithubStep = class extends BaseStep {
|
|
|
43284
43314
|
let isUpdatingExistingPR = false;
|
|
43285
43315
|
let generationBaseSha;
|
|
43286
43316
|
let existingPR;
|
|
43287
|
-
if (
|
|
43317
|
+
if (this.config.previewMode && this.config.token === "") {
|
|
43318
|
+
this.logger.debug("Preview mode without a GitHub token: skipping lookup of existing PRs");
|
|
43319
|
+
} else if (!this.config.automationMode) {
|
|
43288
43320
|
existingPR = await findExistingUpdatablePR(octokit, owner, repo, baseBranch, this.logger);
|
|
43289
43321
|
}
|
|
43290
43322
|
if (existingPR != null) {
|
|
@@ -43352,30 +43384,34 @@ var GithubStep = class extends BaseStep {
|
|
|
43352
43384
|
success: true,
|
|
43353
43385
|
updatedExistingPr: isUpdatingExistingPR
|
|
43354
43386
|
};
|
|
43355
|
-
if (
|
|
43356
|
-
|
|
43357
|
-
|
|
43358
|
-
|
|
43359
|
-
|
|
43360
|
-
|
|
43361
|
-
|
|
43362
|
-
|
|
43363
|
-
|
|
43364
|
-
|
|
43365
|
-
|
|
43366
|
-
|
|
43367
|
-
|
|
43368
|
-
this.
|
|
43369
|
-
|
|
43370
|
-
|
|
43371
|
-
|
|
43372
|
-
|
|
43373
|
-
|
|
43374
|
-
|
|
43375
|
-
|
|
43376
|
-
|
|
43377
|
-
|
|
43378
|
-
|
|
43387
|
+
if (this.config.previewMode) {
|
|
43388
|
+
this.logger.info(
|
|
43389
|
+
`Preview mode: changes committed locally on branch ${prBranch} at ${this.outputDir}; skipping push and pull request. Re-run without --preview to publish.`
|
|
43390
|
+
);
|
|
43391
|
+
return result;
|
|
43392
|
+
}
|
|
43393
|
+
await pushSignedCommit({
|
|
43394
|
+
repository,
|
|
43395
|
+
octokit,
|
|
43396
|
+
owner,
|
|
43397
|
+
repo,
|
|
43398
|
+
branch: prBranch,
|
|
43399
|
+
force: isUpdatingExistingPR,
|
|
43400
|
+
author: resolveCommitAuthor(this.config.token, this.config.author),
|
|
43401
|
+
logger: this.logger
|
|
43402
|
+
});
|
|
43403
|
+
const pushedBranch = await repository.getCurrentBranch();
|
|
43404
|
+
result.branchUrl = `https://${remote}/${owner}/${repo}/tree/${pushedBranch}`;
|
|
43405
|
+
this.logger.info(`Pushed branch: ${result.branchUrl}`);
|
|
43406
|
+
if (generationBaseSha != null) {
|
|
43407
|
+
try {
|
|
43408
|
+
const sanitizedName = this.config.generatorName?.replace(/\//g, "--");
|
|
43409
|
+
const tagName = sanitizedName != null ? `fern-generation-base--${sanitizedName}` : "fern-generation-base";
|
|
43410
|
+
await repository.createAndPushTag(tagName, generationBaseSha);
|
|
43411
|
+
this.logger.debug(`Pushed ${tagName} tag for generation tracking`);
|
|
43412
|
+
result.generationBaseTagSha = generationBaseSha;
|
|
43413
|
+
} catch (error) {
|
|
43414
|
+
this.logger.debug(`Could not push generation tag: ${extractErrorMessage(error)}`);
|
|
43379
43415
|
}
|
|
43380
43416
|
}
|
|
43381
43417
|
const headSha = await repository.getHeadSha();
|
|
@@ -43581,7 +43617,7 @@ var GithubStep = class extends BaseStep {
|
|
|
43581
43617
|
}
|
|
43582
43618
|
async ensureFernignore() {
|
|
43583
43619
|
this.logger.debug("Checking for .fernignore file...");
|
|
43584
|
-
const fernignorePath = (0,
|
|
43620
|
+
const fernignorePath = (0, import_path25.join)(this.outputDir, ".fernignore");
|
|
43585
43621
|
try {
|
|
43586
43622
|
await (0, import_promises17.access)(fernignorePath);
|
|
43587
43623
|
this.logger.debug(".fernignore already exists");
|
|
@@ -43608,7 +43644,7 @@ var GithubStep = class extends BaseStep {
|
|
|
43608
43644
|
if (entry.length === 0 && resolved.newVersion == null) {
|
|
43609
43645
|
return false;
|
|
43610
43646
|
}
|
|
43611
|
-
const changelogPath = (0,
|
|
43647
|
+
const changelogPath = (0, import_path25.join)(this.outputDir, "changelog.md");
|
|
43612
43648
|
let existing;
|
|
43613
43649
|
try {
|
|
43614
43650
|
existing = await (0, import_promises17.readFile)(changelogPath, "utf-8");
|
|
@@ -43726,7 +43762,7 @@ function resolveChangelogUrl({
|
|
|
43726
43762
|
}
|
|
43727
43763
|
|
|
43728
43764
|
// src/pipeline/steps/ReplayStep.ts
|
|
43729
|
-
var
|
|
43765
|
+
var import_child_process7 = require("child_process");
|
|
43730
43766
|
var ReplayStep = class extends BaseStep {
|
|
43731
43767
|
constructor(outputDir, logger, config, cliVersion, generatorVersions) {
|
|
43732
43768
|
super(outputDir, logger);
|
|
@@ -43853,7 +43889,7 @@ var ReplayStep = class extends BaseStep {
|
|
|
43853
43889
|
*/
|
|
43854
43890
|
commitLockfileIfUncommitted() {
|
|
43855
43891
|
try {
|
|
43856
|
-
const status2 = (0,
|
|
43892
|
+
const status2 = (0, import_child_process7.execFileSync)("git", ["status", "--porcelain", "--", ".fern/replay.lock"], {
|
|
43857
43893
|
cwd: this.outputDir,
|
|
43858
43894
|
encoding: "utf-8",
|
|
43859
43895
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -43861,11 +43897,11 @@ var ReplayStep = class extends BaseStep {
|
|
|
43861
43897
|
if (status2.length === 0) {
|
|
43862
43898
|
return;
|
|
43863
43899
|
}
|
|
43864
|
-
(0,
|
|
43900
|
+
(0, import_child_process7.execFileSync)("git", ["add", "--", ".fern/replay.lock"], {
|
|
43865
43901
|
cwd: this.outputDir,
|
|
43866
43902
|
stdio: "pipe"
|
|
43867
43903
|
});
|
|
43868
|
-
(0,
|
|
43904
|
+
(0, import_child_process7.execFileSync)(
|
|
43869
43905
|
"git",
|
|
43870
43906
|
[
|
|
43871
43907
|
"-c",
|
|
@@ -44047,8 +44083,8 @@ function createLogger4(log) {
|
|
|
44047
44083
|
}
|
|
44048
44084
|
|
|
44049
44085
|
// src/pipeline/steps/VerificationStep.ts
|
|
44050
|
-
var
|
|
44051
|
-
var
|
|
44086
|
+
var import_fs17 = require("fs");
|
|
44087
|
+
var import_path26 = require("path");
|
|
44052
44088
|
var CONTAINER_WORKSPACE_PATH = "/workspace";
|
|
44053
44089
|
var VERIFY_SCRIPT_RELATIVE_PATH = ".fern/verify.sh";
|
|
44054
44090
|
var VERIFY_SCRIPT_CONTAINER_PATH = `${CONTAINER_WORKSPACE_PATH}/${VERIFY_SCRIPT_RELATIVE_PATH}`;
|
|
@@ -44064,8 +44100,8 @@ var VerificationStep = class extends BaseStep {
|
|
|
44064
44100
|
generatorVersions;
|
|
44065
44101
|
name = "verify";
|
|
44066
44102
|
async execute(_context) {
|
|
44067
|
-
const verifyScriptHostPath = (0,
|
|
44068
|
-
if (!(0,
|
|
44103
|
+
const verifyScriptHostPath = (0, import_path26.join)(this.outputDir, VERIFY_SCRIPT_RELATIVE_PATH);
|
|
44104
|
+
if (!(0, import_fs17.existsSync)(verifyScriptHostPath)) {
|
|
44069
44105
|
return { executed: true, success: true, skipped: true };
|
|
44070
44106
|
}
|
|
44071
44107
|
const validatorImage = this.deriveValidatorImage();
|
|
@@ -44244,8 +44280,8 @@ var PostGenerationPipeline = class {
|
|
|
44244
44280
|
async run() {
|
|
44245
44281
|
if (this.config.github?.enabled) {
|
|
44246
44282
|
try {
|
|
44247
|
-
(0,
|
|
44248
|
-
(0,
|
|
44283
|
+
(0, import_child_process8.execFileSync)("git", ["config", "user.name", FERN_BOT_NAME2], { cwd: this.config.outputDir });
|
|
44284
|
+
(0, import_child_process8.execFileSync)("git", ["config", "user.email", FERN_BOT_EMAIL2], { cwd: this.config.outputDir });
|
|
44249
44285
|
} catch {
|
|
44250
44286
|
}
|
|
44251
44287
|
}
|
|
@@ -44253,6 +44289,15 @@ var PostGenerationPipeline = class {
|
|
|
44253
44289
|
success: true,
|
|
44254
44290
|
steps: {}
|
|
44255
44291
|
};
|
|
44292
|
+
if (this.config.github?.enabled && this.config.github.workflows === false) {
|
|
44293
|
+
try {
|
|
44294
|
+
stripGeneratedWorkflows(this.config.outputDir, this.logger);
|
|
44295
|
+
} catch (error) {
|
|
44296
|
+
result.success = false;
|
|
44297
|
+
result.errors = [`failed to strip generated workflows: ${extractErrorMessage(error)}`];
|
|
44298
|
+
return result;
|
|
44299
|
+
}
|
|
44300
|
+
}
|
|
44256
44301
|
const pipelineContext = {
|
|
44257
44302
|
previousStepResults: {}
|
|
44258
44303
|
};
|
|
@@ -44755,9 +44800,9 @@ async function createWriteStream(outputPath) {
|
|
|
44755
44800
|
}
|
|
44756
44801
|
async function createWriteStreamFromFile(filepath) {
|
|
44757
44802
|
if (!await doesPathExist(filepath)) {
|
|
44758
|
-
await (0, import_promises19.mkdir)(
|
|
44803
|
+
await (0, import_promises19.mkdir)(import_path27.default.dirname(filepath), { recursive: true });
|
|
44759
44804
|
}
|
|
44760
|
-
return
|
|
44805
|
+
return import_fs18.default.createWriteStream(filepath);
|
|
44761
44806
|
}
|
|
44762
44807
|
/*! Bundled license information:
|
|
44763
44808
|
|