great-cto 0.1.1 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Oleksandr Velykyi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Note: this license covers the `great-cto` npm CLI package only
24
+ (the installer in this directory). The Claude Code plugin itself
25
+ (everything outside packages/cli/) is licensed separately — see the
26
+ LICENSE file in the repository root.
package/dist/bootstrap.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generate .great_cto/PROJECT.md pre-filled from detected stack + archetype.
2
2
  // Safe: will NOT overwrite an existing PROJECT.md.
3
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
+ import { existsSync, mkdirSync, writeFileSync, readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { dim, success, warn } from "./ui.js";
6
6
  export function bootstrap(dir, detection, archetype, compliance) {
@@ -63,7 +63,6 @@ function inferProjectTitle(dir) {
63
63
  try {
64
64
  const pkgPath = join(dir, "package.json");
65
65
  if (existsSync(pkgPath)) {
66
- const { readFileSync } = require("node:fs");
67
66
  const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
68
67
  if (pkg.name)
69
68
  return pkg.name;
package/dist/installer.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Install the great_cto plugin into ~/.claude/plugins/cache/local/great_cto/<version>/.
2
2
  // Uses git clone. Falls back to tarball fetch if git is unavailable.
3
3
  import { spawnSync, execFileSync } from "node:child_process";
4
- import { existsSync, mkdirSync, rmSync, readFileSync } from "node:fs";
4
+ import { existsSync, mkdirSync, rmSync, readFileSync, readdirSync } from "node:fs";
5
5
  import { homedir } from "node:os";
6
6
  import { join } from "node:path";
7
7
  import { log, success, warn, dim } from "./ui.js";
@@ -51,7 +51,6 @@ export function findInstalledVersions() {
51
51
  if (!existsSync(base))
52
52
  return [];
53
53
  try {
54
- const { readdirSync } = require("node:fs");
55
54
  return readdirSync(base).filter((name) => /^[0-9]+\.[0-9]+\.[0-9]+$/.test(name)).sort(cmpSemver);
56
55
  }
57
56
  catch {
package/dist/settings.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Atomic merge of enabledPlugins into ~/.claude/settings.json.
2
2
  // Preserves all other keys. Backup-aware.
3
- import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from "node:fs";
3
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync, renameSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
5
  import { join, dirname } from "node:path";
6
6
  import { dim, success, warn } from "./ui.js";
@@ -44,7 +44,6 @@ export function enableGreatCto() {
44
44
  // Atomic write: write to temp, rename
45
45
  const tmp = `${path}.tmp-${Date.now()}`;
46
46
  writeFileSync(tmp, JSON.stringify(existing, null, 2) + "\n", "utf-8");
47
- const { renameSync } = require("node:fs");
48
47
  renameSync(tmp, path);
49
48
  if (backupPath) {
50
49
  success(`enabled ${pluginKey} in ~/.claude/settings.json ${dim(`(backup: ${backupPath})`)}`);
package/index.mjs CHANGED
@@ -1,19 +1,17 @@
1
1
  #!/usr/bin/env node
2
- // Entry point. Loads compiled src/main.js or runs src/main.ts directly in dev.
2
+ // Entry point: loads the compiled dist/main.js.
3
+ // For local dev, run: `npm run build` first, then `node index.mjs`.
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { dirname, join } from "node:path";
5
6
  import { existsSync } from "node:fs";
6
7
 
7
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
9
  const compiled = join(__dirname, "dist", "main.js");
9
- const source = join(__dirname, "src", "main.ts");
10
10
 
11
- if (existsSync(compiled)) {
12
- await import(compiled);
13
- } else if (existsSync(source)) {
14
- // Node 22 supports --experimental-strip-types via import for .ts
15
- await import(source);
16
- } else {
17
- console.error("great-cto: no entry point found. Did you run `npm run build`?");
11
+ if (!existsSync(compiled)) {
12
+ console.error("great-cto: dist/main.js not found. Run `npm run build` first.");
13
+ console.error("If you installed via npm, please report this at https://github.com/avelikiy/great_cto/issues");
18
14
  process.exit(1);
19
15
  }
16
+
17
+ await import(compiled);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "great-cto",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "One command install for the great_cto Claude Code plugin. Auto-detects your stack, picks the right archetype, bootstraps PROJECT.md.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -51,7 +51,7 @@
51
51
  "type": "module",
52
52
  "scripts": {
53
53
  "build": "tsc",
54
- "test": "node --test 'tests/*.test.ts'",
54
+ "test": "npm run build && node --test tests/*.test.mjs",
55
55
  "prepublishOnly": "npm run build"
56
56
  },
57
57
  "devDependencies": {
@@ -59,6 +59,6 @@
59
59
  "typescript": "5.8.3"
60
60
  },
61
61
  "engines": {
62
- "node": ">=22.6.0"
62
+ "node": ">=18.17.0"
63
63
  }
64
64
  }