playcademy 0.19.1-beta.2 → 0.19.1-beta.4

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
@@ -1065,7 +1065,7 @@ var SAMPLE_BUCKET_FILENAME = "bucket.ts";
1065
1065
  // ../better-auth/package.json
1066
1066
  var package_default = {
1067
1067
  name: "@playcademy/better-auth",
1068
- version: "0.0.6-beta.2",
1068
+ version: "0.0.6-beta.4",
1069
1069
  type: "module",
1070
1070
  exports: {
1071
1071
  "./server": {
@@ -3016,7 +3016,7 @@ import { existsSync as existsSync11, mkdirSync as mkdirSync5, readFileSync as re
3016
3016
  import { join as join13 } from "node:path";
3017
3017
 
3018
3018
  // src/version.ts
3019
- var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.2";
3019
+ var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.4";
3020
3020
 
3021
3021
  // src/lib/init/database.ts
3022
3022
  var drizzleConfigTemplate = loadTemplateString("database/drizzle-config.ts");
package/dist/constants.js CHANGED
@@ -20,7 +20,7 @@ var SAMPLE_BUCKET_FILENAME = "bucket.ts";
20
20
  // ../better-auth/package.json
21
21
  var package_default = {
22
22
  name: "@playcademy/better-auth",
23
- version: "0.0.6-beta.2",
23
+ version: "0.0.6-beta.4",
24
24
  type: "module",
25
25
  exports: {
26
26
  "./server": {
package/dist/db.js CHANGED
@@ -36,7 +36,7 @@ var DEFAULT_API_ROUTES_DIRECTORY = join2(SERVER_ROOT_DIRECTORY, "api");
36
36
  // ../better-auth/package.json
37
37
  var package_default = {
38
38
  name: "@playcademy/better-auth",
39
- version: "0.0.6-beta.2",
39
+ version: "0.0.6-beta.4",
40
40
  type: "module",
41
41
  exports: {
42
42
  "./server": {
package/dist/index.d.ts CHANGED
@@ -1063,6 +1063,7 @@ interface DeploymentContext {
1063
1063
  minify: boolean;
1064
1064
  verbose: boolean;
1065
1065
  debug: boolean;
1066
+ compatibilityDate?: string;
1066
1067
  }
1067
1068
  /**
1068
1069
  * Analysis of what changed in an update
@@ -1195,6 +1196,8 @@ interface BundleOptions {
1195
1196
  sourcemap?: boolean;
1196
1197
  /** Minify output (default: false) */
1197
1198
  minify?: boolean;
1199
+ /** Override the Worker compatibility date used for compat-aware bundling */
1200
+ compatibilityDate?: string;
1198
1201
  }
1199
1202
  /**
1200
1203
  * Metadata describing the sealed backend runtime artifact.
package/dist/index.js CHANGED
@@ -326,7 +326,7 @@ var SAMPLE_BUCKET_FILENAME = "bucket.ts";
326
326
  // ../better-auth/package.json
327
327
  var package_default = {
328
328
  name: "@playcademy/better-auth",
329
- version: "0.0.6-beta.2",
329
+ version: "0.0.6-beta.4",
330
330
  type: "module",
331
331
  exports: {
332
332
  "./server": {
@@ -4017,7 +4017,7 @@ import { existsSync as existsSync9, mkdirSync as mkdirSync2, readFileSync as rea
4017
4017
  import { join as join13 } from "node:path";
4018
4018
 
4019
4019
  // src/version.ts
4020
- var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.2";
4020
+ var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.4";
4021
4021
 
4022
4022
  // src/lib/init/database.ts
4023
4023
  var drizzleConfigTemplate = loadTemplateString("database/drizzle-config.ts");
@@ -9515,7 +9515,10 @@ function createEsbuildConfig(entryCode, paths, bundleConfig, customRoutesDir, op
9515
9515
  // └─────────────────────────────────────────────────────────────────────┘
9516
9516
  "@game-server": join32(workspace, "server")
9517
9517
  },
9518
- plugins: [createBackendNodeCompatPlugin(), createForbiddenRuntimeImportsPlugin(workspace)],
9518
+ plugins: [
9519
+ createBackendNodeCompatPlugin({ compatibilityDate: options.compatibilityDate }),
9520
+ createForbiddenRuntimeImportsPlugin(workspace)
9521
+ ],
9519
9522
  external: []
9520
9523
  // Native workerd builtins are externalized via the compat plugin
9521
9524
  };
@@ -10964,7 +10967,7 @@ import {
10964
10967
  // ../data/src/domains/user/table.ts
10965
10968
  import { relations } from "drizzle-orm";
10966
10969
  import { boolean, pgEnum, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
10967
- var userRoleEnum = pgEnum("user_role", ["admin", "player", "developer"]);
10970
+ var userRoleEnum = pgEnum("user_role", ["admin", "player", "developer", "teacher"]);
10968
10971
  var developerStatusEnum = pgEnum("developer_status", ["none", "pending", "approved"]);
10969
10972
  var users = pgTable("user", {
10970
10973
  id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),
@@ -11504,6 +11507,7 @@ async function prepareDeploymentContext(options) {
11504
11507
  minify: options.minify ?? true,
11505
11508
  verbose: options.verbose ?? false,
11506
11509
  debug: options.debug ?? false,
11510
+ compatibilityDate: options.compatibilityDate,
11507
11511
  localSecrets,
11508
11512
  remoteSecretKeys
11509
11513
  };
@@ -11529,7 +11533,10 @@ async function detectIntegrationMetadataChanges(context2) {
11529
11533
  async function bundleAndHash(context2) {
11530
11534
  try {
11531
11535
  await ensurePlaycademyTypes();
11532
- const bundle = await bundleBackend(context2.fullConfig, { minify: context2.minify });
11536
+ const bundle = await bundleBackend(context2.fullConfig, {
11537
+ minify: context2.minify,
11538
+ compatibilityDate: context2.compatibilityDate
11539
+ });
11533
11540
  const bundleHash = hashContent(bundle.code);
11534
11541
  const [serverSize, dbSize] = await Promise.all([
11535
11542
  getDirectorySize(join37(context2.projectPath, SERVER_ROOT_DIRECTORY)),
@@ -11644,6 +11651,7 @@ async function calculateDeploymentPlan(context2, changes) {
11644
11651
  deployBackend,
11645
11652
  forceBackend
11646
11653
  } = context2;
11654
+ const compatibilityDateOverride = Boolean(context2.compatibilityDate) && deployBackend;
11647
11655
  if (!gameAlreadyDeployed) {
11648
11656
  const needsBackend3 = hasLocalCustomRoutes(projectPath, context2.fullConfig) || Boolean(context2.fullConfig?.integrations);
11649
11657
  const shouldDeployBackend2 = deployBackend && needsBackend3;
@@ -11660,7 +11668,7 @@ async function calculateDeploymentPlan(context2, changes) {
11660
11668
  const configHasChanges = changes.config;
11661
11669
  const secretsHaveChanges = changes.secrets !== void 0;
11662
11670
  const noChanges = !buildHasChanges && !backendHasChanges && !configHasChanges && !secretsHaveChanges;
11663
- if (noChanges && !forceBackend) {
11671
+ if (noChanges && !forceBackend && !compatibilityDateOverride) {
11664
11672
  return {
11665
11673
  action: "no-changes",
11666
11674
  gameType: config.gameType ?? "hosted",
@@ -11673,7 +11681,7 @@ async function calculateDeploymentPlan(context2, changes) {
11673
11681
  const shouldUpdateGame = buildHasChanges || configHasChanges;
11674
11682
  const shouldUploadBuild = buildHasChanges;
11675
11683
  const needsBackend2 = hasLocalCustomRoutes(projectPath, context2.fullConfig) || Boolean(context2.fullConfig?.integrations);
11676
- const shouldDeployBackend = deployBackend && (backendHasChanges || forceBackend || shouldUploadBuild && needsBackend2);
11684
+ const shouldDeployBackend = deployBackend && (backendHasChanges || forceBackend || compatibilityDateOverride || shouldUploadBuild && needsBackend2);
11677
11685
  return {
11678
11686
  action: "update-existing",
11679
11687
  gameType: config.gameType ?? "hosted",
@@ -11854,7 +11862,10 @@ async function deployGame(context2, shouldUploadBuild, shouldDeployBackend) {
11854
11862
  await ensurePlaycademyTypes();
11855
11863
  const bundle = await runStep(
11856
11864
  "Bundling backend",
11857
- async () => context2.currentBackendBundle ?? bundleBackend(fullConfig, { minify: context2.minify }),
11865
+ async () => context2.currentBackendBundle ?? bundleBackend(fullConfig, {
11866
+ minify: context2.minify,
11867
+ compatibilityDate: context2.compatibilityDate
11868
+ }),
11858
11869
  "Backend bundled"
11859
11870
  );
11860
11871
  const deploymentPrep = await runStep(
@@ -11898,7 +11909,7 @@ async function deployGame(context2, shouldUploadBuild, shouldDeployBackend) {
11898
11909
  ...bundle,
11899
11910
  bindings: Object.keys(deploymentPrep.bindings).length > 0 ? deploymentPrep.bindings : void 0,
11900
11911
  schema: deploymentPrep.schemaInfo || void 0,
11901
- compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE,
11912
+ compatibilityDate: context2.compatibilityDate ?? CLOUDFLARE_COMPATIBILITY_DATE,
11902
11913
  compatibilityFlags: [...BACKEND_COMPATIBILITY_FLAGS]
11903
11914
  };
11904
11915
  const [serverSize, dbSize] = await Promise.all([
@@ -11928,7 +11939,8 @@ async function deployGame(context2, shouldUploadBuild, shouldDeployBackend) {
11928
11939
  );
11929
11940
  backendBundle = {
11930
11941
  code: stubCode,
11931
- config: fullConfig || { name: "stub" }
11942
+ config: fullConfig || { name: "stub" },
11943
+ ...context2.compatibilityDate ? { compatibilityDate: context2.compatibilityDate } : {}
11932
11944
  };
11933
11945
  }
11934
11946
  let game;
@@ -344,9 +344,9 @@ var init_routes = __esm({
344
344
  // ../edge-play/src/entry/metadata.ts
345
345
  function getRuntimeMetadata() {
346
346
  return {
347
- cliVersion: true ? "0.19.1-beta.2" : "0.0.0-dev",
348
- sdkVersion: true ? "0.4.1-beta.2" : "0.0.0-dev",
349
- buildId: true ? "d7346ec4a42f" : "dev-source"
347
+ cliVersion: true ? "0.19.1-beta.4" : "0.0.0-dev",
348
+ sdkVersion: true ? "0.4.1-beta.4" : "0.0.0-dev",
349
+ buildId: true ? "496079034260" : "dev-source"
350
350
  };
351
351
  }
352
352
  var init_metadata = __esm({
@@ -1,7 +1,7 @@
1
1
  {
2
- "cliVersion": "0.19.1-beta.2",
3
- "sdkVersion": "0.4.1-beta.2",
4
- "runtimeBuildId": "d7346ec4a42f",
5
- "inputFingerprint": "d7346ec4a42f0c9fb0a5c28e455ad8bcb81ed072898ac8b1550dd01e57f50e7d",
2
+ "cliVersion": "0.19.1-beta.4",
3
+ "sdkVersion": "0.4.1-beta.4",
4
+ "runtimeBuildId": "496079034260",
5
+ "inputFingerprint": "49607903426071782d895256d849a86318572b2a424466ac49b2e56b8bb52cdd",
6
6
  "entry": "index.js"
7
7
  }
package/dist/utils.js CHANGED
@@ -477,7 +477,7 @@ var DEFAULT_API_ROUTES_DIRECTORY = join2(SERVER_ROOT_DIRECTORY, "api");
477
477
  // ../better-auth/package.json
478
478
  var package_default = {
479
479
  name: "@playcademy/better-auth",
480
- version: "0.0.6-beta.2",
480
+ version: "0.0.6-beta.4",
481
481
  type: "module",
482
482
  exports: {
483
483
  "./server": {
@@ -2529,7 +2529,7 @@ import { existsSync as existsSync8, mkdirSync as mkdirSync2, writeFileSync as wr
2529
2529
  import { dirname as dirname4, join as join13 } from "node:path";
2530
2530
 
2531
2531
  // src/version.ts
2532
- var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.2";
2532
+ var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.4";
2533
2533
 
2534
2534
  // src/lib/build/binary-resource.ts
2535
2535
  function writeFileTree(baseDir, files) {
@@ -5232,7 +5232,10 @@ function createEsbuildConfig(entryCode, paths, bundleConfig, customRoutesDir, op
5232
5232
  // └─────────────────────────────────────────────────────────────────────┘
5233
5233
  "@game-server": join18(workspace, "server")
5234
5234
  },
5235
- plugins: [createBackendNodeCompatPlugin(), createForbiddenRuntimeImportsPlugin(workspace)],
5235
+ plugins: [
5236
+ createBackendNodeCompatPlugin({ compatibilityDate: options.compatibilityDate }),
5237
+ createForbiddenRuntimeImportsPlugin(workspace)
5238
+ ],
5236
5239
  external: []
5237
5240
  // Native workerd builtins are externalized via the compat plugin
5238
5241
  };
package/dist/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.2";
2
+ var cliVersion = false ? "0.0.0-dev" : "0.19.1-beta.4";
3
3
  export {
4
4
  cliVersion
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.19.1-beta.2",
3
+ "version": "0.19.1-beta.4",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {