@playcademy/vite-plugin 0.0.1-beta.7 → 0.0.1-beta.8

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -566,7 +566,7 @@ globstar while`, file, fr, pattern, pr3, swallowee);
566
566
  }
567
567
  };
568
568
  for (let i3 = 0, c2;i3 < pattern.length && (c2 = pattern.charAt(i3)); i3++) {
569
- this.debug("%s\t%s %s %j", pattern, i3, re3, c2);
569
+ this.debug("%s %s %s %j", pattern, i3, re3, c2);
570
570
  if (escaping) {
571
571
  if (c2 === "/") {
572
572
  return false;
@@ -56378,7 +56378,7 @@ globstar while`, file, fr, pattern, pr3, swallowee);
56378
56378
  }
56379
56379
  };
56380
56380
  for (let i3 = 0, c2;i3 < pattern.length && (c2 = pattern.charAt(i3)); i3++) {
56381
- this.debug("%s\t%s %s %j", pattern, i3, re3, c2);
56381
+ this.debug("%s %s %s %j", pattern, i3, re3, c2);
56382
56382
  if (escaping) {
56383
56383
  if (c2 === "/") {
56384
56384
  return false;
@@ -64901,7 +64901,7 @@ Is ${source_default.bold.blue(this.base.name)} schema created or renamed from an
64901
64901
  IS_LINE_JUNK = function(line22, pat = /^\s*#?\s*$/) {
64902
64902
  return pat.test(line22);
64903
64903
  };
64904
- IS_CHARACTER_JUNK = function(ch, ws = " \t") {
64904
+ IS_CHARACTER_JUNK = function(ch, ws = " ") {
64905
64905
  return indexOf.call(ws, ch) >= 0;
64906
64906
  };
64907
64907
  _formatRangeUnified = function(start2, stop2) {
@@ -74491,7 +74491,7 @@ globstar while`, file, fr, pattern, pr3, swallowee);
74491
74491
  }
74492
74492
  };
74493
74493
  for (let i3 = 0, c2;i3 < pattern.length && (c2 = pattern.charAt(i3)); i3++) {
74494
- this.debug("%s\t%s %s %j", pattern, i3, re3, c2);
74494
+ this.debug("%s %s %s %j", pattern, i3, re3, c2);
74495
74495
  if (escaping) {
74496
74496
  if (c2 === "/") {
74497
74497
  return false;
@@ -118885,7 +118885,7 @@ async function seedCurrentProjectGame(db, project) {
118885
118885
  }
118886
118886
  var package_default = {
118887
118887
  name: "@playcademy/sandbox",
118888
- version: "0.1.0-beta.2",
118888
+ version: "0.1.0-beta.3",
118889
118889
  description: "Local development server for Playcademy game development",
118890
118890
  type: "module",
118891
118891
  exports: {
@@ -123400,7 +123400,7 @@ var shell_default = `<!doctype html>
123400
123400
  </div>
123401
123401
 
123402
123402
  <script type="module">
123403
- import { bus, BusEvents } from '@playcademy/sdk'
123403
+ import { messaging, MessageEvents } from '@playcademy/sdk'
123404
123404
 
123405
123405
  const status = document.getElementById('status')
123406
123406
  const loading = document.getElementById('loading')
@@ -123446,16 +123446,17 @@ var shell_default = `<!doctype html>
123446
123446
  'Game iframe loaded, sending PLAYCADEMY_INIT message',
123447
123447
  )
123448
123448
 
123449
- gameFrame.contentWindow.postMessage(
123449
+ messaging.send(
123450
+ MessageEvents.INIT,
123450
123451
  {
123451
- type: BusEvents.INIT,
123452
- payload: {
123453
- baseUrl: '{{SANDBOX_URL}}',
123454
- token: 'dev-token',
123455
- gameId: '{{GAME_ID}}',
123456
- },
123452
+ baseUrl: '{{SANDBOX_URL}}',
123453
+ token: 'dev-token',
123454
+ gameId: '{{GAME_ID}}',
123455
+ },
123456
+ {
123457
+ target: gameFrame.contentWindow,
123458
+ origin: '*',
123457
123459
  },
123458
- '*',
123459
123460
  )
123460
123461
  }
123461
123462
 
@@ -123474,7 +123475,8 @@ var shell_default = `<!doctype html>
123474
123475
  const { type, ...payload } = event.data || {}
123475
123476
  if (type && type.startsWith('PLAYCADEMY_')) {
123476
123477
  logIfDebug('Received message from game:', type, payload)
123477
- bus.emit(type, payload)
123478
+ // Bridge the message to the local context using CustomEvent
123479
+ messaging.send(type, payload)
123478
123480
  }
123479
123481
  }
123480
123482
  })
@@ -123499,6 +123501,11 @@ function devServerMiddleware(server, sandboxUrl, project) {
123499
123501
  res.end(generateLoaderHTML(sandboxUrl, gameId));
123500
123502
  return;
123501
123503
  }
123504
+ if (req.url === "/game" && req.method === "GET") {
123505
+ req.url = "/index.html";
123506
+ next();
123507
+ return;
123508
+ }
123502
123509
  next();
123503
123510
  });
123504
123511
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@playcademy/vite-plugin",
3
3
  "type": "module",
4
- "version": "0.0.1-beta.7",
4
+ "version": "0.0.1-beta.8",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {