Skip to content

Commit

Permalink
chore: update release bot identity
Browse files Browse the repository at this point in the history
  • Loading branch information
floydspace committed Jan 26, 2025
1 parent 27a63bf commit e58cbe4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion projenrc/monorepo-project.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { PnpmMonorepoProjectOptions } from "@floydspace/projen-components";
import { LinkableProject, PnpmMonorepoProject } from "@floydspace/projen-components";
import { JsonPatch, typescript } from "projen";
import { github, JsonPatch, typescript } from "projen";
import type { GitIdentity } from "projen/lib/github/task-workflow.js";
import { TypescriptConfig, TypescriptConfigExtends, TypeScriptModuleResolution } from "projen/lib/javascript";

type PredefinedProps = "packageManager" | "clobber" | "depsUpgrade";
Expand Down Expand Up @@ -77,6 +78,18 @@ export class MonorepoProject extends PnpmMonorepoProject {
preSynthesize(): void {
super.preSynthesize();

// Set git identity for release workflow to keep the bot's commits consistent
const releaseWorkflow = this.node.tryFindChild(`GithubWorkflow#release`) as github.GithubWorkflow;
if (releaseWorkflow) {
// @ts-ignore - `jobs` is private
const jobStep = releaseWorkflow.jobs.release.steps.find((s) => s.name === "Set git identity");
const gitIdentity: GitIdentity = {
name: "github-actions[bot]",
email: "github-actions[bot]@users.noreply.github.com",
};
jobStep.run = github.WorkflowSteps.setupGitIdentity({ gitIdentity }).run;
}

this.tsconfig?.addExtends(this.tsconfigBase);
this.tsconfig?.file.addDeletionOverride("compilerOptions");
this.tsconfig?.file.addDeletionOverride("exclude");
Expand Down
33 changes: 1 addition & 32 deletions projenrc/typescript-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class TypeScriptLibProject extends typescript.TypeScriptProject {
license: "MIT",
packageManager: javascript.NodePackageManager.PNPM,
outdir: `packages/${options.name}`,
prettier: false, // Monorepo prettier doesn't work for some reason
prettier: false,
projenVersion: parent?.deps.getDependency("projen").version,
typescriptVersion: parent?.deps.getDependency("typescript").version,
package: false, // It will be created by @changesets/cli
Expand Down Expand Up @@ -61,37 +61,6 @@ export class TypeScriptLibProject extends typescript.TypeScriptProject {
{ path: this.tsconfigDev.fileName },
]);

// // Add tsconfig for esm
// new JsonFile(this, "tsconfig.esm.json", {
// obj: {
// extends: "./tsconfig.json",
// compilerOptions: {
// outDir: `${this.libdir}/esm`,
// resolveJsonModule: false, // JSON modules are not supported in esm
// declaration: true,
// declarationDir: `${this.libdir}/dts`,
// },
// },
// });

// // Add tsconfig for cjs
// new JsonFile(this, "tsconfig.cjs.json", {
// obj: {
// extends: "./tsconfig.json",
// compilerOptions: {
// outDir: `${this.libdir}/cjs`,
// moduleResolution: javascript.TypeScriptModuleResolution.NODE,
// module: "CommonJS",
// },
// },
// });

// // Build both cjs and esm
// this.compileTask.reset("tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json");

// this.addPackageIgnore("/tsconfig.cjs.json");
// this.addPackageIgnore("/tsconfig.esm.json");

this.addFields({
// Reference to esm index for root imports
module: `${this.libdir}/esm/index.js`,
Expand Down

0 comments on commit e58cbe4

Please sign in to comment.