playcademy 0.14.11-alpha.5 → 0.14.11-alpha.6
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 +81 -75
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3888,13 +3888,13 @@ function getErrorMessage(error) {
|
|
|
3888
3888
|
}
|
|
3889
3889
|
return "Unknown error";
|
|
3890
3890
|
}
|
|
3891
|
-
function logAndExit(error,
|
|
3891
|
+
function logAndExit(error, logger3, options = {}) {
|
|
3892
3892
|
const { code = 1, prefix } = options;
|
|
3893
3893
|
const message = getErrorMessage(error);
|
|
3894
3894
|
const fullMessage = prefix ? `${prefix}: ${message}` : message;
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3895
|
+
logger3.newLine();
|
|
3896
|
+
logger3.error(fullMessage);
|
|
3897
|
+
logger3.newLine();
|
|
3898
3898
|
process.exit(code);
|
|
3899
3899
|
}
|
|
3900
3900
|
var init_errors2 = __esm({
|
|
@@ -6482,8 +6482,8 @@ var timebackChangeDetector = {
|
|
|
6482
6482
|
}
|
|
6483
6483
|
} catch (error) {
|
|
6484
6484
|
if (verbose && error instanceof Error) {
|
|
6485
|
-
const { logger:
|
|
6486
|
-
|
|
6485
|
+
const { logger: logger3 } = await Promise.resolve().then(() => (init_core(), core_exports));
|
|
6486
|
+
logger3.remark(`TimeBack config change failed: ${error.message}`);
|
|
6487
6487
|
}
|
|
6488
6488
|
}
|
|
6489
6489
|
}
|
|
@@ -9196,10 +9196,11 @@ async function analyzeChanges(context2) {
|
|
|
9196
9196
|
if (buildHash !== void 0 && previousBuildHash !== void 0) {
|
|
9197
9197
|
buildChanged = buildHash !== previousBuildHash;
|
|
9198
9198
|
if (context2.debug) {
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9199
|
+
console.log("\n[DEBUG] Build change detection:");
|
|
9200
|
+
console.log(` Current hash: ${buildHash}`);
|
|
9201
|
+
console.log(` Previous hash: ${previousBuildHash}`);
|
|
9202
|
+
console.log(` Changed: ${buildChanged}
|
|
9203
|
+
`);
|
|
9203
9204
|
}
|
|
9204
9205
|
} else if (buildHash !== void 0 && previousBuildHash === void 0) {
|
|
9205
9206
|
buildChanged = true;
|
|
@@ -9921,7 +9922,7 @@ async function startDevServer(options) {
|
|
|
9921
9922
|
port: preferredPort,
|
|
9922
9923
|
config: providedConfig,
|
|
9923
9924
|
platformUrl,
|
|
9924
|
-
logger:
|
|
9925
|
+
logger: logger3 = true,
|
|
9925
9926
|
customLogger
|
|
9926
9927
|
} = options;
|
|
9927
9928
|
const port = await findAvailablePort(preferredPort);
|
|
@@ -9941,7 +9942,7 @@ async function startDevServer(options) {
|
|
|
9941
9942
|
const bucketDir = hasBucket ? await ensureBucketDirectory() : void 0;
|
|
9942
9943
|
const workspace = getWorkspace();
|
|
9943
9944
|
const envSecrets = await readEnvFile(workspace);
|
|
9944
|
-
const log2 =
|
|
9945
|
+
const log2 = logger3 ? new FilteredLog(LogLevel.INFO, customLogger) : new Log(LogLevel.NONE);
|
|
9945
9946
|
const sandboxInfo = readServerInfo("sandbox", workspace);
|
|
9946
9947
|
const baseUrl = platformUrl ?? sandboxInfo?.url ?? process.env.PLAYCADEMY_BASE_URL ?? `http://localhost:${DEFAULT_PORTS.SANDBOX}`;
|
|
9947
9948
|
const bindings = {
|
|
@@ -10235,64 +10236,64 @@ ${error.suggestion}` : error.message;
|
|
|
10235
10236
|
|
|
10236
10237
|
// src/lib/timeback/cleanup.ts
|
|
10237
10238
|
init_logger();
|
|
10238
|
-
function displayCleanupWarning(integration, gameName,
|
|
10239
|
-
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10239
|
+
function displayCleanupWarning(integration, gameName, logger3) {
|
|
10240
|
+
logger3.newLine();
|
|
10241
|
+
logger3.warn("This will remove your TimeBack integration");
|
|
10242
|
+
logger3.data("Game", gameName, 1);
|
|
10243
|
+
logger3.data("Course ID", integration.courseId, 1);
|
|
10244
|
+
logger3.newLine();
|
|
10245
|
+
logger3.admonition("warning", "Are you sure?", [
|
|
10245
10246
|
"This action will soft-delete all OneRoster resources"
|
|
10246
10247
|
]);
|
|
10247
|
-
|
|
10248
|
+
logger3.newLine();
|
|
10248
10249
|
}
|
|
10249
10250
|
|
|
10250
10251
|
// src/lib/timeback/setup.ts
|
|
10251
10252
|
init_logger();
|
|
10252
|
-
function displayConfigPreview(config,
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10253
|
+
function displayConfigPreview(config, logger3) {
|
|
10254
|
+
logger3.newLine();
|
|
10255
|
+
logger3.highlight("Dry Run");
|
|
10256
|
+
logger3.newLine();
|
|
10257
|
+
logger3.highlight("Organization");
|
|
10258
|
+
logger3.data("Name", config.organization.name, 1);
|
|
10259
|
+
logger3.data("Type", config.organization.type, 1);
|
|
10260
|
+
logger3.data("ID", config.organization.identifier, 1);
|
|
10261
|
+
logger3.newLine();
|
|
10262
|
+
logger3.highlight("Course");
|
|
10263
|
+
logger3.data("Title", config.course.title, 1);
|
|
10264
|
+
logger3.data("Code", config.course.courseCode, 1);
|
|
10265
|
+
logger3.data("Subjects", config.course.subjects.join(", "), 1);
|
|
10266
|
+
logger3.data("Grades", config.course.grades.join(", "), 1);
|
|
10267
|
+
logger3.data("Level", config.course.level, 1);
|
|
10268
|
+
logger3.newLine();
|
|
10269
|
+
logger3.highlight("Resource");
|
|
10270
|
+
logger3.data("Title", config.resource.title, 1);
|
|
10271
|
+
logger3.data("Launch URL", config.resource.metadata.launchUrl, 1);
|
|
10272
|
+
logger3.newLine();
|
|
10272
10273
|
}
|
|
10273
10274
|
|
|
10274
10275
|
// src/lib/timeback/verify.ts
|
|
10275
|
-
function displayIntegrationDetails(integration,
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10276
|
+
function displayIntegrationDetails(integration, logger3) {
|
|
10277
|
+
logger3.highlight("Integration");
|
|
10278
|
+
logger3.data("Course ID", integration.courseId, 1);
|
|
10279
|
+
logger3.data(
|
|
10279
10280
|
"Last verified",
|
|
10280
10281
|
integration.lastVerifiedAt ? new Date(integration.lastVerifiedAt).toLocaleString() : "Never",
|
|
10281
10282
|
1
|
|
10282
10283
|
);
|
|
10283
|
-
|
|
10284
|
-
}
|
|
10285
|
-
function displayResourcesStatus(resources,
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10284
|
+
logger3.newLine();
|
|
10285
|
+
}
|
|
10286
|
+
function displayResourcesStatus(resources, logger3) {
|
|
10287
|
+
logger3.highlight("Resources");
|
|
10288
|
+
logger3.data("Course", resources.course.found ? "\u2713 Found" : "\u2717 Not found", 1);
|
|
10289
|
+
logger3.data("Component", resources.component.found ? "\u2713 Found" : "\u2717 Not found", 1);
|
|
10290
|
+
logger3.data("Resource", resources.resource.found ? "\u2713 Found" : "\u2717 Not found", 1);
|
|
10291
|
+
logger3.data(
|
|
10291
10292
|
"Component Resource",
|
|
10292
10293
|
resources.componentResource.found ? "\u2713 Found" : "\u2717 Not found",
|
|
10293
10294
|
1
|
|
10294
10295
|
);
|
|
10295
|
-
|
|
10296
|
+
logger3.newLine();
|
|
10296
10297
|
}
|
|
10297
10298
|
|
|
10298
10299
|
// src/commands/init/config.ts
|
|
@@ -10784,31 +10785,36 @@ async function runDeployment(options) {
|
|
|
10784
10785
|
await selectEnvironment({ env: environment, dryRun: options.dryRun });
|
|
10785
10786
|
const context2 = await prepareDeploymentContext(options);
|
|
10786
10787
|
displayCurrentConfiguration(context2);
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10788
|
+
if (options.debug) {
|
|
10789
|
+
console.log("\n[DEBUG] Before promptForMissingConfig:");
|
|
10790
|
+
console.log(` config.displayName: ${context2.config.displayName}`);
|
|
10791
|
+
console.log(` config.buildPath: ${context2.config.buildPath}`);
|
|
10792
|
+
console.log(` context.buildHash: ${context2.buildHash}`);
|
|
10793
|
+
console.log(` context.buildSize: ${context2.buildSize}`);
|
|
10794
|
+
}
|
|
10794
10795
|
const didPrompt = await promptForMissingConfig(context2);
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10796
|
+
if (options.debug) {
|
|
10797
|
+
console.log("\n[DEBUG] After promptForMissingConfig:");
|
|
10798
|
+
console.log(` didPrompt: ${didPrompt}`);
|
|
10799
|
+
console.log(` config.buildPath: ${context2.config.buildPath}`);
|
|
10800
|
+
}
|
|
10799
10801
|
if (didPrompt && context2.config.buildPath) {
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10802
|
+
if (options.debug) {
|
|
10803
|
+
console.log("\n[DEBUG] Before updateBuildMetadata:");
|
|
10804
|
+
console.log(` buildPath: ${context2.config.buildPath}`);
|
|
10805
|
+
console.log(` buildHash: ${context2.buildHash}`);
|
|
10806
|
+
console.log(` previousBuildHash: ${context2.previousBuildHash}`);
|
|
10807
|
+
console.log(` buildSize: ${context2.buildSize}`);
|
|
10808
|
+
console.log(` previousBuildSize: ${context2.previousBuildSize}`);
|
|
10809
|
+
}
|
|
10806
10810
|
await updateBuildMetadata(context2);
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10811
|
+
if (options.debug) {
|
|
10812
|
+
console.log("\n[DEBUG] After updateBuildMetadata:");
|
|
10813
|
+
console.log(` buildHash: ${context2.buildHash}`);
|
|
10814
|
+
console.log(` buildSize: ${context2.buildSize}`);
|
|
10815
|
+
console.log(` Hash changed: ${context2.buildHash !== context2.previousBuildHash}
|
|
10816
|
+
`);
|
|
10817
|
+
}
|
|
10812
10818
|
}
|
|
10813
10819
|
if (didPrompt) logger.newLine();
|
|
10814
10820
|
await validateDeployConfig(context2.config).catch((error) => {
|