epicshop 6.76.0 → 6.76.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/README.md +1 -1
- package/dist/cli.js +8 -2
- package/dist/commands/cleanup.d.ts +2 -1
- package/dist/commands/cleanup.js +36 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ epicshop start <workshop>
|
|
|
48
48
|
- `epicshop update`: pull the latest workshop changes
|
|
49
49
|
- `epicshop warm`: warm caches for faster workshop startup
|
|
50
50
|
- `epicshop cleanup`: select what to delete (workshops, caches, offline videos,
|
|
51
|
-
prefs, auth)
|
|
51
|
+
prefs, auth, config)
|
|
52
52
|
- `epicshop exercises`: list exercises with progress (context-aware)
|
|
53
53
|
- `epicshop playground`: view, set, or restore saved playgrounds (context-aware)
|
|
54
54
|
- `epicshop progress`: view or update your progress (context-aware)
|
package/dist/cli.js
CHANGED
|
@@ -544,8 +544,14 @@ const cli = yargs(args)
|
|
|
544
544
|
.option('targets', {
|
|
545
545
|
alias: 't',
|
|
546
546
|
type: 'array',
|
|
547
|
-
choices: [
|
|
548
|
-
|
|
547
|
+
choices: [
|
|
548
|
+
'caches',
|
|
549
|
+
'offline-videos',
|
|
550
|
+
'preferences',
|
|
551
|
+
'auth',
|
|
552
|
+
'config',
|
|
553
|
+
],
|
|
554
|
+
description: 'Cleanup targets (repeatable): caches, offline-videos, preferences, auth, config',
|
|
549
555
|
})
|
|
550
556
|
.option('workshops', {
|
|
551
557
|
type: 'array',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@epic-web/workshop-utils/init-env';
|
|
2
|
-
export type CleanupTarget = 'workshops' | 'caches' | 'offline-videos' | 'preferences' | 'auth';
|
|
2
|
+
export type CleanupTarget = 'workshops' | 'caches' | 'offline-videos' | 'preferences' | 'auth' | 'config';
|
|
3
3
|
export type WorkshopCleanupTarget = 'files' | 'caches' | 'offline-videos';
|
|
4
4
|
export type CleanupResult = {
|
|
5
5
|
success: boolean;
|
|
@@ -16,6 +16,7 @@ type CleanupPaths = {
|
|
|
16
16
|
legacyCacheDir: string;
|
|
17
17
|
dataPaths: string[];
|
|
18
18
|
offlineVideosDir: string;
|
|
19
|
+
configPath: string;
|
|
19
20
|
};
|
|
20
21
|
export type CleanupOptions = {
|
|
21
22
|
silent?: boolean;
|
package/dist/commands/cleanup.js
CHANGED
|
@@ -4,7 +4,7 @@ import fs from 'node:fs/promises';
|
|
|
4
4
|
import os from 'node:os';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { resolveCacheDir, resolveFallbackPath, resolvePrimaryDir, resolvePrimaryPath, } from '@epic-web/workshop-utils/data-storage.server';
|
|
7
|
-
import { deleteWorkshop, getReposDirectory, getUnpushedChanges, } from '@epic-web/workshop-utils/workshops.server';
|
|
7
|
+
import { deleteWorkshop, getConfigPath, getReposDirectory, getUnpushedChanges, } from '@epic-web/workshop-utils/workshops.server';
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import { assertCanPrompt } from "../utils/cli-runtime.js";
|
|
@@ -29,6 +29,11 @@ const CLEANUP_TARGETS = [
|
|
|
29
29
|
name: 'Preferences',
|
|
30
30
|
description: 'Clear stored preferences and local settings',
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
value: 'config',
|
|
34
|
+
name: 'CLI config',
|
|
35
|
+
description: 'Remove saved CLI config (workshops directory setting)',
|
|
36
|
+
},
|
|
32
37
|
{
|
|
33
38
|
value: 'auth',
|
|
34
39
|
name: 'Auth data',
|
|
@@ -86,7 +91,15 @@ async function resolveCleanupPaths(paths = {}) {
|
|
|
86
91
|
resolveFallbackPath(),
|
|
87
92
|
];
|
|
88
93
|
const offlineVideosDir = paths.offlineVideosDir ?? path.join(resolvePrimaryDir(), 'offline-videos');
|
|
89
|
-
|
|
94
|
+
const configPath = paths.configPath ?? getConfigPath();
|
|
95
|
+
return {
|
|
96
|
+
reposDir,
|
|
97
|
+
cacheDir,
|
|
98
|
+
legacyCacheDir,
|
|
99
|
+
dataPaths,
|
|
100
|
+
offlineVideosDir,
|
|
101
|
+
configPath,
|
|
102
|
+
};
|
|
90
103
|
}
|
|
91
104
|
async function pathExists(targetPath) {
|
|
92
105
|
try {
|
|
@@ -542,6 +555,7 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
542
555
|
let legacyCacheDir = '';
|
|
543
556
|
let dataPaths = [];
|
|
544
557
|
let offlineVideosDir = '';
|
|
558
|
+
let configPath = '';
|
|
545
559
|
let workshopSummaries = [];
|
|
546
560
|
let workshopBytes = 0;
|
|
547
561
|
let legacyCacheBytes = 0;
|
|
@@ -549,10 +563,17 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
549
563
|
let offlineVideosBytes = 0;
|
|
550
564
|
let preferencesBytes = 0;
|
|
551
565
|
let authBytes = 0;
|
|
566
|
+
let configBytes = 0;
|
|
552
567
|
try {
|
|
553
568
|
updateSpinner(analysisSpinner, 'Resolving cleanup locations...');
|
|
554
|
-
({
|
|
555
|
-
|
|
569
|
+
({
|
|
570
|
+
reposDir,
|
|
571
|
+
cacheDir,
|
|
572
|
+
legacyCacheDir,
|
|
573
|
+
dataPaths,
|
|
574
|
+
offlineVideosDir,
|
|
575
|
+
configPath,
|
|
576
|
+
} = await resolveCleanupPaths(paths));
|
|
556
577
|
updateSpinner(analysisSpinner, 'Finding installed workshops...');
|
|
557
578
|
const allWorkshops = await listWorkshopsInDirectory(reposDir);
|
|
558
579
|
updateSpinner(analysisSpinner, 'Calculating workshop sizes...');
|
|
@@ -570,6 +591,8 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
570
591
|
cacheBytes = cacheDirBytes + legacyCacheBytes;
|
|
571
592
|
updateSpinner(analysisSpinner, 'Calculating offline video sizes...');
|
|
572
593
|
offlineVideosBytes = await getPathSize(offlineVideosDir);
|
|
594
|
+
updateSpinner(analysisSpinner, 'Calculating CLI config size...');
|
|
595
|
+
configBytes = await getPathSize(configPath);
|
|
573
596
|
updateSpinner(analysisSpinner, 'Scanning preferences and auth data...');
|
|
574
597
|
({ preferencesBytes, authBytes } =
|
|
575
598
|
await getDataCleanupSizeSummary(dataPaths));
|
|
@@ -584,6 +607,7 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
584
607
|
'offline-videos': offlineVideosBytes,
|
|
585
608
|
preferences: preferencesBytes,
|
|
586
609
|
auth: authBytes,
|
|
610
|
+
config: configBytes,
|
|
587
611
|
};
|
|
588
612
|
return {
|
|
589
613
|
...target,
|
|
@@ -709,6 +733,9 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
709
733
|
if (selectedTargets.includes('preferences')) {
|
|
710
734
|
console.log(chalk.yellow(`- Preferences: ${formatBytes(preferencesBytes)} (${dataPaths.join(', ')})`));
|
|
711
735
|
}
|
|
736
|
+
if (selectedTargets.includes('config')) {
|
|
737
|
+
console.log(chalk.yellow(`- CLI config: ${formatBytes(configBytes)} (${configPath})`));
|
|
738
|
+
}
|
|
712
739
|
if (selectedTargets.includes('auth')) {
|
|
713
740
|
console.log(chalk.yellow(`- Auth data: ${formatBytes(authBytes)} (${dataPaths.join(', ')})`));
|
|
714
741
|
}
|
|
@@ -744,6 +771,8 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
744
771
|
switch (target) {
|
|
745
772
|
case 'offline-videos':
|
|
746
773
|
return 'Offline videos';
|
|
774
|
+
case 'config':
|
|
775
|
+
return 'CLI config';
|
|
747
776
|
default:
|
|
748
777
|
return target.charAt(0).toUpperCase() + target.slice(1);
|
|
749
778
|
}
|
|
@@ -837,6 +866,9 @@ export async function cleanup({ silent = false, force = false, targets, workshop
|
|
|
837
866
|
failures,
|
|
838
867
|
});
|
|
839
868
|
}
|
|
869
|
+
if (selectedTargets.includes('config')) {
|
|
870
|
+
await removePath(configPath, removedPaths, skippedPaths, failures);
|
|
871
|
+
}
|
|
840
872
|
if (failures.length > 0) {
|
|
841
873
|
const message = `Failed to clean up ${failures.length} path(s).`;
|
|
842
874
|
if (!silent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "epicshop",
|
|
3
|
-
"version": "6.76.
|
|
3
|
+
"version": "6.76.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"build:watch": "nx watch --projects=epicshop -- nx run \\$NX_PROJECT_NAME:build"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@epic-web/workshop-utils": "6.76.
|
|
102
|
+
"@epic-web/workshop-utils": "6.76.2",
|
|
103
103
|
"@inquirer/prompts": "^8.2.0",
|
|
104
104
|
"@sentry/node": "^10.36.0",
|
|
105
105
|
"chalk": "^5.6.2",
|