@nemus-cli/nemus 0.10.0 → 0.12.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.
- package/CHANGELOG.md +27 -0
- package/README.md +14 -0
- package/dist/commands/prune.js +196 -0
- package/dist/commands/version.js +37 -0
- package/dist/program.js +4 -0
- package/dist/utils/prune.js +70 -0
- package/dist/utils/version-check.js +15 -0
- package/package.json +1 -1
- package/scripts/release-notes.mjs +54 -0
- package/skills/config.md +17 -0
- package/skills/nemus/SKILL.md +7 -2
- package/skills/nemus/references/completion.md +22 -0
- package/skills/nemus/references/config.md +32 -0
- package/skills/nemus/references/prune.md +44 -0
- package/skills/nemus/references/reflect.md +43 -0
- package/skills/nemus/references/save-context.md +25 -0
- package/skills/prune-workspaces.md +23 -0
- package/skills/reflect.md +21 -0
- package/src/commands/prune.ts +183 -0
- package/src/commands/version.test.ts +21 -0
- package/src/commands/version.ts +45 -0
- package/src/program.ts +4 -0
- package/src/utils/prune.test.ts +121 -0
- package/src/utils/prune.ts +109 -0
- package/src/utils/version-check.test.ts +28 -1
- package/src/utils/version-check.ts +15 -0
|
@@ -60,6 +60,10 @@ async function fetchLatestVersion(): Promise<string | null> {
|
|
|
60
60
|
* This is designed to be non-blocking and best-effort — failures are silent.
|
|
61
61
|
*/
|
|
62
62
|
export async function checkForUpdate(): Promise<string | null> {
|
|
63
|
+
// Opt-out: skip the check entirely (no cache read, no network) when the user
|
|
64
|
+
// asks for it. NEMUS_NO_UPDATE_CHECK is ours; NO_UPDATE_NOTIFIER is the
|
|
65
|
+
// de-facto convention several Node CLIs honor.
|
|
66
|
+
if (updateCheckDisabled(process.env)) return null;
|
|
63
67
|
try {
|
|
64
68
|
const currentVersion = getPackageVersion();
|
|
65
69
|
const cache = await loadCache();
|
|
@@ -91,6 +95,17 @@ export async function checkForUpdate(): Promise<string | null> {
|
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Whether the update check is opted out via env. A value is "set" unless it is
|
|
100
|
+
* empty or an explicit falsey token (`0`/`false`), so `NEMUS_NO_UPDATE_CHECK=0`
|
|
101
|
+
* does NOT disable the check. Pure + exported for testing.
|
|
102
|
+
*/
|
|
103
|
+
export function updateCheckDisabled(env: NodeJS.ProcessEnv): boolean {
|
|
104
|
+
const isSet = (v: string | undefined) =>
|
|
105
|
+
v !== undefined && v !== '' && v !== '0' && v.toLowerCase() !== 'false';
|
|
106
|
+
return isSet(env.NEMUS_NO_UPDATE_CHECK) || isSet(env.NO_UPDATE_NOTIFIER);
|
|
107
|
+
}
|
|
108
|
+
|
|
94
109
|
function formatUpdateMessage(current: string, latest: string): string {
|
|
95
110
|
return `\x1b[33m[nemus] Update available: ${current} -> ${latest}. Run: npm install -g @nemus-cli/nemus@latest\x1b[0m`;
|
|
96
111
|
}
|