@playcademy/vite-plugin 0.1.29 → 0.1.30
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/index.js +145 -61
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -41199,7 +41199,7 @@ var import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
|
41199
41199
|
// package.json
|
|
41200
41200
|
var package_default = {
|
|
41201
41201
|
name: "@playcademy/vite-plugin",
|
|
41202
|
-
version: "0.1.
|
|
41202
|
+
version: "0.1.29",
|
|
41203
41203
|
type: "module",
|
|
41204
41204
|
exports: {
|
|
41205
41205
|
".": {
|
|
@@ -41407,9 +41407,9 @@ import { createPublicKey as createPublicKey2, createVerify, verify as verify3 }
|
|
|
41407
41407
|
import { request as request2 } from "https";
|
|
41408
41408
|
import { pipeline } from "stream";
|
|
41409
41409
|
import { execSync } from "node:child_process";
|
|
41410
|
-
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
41410
|
+
import { mkdir, readdir as readdir2, readFile as readFile2, rm, stat, writeFile } from "node:fs/promises";
|
|
41411
41411
|
import { tmpdir } from "node:os";
|
|
41412
|
-
import { join as join5 } from "node:path";
|
|
41412
|
+
import { join as join5, relative } from "node:path";
|
|
41413
41413
|
import { createHash } from "node:crypto";
|
|
41414
41414
|
import { readdir, readFile } from "node:fs/promises";
|
|
41415
41415
|
import { join as join3 } from "node:path";
|
|
@@ -45780,7 +45780,7 @@ var require_node22 = __commonJS2((exports) => {
|
|
|
45780
45780
|
exports2.isAbsolute = function(aPath) {
|
|
45781
45781
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
45782
45782
|
};
|
|
45783
|
-
function
|
|
45783
|
+
function relative2(aRoot, aPath) {
|
|
45784
45784
|
if (aRoot === "") {
|
|
45785
45785
|
aRoot = ".";
|
|
45786
45786
|
}
|
|
@@ -45799,7 +45799,7 @@ var require_node22 = __commonJS2((exports) => {
|
|
|
45799
45799
|
}
|
|
45800
45800
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
45801
45801
|
}
|
|
45802
|
-
exports2.relative =
|
|
45802
|
+
exports2.relative = relative2;
|
|
45803
45803
|
var supportsNullProto = function() {
|
|
45804
45804
|
var obj = Object.create(null);
|
|
45805
45805
|
return !("__proto__" in obj);
|
|
@@ -47830,7 +47830,7 @@ If you have no idea what this means or what Pirates is, let me explain: Pirates
|
|
|
47830
47830
|
});
|
|
47831
47831
|
};
|
|
47832
47832
|
}
|
|
47833
|
-
var
|
|
47833
|
+
var readFile3 = (fp) => new Promise((resolve2, reject) => {
|
|
47834
47834
|
_fs.default.readFile(fp, "utf8", (err2, data) => {
|
|
47835
47835
|
if (err2)
|
|
47836
47836
|
return reject(err2);
|
|
@@ -48028,7 +48028,7 @@ If you have no idea what this means or what Pirates is, let me explain: Pirates
|
|
|
48028
48028
|
data: _this3.packageJsonCache.get(filepath)[options.packageKey]
|
|
48029
48029
|
};
|
|
48030
48030
|
}
|
|
48031
|
-
const data = _this3.options.parseJSON(yield
|
|
48031
|
+
const data = _this3.options.parseJSON(yield readFile3(filepath));
|
|
48032
48032
|
return {
|
|
48033
48033
|
path: filepath,
|
|
48034
48034
|
data
|
|
@@ -48036,7 +48036,7 @@ If you have no idea what this means or what Pirates is, let me explain: Pirates
|
|
|
48036
48036
|
}
|
|
48037
48037
|
return {
|
|
48038
48038
|
path: filepath,
|
|
48039
|
-
data: yield
|
|
48039
|
+
data: yield readFile3(filepath)
|
|
48040
48040
|
};
|
|
48041
48041
|
}
|
|
48042
48042
|
return {};
|
|
@@ -56286,8 +56286,8 @@ var init_api = __esm(() => {
|
|
|
56286
56286
|
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
56287
56287
|
resolvedLink = cache[base];
|
|
56288
56288
|
} else {
|
|
56289
|
-
var
|
|
56290
|
-
if (!
|
|
56289
|
+
var stat2 = fs32.lstatSync(base);
|
|
56290
|
+
if (!stat2.isSymbolicLink()) {
|
|
56291
56291
|
knownHard[base] = true;
|
|
56292
56292
|
if (cache)
|
|
56293
56293
|
cache[base] = base;
|
|
@@ -56295,7 +56295,7 @@ var init_api = __esm(() => {
|
|
|
56295
56295
|
}
|
|
56296
56296
|
var linkTarget = null;
|
|
56297
56297
|
if (!isWindows) {
|
|
56298
|
-
var id =
|
|
56298
|
+
var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32);
|
|
56299
56299
|
if (seenLinks.hasOwnProperty(id)) {
|
|
56300
56300
|
linkTarget = seenLinks[id];
|
|
56301
56301
|
}
|
|
@@ -56369,17 +56369,17 @@ var init_api = __esm(() => {
|
|
|
56369
56369
|
}
|
|
56370
56370
|
return fs32.lstat(base, gotStat);
|
|
56371
56371
|
}
|
|
56372
|
-
function gotStat(err2,
|
|
56372
|
+
function gotStat(err2, stat2) {
|
|
56373
56373
|
if (err2)
|
|
56374
56374
|
return cb(err2);
|
|
56375
|
-
if (!
|
|
56375
|
+
if (!stat2.isSymbolicLink()) {
|
|
56376
56376
|
knownHard[base] = true;
|
|
56377
56377
|
if (cache)
|
|
56378
56378
|
cache[base] = base;
|
|
56379
56379
|
return process.nextTick(LOOP);
|
|
56380
56380
|
}
|
|
56381
56381
|
if (!isWindows) {
|
|
56382
|
-
var id =
|
|
56382
|
+
var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32);
|
|
56383
56383
|
if (seenLinks.hasOwnProperty(id)) {
|
|
56384
56384
|
return gotTarget(null, seenLinks[id], base);
|
|
56385
56385
|
}
|
|
@@ -57658,7 +57658,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);
|
|
|
57658
57658
|
return this._readdir(abs, false);
|
|
57659
57659
|
var entries;
|
|
57660
57660
|
var lstat;
|
|
57661
|
-
var
|
|
57661
|
+
var stat2;
|
|
57662
57662
|
try {
|
|
57663
57663
|
lstat = this.fs.lstatSync(abs);
|
|
57664
57664
|
} catch (er2) {
|
|
@@ -57791,8 +57791,8 @@ See: https://github.com/isaacs/node-glob/issues/167`);
|
|
|
57791
57791
|
return false;
|
|
57792
57792
|
}
|
|
57793
57793
|
var exists22;
|
|
57794
|
-
var
|
|
57795
|
-
if (!
|
|
57794
|
+
var stat2 = this.statCache[abs];
|
|
57795
|
+
if (!stat2) {
|
|
57796
57796
|
var lstat;
|
|
57797
57797
|
try {
|
|
57798
57798
|
lstat = this.fs.lstatSync(abs);
|
|
@@ -57804,18 +57804,18 @@ See: https://github.com/isaacs/node-glob/issues/167`);
|
|
|
57804
57804
|
}
|
|
57805
57805
|
if (lstat && lstat.isSymbolicLink()) {
|
|
57806
57806
|
try {
|
|
57807
|
-
|
|
57807
|
+
stat2 = this.fs.statSync(abs);
|
|
57808
57808
|
} catch (er2) {
|
|
57809
|
-
|
|
57809
|
+
stat2 = lstat;
|
|
57810
57810
|
}
|
|
57811
57811
|
} else {
|
|
57812
|
-
|
|
57812
|
+
stat2 = lstat;
|
|
57813
57813
|
}
|
|
57814
57814
|
}
|
|
57815
|
-
this.statCache[abs] =
|
|
57815
|
+
this.statCache[abs] = stat2;
|
|
57816
57816
|
var c2 = true;
|
|
57817
|
-
if (
|
|
57818
|
-
c2 =
|
|
57817
|
+
if (stat2)
|
|
57818
|
+
c2 = stat2.isDirectory() ? "DIR" : "FILE";
|
|
57819
57819
|
this.cache[abs] = this.cache[abs] || c2;
|
|
57820
57820
|
if (needDir && c2 === "FILE")
|
|
57821
57821
|
return false;
|
|
@@ -58451,16 +58451,16 @@ See: https://github.com/isaacs/node-glob/issues/167`);
|
|
|
58451
58451
|
return cb();
|
|
58452
58452
|
}
|
|
58453
58453
|
var exists22;
|
|
58454
|
-
var
|
|
58455
|
-
if (
|
|
58456
|
-
if (
|
|
58457
|
-
return cb(null,
|
|
58454
|
+
var stat2 = this.statCache[abs];
|
|
58455
|
+
if (stat2 !== undefined) {
|
|
58456
|
+
if (stat2 === false)
|
|
58457
|
+
return cb(null, stat2);
|
|
58458
58458
|
else {
|
|
58459
|
-
var type =
|
|
58459
|
+
var type = stat2.isDirectory() ? "DIR" : "FILE";
|
|
58460
58460
|
if (needDir && type === "FILE")
|
|
58461
58461
|
return cb();
|
|
58462
58462
|
else
|
|
58463
|
-
return cb(null, type,
|
|
58463
|
+
return cb(null, type, stat2);
|
|
58464
58464
|
}
|
|
58465
58465
|
}
|
|
58466
58466
|
var self2 = this;
|
|
@@ -58469,33 +58469,33 @@ See: https://github.com/isaacs/node-glob/issues/167`);
|
|
|
58469
58469
|
self2.fs.lstat(abs, statcb);
|
|
58470
58470
|
function lstatcb_(er2, lstat) {
|
|
58471
58471
|
if (lstat && lstat.isSymbolicLink()) {
|
|
58472
|
-
return self2.fs.stat(abs, function(er22,
|
|
58472
|
+
return self2.fs.stat(abs, function(er22, stat22) {
|
|
58473
58473
|
if (er22)
|
|
58474
58474
|
self2._stat2(f3, abs, null, lstat, cb);
|
|
58475
58475
|
else
|
|
58476
|
-
self2._stat2(f3, abs, er22,
|
|
58476
|
+
self2._stat2(f3, abs, er22, stat22, cb);
|
|
58477
58477
|
});
|
|
58478
58478
|
} else {
|
|
58479
58479
|
self2._stat2(f3, abs, er2, lstat, cb);
|
|
58480
58480
|
}
|
|
58481
58481
|
}
|
|
58482
58482
|
};
|
|
58483
|
-
Glob.prototype._stat2 = function(f3, abs, er2,
|
|
58483
|
+
Glob.prototype._stat2 = function(f3, abs, er2, stat2, cb) {
|
|
58484
58484
|
if (er2 && (er2.code === "ENOENT" || er2.code === "ENOTDIR")) {
|
|
58485
58485
|
this.statCache[abs] = false;
|
|
58486
58486
|
return cb();
|
|
58487
58487
|
}
|
|
58488
58488
|
var needDir = f3.slice(-1) === "/";
|
|
58489
|
-
this.statCache[abs] =
|
|
58490
|
-
if (abs.slice(-1) === "/" &&
|
|
58491
|
-
return cb(null, false,
|
|
58489
|
+
this.statCache[abs] = stat2;
|
|
58490
|
+
if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory())
|
|
58491
|
+
return cb(null, false, stat2);
|
|
58492
58492
|
var c2 = true;
|
|
58493
|
-
if (
|
|
58494
|
-
c2 =
|
|
58493
|
+
if (stat2)
|
|
58494
|
+
c2 = stat2.isDirectory() ? "DIR" : "FILE";
|
|
58495
58495
|
this.cache[abs] = this.cache[abs] || c2;
|
|
58496
58496
|
if (needDir && c2 === "FILE")
|
|
58497
58497
|
return cb();
|
|
58498
|
-
return cb(null, c2,
|
|
58498
|
+
return cb(null, c2, stat2);
|
|
58499
58499
|
};
|
|
58500
58500
|
}
|
|
58501
58501
|
});
|
|
@@ -143894,10 +143894,10 @@ var require_getSSOTokenFromFile = __commonJS2((exports) => {
|
|
|
143894
143894
|
exports.getSSOTokenFromFile = undefined;
|
|
143895
143895
|
var fs_1 = __require2("fs");
|
|
143896
143896
|
var getSSOTokenFilepath_1 = require_getSSOTokenFilepath();
|
|
143897
|
-
var { readFile:
|
|
143897
|
+
var { readFile: readFile3 } = fs_1.promises;
|
|
143898
143898
|
var getSSOTokenFromFile2 = async (id) => {
|
|
143899
143899
|
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
|
|
143900
|
-
const ssoTokenText = await
|
|
143900
|
+
const ssoTokenText = await readFile3(ssoTokenFilepath, "utf8");
|
|
143901
143901
|
return JSON.parse(ssoTokenText);
|
|
143902
143902
|
};
|
|
143903
143903
|
exports.getSSOTokenFromFile = getSSOTokenFromFile2;
|
|
@@ -143906,11 +143906,11 @@ var require_slurpFile = __commonJS2((exports) => {
|
|
|
143906
143906
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
143907
143907
|
exports.slurpFile = undefined;
|
|
143908
143908
|
var fs_1 = __require2("fs");
|
|
143909
|
-
var { readFile:
|
|
143909
|
+
var { readFile: readFile3 } = fs_1.promises;
|
|
143910
143910
|
var filePromisesHash = {};
|
|
143911
143911
|
var slurpFile = (path32, options) => {
|
|
143912
143912
|
if (!filePromisesHash[path32] || (options === null || options === undefined ? undefined : options.ignoreCache)) {
|
|
143913
|
-
filePromisesHash[path32] =
|
|
143913
|
+
filePromisesHash[path32] = readFile3(path32, "utf8");
|
|
143914
143914
|
}
|
|
143915
143915
|
return filePromisesHash[path32];
|
|
143916
143916
|
};
|
|
@@ -145552,12 +145552,12 @@ var require_fromHttp = __commonJS2((exports) => {
|
|
|
145552
145552
|
var fromHttp = (options = {}) => {
|
|
145553
145553
|
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
145554
145554
|
let host;
|
|
145555
|
-
const
|
|
145555
|
+
const relative2 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
|
|
145556
145556
|
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
|
|
145557
145557
|
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
|
|
145558
145558
|
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
|
|
145559
145559
|
const warn = options.logger?.constructor?.name === "NoOpLogger" || !options.logger ? console.warn : options.logger.warn;
|
|
145560
|
-
if (
|
|
145560
|
+
if (relative2 && full) {
|
|
145561
145561
|
warn("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
145562
145562
|
warn("awsContainerCredentialsFullUri will take precedence.");
|
|
145563
145563
|
}
|
|
@@ -145567,8 +145567,8 @@ var require_fromHttp = __commonJS2((exports) => {
|
|
|
145567
145567
|
}
|
|
145568
145568
|
if (full) {
|
|
145569
145569
|
host = full;
|
|
145570
|
-
} else if (
|
|
145571
|
-
host = `${DEFAULT_LINK_LOCAL_HOST}${
|
|
145570
|
+
} else if (relative2) {
|
|
145571
|
+
host = `${DEFAULT_LINK_LOCAL_HOST}${relative2}`;
|
|
145572
145572
|
} else {
|
|
145573
145573
|
throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
145574
145574
|
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
|
|
@@ -175828,7 +175828,7 @@ var serve = (options, listeningListener) => {
|
|
|
175828
175828
|
};
|
|
175829
175829
|
var package_default2 = {
|
|
175830
175830
|
name: "@playcademy/sandbox",
|
|
175831
|
-
version: "0.1.
|
|
175831
|
+
version: "0.1.11",
|
|
175832
175832
|
description: "Local development server for Playcademy game development",
|
|
175833
175833
|
type: "module",
|
|
175834
175834
|
exports: {
|
|
@@ -197974,6 +197974,63 @@ class CloudflareProvider {
|
|
|
197974
197974
|
getClient() {
|
|
197975
197975
|
return this.client;
|
|
197976
197976
|
}
|
|
197977
|
+
async checkIfRequiresR2Strategy(assetsPath) {
|
|
197978
|
+
async function scanDirectory(dir) {
|
|
197979
|
+
const entries = await readdir2(dir, { withFileTypes: true });
|
|
197980
|
+
for (const entry of entries) {
|
|
197981
|
+
const fullPath = join5(dir, entry.name);
|
|
197982
|
+
if (entry.isDirectory()) {
|
|
197983
|
+
if (await scanDirectory(fullPath))
|
|
197984
|
+
return true;
|
|
197985
|
+
} else {
|
|
197986
|
+
const stats = await stat(fullPath);
|
|
197987
|
+
if (stats.size >= 26214400) {
|
|
197988
|
+
log2.info("[CloudflareProvider] Large file detected, R2 strategy required", {
|
|
197989
|
+
file: entry.name,
|
|
197990
|
+
size: `${(stats.size / 1024 / 1024).toFixed(2)}MB`
|
|
197991
|
+
});
|
|
197992
|
+
return true;
|
|
197993
|
+
}
|
|
197994
|
+
}
|
|
197995
|
+
}
|
|
197996
|
+
return false;
|
|
197997
|
+
}
|
|
197998
|
+
return await scanDirectory(assetsPath);
|
|
197999
|
+
}
|
|
198000
|
+
async resolveAssetBasePath(dirPath) {
|
|
198001
|
+
const entries = await readdir2(dirPath, { withFileTypes: true });
|
|
198002
|
+
if (entries.length === 1 && entries[0]?.isDirectory()) {
|
|
198003
|
+
const unwrappedPath = join5(dirPath, entries[0].name);
|
|
198004
|
+
log2.debug("[CloudflareProvider] Unwrapping wrapper directory", {
|
|
198005
|
+
wrapper: entries[0].name
|
|
198006
|
+
});
|
|
198007
|
+
return await this.resolveAssetBasePath(unwrappedPath);
|
|
198008
|
+
}
|
|
198009
|
+
return dirPath;
|
|
198010
|
+
}
|
|
198011
|
+
async uploadFilesToR2(dir, baseDir, bucketName) {
|
|
198012
|
+
const entries = await readdir2(dir, { withFileTypes: true });
|
|
198013
|
+
for (const entry of entries) {
|
|
198014
|
+
const fullPath = join5(dir, entry.name);
|
|
198015
|
+
if (entry.isDirectory()) {
|
|
198016
|
+
await this.uploadFilesToR2(fullPath, baseDir, bucketName);
|
|
198017
|
+
} else {
|
|
198018
|
+
const content = await readFile2(fullPath);
|
|
198019
|
+
const relativePath = relative(baseDir, fullPath).replace(/\\/g, "/");
|
|
198020
|
+
const contentType = getContentType(relativePath);
|
|
198021
|
+
await this.client.r2.putObject(bucketName, relativePath, content, contentType);
|
|
198022
|
+
}
|
|
198023
|
+
}
|
|
198024
|
+
}
|
|
198025
|
+
async uploadDirectoryToR2(dirPath, bucketName) {
|
|
198026
|
+
const basePath = await this.resolveAssetBasePath(dirPath);
|
|
198027
|
+
log2.debug("[CloudflareProvider] Uploading assets to R2", {
|
|
198028
|
+
bucketName,
|
|
198029
|
+
basePath,
|
|
198030
|
+
filesFrom: relative(dirPath, basePath) || "(root)"
|
|
198031
|
+
});
|
|
198032
|
+
await this.uploadFilesToR2(basePath, basePath, bucketName);
|
|
198033
|
+
}
|
|
197977
198034
|
async deploy(deploymentId, code, env2, options) {
|
|
197978
198035
|
const opts = normalizeDeploymentOptions(options);
|
|
197979
198036
|
const isFirstDeploy = env2.PLAYCADEMY_API_KEY !== undefined;
|
|
@@ -198057,16 +198114,45 @@ class CloudflareProvider {
|
|
|
198057
198114
|
warnDurableObjectsNotImplemented(opts.bindings.durableObjects);
|
|
198058
198115
|
addResourceBindings(bindings, resourceIds);
|
|
198059
198116
|
let assetsJWT;
|
|
198117
|
+
let assetsStrategy;
|
|
198118
|
+
let assetsR2Bucket;
|
|
198060
198119
|
if (finalAssetsPath) {
|
|
198061
|
-
|
|
198062
|
-
|
|
198063
|
-
|
|
198064
|
-
|
|
198065
|
-
|
|
198066
|
-
|
|
198067
|
-
|
|
198120
|
+
const requiresR2 = await this.checkIfRequiresR2Strategy(finalAssetsPath);
|
|
198121
|
+
if (requiresR2) {
|
|
198122
|
+
assetsStrategy = "r2";
|
|
198123
|
+
assetsR2Bucket = `${deploymentId}-assets`;
|
|
198124
|
+
log2.info("[CloudflareProvider] Using R2 strategy for large files", {
|
|
198125
|
+
deploymentId,
|
|
198126
|
+
bucketName: assetsR2Bucket
|
|
198127
|
+
});
|
|
198128
|
+
await this.client.r2.create(assetsR2Bucket);
|
|
198129
|
+
await this.uploadDirectoryToR2(finalAssetsPath, assetsR2Bucket);
|
|
198130
|
+
bindings.push({
|
|
198131
|
+
type: "r2_bucket",
|
|
198132
|
+
name: "ASSETS",
|
|
198133
|
+
bucket_name: assetsR2Bucket
|
|
198134
|
+
});
|
|
198135
|
+
if (!resources.r2)
|
|
198136
|
+
resources.r2 = [];
|
|
198137
|
+
resources.r2.push({ name: assetsR2Bucket });
|
|
198138
|
+
} else {
|
|
198139
|
+
assetsStrategy = "workers-assets";
|
|
198140
|
+
log2.debug("[CloudflareProvider] Using Workers Assets strategy", {
|
|
198141
|
+
deploymentId,
|
|
198142
|
+
finalAssetsPath
|
|
198143
|
+
});
|
|
198144
|
+
assetsJWT = await this.client.workers.uploadAssets(this.config.dispatchNamespace, deploymentId, { type: "directory", path: finalAssetsPath });
|
|
198145
|
+
bindings.push({ type: "assets", name: "ASSETS" });
|
|
198146
|
+
}
|
|
198147
|
+
} else if (opts.keepAssets) {
|
|
198068
198148
|
bindings.push({ type: "assets", name: "ASSETS" });
|
|
198069
198149
|
}
|
|
198150
|
+
if (assetsStrategy) {
|
|
198151
|
+
resources.assetsStrategy = assetsStrategy;
|
|
198152
|
+
if (assetsR2Bucket) {
|
|
198153
|
+
resources.assetsR2Bucket = assetsR2Bucket;
|
|
198154
|
+
}
|
|
198155
|
+
}
|
|
198070
198156
|
const keepBindingsValue = !isFirstDeploy ? ["secret_text"] : [];
|
|
198071
198157
|
log2.info("[Cloudflare Provider] Deployment configuration", {
|
|
198072
198158
|
deploymentId,
|
|
@@ -198147,7 +198233,8 @@ class CloudflareProvider {
|
|
|
198147
198233
|
await Promise.all([
|
|
198148
198234
|
this.client.d1.delete(deploymentId).catch(() => {}),
|
|
198149
198235
|
this.client.kv.delete(deploymentId).catch(() => {}),
|
|
198150
|
-
this.client.r2.delete(deploymentId).catch(() => {})
|
|
198236
|
+
this.client.r2.delete(deploymentId).catch(() => {}),
|
|
198237
|
+
this.client.r2.delete(`${deploymentId}-assets`).catch(() => {})
|
|
198151
198238
|
]);
|
|
198152
198239
|
}
|
|
198153
198240
|
async deleteCustomDomains(customDomains, gameSlug) {
|
|
@@ -198622,7 +198709,7 @@ async function checkIfNeedsSeeding(db) {
|
|
|
198622
198709
|
}
|
|
198623
198710
|
}
|
|
198624
198711
|
async function setupServerDatabase(processedOptions, project) {
|
|
198625
|
-
const { memoryOnly, recreateDb, databasePath, seed,
|
|
198712
|
+
const { memoryOnly, recreateDb, databasePath, seed, quiet } = processedOptions;
|
|
198626
198713
|
const effectiveDbPath = databasePath ?? process.env.PLAYCADEMY_SANDBOX_DB_PATH;
|
|
198627
198714
|
const resolvedDbPath = memoryOnly || effectiveDbPath === ":memory:" ? ":memory:" : effectiveDbPath ? DatabasePathManager.resolveDatabasePath(effectiveDbPath) : DatabasePathManager.resolveDatabasePath();
|
|
198628
198715
|
if (!memoryOnly && recreateDb && fs5.existsSync(resolvedDbPath)) {
|
|
@@ -198633,9 +198720,6 @@ async function setupServerDatabase(processedOptions, project) {
|
|
|
198633
198720
|
}
|
|
198634
198721
|
}
|
|
198635
198722
|
const isNewDb = resolvedDbPath === ":memory:" ? true : !fs5.existsSync(resolvedDbPath);
|
|
198636
|
-
if (verbose && !quiet && resolvedDbPath !== ":memory:") {
|
|
198637
|
-
console.log(`[Sandbox] Database: ${resolvedDbPath}`);
|
|
198638
|
-
}
|
|
198639
198723
|
const db = await setupDatabase(resolvedDbPath);
|
|
198640
198724
|
const shouldSeed = seed && (isNewDb || await checkIfNeedsSeeding(db));
|
|
198641
198725
|
if (shouldSeed) {
|
|
@@ -208492,8 +208576,8 @@ async function getNotificationStats(ctx) {
|
|
|
208492
208576
|
status: notifications.status,
|
|
208493
208577
|
count: sql`count(*)`
|
|
208494
208578
|
}).from(notifications).where(and(...conditions)).groupBy(notifications.status);
|
|
208495
|
-
const statsMap = stats.reduce((acc,
|
|
208496
|
-
acc[
|
|
208579
|
+
const statsMap = stats.reduce((acc, stat2) => {
|
|
208580
|
+
acc[stat2.status] = Number(stat2.count);
|
|
208497
208581
|
return acc;
|
|
208498
208582
|
}, {});
|
|
208499
208583
|
const total = Object.values(statsMap).reduce((sum3, count2) => sum3 + count2, 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcademy/vite-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"archiver": "^7.0.1",
|
|
23
23
|
"picocolors": "^1.1.1",
|
|
24
|
-
"playcademy": "0.14.
|
|
24
|
+
"playcademy": "0.14.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@inquirer/prompts": "^7.8.6",
|
|
28
|
-
"@playcademy/sandbox": "0.1.
|
|
28
|
+
"@playcademy/sandbox": "0.1.11",
|
|
29
29
|
"@types/archiver": "^6.0.3",
|
|
30
30
|
"@types/bun": "latest"
|
|
31
31
|
},
|