Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+20
-18
@@ -12,7 +12,6 @@ const migratedWrappers = [
|
||||
"apps/web/app/utils/db/subscriptionProducts.db.server.ts",
|
||||
"apps/web/app/utils/db/tenantSubscriptions.db.server.ts",
|
||||
"apps/web/app/utils/db/subscriptions/tenantSubscriptionProducts.db.server.ts",
|
||||
"apps/web/app/utils/db/stripe/checkoutSessions.db.server.ts",
|
||||
];
|
||||
|
||||
const directBillingPrismaModels = [
|
||||
@@ -29,10 +28,10 @@ const directBillingPrismaModels = [
|
||||
];
|
||||
|
||||
describe("subscription app boundary", () => {
|
||||
it.each(migratedWrappers)("keeps %s behind @toolctrl/db/subscriptions.server", (path) => {
|
||||
it.each(migratedWrappers)("keeps %s behind @hivegrid/db/subscriptions.server", (path) => {
|
||||
const source = readRepoFile(path);
|
||||
|
||||
expect(source).toContain("@toolctrl/db/subscriptions.server");
|
||||
expect(source).toContain("@hivegrid/db/subscriptions.server");
|
||||
expect(source).not.toContain("~/utils/db.server");
|
||||
expect(source).not.toContain("../../db.server");
|
||||
expect(source).not.toContain("../db.server");
|
||||
@@ -42,10 +41,10 @@ describe("subscription app boundary", () => {
|
||||
it("keeps subscriptionService subscription billing persistence behind the package boundary", () => {
|
||||
const source = readRepoFile("apps/web/app/utils/services/.server/subscriptionService.ts");
|
||||
|
||||
expect(source).toContain("@toolctrl/db/subscriptions.server");
|
||||
expect(source).toContain("@hivegrid/db/subscriptions.server");
|
||||
expect(source).toContain("../../db.server");
|
||||
expect(source).toContain("clearCacheKey");
|
||||
expect(source).toContain("cancelStripeSubscription");
|
||||
expect(source).toContain("cancelTenantSubscription");
|
||||
expect(source).toContain("EventsService.create");
|
||||
|
||||
for (const model of directBillingPrismaModels) {
|
||||
@@ -53,20 +52,23 @@ describe("subscription app boundary", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps tenant subscription route writes behind cache-clearing web wrappers", () => {
|
||||
const routePaths = [
|
||||
"apps/web/app/routes/subscribe.$tenant.tsx",
|
||||
"apps/web/app/routes/app.$tenant/settings/subscription.tsx",
|
||||
];
|
||||
it("keeps tenant subscription settings writes behind cache-clearing web wrappers", () => {
|
||||
const source = readRepoFile("apps/web/app/routes/app.$tenant/settings/subscription.tsx");
|
||||
const directPackageImport = source.match(/import\s+\{([^}]+)\}\s+from\s+["']@hivegrid\/db\/subscriptions\.server["']/s);
|
||||
const importedNames = directPackageImport?.[1] ?? "";
|
||||
|
||||
for (const path of routePaths) {
|
||||
const source = readRepoFile(path);
|
||||
const directPackageImport = source.match(/import\s+\{([^}]+)\}\s+from\s+["']@toolctrl\/db\/subscriptions\.server["']/s);
|
||||
const importedNames = directPackageImport?.[1] ?? "";
|
||||
expect(importedNames).not.toMatch(/\bcreateTenantSubscription\b/);
|
||||
expect(importedNames).not.toMatch(/\bupdateTenantSubscriptionCustomerId\b/);
|
||||
expect(source).toContain("~/utils/db/tenantSubscriptions.db.server");
|
||||
});
|
||||
|
||||
expect(importedNames).not.toMatch(/\bcreateTenantSubscription\b/);
|
||||
expect(importedNames).not.toMatch(/\bupdateTenantSubscriptionCustomerId\b/);
|
||||
expect(source).toContain("~/utils/db/tenantSubscriptions.db.server");
|
||||
}
|
||||
it("keeps the legacy subscribe route free of in-app checkout writes and plan UI", () => {
|
||||
const source = readRepoFile("apps/web/app/routes/subscribe.$tenant.tsx");
|
||||
|
||||
expect(source).not.toContain("@hivegrid/db/subscriptions.server");
|
||||
expect(source).not.toContain("~/utils/db/tenantSubscriptions.db.server");
|
||||
expect(source).not.toContain("createCheckoutSession");
|
||||
expect(source).not.toContain("createBillingCustomer");
|
||||
expect(source).not.toContain("PlansGrouped");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user