playcademy 0.13.21 → 0.13.22

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 +18 -154
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -9506,7 +9506,6 @@ async function runDbInit() {
9506
9506
  }
9507
9507
 
9508
9508
  // src/commands/db/reset.ts
9509
- init_src2();
9510
9509
  init_src();
9511
9510
  import { spawn } from "child_process";
9512
9511
  import { existsSync as existsSync19, rmSync as rmSync2 } from "fs";
@@ -9557,24 +9556,10 @@ async function runDbReset() {
9557
9556
  logger.newLine();
9558
9557
  return;
9559
9558
  }
9560
- const config = await loadConfig();
9561
- const { code } = await bundleBackend(config);
9559
+ await loadConfig();
9562
9560
  try {
9563
9561
  const mf = new Miniflare2({
9564
- port: 0,
9565
- // Random available port
9566
- modules: [
9567
- {
9568
- type: "ESModule",
9569
- path: "index.mjs",
9570
- contents: code
9571
- }
9572
- ],
9573
- bindings: {
9574
- PLAYCADEMY_API_KEY: "dev-api-key",
9575
- GAME_ID: CORE_GAME_UUIDS.PLAYGROUND,
9576
- PLAYCADEMY_BASE_URL: "http://localhost:5174"
9577
- },
9562
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
9578
9563
  d1Databases: ["DB"],
9579
9564
  d1Persist: dbDir,
9580
9565
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -9598,7 +9583,7 @@ async function runDbReset() {
9598
9583
  // stdin: ignore, stdout: ignore, stderr: inherit
9599
9584
  env: process.env
9600
9585
  });
9601
- child.on("close", (code2) => resolve11(code2 || 0));
9586
+ child.on("close", (code) => resolve11(code || 0));
9602
9587
  child.on("error", () => resolve11(1));
9603
9588
  });
9604
9589
  return exitCode2;
@@ -9696,19 +9681,9 @@ async function runKVClear(options = {}) {
9696
9681
  }
9697
9682
  process.exit(1);
9698
9683
  }
9699
- const bundle = await bundleBackend(config, {
9700
- sourcemap: false,
9701
- minify: false
9702
- });
9703
9684
  const kvDir = join24(getWorkspace(), CLI_DIRECTORIES.KV);
