@playcademy/vite-plugin 0.1.26-alpha.3 → 0.1.26-alpha.5
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/README.md +10 -7
- package/dist/index.js +6 -2
- package/dist/lib/sandbox/server.d.ts +1 -0
- package/dist/server/platform-mode.d.ts +1 -0
- package/dist/types/internal.d.ts +1 -0
- package/dist/types/options.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,7 +120,8 @@ export default defineConfig({
|
|
|
120
120
|
sandbox: {
|
|
121
121
|
autoStart: false, // Disable auto-start
|
|
122
122
|
url: 'http://localhost:8080', // Custom port
|
|
123
|
-
verbose: true, // Enable
|
|
123
|
+
verbose: true, // Enable verbose logging
|
|
124
|
+
logLevel: 'debug', // Set log level (debug, info, warn, error)
|
|
124
125
|
},
|
|
125
126
|
}),
|
|
126
127
|
],
|
|
@@ -142,12 +143,14 @@ Configuration for manifest generation and build output:
|
|
|
142
143
|
|
|
143
144
|
Configuration for the development sandbox server:
|
|
144
145
|
|
|
145
|
-
| Option
|
|
146
|
-
|
|
|
147
|
-
| `autoStart`
|
|
148
|
-
| `url`
|
|
149
|
-
| `verbose`
|
|
150
|
-
| `
|
|
146
|
+
| Option | Type | Default | Description |
|
|
147
|
+
| ------------ | ---------------------------------------- | ----------------------------- | -------------------------------- |
|
|
148
|
+
| `autoStart` | `boolean` | `true` | Start sandbox during development |
|
|
149
|
+
| `url` | `string` | `'http://localhost:4321/api'` | Sandbox server URL |
|
|
150
|
+
| `verbose` | `boolean` | `false` | Enable verbose logging |
|
|
151
|
+
| `logLevel` | `'debug' \| 'info' \| 'warn' \| 'error'` | `'info'` | Log level for sandbox server |
|
|
152
|
+
| `recreateDb` | `boolean` | `false` | Recreate database on each start |
|
|
153
|
+
| `realtime` | `object` | `{...}` | Real-time server configuration |
|
|
151
154
|
|
|
152
155
|
## Build Output
|
|
153
156
|
|
package/dist/index.js
CHANGED
|
@@ -194815,7 +194815,7 @@ function processServerOptions(port, options) {
|
|
|
194815
194815
|
timeback: timeback3,
|
|
194816
194816
|
logger: customLogger2
|
|
194817
194817
|
} = options;
|
|
194818
|
-
const effectiveLogLevel =
|
|
194818
|
+
const effectiveLogLevel = logLevel;
|
|
194819
194819
|
if (effectiveLogLevel) {
|
|
194820
194820
|
process.env.LOG_LEVEL = effectiveLogLevel;
|
|
194821
194821
|
}
|
|
@@ -205407,7 +205407,7 @@ function printSandboxInfo(viteConfig, apiPort, realtimePort, projectInfo) {
|
|
|
205407
205407
|
viteConfig.logger.info("");
|
|
205408
205408
|
}
|
|
205409
205409
|
async function startSandbox(viteConfig, autoStart = true, options = {}) {
|
|
205410
|
-
const { verbose = false, customUrl, quiet = false, recreateDb = false } = options;
|
|
205410
|
+
const { verbose = false, customUrl, quiet = false, recreateDb = false, logLevel = "info" } = options;
|
|
205411
205411
|
if (!autoStart || viteConfig.command !== "serve") {
|
|
205412
205412
|
const baseUrl = customUrl ?? `http://localhost:${DEFAULT_PORTS2.SANDBOX}`;
|
|
205413
205413
|
const deriveRealtimeUrl = (url) => {
|
|
@@ -205440,6 +205440,7 @@ async function startSandbox(viteConfig, autoStart = true, options = {}) {
|
|
|
205440
205440
|
quiet,
|
|
205441
205441
|
seed: true,
|
|
205442
205442
|
recreateDb,
|
|
205443
|
+
logLevel,
|
|
205443
205444
|
realtime: { enabled: false, port: realtimePort },
|
|
205444
205445
|
timeback: timebackOptions,
|
|
205445
205446
|
logger: createLoggerAdapter("sandbox")
|
|
@@ -205952,6 +205953,7 @@ function devServerMiddleware(server, sandbox, gameUrl, showBadge) {
|
|
|
205952
205953
|
async function configurePlatformMode(server, viteConfig, options) {
|
|
205953
205954
|
const sandbox = await startSandbox(viteConfig, options.startSandbox, {
|
|
205954
205955
|
verbose: options.verbose,
|
|
205956
|
+
logLevel: options.logLevel,
|
|
205955
205957
|
customUrl: options.sandboxUrl,
|
|
205956
205958
|
quiet: true,
|
|
205957
205959
|
recreateDb: options.recreateDb
|
|
@@ -206041,6 +206043,7 @@ async function configureServerHook(server, context) {
|
|
|
206041
206043
|
const platformModeOptions = {
|
|
206042
206044
|
startSandbox: context.options.startSandbox,
|
|
206043
206045
|
verbose: context.options.verbose,
|
|
206046
|
+
logLevel: context.options.logLevel,
|
|
206044
206047
|
sandboxUrl: context.options.sandboxUrl,
|
|
206045
206048
|
recreateDb: context.options.recreateDb,
|
|
206046
206049
|
showBadge: context.options.showBadge,
|
|
@@ -206106,6 +206109,7 @@ function resolveOptions(options) {
|
|
|
206106
206109
|
sandboxUrl: sandboxOptions.url ?? `http://localhost:${DEFAULT_PORTS4.SANDBOX}`,
|
|
206107
206110
|
startSandbox: sandboxOptions.url ? false : sandboxOptions.autoStart ?? true,
|
|
206108
206111
|
verbose: sandboxOptions.verbose ?? false,
|
|
206112
|
+
logLevel: sandboxOptions.logLevel ?? "info",
|
|
206109
206113
|
recreateDb: sandboxOptions.recreateDb ?? false,
|
|
206110
206114
|
showBadge: shellOptions.showBadge ?? true
|
|
206111
206115
|
};
|
package/dist/types/internal.d.ts
CHANGED
package/dist/types/options.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export interface PlaycademySandboxOptions {
|
|
|
24
24
|
autoStart?: boolean;
|
|
25
25
|
url?: string;
|
|
26
26
|
verbose?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Log level for the sandbox server
|
|
29
|
+
* @default 'info'
|
|
30
|
+
*/
|
|
31
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
27
32
|
/**
|
|
28
33
|
* Recreate the sandbox database on each start
|
|
29
34
|
* @default false
|