@aslomon/effectum 0.2.0 → 0.2.1

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/bin/install.js CHANGED
@@ -16,8 +16,6 @@ const fs = require("fs");
16
16
  const path = require("path");
17
17
  const os = require("os");
18
18
  const { spawnSync } = require("child_process");
19
- const p = require("@clack/prompts");
20
-
21
19
  const { detectAll } = require("./lib/detect");
22
20
  const { loadStackPreset } = require("./lib/stack-parser");
23
21
  const {
@@ -30,6 +28,8 @@ const { writeConfig } = require("./lib/config");
30
28
  const { AUTONOMY_MAP, FORMATTER_MAP, MCP_SERVERS } = require("./lib/constants");
31
29
  const { ensureDir, deepMerge, findRepoRoot: findRepoRootShared } = require("./lib/utils");
32
30
  const {
31
+ initClack,
32
+ getClack,
33
33
  printBanner,
34
34
  askProjectName,
35
35
  askStack,
@@ -300,8 +300,8 @@ function generateConfiguredFiles(config, targetDir, repoRoot, isGlobal) {
300
300
  steps.push({ status: "created", dest: claudeMdDest });
301
301
 
302
302
  if (claudeMdRemaining.length > 0) {
303
- p.log.warn(
304
- `CLAUDE.md has remaining placeholders: ${claudeMdRemaining.join(", ")}`,
303
+ console.warn(
304
+ `⚠ CLAUDE.md has remaining placeholders: ${claudeMdRemaining.join(", ")}`,
305
305
  );
306
306
  }
307
307
 
@@ -525,6 +525,7 @@ Options:
525
525
  }
526
526
 
527
527
  // ── Interactive mode ────────────────────────────────────────────────────
528
+ const p = await initClack();
528
529
  printBanner();
529
530
 
530
531
  const detected = detectAll(process.cwd());
@@ -706,6 +707,6 @@ Options:
706
707
  }
707
708
 
708
709
  main().catch((err) => {
709
- p.log.error(`Fatal error: ${err.message}`);
710
+ console.error(`Fatal error: ${err.message}`);
710
711
  process.exit(1);
711
712
  });
package/bin/lib/ui.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Shared @clack/prompts helpers and display utilities.
3
+ * Uses dynamic import() because @clack/prompts is ESM-only.
3
4
  */
4
5
  "use strict";
5
6
 
6
- const p = require("@clack/prompts");
7
7
  const {
8
8
  STACK_CHOICES,
9
9
  LANGUAGE_CHOICES,
@@ -11,6 +11,29 @@ const {
11
11
  MCP_SERVERS,
12
12
  } = require("./constants");
13
13
 
14
+ /** @type {import("@clack/prompts")} */
15
+ let p;
16
+
17
+ /**
18
+ * Initialize @clack/prompts (ESM module). Must be called once before using prompts.
19
+ * @returns {Promise<import("@clack/prompts")>}
20
+ */
21
+ async function initClack() {
22
+ if (!p) {
23
+ p = await import("@clack/prompts");
24
+ }
25
+ return p;
26
+ }
27
+
28
+ /**
29
+ * Get the loaded clack instance (for use in install.js / reconfigure.js).
30
+ * @returns {import("@clack/prompts")}
31
+ */
32
+ function getClack() {
33
+ if (!p) throw new Error("Call initClack() before using prompts");
34
+ return p;
35
+ }
36
+
14
37
  /**
15
38
  * Print the Effectum banner via clack intro.
16
39
  */
@@ -207,6 +230,8 @@ function showOutro(isGlobal) {
207
230
  }
208
231
 
209
232
  module.exports = {
233
+ initClack,
234
+ getClack,
210
235
  printBanner,
211
236
  handleCancel,
212
237
  askProjectName,
@@ -7,8 +7,6 @@
7
7
 
8
8
  const fs = require("fs");
9
9
  const path = require("path");
10
- const p = require("@clack/prompts");
11
-
12
10
  const { readConfig } = require("./lib/config");
13
11
  const { loadStackPreset } = require("./lib/stack-parser");
14
12
  const {
@@ -20,6 +18,7 @@ const {
20
18
  } = require("./lib/template");
21
19
  const { AUTONOMY_MAP, FORMATTER_MAP } = require("./lib/constants");
22
20
  const { ensureDir, deepMerge, findRepoRoot } = require("./lib/utils");
21
+ const { initClack } = require("./lib/ui");
23
22
 
24
23
  // ─── Main ─────────────────────────────────────────────────────────────────
25
24
 
@@ -29,6 +28,7 @@ async function main() {
29
28
  const targetDir = process.cwd();
30
29
  const repoRoot = findRepoRoot();
31
30
 
31
+ const p = await initClack();
32
32
  p.intro("EFFECTUM — Reconfigure");
33
33
 
34
34
  // Read existing config
@@ -165,6 +165,6 @@ async function main() {
165
165
  }
166
166
 
167
167
  main().catch((err) => {
168
- p.log.error(`Fatal error: ${err.message}`);
168
+ console.error(`Fatal error: ${err.message}`);
169
169
  process.exit(1);
170
170
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aslomon/effectum",
3
- "version": "0.2.0",
4
- "description": "Autonomous development system for Claude Code describe what you want, get production-ready code",
3
+ "version": "0.2.1",
4
+ "description": "Autonomous development system for Claude Code \u2014 describe what you want, get production-ready code",
5
5
  "bin": {
6
6
  "effectum": "bin/effectum.js"
7
7
  },