@fern-api/generator-cli 0.9.55 → 0.9.56

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.
Files changed (2) hide show
  1. package/dist/cli.js +31 -25
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -43284,7 +43284,9 @@ var GithubStep = class extends BaseStep {
43284
43284
  let isUpdatingExistingPR = false;
43285
43285
  let generationBaseSha;
43286
43286
  let existingPR;
43287
- if (!this.config.automationMode) {
43287
+ if (this.config.previewMode && this.config.token === "") {
43288
+ this.logger.debug("Preview mode without a GitHub token: skipping lookup of existing PRs");
43289
+ } else if (!this.config.automationMode) {
43288
43290
  existingPR = await findExistingUpdatablePR(octokit, owner, repo, baseBranch, this.logger);
43289
43291
  }
43290
43292
  if (existingPR != null) {
@@ -43352,30 +43354,34 @@ var GithubStep = class extends BaseStep {
43352
43354
  success: true,
43353
43355
  updatedExistingPr: isUpdatingExistingPR
43354
43356
  };
43355
- if (!this.config.previewMode) {
43356
- await pushSignedCommit({
43357
- repository,
43358
- octokit,
43359
- owner,
43360
- repo,
43361
- branch: prBranch,
43362
- force: isUpdatingExistingPR,
43363
- author: resolveCommitAuthor(this.config.token, this.config.author),
43364
- logger: this.logger
43365
- });
43366
- const pushedBranch = await repository.getCurrentBranch();
43367
- result.branchUrl = `https://${remote}/${owner}/${repo}/tree/${pushedBranch}`;
43368
- this.logger.info(`Pushed branch: ${result.branchUrl}`);
43369
- if (generationBaseSha != null) {
43370
- try {
43371
- const sanitizedName = this.config.generatorName?.replace(/\//g, "--");
43372
- const tagName = sanitizedName != null ? `fern-generation-base--${sanitizedName}` : "fern-generation-base";
43373
- await repository.createAndPushTag(tagName, generationBaseSha);
43374
- this.logger.debug(`Pushed ${tagName} tag for generation tracking`);
43375
- result.generationBaseTagSha = generationBaseSha;
43376
- } catch (error) {
43377
- this.logger.debug(`Could not push generation tag: ${extractErrorMessage(error)}`);
43378
- }
43357
+ if (this.config.previewMode) {
43358
+ this.logger.info(
43359
+ `Preview mode: changes committed locally on branch ${prBranch} at ${this.outputDir}; skipping push and pull request. Re-run without --preview to publish.`
43360
+ );
43361
+ return result;
43362
+ }
43363
+ await pushSignedCommit({
43364
+ repository,
43365
+ octokit,
43366
+ owner,
43367
+ repo,
43368
+ branch: prBranch,
43369
+ force: isUpdatingExistingPR,
43370
+ author: resolveCommitAuthor(this.config.token, this.config.author),
43371
+ logger: this.logger
43372
+ });
43373
+ const pushedBranch = await repository.getCurrentBranch();
43374
+ result.branchUrl = `https://${remote}/${owner}/${repo}/tree/${pushedBranch}`;
43375
+ this.logger.info(`Pushed branch: ${result.branchUrl}`);
43376
+ if (generationBaseSha != null) {
43377
+ try {
43378
+ const sanitizedName = this.config.generatorName?.replace(/\//g, "--");
43379
+ const tagName = sanitizedName != null ? `fern-generation-base--${sanitizedName}` : "fern-generation-base";
43380
+ await repository.createAndPushTag(tagName, generationBaseSha);
43381
+ this.logger.debug(`Pushed ${tagName} tag for generation tracking`);
43382
+ result.generationBaseTagSha = generationBaseSha;
43383
+ } catch (error) {
43384
+ this.logger.debug(`Could not push generation tag: ${extractErrorMessage(error)}`);
43379
43385
  }
43380
43386
  }
43381
43387
  const headSha = await repository.getHeadSha();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/generator-cli",
3
- "version": "0.9.55",
3
+ "version": "0.9.56",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/fern-api/fern.git",