@przeprogramowani/10x-cli 1.3.1 → 1.3.2
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.mjs +10 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2271,7 +2271,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
2271
2271
|
// package.json
|
|
2272
2272
|
var package_default = {
|
|
2273
2273
|
name: "@przeprogramowani/10x-cli",
|
|
2274
|
-
version: "1.3.
|
|
2274
|
+
version: "1.3.2",
|
|
2275
2275
|
description: "Open-source CLI for 10xDevs course content",
|
|
2276
2276
|
repository: {
|
|
2277
2277
|
type: "git",
|
|
@@ -5274,13 +5274,14 @@ function formatModuleRow(m3, lessonCount) {
|
|
|
5274
5274
|
return ` ${icon} ${label} — ${lessonCount} lesson${lessonCount === 1 ? "" : "s"} [${state}]`;
|
|
5275
5275
|
}
|
|
5276
5276
|
function renderModuleDetail(ctx, module) {
|
|
5277
|
+
const isLocked = module.effectiveState === "locked";
|
|
5277
5278
|
if (ctx.json) {
|
|
5278
5279
|
output(ctx, "", {
|
|
5279
5280
|
module: module.module,
|
|
5280
5281
|
title: module.title,
|
|
5281
5282
|
state: module.effectiveState,
|
|
5282
5283
|
releaseAt: module.releaseAt,
|
|
5283
|
-
lessons: module.lessons.map((l2) => ({
|
|
5284
|
+
lessons: isLocked ? [] : module.lessons.map((l2) => ({
|
|
5284
5285
|
lessonId: l2.lessonId,
|
|
5285
5286
|
lesson: l2.lesson,
|
|
5286
5287
|
title: l2.title,
|
|
@@ -5290,10 +5291,16 @@ function renderModuleDetail(ctx, module) {
|
|
|
5290
5291
|
});
|
|
5291
5292
|
return;
|
|
5292
5293
|
}
|
|
5293
|
-
const stateLabel =
|
|
5294
|
+
const stateLabel = isLocked ? `locked — unlocks ${formatReleaseAt(module.releaseAt)}` : "unlocked";
|
|
5294
5295
|
const lines = [];
|
|
5295
5296
|
lines.push(`Module ${module.module}: ${module.title} [${stateLabel}]`);
|
|
5296
5297
|
lines.push("");
|
|
5298
|
+
if (isLocked) {
|
|
5299
|
+
lines.push(` Lessons will be available after this module unlocks on ${formatReleaseAt(module.releaseAt)}.`);
|
|
5300
|
+
output(ctx, lines.join(`
|
|
5301
|
+
`), undefined);
|
|
5302
|
+
return;
|
|
5303
|
+
}
|
|
5297
5304
|
if (module.lessons.length === 0) {
|
|
5298
5305
|
lines.push(" (no lessons in this module)");
|
|
5299
5306
|
} else {
|