stackmem 1.0.16 → 1.0.17

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.
Files changed (3) hide show
  1. package/dist/cli.js +22 -0
  2. package/package.json +1 -1
  3. package/src/cli.ts +27 -0
package/dist/cli.js CHANGED
@@ -930,6 +930,24 @@ function registerMcpServer(distIndexPath) {
930
930
  nodeFs.writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2), "utf-8");
931
931
  console.log("stackmem MCP server registered with Claude Code.");
932
932
  }
933
+ const DEFAULT_GITIGNORE_CONTENT = `node_modules/
934
+ dist/
935
+ .env
936
+ .env.local
937
+ .DS_Store
938
+ *.log
939
+ coverage/
940
+ `;
941
+ // Returns true if the file was created, false if it already existed
942
+ // (and was left untouched).
943
+ function writeGitignore(resolvedPath) {
944
+ const gitignorePath = nodePath.join(resolvedPath, ".gitignore");
945
+ if (nodeFs.existsSync(gitignorePath)) {
946
+ return false;
947
+ }
948
+ nodeFs.writeFileSync(gitignorePath, DEFAULT_GITIGNORE_CONTENT, "utf-8");
949
+ return true;
950
+ }
933
951
  function writeClaudeMd(project, resolvedPath) {
934
952
  const claudeMdPath = nodePath.join(resolvedPath, "CLAUDE.md");
935
953
  if (nodeFs.existsSync(claudeMdPath)) {
@@ -1174,6 +1192,7 @@ async function cmdInit(project, targetPath) {
1174
1192
  console.error(`No git repo found at ${targetPath}`);
1175
1193
  process.exit(1);
1176
1194
  }
1195
+ const gitignoreCreated = writeGitignore(resolvedPath);
1177
1196
  const codingMemoryDir = nodePath.join(resolvedPath, ".coding-memory");
1178
1197
  nodeFs.mkdirSync(codingMemoryDir, { recursive: true });
1179
1198
  const hookLogicPath = nodePath.join(codingMemoryDir, "post-commit-hook.mjs");
@@ -1193,6 +1212,9 @@ async function cmdInit(project, targetPath) {
1193
1212
  const windsurfRulesWritten = writeWindsurfRules(resolvedPath, rulesContent);
1194
1213
  const backendOk = await verifyBackendConnection(project);
1195
1214
  console.log("");
1215
+ if (gitignoreCreated) {
1216
+ console.log("✓ .gitignore created");
1217
+ }
1196
1218
  console.log("✓ Git hook installed");
1197
1219
  console.log("✓ MCP server registered");
1198
1220
  console.log("✓ CLAUDE.md written");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stackmem",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/cli.ts CHANGED
@@ -1059,6 +1059,28 @@ function registerMcpServer(distIndexPath: string): void {
1059
1059
  console.log("stackmem MCP server registered with Claude Code.");
1060
1060
  }
1061
1061
 
1062
+ const DEFAULT_GITIGNORE_CONTENT = `node_modules/
1063
+ dist/
1064
+ .env
1065
+ .env.local
1066
+ .DS_Store
1067
+ *.log
1068
+ coverage/
1069
+ `;
1070
+
1071
+ // Returns true if the file was created, false if it already existed
1072
+ // (and was left untouched).
1073
+ function writeGitignore(resolvedPath: string): boolean {
1074
+ const gitignorePath = nodePath.join(resolvedPath, ".gitignore");
1075
+
1076
+ if (nodeFs.existsSync(gitignorePath)) {
1077
+ return false;
1078
+ }
1079
+
1080
+ nodeFs.writeFileSync(gitignorePath, DEFAULT_GITIGNORE_CONTENT, "utf-8");
1081
+ return true;
1082
+ }
1083
+
1062
1084
  function writeClaudeMd(project: string, resolvedPath: string): void {
1063
1085
  const claudeMdPath = nodePath.join(resolvedPath, "CLAUDE.md");
1064
1086
 
@@ -1337,6 +1359,8 @@ async function cmdInit(project: string, targetPath: string) {
1337
1359
  process.exit(1);
1338
1360
  }
1339
1361
 
1362
+ const gitignoreCreated = writeGitignore(resolvedPath);
1363
+
1340
1364
  const codingMemoryDir = nodePath.join(resolvedPath, ".coding-memory");
1341
1365
  nodeFs.mkdirSync(codingMemoryDir, { recursive: true });
1342
1366
 
@@ -1365,6 +1389,9 @@ async function cmdInit(project: string, targetPath: string) {
1365
1389
  const backendOk = await verifyBackendConnection(project);
1366
1390
 
1367
1391
  console.log("");
1392
+ if (gitignoreCreated) {
1393
+ console.log("✓ .gitignore created");
1394
+ }
1368
1395
  console.log("✓ Git hook installed");
1369
1396
  console.log("✓ MCP server registered");
1370
1397
  console.log("✓ CLAUDE.md written");