@playcademy/vite-plugin 0.2.35-beta.2 → 0.2.35-beta.3
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 +95 -51
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23738,9 +23738,54 @@ import { DEFAULT_PORTS as DEFAULT_PORTS4 } from "playcademy/constants";
|
|
|
23738
23738
|
// src/lib/build/manifest.ts
|
|
23739
23739
|
var import_archiver = __toESM(require_archiver(), 1);
|
|
23740
23740
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
23741
|
+
import { execFile } from "node:child_process";
|
|
23741
23742
|
import { createWriteStream } from "node:fs";
|
|
23742
23743
|
import fs2 from "node:fs/promises";
|
|
23744
|
+
import { homedir } from "node:os";
|
|
23743
23745
|
import path from "node:path";
|
|
23746
|
+
// package.json
|
|
23747
|
+
var package_default = {
|
|
23748
|
+
name: "@playcademy/vite-plugin",
|
|
23749
|
+
version: "0.2.35-beta.3",
|
|
23750
|
+
type: "module",
|
|
23751
|
+
exports: {
|
|
23752
|
+
".": {
|
|
23753
|
+
types: "./dist/index.d.ts",
|
|
23754
|
+
import: "./dist/index.js"
|
|
23755
|
+
}
|
|
23756
|
+
},
|
|
23757
|
+
main: "dist/index.js",
|
|
23758
|
+
module: "dist/index.js",
|
|
23759
|
+
files: [
|
|
23760
|
+
"dist"
|
|
23761
|
+
],
|
|
23762
|
+
scripts: {
|
|
23763
|
+
build: "bun build.ts",
|
|
23764
|
+
docs: "typedoc --skipErrorChecking"
|
|
23765
|
+
},
|
|
23766
|
+
dependencies: {
|
|
23767
|
+
archiver: "^7.0.1",
|
|
23768
|
+
picocolors: "^1.1.1",
|
|
23769
|
+
playcademy: "workspace:*"
|
|
23770
|
+
},
|
|
23771
|
+
devDependencies: {
|
|
23772
|
+
"@electric-sql/pglite": "^0.3.16",
|
|
23773
|
+
"@inquirer/prompts": "^7.8.6",
|
|
23774
|
+
"@playcademy/constants": "workspace:*",
|
|
23775
|
+
"@playcademy/sandbox": "workspace:*",
|
|
23776
|
+
"@playcademy/sdk": "workspace:*",
|
|
23777
|
+
"@playcademy/types": "workspace:*",
|
|
23778
|
+
"@playcademy/utils": "workspace:*",
|
|
23779
|
+
"@types/archiver": "^6.0.3",
|
|
23780
|
+
"@types/bun": "latest"
|
|
23781
|
+
},
|
|
23782
|
+
peerDependencies: {
|
|
23783
|
+
typescript: "^5",
|
|
23784
|
+
vite: "^5 || ^6"
|
|
23785
|
+
}
|
|
23786
|
+
};
|
|
23787
|
+
|
|
23788
|
+
// src/lib/build/manifest.ts
|
|
23744
23789
|
var LOG_LINE_TOTAL_WIDTH = 60;
|
|
23745
23790
|
function formatNumberWithCommas(numStr) {
|
|
23746
23791
|
if (!numStr)
|
|
@@ -23751,11 +23796,51 @@ function formatNumberWithCommas(numStr) {
|
|
|
23751
23796
|
parts2[0] = parts2[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
23752
23797
|
return parts2.join(".");
|
|
23753
23798
|
}
|
|
23799
|
+
async function resolvePackageVersion(projectRoot, packageName) {
|
|
23800
|
+
try {
|
|
23801
|
+
const pkgJsonPath = path.resolve(projectRoot, "node_modules", packageName, "package.json");
|
|
23802
|
+
const raw = await fs2.readFile(pkgJsonPath, "utf8");
|
|
23803
|
+
const pkg = JSON.parse(raw);
|
|
23804
|
+
return pkg.version;
|
|
23805
|
+
} catch {
|
|
23806
|
+
return;
|
|
23807
|
+
}
|
|
23808
|
+
}
|
|
23809
|
+
async function resolveCliVersion() {
|
|
23810
|
+
const bin = path.join(homedir(), ".playcademy", "bin", "playcademy");
|
|
23811
|
+
return new Promise((resolve) => {
|
|
23812
|
+
execFile(bin, ["--version"], { timeout: 3000 }, (err2, stdout) => {
|
|
23813
|
+
if (err2)
|
|
23814
|
+
return resolve(undefined);
|
|
23815
|
+
const version = stdout.trim();
|
|
23816
|
+
resolve(version || undefined);
|
|
23817
|
+
});
|
|
23818
|
+
});
|
|
23819
|
+
}
|
|
23820
|
+
async function resolveVersions(projectRoot) {
|
|
23821
|
+
const [cli, sdk, vite] = await Promise.all([
|
|
23822
|
+
resolveCliVersion(),
|
|
23823
|
+
resolvePackageVersion(projectRoot, "@playcademy/sdk"),
|
|
23824
|
+
resolvePackageVersion(projectRoot, "vite")
|
|
23825
|
+
]);
|
|
23826
|
+
const versions = {
|
|
23827
|
+
vitePlugin: package_default.version
|
|
23828
|
+
};
|
|
23829
|
+
if (sdk)
|
|
23830
|
+
versions.sdk = sdk;
|
|
23831
|
+
if (cli)
|
|
23832
|
+
versions.cli = cli;
|
|
23833
|
+
if (vite)
|
|
23834
|
+
versions.vite = vite;
|
|
23835
|
+
return versions;
|
|
23836
|
+
}
|
|
23754
23837
|
async function generatePlaycademyManifest(config, outDir, buildOutputs) {
|
|
23838
|
+
const versions = await resolveVersions(config.root);
|
|
23755
23839
|
const manifestData = {
|
|
23756
|
-
version: "
|
|
23840
|
+
version: "2",
|
|
23757
23841
|
platform: "web",
|
|
23758
|
-
createdAt: new Date().toISOString()
|
|
23842
|
+
createdAt: new Date().toISOString(),
|
|
23843
|
+
versions
|
|
23759
23844
|
};
|
|
23760
23845
|
const manifestPath = path.resolve(outDir, "playcademy.manifest.json");
|
|
23761
23846
|
const manifestJson = JSON.stringify(manifestData, null, 2);
|
|
@@ -24004,7 +24089,7 @@ import { Readable } from "stream";
|
|
|
24004
24089
|
import crypto2 from "crypto";
|
|
24005
24090
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
24006
24091
|
import { createServer } from "node:net";
|
|
24007
|
-
import { homedir } from "node:os";
|
|
24092
|
+
import { homedir as homedir2 } from "node:os";
|
|
24008
24093
|
import { join } from "node:path";
|
|
24009
24094
|
import { mkdir, writeFile } from "fs/promises";
|
|
24010
24095
|
import { join as join2 } from "path";
|
|
@@ -25259,7 +25344,7 @@ var init_dist = __esm(() => {
|
|
|
25259
25344
|
outgoingEnded = Symbol("outgoingEnded");
|
|
25260
25345
|
});
|
|
25261
25346
|
function getRegistryPath() {
|
|
25262
|
-
const home =
|
|
25347
|
+
const home = homedir2();
|
|
25263
25348
|
const dir = join(home, ".playcademy");
|
|
25264
25349
|
if (!existsSync(dir)) {
|
|
25265
25350
|
mkdirSync(dir, { recursive: true });
|
|
@@ -25349,11 +25434,11 @@ async function requirePortAvailable(port, timeoutMs = 100) {
|
|
|
25349
25434
|
}
|
|
25350
25435
|
}
|
|
25351
25436
|
var init_port = () => {};
|
|
25352
|
-
var
|
|
25437
|
+
var package_default2;
|
|
25353
25438
|
var init_package = __esm(() => {
|
|
25354
|
-
|
|
25439
|
+
package_default2 = {
|
|
25355
25440
|
name: "@playcademy/sandbox",
|
|
25356
|
-
version: "0.3.19-beta.
|
|
25441
|
+
version: "0.3.19-beta.3",
|
|
25357
25442
|
description: "Local development server for Playcademy game development",
|
|
25358
25443
|
type: "module",
|
|
25359
25444
|
exports: {
|
|
@@ -126754,7 +126839,7 @@ var init_server = __esm(() => {
|
|
|
126754
126839
|
init_app();
|
|
126755
126840
|
init_database2();
|
|
126756
126841
|
init_options();
|
|
126757
|
-
version3 =
|
|
126842
|
+
version3 = package_default2.version;
|
|
126758
126843
|
});
|
|
126759
126844
|
init_server();
|
|
126760
126845
|
|
|
@@ -128245,47 +128330,6 @@ function recreateDatabaseHotkey(options) {
|
|
|
128245
128330
|
|
|
128246
128331
|
// src/server/hotkeys/toggle-mode.ts
|
|
128247
128332
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
128248
|
-
// package.json
|
|
128249
|
-
var package_default2 = {
|
|
128250
|
-
name: "@playcademy/vite-plugin",
|
|
128251
|
-
version: "0.2.35-beta.2",
|
|
128252
|
-
type: "module",
|
|
128253
|
-
exports: {
|
|
128254
|
-
".": {
|
|
128255
|
-
types: "./dist/index.d.ts",
|
|
128256
|
-
import: "./dist/index.js"
|
|
128257
|
-
}
|
|
128258
|
-
},
|
|
128259
|
-
main: "dist/index.js",
|
|
128260
|
-
module: "dist/index.js",
|
|
128261
|
-
files: [
|
|
128262
|
-
"dist"
|
|
128263
|
-
],
|
|
128264
|
-
scripts: {
|
|
128265
|
-
build: "bun build.ts",
|
|
128266
|
-
docs: "typedoc --skipErrorChecking"
|
|
128267
|
-
},
|
|
128268
|
-
dependencies: {
|
|
128269
|
-
archiver: "^7.0.1",
|
|
128270
|
-
picocolors: "^1.1.1",
|
|
128271
|
-
playcademy: "workspace:*"
|
|
128272
|
-
},
|
|
128273
|
-
devDependencies: {
|
|
128274
|
-
"@electric-sql/pglite": "^0.3.16",
|
|
128275
|
-
"@inquirer/prompts": "^7.8.6",
|
|
128276
|
-
"@playcademy/constants": "workspace:*",
|
|
128277
|
-
"@playcademy/sandbox": "workspace:*",
|
|
128278
|
-
"@playcademy/sdk": "workspace:*",
|
|
128279
|
-
"@playcademy/types": "workspace:*",
|
|
128280
|
-
"@playcademy/utils": "workspace:*",
|
|
128281
|
-
"@types/archiver": "^6.0.3",
|
|
128282
|
-
"@types/bun": "latest"
|
|
128283
|
-
},
|
|
128284
|
-
peerDependencies: {
|
|
128285
|
-
typescript: "^5",
|
|
128286
|
-
vite: "^5 || ^6"
|
|
128287
|
-
}
|
|
128288
|
-
};
|
|
128289
128333
|
|
|
128290
128334
|
// src/lib/backend/server.ts
|
|
128291
128335
|
import {
|
|
@@ -128451,7 +128495,7 @@ async function configurePlatformMode(server, viteConfig, options) {
|
|
|
128451
128495
|
const totalCourses = projectInfo.timebackCourses?.length ?? 0;
|
|
128452
128496
|
const enrolledCourses = countEnrolledCourses(projectInfo.timebackCourses, timebackOptions?.courses);
|
|
128453
128497
|
printBanner(viteConfig, {
|
|
128454
|
-
version:
|
|
128498
|
+
version: package_default.version,
|
|
128455
128499
|
gameName: projectInfo.slug,
|
|
128456
128500
|
sandbox: { port: sandbox.port, enabled: true },
|
|
128457
128501
|
backend: createBackendBannerOptions(backend?.port, server.config.server.port),
|
|
@@ -128479,7 +128523,7 @@ async function configureStandaloneMode(server, viteConfig, options) {
|
|
|
128479
128523
|
server.httpServer?.once("listening", () => {
|
|
128480
128524
|
setTimeout(() => {
|
|
128481
128525
|
printBanner(viteConfig, {
|
|
128482
|
-
version:
|
|
128526
|
+
version: package_default.version,
|
|
128483
128527
|
sandbox: { enabled: false },
|
|
128484
128528
|
backend: { port: backend.port }
|
|
128485
128529
|
});
|