@supacloud/compiler 0.50.0 → 0.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -390,6 +390,17 @@ function validateFeatureSpec(spec, module) {
390
390
  }
391
391
  }
392
392
  }
393
+ const declaredTags = module ? new Set(module.controllers.flatMap((controller) => controller.routes.flatMap((route) => route.tags ?? []))) : new Set;
394
+ if (transition.persistence !== undefined && declaredTags.size > 0 && transition.invalidateTags === undefined) {
395
+ error("feature-invalidation-tags-required", `Persistent transition ${transition.name} must declare invalidateTags when Feature ${spec.name} exposes query tags.`);
396
+ }
397
+ if (transition.invalidateTags !== undefined && declaredTags.size > 0) {
398
+ for (const tag of transition.invalidateTags) {
399
+ if (!declaredTags.has(tag)) {
400
+ error("feature-invalidation-tag-unresolved", `Transition ${transition.name} invalidates '${tag}', but Feature ${spec.name} does not declare that query tag.`);
401
+ }
402
+ }
403
+ }
393
404
  if (transition.route) {
394
405
  const routes = module.controllers.flatMap((controller) => controller.routes.filter((route) => `${route.method} ${joinRoutePaths(controller.path, route.path)}` === transition.route));
395
406
  if (routes.length !== 1) {
@@ -1440,8 +1451,9 @@ var init_validate = __esm(() => {
1440
1451
  "feature-governance-drift": { code: "SC6105", docsUrl: "https://supacloud.dev/errors/SC6105" },
1441
1452
  "feature-persistence-invalid": { code: "SC6110", docsUrl: "https://supacloud.dev/errors/SC6110" },
1442
1453
  "feature-persistence-drift": { code: "SC6111", docsUrl: "https://supacloud.dev/errors/SC6111" },
1454
+ "feature-invalidation-tag-unresolved": { code: "SC6113", docsUrl: "https://supacloud.dev/errors/SC6113" },
1443
1455
  "feature-tenant-boundary-invalid": { code: "SC6112", docsUrl: "https://supacloud.dev/errors/SC6112" },
1444
- "feature-tenant-boundary-drift": { code: "SC6113", docsUrl: "https://supacloud.dev/errors/SC6113" },
1456
+ "feature-tenant-boundary-drift": { code: "SC6127", docsUrl: "https://supacloud.dev/errors/SC6127" },
1445
1457
  "feature-query-tenant-boundary": { code: "SC6114", docsUrl: "https://supacloud.dev/errors/SC6114" },
1446
1458
  "feature-job-tenant-boundary": { code: "SC6115", docsUrl: "https://supacloud.dev/errors/SC6115" },
1447
1459
  "feature-command-tenant-boundary": { code: "SC6116", docsUrl: "https://supacloud.dev/errors/SC6116" },
@@ -1454,6 +1466,7 @@ var init_validate = __esm(() => {
1454
1466
  "feature-database-source-invalid": { code: "SC6123", docsUrl: "https://supacloud.dev/errors/SC6123" },
1455
1467
  "feature-database-table-invalid": { code: "SC6124", docsUrl: "https://supacloud.dev/errors/SC6124" },
1456
1468
  "feature-database-row-type-invalid": { code: "SC6125", docsUrl: "https://supacloud.dev/errors/SC6125" },
1469
+ "feature-invalidation-tags-required": { code: "SC6126", docsUrl: "https://supacloud.dev/errors/SC6126" },
1457
1470
  "feature-route-unresolved": { code: "SC6106", docsUrl: "https://supacloud.dev/errors/SC6106" },
1458
1471
  "feature-route-drift": { code: "SC6107", docsUrl: "https://supacloud.dev/errors/SC6107" },
1459
1472
  "invalid-feature-spec": { code: "SC6108", docsUrl: "https://supacloud.dev/errors/SC6108" }
@@ -24993,10 +25006,10 @@ import { readFileSync as readFileSync4 } from "node:fs";
24993
25006
  import { resolve as resolve18 } from "node:path";
24994
25007
 
24995
25008
  // src/migration-app-version.ts
24996
- var MIGRATION_APP_VERSION = "0.31.0";
25009
+ var MIGRATION_APP_VERSION = "0.31.1";
24997
25010
 
24998
25011
  // src/migration-elysia-version.ts
24999
- var MIGRATION_ELYSIA_VERSION = "0.35.1";
25012
+ var MIGRATION_ELYSIA_VERSION = "0.35.2";
25000
25013
 
25001
25014
  // src/migration-policy.ts
25002
25015
  var cachedCompilerVersion;
package/dist/index.js CHANGED
@@ -389,6 +389,17 @@ function validateFeatureSpec(spec, module) {
389
389
  }
390
390
  }
391
391
  }
392
+ const declaredTags = module ? new Set(module.controllers.flatMap((controller) => controller.routes.flatMap((route) => route.tags ?? []))) : new Set;
393
+ if (transition.persistence !== undefined && declaredTags.size > 0 && transition.invalidateTags === undefined) {
394
+ error("feature-invalidation-tags-required", `Persistent transition ${transition.name} must declare invalidateTags when Feature ${spec.name} exposes query tags.`);
395
+ }
396
+ if (transition.invalidateTags !== undefined && declaredTags.size > 0) {
397
+ for (const tag of transition.invalidateTags) {
398
+ if (!declaredTags.has(tag)) {
399
+ error("feature-invalidation-tag-unresolved", `Transition ${transition.name} invalidates '${tag}', but Feature ${spec.name} does not declare that query tag.`);
400
+ }
401
+ }
402
+ }
392
403
  if (transition.route) {
393
404
  const routes = module.controllers.flatMap((controller) => controller.routes.filter((route) => `${route.method} ${joinRoutePaths(controller.path, route.path)}` === transition.route));
394
405
  if (routes.length !== 1) {
@@ -1439,8 +1450,9 @@ var init_validate = __esm(() => {
1439
1450
  "feature-governance-drift": { code: "SC6105", docsUrl: "https://supacloud.dev/errors/SC6105" },
1440
1451
  "feature-persistence-invalid": { code: "SC6110", docsUrl: "https://supacloud.dev/errors/SC6110" },
1441
1452
  "feature-persistence-drift": { code: "SC6111", docsUrl: "https://supacloud.dev/errors/SC6111" },
1453
+ "feature-invalidation-tag-unresolved": { code: "SC6113", docsUrl: "https://supacloud.dev/errors/SC6113" },
1442
1454
  "feature-tenant-boundary-invalid": { code: "SC6112", docsUrl: "https://supacloud.dev/errors/SC6112" },
1443
- "feature-tenant-boundary-drift": { code: "SC6113", docsUrl: "https://supacloud.dev/errors/SC6113" },
1455
+ "feature-tenant-boundary-drift": { code: "SC6127", docsUrl: "https://supacloud.dev/errors/SC6127" },
1444
1456
  "feature-query-tenant-boundary": { code: "SC6114", docsUrl: "https://supacloud.dev/errors/SC6114" },
1445
1457
  "feature-job-tenant-boundary": { code: "SC6115", docsUrl: "https://supacloud.dev/errors/SC6115" },
1446
1458
  "feature-command-tenant-boundary": { code: "SC6116", docsUrl: "https://supacloud.dev/errors/SC6116" },
@@ -1453,6 +1465,7 @@ var init_validate = __esm(() => {
1453
1465
  "feature-database-source-invalid": { code: "SC6123", docsUrl: "https://supacloud.dev/errors/SC6123" },
1454
1466
  "feature-database-table-invalid": { code: "SC6124", docsUrl: "https://supacloud.dev/errors/SC6124" },
1455
1467
  "feature-database-row-type-invalid": { code: "SC6125", docsUrl: "https://supacloud.dev/errors/SC6125" },
1468
+ "feature-invalidation-tags-required": { code: "SC6126", docsUrl: "https://supacloud.dev/errors/SC6126" },
1456
1469
  "feature-route-unresolved": { code: "SC6106", docsUrl: "https://supacloud.dev/errors/SC6106" },
1457
1470
  "feature-route-drift": { code: "SC6107", docsUrl: "https://supacloud.dev/errors/SC6107" },
1458
1471
  "invalid-feature-spec": { code: "SC6108", docsUrl: "https://supacloud.dev/errors/SC6108" }
@@ -24675,10 +24688,10 @@ import { readFileSync as readFileSync4 } from "node:fs";
24675
24688
  import { resolve as resolve17 } from "node:path";
24676
24689
 
24677
24690
  // src/migration-app-version.ts
24678
- var MIGRATION_APP_VERSION = "0.31.0";
24691
+ var MIGRATION_APP_VERSION = "0.31.1";
24679
24692
 
24680
24693
  // src/migration-elysia-version.ts
24681
- var MIGRATION_ELYSIA_VERSION = "0.35.1";
24694
+ var MIGRATION_ELYSIA_VERSION = "0.35.2";
24682
24695
 
24683
24696
  // src/migration-policy.ts
24684
24697
  var cachedCompilerVersion;
@@ -1 +1 @@
1
- export declare const MIGRATION_APP_VERSION = "0.31.0";
1
+ export declare const MIGRATION_APP_VERSION = "0.31.1";
@@ -1 +1 @@
1
- export declare const MIGRATION_ELYSIA_VERSION = "0.35.1";
1
+ export declare const MIGRATION_ELYSIA_VERSION = "0.35.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.50.0",
3
+ "version": "0.50.1",
4
4
  "description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",