Skip to content
Merged
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
36 changes: 22 additions & 14 deletions apps/web/src/pages/onboarding-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { useCallback, useEffect, useState } from "react";
import { ensurePrimaryTenant, runPortableClientBootstrap } from "../client-bootstrap";
import { createFetchStockHub, findOwnedTenants } from "../needs-converge";
import { deployMyraSource } from "../myra-deploy";
import { publishToolPackageRegistry } from "../tools/registry-publish";
import { useNavigate } from "../navigation";
import { triggerFirstLoginProvisioning } from "../onboarding";
import { OnboardingLayout } from "../onboarding/onboarding-layout";
Expand Down Expand Up @@ -152,20 +153,27 @@ export function OnboardingPage({ user }: { readonly user: SessionUser }) {
tenantDomain: string,
offering: ExistingOffering,
): Promise<void> {
return deployMyraSource({
tenantId,
tenantDomain,
sourceOfferingIds: offering.sourceOfferingIds,
defaultSourceOfferingId: offering.defaultSourceOfferingId,
}).then(
(myraDeploy) => setState({ phase: "installing", myraDeploy }),
(error: unknown) => {
setState({
phase: "error",
message: error instanceof Error ? error.message : "Publishing Myra's source hit a snag.",
});
},
);
// Myra's pins resolve from the tenant registry, so the tool packages
// must be there before her definition deploys.
return publishToolPackageRegistry(tenantId)
.then(() =>
deployMyraSource({
tenantId,
tenantDomain,
sourceOfferingIds: offering.sourceOfferingIds,
defaultSourceOfferingId: offering.defaultSourceOfferingId,
}),
)
.then(
(myraDeploy) => setState({ phase: "installing", myraDeploy }),
(error: unknown) => {
setState({
phase: "error",
message:
error instanceof Error ? error.message : "Publishing Myra's source hit a snag.",
});
},
);
}

// Step 4: the installer itself, run once a `myraDeploy` is in hand. A
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/tools/registry-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
return `${name.replace(/^@/, "").replace("/", "-")}-${version}.tgz`;
}

const TOOL_PACKAGE_MANIFESTS = import.meta.glob("../../../../tools/*/package.json", {

Check failure on line 113 in apps/web/src/tools/registry-publish.ts

View workflow job for this annotation

GitHub Actions / unit

TypeError: undefined is not a function (near '...import.meta.glob("../../../../tools/*/package.json", {

import: "default", eager: !0 })...') at /home/runner/work/workbench/workbench/apps/web/src/tools/registry-publish.ts:113:44
query: "?raw",
import: "default",
eager: true,
Expand Down Expand Up @@ -164,7 +164,7 @@
),
};
for (const [sourcePath, contents] of Object.entries(TOOL_PACKAGE_SOURCE_FILES)) {
if (!sourcePath.startsWith(prefix)) continue;
if (!sourcePath.startsWith(prefix) || /\.test\.tsx?$/.test(sourcePath)) continue;
tree[sourcePath.slice(prefix.length)] = contents;
}
return { name: manifest.name, version: manifest.version, tree };
Expand Down
Loading