epicshop 6.85.4 → 6.86.0

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.
@@ -197,14 +197,24 @@ export async function update(options = {}) {
197
197
  throw error;
198
198
  }
199
199
  }
200
- await updateProgress({ lessonSlug: targetSlug, complete });
200
+ const result = await updateProgress({ lessonSlug: targetSlug, complete });
201
+ if (result.status === 'error') {
202
+ throw new Error(result.error);
203
+ }
201
204
  const statusWord = complete ? 'complete' : 'incomplete';
202
205
  if (!silent) {
203
- console.log(chalk.green(`✅ Marked "${targetSlug}" as ${statusWord}`));
206
+ if (result.status === 'queued') {
207
+ console.log(chalk.yellow(`🕓 Saved "${targetSlug}" as ${statusWord} locally. It will sync when online.`));
208
+ }
209
+ else {
210
+ console.log(chalk.green(`✅ Marked "${targetSlug}" as ${statusWord}`));
211
+ }
204
212
  }
205
213
  return {
206
214
  success: true,
207
- message: `Marked "${targetSlug}" as ${statusWord}`,
215
+ message: result.status === 'queued'
216
+ ? `Saved "${targetSlug}" as ${statusWord} locally. It will sync when online.`
217
+ : `Marked "${targetSlug}" as ${statusWord}`,
208
218
  };
209
219
  }
210
220
  catch (error) {
@@ -9,7 +9,7 @@ export async function warm({ silent = false, } = {}) {
9
9
  }
10
10
  try {
11
11
  const { getApps, isProblemApp, isSolutionApp } = await import('@epic-web/workshop-utils/apps.server');
12
- const { getDiffFiles, getDiffCode } = await import('@epic-web/workshop-utils/diff.server');
12
+ const { getDiffFiles, getDiffPatch } = await import('@epic-web/workshop-utils/diff.server');
13
13
  const { warmCache: warmEpicAPICache } = await import('@epic-web/workshop-utils/epic-api.server');
14
14
  void warmEpicAPICache().catch(() => { }); // ignore failure
15
15
  // Warm up the apps cache
@@ -34,7 +34,7 @@ export async function warm({ silent = false, } = {}) {
34
34
  if (solutionApp) {
35
35
  const pairName = `${problemApp.exerciseNumber.toString().padStart(2, '0')}.${problemApp.stepNumber.toString().padStart(2, '0')}.problem vs ${solutionApp.exerciseNumber.toString().padStart(2, '0')}.${solutionApp.stepNumber.toString().padStart(2, '0')}.solution`;
36
36
  try {
37
- await getDiffCode(problemApp, solutionApp);
37
+ await getDiffPatch(problemApp, solutionApp);
38
38
  await getDiffFiles(problemApp, solutionApp);
39
39
  diffCount++;
40
40
  if (!silent) {
@@ -268,11 +268,9 @@ async function fetchWorkshopPackageJson(repo) {
268
268
  if (apiPackageJson) {
269
269
  return apiPackageJson;
270
270
  }
271
- context.metadata.ttl = 1000 * 60;
272
- context.metadata.swr = 0;
273
- return null;
271
+ throw new Error(`Failed to fetch package.json for workshop "${repo.name}" from GitHub`);
274
272
  },
275
- });
273
+ }).catch(() => null);
276
274
  }
277
275
  /**
278
276
  * Enrich workshops with metadata from their package.json files
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epicshop",
3
- "version": "6.85.4",
3
+ "version": "6.86.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -105,7 +105,7 @@
105
105
  "build:watch": "nx watch --projects=epicshop -- nx run \\$NX_PROJECT_NAME:build"
106
106
  },
107
107
  "dependencies": {
108
- "@epic-web/workshop-utils": "6.85.4",
108
+ "@epic-web/workshop-utils": "6.86.0",
109
109
  "@inquirer/prompts": "^8.2.0",
110
110
  "@sentry/node": "^10.38.0",
111
111
  "chalk": "^5.6.2",