planmode 0.1.3 → 0.1.4
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 +11 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/lib/analytics.ts +12 -0
- package/src/lib/installer.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -616,6 +616,15 @@ var logger = {
|
|
|
616
616
|
}
|
|
617
617
|
};
|
|
618
618
|
|
|
619
|
+
// src/lib/analytics.ts
|
|
620
|
+
var API_BASE = "https://api.planmode.org";
|
|
621
|
+
function trackDownload(packageName) {
|
|
622
|
+
fetch(`${API_BASE}/downloads/${encodeURIComponent(packageName)}`, {
|
|
623
|
+
method: "POST"
|
|
624
|
+
}).catch(() => {
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
|
|
619
628
|
// src/lib/installer.ts
|
|
620
629
|
function getInstallDir(type) {
|
|
621
630
|
switch (type) {
|
|
@@ -689,6 +698,7 @@ async function installPackage(packageName, options = {}) {
|
|
|
689
698
|
fs7.mkdirSync(path7.dirname(fullPath), { recursive: true });
|
|
690
699
|
fs7.writeFileSync(fullPath, content, "utf-8");
|
|
691
700
|
logger.success(`Installed ${packageName}@${version} \u2192 ${installPath}`);
|
|
701
|
+
trackDownload(packageName);
|
|
692
702
|
if (type === "plan") {
|
|
693
703
|
addImport(packageName, projectDir);
|
|
694
704
|
logger.dim(`Added @import to CLAUDE.md`);
|
|
@@ -1294,7 +1304,7 @@ var loginCommand = new Command10("login").description("Configure GitHub authenti
|
|
|
1294
1304
|
|
|
1295
1305
|
// src/index.ts
|
|
1296
1306
|
var program = new Command11();
|
|
1297
|
-
program.name("planmode").description("The open source package manager for AI plans, rules, and prompts.").version("0.1.
|
|
1307
|
+
program.name("planmode").description("The open source package manager for AI plans, rules, and prompts.").version("0.1.4");
|
|
1298
1308
|
program.addCommand(installCommand);
|
|
1299
1309
|
program.addCommand(uninstallCommand);
|
|
1300
1310
|
program.addCommand(searchCommand);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ const program = new Command();
|
|
|
15
15
|
program
|
|
16
16
|
.name("planmode")
|
|
17
17
|
.description("The open source package manager for AI plans, rules, and prompts.")
|
|
18
|
-
.version("0.1.
|
|
18
|
+
.version("0.1.4");
|
|
19
19
|
|
|
20
20
|
program.addCommand(installCommand);
|
|
21
21
|
program.addCommand(uninstallCommand);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const API_BASE = "https://api.planmode.org";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fire-and-forget download tracking. Never throws, never blocks.
|
|
5
|
+
*/
|
|
6
|
+
export function trackDownload(packageName: string): void {
|
|
7
|
+
fetch(`${API_BASE}/downloads/${encodeURIComponent(packageName)}`, {
|
|
8
|
+
method: "POST",
|
|
9
|
+
}).catch(() => {
|
|
10
|
+
// Silently ignore — analytics should never affect the install flow
|
|
11
|
+
});
|
|
12
|
+
}
|
package/src/lib/installer.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { addImport, removeImport } from "./claude-md.js";
|
|
|
10
10
|
import { parseManifest, readPackageContent } from "./manifest.js";
|
|
11
11
|
import { renderTemplate, collectVariableValues } from "./template.js";
|
|
12
12
|
import { logger } from "./logger.js";
|
|
13
|
+
import { trackDownload } from "./analytics.js";
|
|
13
14
|
|
|
14
15
|
function getInstallDir(type: PackageType): string {
|
|
15
16
|
switch (type) {
|
|
@@ -116,6 +117,7 @@ export async function installPackage(
|
|
|
116
117
|
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
117
118
|
fs.writeFileSync(fullPath, content, "utf-8");
|
|
118
119
|
logger.success(`Installed ${packageName}@${version} → ${installPath}`);
|
|
120
|
+
trackDownload(packageName);
|
|
119
121
|
|
|
120
122
|
// Update CLAUDE.md for plans
|
|
121
123
|
if (type === "plan") {
|