Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update versions for generators #4796

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Include generators in update-versions script
ceciliaavila committed Nov 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8af3364fb2e0525d0dd9a88682e3fbb7283da332
2 changes: 1 addition & 1 deletion libraries/botbuilder-repo-utils/src/package.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export interface Package {
deprecated?: boolean;
internal?: boolean;

workspaces?: { packages: string[] };
workspaces?: { packages: string[]; generators: string[] };

dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
7 changes: 6 additions & 1 deletion libraries/botbuilder-repo-utils/src/updateVersions.ts
Original file line number Diff line number Diff line change
@@ -94,8 +94,13 @@ export const command = (argv: string[], quiet = false) => async (): Promise<Resu
// Read git commit sha if instructed (JSON.parse properly coerces strings to boolean)
const commitSha = JSON.parse(flags.git) ? await gitSha('HEAD') : undefined;

const projects: string[] = [
...(packageFile.workspaces?.packages || []),
...(packageFile.workspaces?.generators || []),
];

// Collect all workspaces from the repo root. Returns workspaces with absolute paths.
const workspaces = await collectWorkspacePackages(repoRoot, packageFile.workspaces?.packages);
const workspaces = await collectWorkspacePackages(repoRoot, projects);

// Build an object mapping a package name to its new, updated version
const workspaceVersions = workspaces.reduce<Record<string, string>>(
6 changes: 5 additions & 1 deletion libraries/botbuilder-repo-utils/src/workspace.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,11 @@ export async function collectWorkspacePackages(
filters: Partial<Filters> = {}
): Promise<Array<Workspace>> {
// Note: posix is required, this emits absolute paths that are platform specific
const paths = await glob(workspaces.map((workspace) => path.posix.join(repoRoot, workspace, 'package.json')));
const paths = await glob(
workspaces.map((workspace) =>
path.posix.join(repoRoot, workspace, '{package.json,package-with-tests.json}{,.js,.ts}'),
),
);

const maybeWorkspaces = await Promise.all(
paths.map(
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -5,12 +5,12 @@
"workspaces": {
"packages": [
"libraries/*",
"libraries/functional-tests/dialogToDialog/*",
"libraries/testskills/*",
"testing/*",
"testing/browser-functional/browser-echo-bot",
"tools",
"transcripts"
"tools"
],
"generators": [
"generators/generator-botbuilder/generators/app/templates/*"
],
"nohoist": [
"**/@types/selenium-webdriver"