9704
9685
  const mf = new Miniflare3({
9705
- modules: [
9706
- {
9707
- type: "ESModule",
9708
- path: "index.mjs",
9709
- contents: bundle.code
9710
- }
9711
- ],
9686
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
9712
9687
  kvNamespaces: ["KV"],
9713
9688
  kvPersist: kvDir,
9714
9689
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -9819,19 +9794,9 @@ async function runKVDelete(key, options = {}) {
9819
9794
  }
9820
9795
  process.exit(1);
9821
9796
  }
9822
- const bundle = await bundleBackend(config, {
9823
- sourcemap: false,
9824
- minify: false
9825
- });
9826
9797
  const kvDir = join25(getWorkspace(), CLI_DIRECTORIES.KV);
9827
9798
  const mf = new Miniflare4({
9828
- modules: [
9829
- {
9830
- type: "ESModule",
9831
- path: "index.mjs",
9832
- contents: bundle.code
9833
- }
9834
- ],
9799
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
9835
9800
  kvNamespaces: ["KV"],
9836
9801
  kvPersist: kvDir,
9837
9802
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -9907,19 +9872,9 @@ async function runKVGet(key, options = {}) {
9907
9872
  }
9908
9873
  process.exit(1);
9909
9874
  }
9910
- const bundle = await bundleBackend(config, {
9911
- sourcemap: false,
9912
- minify: false
9913
- });
9914
9875
  const kvDir = join26(getWorkspace(), CLI_DIRECTORIES.KV);
9915
9876
  const mf = new Miniflare5({
9916
- modules: [
9917
- {
9918
- type: "ESModule",
9919
- path: "index.mjs",
9920
- contents: bundle.code
9921
- }
9922
- ],
9877
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
9923
9878
  kvNamespaces: ["KV"],
9924
9879
  kvPersist: kvDir,
9925
9880
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10097,19 +10052,9 @@ async function runKVInspect(key, options = {}) {
10097
10052
  }
10098
10053
  process.exit(1);
10099
10054
  }
10100
- const bundle = await bundleBackend(config, {
10101
- sourcemap: false,
10102
- minify: false
10103
- });
10104
10055
  const kvDir = join27(getWorkspace(), CLI_DIRECTORIES.KV);
10105
10056
  const mf = new Miniflare6({
10106
- modules: [
10107
- {
10108
- type: "ESModule",
10109
- path: "index.mjs",
10110
- contents: bundle.code
10111
- }
10112
- ],
10057
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10113
10058
  kvNamespaces: ["KV"],
10114
10059
  kvPersist: kvDir,
10115
10060
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10227,19 +10172,9 @@ async function runKVList(options = {}) {
10227
10172
  }
10228
10173
  process.exit(1);
10229
10174
  }
10230
- const bundle = await bundleBackend(config, {
10231
- sourcemap: false,
10232
- minify: false
10233
- });
10234
10175
  const kvDir = join28(getWorkspace(), CLI_DIRECTORIES.KV);
10235
10176
  const mf = new Miniflare7({
10236
- modules: [
10237
- {
10238
- type: "ESModule",
10239
- path: "index.mjs",
10240
- contents: bundle.code
10241
- }
10242
- ],
10177
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10243
10178
  kvNamespaces: ["KV"],
10244
10179
  kvPersist: kvDir,
10245
10180
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10352,19 +10287,9 @@ async function runKVSeed(seedFile, options = {}) {
10352
10287
  }
10353
10288
  process.exit(1);
10354
10289
  }
10355
- const bundle = await bundleBackend(config, {
10356
- sourcemap: false,
10357
- minify: false
10358
- });
10359
10290
  const kvDir = join29(workspace, CLI_DIRECTORIES.KV);
10360
10291
  const mf = new Miniflare8({
10361
- modules: [
10362
- {
10363
- type: "ESModule",
10364
- path: "index.mjs",
10365
- contents: bundle.code
10366
- }
10367
- ],
10292
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10368
10293
  kvNamespaces: ["KV"],
10369
10294
  kvPersist: kvDir,
10370
10295
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10513,19 +10438,9 @@ async function runKVSet(key, value, options = {}) {
10513
10438
  }
10514
10439
  process.exit(1);
10515
10440
  }
10516
- const bundle = await bundleBackend(config, {
10517
- sourcemap: false,
10518
- minify: false
10519
- });
10520
10441
  const kvDir = join30(getWorkspace(), CLI_DIRECTORIES.KV);
10521
10442
  const mf = new Miniflare9({
10522
- modules: [
10523
- {
10524
- type: "ESModule",
10525
- path: "index.mjs",
10526
- contents: bundle.code
10527
- }
10528
- ],
10443
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10529
10444
  kvNamespaces: ["KV"],
10530
10445
  kvPersist: kvDir,
10531
10446
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10593,19 +10508,9 @@ async function runKVStats(options = {}) {
10593
10508
  }
10594
10509
  process.exit(1);
10595
10510
  }
10596
- const bundle = await bundleBackend(config, {
10597
- sourcemap: false,
10598
- minify: false
10599
- });
10600
10511
  const kvDir = join31(getWorkspace(), CLI_DIRECTORIES.KV);
10601
10512
  const mf = new Miniflare10({
10602
- modules: [
10603
- {
10604
- type: "ESModule",
10605
- path: "index.mjs",
10606
- contents: bundle.code
10607
- }
10608
- ],
10513
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10609
10514
  kvNamespaces: ["KV"],
10610
10515
  kvPersist: kvDir,
10611
10516
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10761,19 +10666,9 @@ async function runBucketDelete(key, options = {}) {
10761
10666
  }
10762
10667
  process.exit(1);
10763
10668
  }
10764
- const bundle = await bundleBackend(config, {
10765
- sourcemap: false,
10766
- minify: false
10767
- });
10768
10669
  const bucketDir = join32(getWorkspace(), CLI_DIRECTORIES.BUCKET);
10769
10670
  const mf = new Miniflare11({
10770
- modules: [
10771
- {
10772
- type: "ESModule",
10773
- path: "index.mjs",
10774
- contents: bundle.code
10775
- }
10776
- ],
10671
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10777
10672
  r2Buckets: ["BUCKET"],
10778
10673
  r2Persist: bucketDir,
10779
10674
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -10865,19 +10760,9 @@ async function runBucketGet(key, options = {}) {
10865
10760
  }
10866
10761
  process.exit(1);
10867
10762
  }
10868
- const bundle = await bundleBackend(config, {
10869
- sourcemap: false,
10870
- minify: false
10871
- });
10872
10763
  const bucketDir = join33(getWorkspace(), CLI_DIRECTORIES.BUCKET);
10873
10764
  const mf = new Miniflare12({
10874
- modules: [
10875
- {
10876
- type: "ESModule",
10877
- path: "index.mjs",
10878
- contents: bundle.code
10879
- }
10880
- ],
10765
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
10881
10766
  r2Buckets: ["BUCKET"],
10882
10767
  r2Persist: bucketDir,
10883
10768
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -11056,19 +10941,9 @@ async function runBucketList(options = {}) {
11056
10941
  }
11057
10942
  process.exit(1);
11058
10943
  }
11059
- const bundle = await bundleBackend(config, {
11060
- sourcemap: false,
11061
- minify: false
11062
- });
11063
10944
  const bucketDir = join34(getWorkspace(), CLI_DIRECTORIES.BUCKET);
11064
10945
  const mf = new Miniflare13({
11065
- modules: [
11066
- {
11067
- type: "ESModule",
11068
- path: "index.mjs",
11069
- contents: bundle.code
11070
- }
11071
- ],
10946
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
11072
10947
  r2Buckets: ["BUCKET"],
11073
10948
  r2Persist: bucketDir,
11074
10949
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
@@ -11197,29 +11072,18 @@ async function runBucketPut(key, filePath, options = {}) {
11197
11072
  }
11198
11073
  process.exit(1);
11199
11074
  }
11200
- const bundle = await bundleBackend(config, {
11201
- sourcemap: false,
11202
- minify: false
11203
- });
11204
11075
  const bucketDir = join35(getWorkspace(), CLI_DIRECTORIES.BUCKET);
11205
11076
  const mf = new Miniflare14({
11206
- modules: [
11207
- {
11208
- type: "ESModule",
11209
- path: "index.mjs",
11210
- contents: bundle.code
11211
- }
11212
- ],
11077
+ modules: [{ type: "ESModule", path: "index.mjs", contents: "" }],
11213
11078
  r2Buckets: ["BUCKET"],
11214
11079
  r2Persist: bucketDir,
11215
11080
  compatibilityDate: CLOUDFLARE_COMPATIBILITY_DATE
11216
11081
  });
11217
11082
  try {
11218
11083
  const bucket = await mf.getR2Bucket("BUCKET");
11219
- const contentType = getContentType(filePath);
11220
- await bucket.put(key, fileBuffer, {
11084
+ await bucket.put(key, new Uint8Array(fileBuffer).buffer, {
11221
11085
  httpMetadata: {
11222
- contentType
11086
+ contentType: getContentType(filePath)
11223
11087
  }
11224
11088
  });
11225
11089
  if (options.json) {
@@ -11238,7 +11102,7 @@ async function runBucketPut(key, filePath, options = {}) {
11238
11102
  logger.success(`Uploaded '${filePath}' to '${key}'`);
11239
11103
  logger.newLine();
11240
11104
  logger.data("Size", `${fileSize} bytes`, 1);
11241
- logger.data("Content-Type", contentType, 1);
11105
+ logger.data("Content-Type", getContentType(filePath), 1);
11242
11106
  logger.newLine();
11243
11107
  } finally {
11244
11108
  await mf.dispose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.13.21",
3
+ "version": "0.13.22",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@inquirer/prompts": "^7.8.6",
43
- "@playcademy/sdk": "0.1.9",
43
+ "@playcademy/sdk": "0.1.10",
44
44
  "better-sqlite3": "^12.4.1",
45
45
  "chokidar": "^4.0.3",
46
46
  "colorette": "^2.0.20",