Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@forgerock/device-client",
"@forgerock/davinci-app",
"@forgerock/davinci-suites",
"@forgerock/mock-api-v2"
"@forgerock/mock-api-v2",
"@forgerock/local-release-tool"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
payload-delimiter: '_'
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: steps.changesets.outputs.publishedPackages
payload: ${{ steps.changesets.outputs.publishedPackages }}

- uses: codecov/codecov-action@v5
with:
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"docs": "nx affected --target=typedoc",
"format": "pnpm nx format:write",
"lint": "nx affected --target=lint",
"local-release": "pnpm ts-node tools/release/release.ts",
"nx": "nx",
"preinstall": "npx only-allow pnpm",
"prepare": "node .husky/install.mjs",
Expand Down Expand Up @@ -52,6 +53,7 @@
"@commitlint/cli": "^19.1.0",
"@commitlint/config-conventional": "^19.1.0",
"@commitlint/prompt": "^19.1.0",
"@effect/cli": "0.59.9",
"@effect/language-service": "^0.2.0",
"@effect/platform": "^0.58.27",
"@effect/platform-node": "^0.53.26",
Expand Down Expand Up @@ -85,6 +87,7 @@
"conventional-changelog-conventionalcommits": "^8.0.0",
"cz-conventional-changelog": "^3.3.0",
"cz-git": "^1.6.1",
"effect": "^3.12.7",
"eslint": "^9.8.0",
"eslint-config-prettier": "10.1.2",
"eslint-plugin-import": "2.31.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=logger.test.d.ts.map

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

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/effects/logger/out-tsc/vitest/vite.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: import("vite").UserConfigFnObject;
export default _default;
//# sourceMappingURL=vite.config.d.ts.map

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

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/effects/oidc/out-tsc/vitest/vite.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: import("vite").UserConfigFnObject;
export default _default;
//# sourceMappingURL=vite.config.d.ts.map
1 change: 1 addition & 0 deletions packages/effects/oidc/out-tsc/vitest/vite.config.d.ts.map

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=request-mware.test.d.ts.map

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: import("vite").UserConfigFnObject;
export default _default;
//# sourceMappingURL=vite.config.d.ts.map

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

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/sdk-types/out-tsc/vitest/vite.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const _default: import("vite").UserConfigFnObject;
export default _default;
//# sourceMappingURL=vite.config.d.ts.map
1 change: 1 addition & 0 deletions packages/sdk-types/out-tsc/vitest/vite.config.d.ts.map

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

71 changes: 70 additions & 1 deletion pnpm-lock.yaml

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

77 changes: 77 additions & 0 deletions tools/release/commands/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { Effect, Stream, Console } from 'effect';
import { Command } from '@effect/platform';

export const buildPackages = Command.make('pnpm', 'build').pipe(
Command.lines,
Stream.tap((line) => Console.log(`Build: ${line}`)),
Stream.runDrain,
);

// Effect to check git status for staged files
export const checkGitStatus = Command.make('git', 'status', '--porcelain').pipe(
Command.string,
Effect.flatMap((output) => {
// Check if the output contains lines indicating staged changes (e.g., starting with M, A, D, R, C, U followed by a space)
const stagedChanges = output.split('\n').some((line) => /^[MADRCU] /.test(line.trim()));
if (stagedChanges) {
return Effect.fail(
'Git repository has staged changes. Please commit or stash them before releasing.',
);
}
return Effect.void; // No staged changes
}),
// If the command fails (e.g., not a git repo), treat it as an error too.
Effect.catchAll((error) => Effect.fail(`Git status check command failed: ${error}`)),
Effect.tapError((error) => Console.error(error)), // Log the specific error message
Effect.asVoid, // Don't need the output on success
);

// Effect to run changesets snapshot
export const runChangesetsSnapshot = Command.make(
'pnpm',
'changeset',
'version',
'--snapshot',
'beta',
).pipe(
Command.lines,
Stream.tap((line) => Console.log(`Changesets: ${line}`)),
Stream.runDrain, // Consume the stream and wait for completion
Effect.tapBoth({
onFailure: (error) =>
Effect.fail(Console.error(`Changesets snapshot command failed: ${error}`)),
onSuccess: () => Console.log('Changesets snapshot completed successfully.'),
}),
Effect.asVoid,
);

// Effect to start local registry (run in background)
export const startLocalRegistry = Command.make('pnpm', 'nx', 'local-registry').pipe(
Command.start, // Starts the process and returns immediately
Effect.tap(() =>
Console.log('Attempting to start local registry (Verdaccio) in the background...'),
),
Effect.tapError((error) => Console.error(`Failed to start local registry: ${error}`)),
Effect.asVoid, // We don't need the Process handle for this script's logic
);

export const restoreGitFiles = Command.make('git', 'restore', '.').pipe(Command.start);

export const publishPackages = Command.make(
'pnpm',
'publish',
'-r',
'--tag',
'beta',
'--registry=http://localhost:4873',
'--no-git-checks',
).pipe(
Command.lines,
Stream.tap((line) => Console.log(`Publish: ${line}`)),
Stream.runDrain,
Effect.tapBoth({
onFailure: (error) => Effect.fail(() => Console.error(`Publishing failed: ${error}`)),
onSuccess: () => Console.log('Packages were published successfully to the local registry.'),
}),
Effect.asVoid,
);
12 changes: 12 additions & 0 deletions tools/release/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@forgerock/local-release-tool",
"version": "0.0.0",
"private": true,
"description": "",
"keywords": [],
"license": "ISC",
"author": "",
"main": "index.js",
"scripts": {},
"dependencies": {}
}
Loading