create-ombutocode 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/bin/create-ombutocode.js +269 -269
  2. package/package.json +31 -31
@@ -1,269 +1,269 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const { execSync } = require('child_process');
6
-
7
- const REPO_URL = 'https://github.com/FrancoisBotha/ombutocode.git';
8
- // Installer version is kept in lockstep with the workbench version
9
- // (.ombutocode/src/package.json) — every workbench release bumps both
10
- // to the same number. See DeployInstructions.md §3 and §3.0.
11
- const VERSION = '0.2.1';
12
-
13
- // Pinned Ombuto Code workbench release to clone.
14
- //
15
- // This installer version ships paired with a specific, tested release of
16
- // the workbench — not the tip of main — so that every `npx create-ombutocode`
17
- // run is reproducible. To ship a new workbench release to users:
18
- //
19
- // 1. Tag and release the workbench on GitHub (see DeployInstructions.md §2)
20
- // 2. Bump CLONE_REF below to the new tag
21
- // 3. Bump this installer's VERSION (above) and the package.json version
22
- // 4. `npm publish` the installer (see DeployInstructions.md §3)
23
- const CLONE_REF = 'v0.2.1';
24
-
25
- // Files and directories at the repo root that belong to the Ombuto Code
26
- // upstream project and should be removed from a scaffolded user project.
27
- //
28
- // Two categories:
29
- //
30
- // 1. Maintainer docs — describe how to contribute to / release Ombuto Code
31
- // itself, not anything the user's new project should inherit.
32
- //
33
- // 2. Sample / demo app files — the upstream repo contains an example
34
- // Electron + Vue app at the repo root (DropSync) that is used as a
35
- // test bed for the workbench. It is NOT meant to be a starter template
36
- // for user projects, so it is stripped too.
37
- const UPSTREAM_FILES_TO_STRIP = [
38
- // Maintainer docs
39
- 'README.md',
40
- 'CLA.md',
41
- 'CONTRIBUTING.md',
42
- 'DeployInstructions.md',
43
- 'UPGRADING.md',
44
- 'CLAUDE.md',
45
- 'LICENSE', // upstream Apache 2.0 lives under .ombutocode/LICENSE
46
-
47
- // Sample / demo app at the repo root (not a user-facing starter)
48
- 'src',
49
- 'scripts',
50
- 'package.json',
51
- 'package-lock.json',
52
- 'vite.config.js',
53
- 'eslint.config.js',
54
- 'tsconfig.json',
55
-
56
- // Maintainer-only tooling — not part of what a user's new project needs
57
- 'migration-tool',
58
- ];
59
-
60
- // Files in create-ombutocode/template/ that are copied into the scaffolded
61
- // project after stripping. Any occurrence of {{PROJECT_NAME}} in these
62
- // files is substituted with the user's project name at copy time.
63
- const TEMPLATE_FILES = [
64
- 'README.md',
65
- 'CLAUDE.md',
66
- 'GettingStarted.md',
67
- ];
68
-
69
- // ── Helpers ──
70
-
71
- function log(msg) { console.log(` ${msg}`); }
72
- function heading(msg) { console.log(`\n── ${msg} ──`); }
73
-
74
- function fatal(msg) {
75
- console.error(`\n✖ ${msg}`);
76
- process.exit(1);
77
- }
78
-
79
- function run(cmd, opts = {}) {
80
- try {
81
- execSync(cmd, { stdio: 'inherit', ...opts });
82
- } catch {
83
- fatal(`Command failed: ${cmd}`);
84
- }
85
- }
86
-
87
- function copyDirSync(src, dest) {
88
- fs.mkdirSync(dest, { recursive: true });
89
- for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
90
- const srcPath = path.join(src, entry.name);
91
- const destPath = path.join(dest, entry.name);
92
- if (entry.isDirectory()) {
93
- copyDirSync(srcPath, destPath);
94
- } else {
95
- fs.copyFileSync(srcPath, destPath);
96
- }
97
- }
98
- }
99
-
100
- function stripUpstreamFiles(projectDir) {
101
- for (const name of UPSTREAM_FILES_TO_STRIP) {
102
- const target = path.join(projectDir, name);
103
- if (fs.existsSync(target)) {
104
- // Use recursive + force so this handles both files and directories.
105
- fs.rmSync(target, { recursive: true, force: true });
106
- log(`Removed upstream ${name}`);
107
- }
108
- }
109
- }
110
-
111
- function writeTemplateFiles(projectDir, projectName) {
112
- // Template files ship inside the installer package at ../template
113
- // relative to this script (bin/create-ombutocode.js).
114
- const templateDir = path.resolve(__dirname, '..', 'template');
115
- if (!fs.existsSync(templateDir)) {
116
- log('Template directory not found — skipping template overlay.');
117
- return;
118
- }
119
-
120
- for (const name of TEMPLATE_FILES) {
121
- const src = path.join(templateDir, name);
122
- if (!fs.existsSync(src)) {
123
- log(`Template file missing: ${name} (skipping)`);
124
- continue;
125
- }
126
- const content = fs.readFileSync(src, 'utf-8')
127
- .replace(/\{\{PROJECT_NAME\}\}/g, projectName);
128
- fs.writeFileSync(path.join(projectDir, name), content);
129
- log(`Wrote ${name}`);
130
- }
131
- }
132
-
133
- // ── CLI ──
134
-
135
- const args = process.argv.slice(2);
136
- if (args.includes('--help') || args.includes('-h')) {
137
- console.log(`
138
- create-ombutocode v${VERSION}
139
-
140
- Create a new Ombuto Code project — Agentic Software Engineering Workbench
141
-
142
- Usage:
143
- npx create-ombutocode <project-name>
144
-
145
- Example:
146
- npx create-ombutocode my-app
147
- cd my-app
148
- .ombutocode/buildandrun.bat # Windows
149
- bash .ombutocode/buildandrun # macOS / Linux
150
- `);
151
- process.exit(0);
152
- }
153
-
154
- const projectName = args[0];
155
- if (!projectName) {
156
- fatal('Please specify a project name:\n\n npx create-ombutocode my-app\n');
157
- }
158
-
159
- if (fs.existsSync(projectName)) {
160
- fatal(`Directory "${projectName}" already exists.`);
161
- }
162
-
163
- // ── Banner ──
164
-
165
- console.log(`
166
- ╔═══════════════════════════════════════════╗
167
- ║ create-ombutocode v${VERSION} ║
168
- ║ Agentic Software Engineering Workbench ║
169
- ╚═══════════════════════════════════════════╝
170
- `);
171
-
172
- console.log(`Creating project: ${projectName}`);
173
-
174
- // ── Step 1: Clone the repository at the pinned release tag ──
175
-
176
- heading(`Cloning Ombuto Code ${CLONE_REF}`);
177
- run(`git clone --depth 1 --branch ${CLONE_REF} ${REPO_URL} "${projectName}"`);
178
-
179
- const projectDir = path.resolve(projectName);
180
-
181
- // Remove the .git directory so the user starts fresh
182
- const gitDir = path.join(projectDir, '.git');
183
- if (fs.existsSync(gitDir)) {
184
- log('Removing upstream .git history...');
185
- fs.rmSync(gitDir, { recursive: true, force: true });
186
- }
187
-
188
- // Remove create-ombutocode directory (the installer itself)
189
- const installerDir = path.join(projectDir, 'create-ombutocode');
190
- if (fs.existsSync(installerDir)) {
191
- log('Removing installer package...');
192
- fs.rmSync(installerDir, { recursive: true, force: true });
193
- }
194
-
195
- // ── Step 1b: Strip upstream maintainer files & write project templates ──
196
- //
197
- // The Ombuto Code repo we just cloned contains files that belong to the
198
- // upstream project (README, CLA, CONTRIBUTING, DeployInstructions, CLAUDE,
199
- // root LICENSE) — they should not travel into the user's new project.
200
- // Replace them with minimal project-specific templates.
201
-
202
- heading('Preparing project files');
203
- stripUpstreamFiles(projectDir);
204
- writeTemplateFiles(projectDir, projectName);
205
-
206
- // ── Step 2: Install dependencies ──
207
-
208
- heading('Installing dependencies');
209
- const srcDir = path.join(projectDir, '.ombutocode', 'src');
210
- if (fs.existsSync(path.join(srcDir, 'package.json'))) {
211
- run('npm install --no-audit --no-fund', { cwd: srcDir });
212
- } else {
213
- fatal('.ombutocode/src/package.json not found — repository may be corrupted.');
214
- }
215
-
216
- // ── Step 3: Initialise project data ──
217
-
218
- heading('Initialising project');
219
-
220
- // Run initombuto with --clear to create fresh docs/
221
- const isWindows = process.platform === 'win32';
222
- const initScript = path.join(projectDir, '.ombutocode', isWindows ? 'initombuto.bat' : 'initombuto');
223
-
224
- if (fs.existsSync(initScript)) {
225
- if (isWindows) {
226
- run(`"${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
227
- } else {
228
- // Ensure executable
229
- try { fs.chmodSync(initScript, 0o755); } catch {}
230
- run(`bash "${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
231
- }
232
- } else {
233
- log('initombuto script not found — creating docs/ structure manually...');
234
- const dirs = [
235
- 'Structure', 'Product Requirements Document', 'Architecture',
236
- 'Functional Requirements', 'Non-Functional Requirements', 'Epics',
237
- 'Use Cases', 'Use Case Diagrams', 'Class Diagrams', 'Data Model',
238
- 'Style Guide', 'Mockups', 'References', 'Skills', 'ScratchPad'
239
- ];
240
- for (const dir of dirs) {
241
- fs.mkdirSync(path.join(projectDir, 'docs', dir), { recursive: true });
242
- }
243
- }
244
-
245
- // ── Step 4: Initialise git ──
246
-
247
- heading('Initialising Git repository');
248
- run('git init', { cwd: projectDir });
249
- run('git add -A', { cwd: projectDir });
250
- run('git commit -m "Initial commit — Ombuto Code project"', { cwd: projectDir });
251
-
252
- // ── Done ──
253
-
254
- console.log(`
255
- ╔═══════════════════════════════════════════╗
256
- ║ Project ready! ║
257
- ╚═══════════════════════════════════════════╝
258
-
259
- cd ${projectName}
260
-
261
- # Read this first:
262
- GettingStarted.md — what's in the project and what to do next
263
-
264
- # Launch the workbench:
265
- .ombutocode/buildandrun.bat # Windows
266
- bash .ombutocode/buildandrun # macOS / Linux
267
-
268
- Happy building!
269
- `);
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { execSync } = require('child_process');
6
+
7
+ const REPO_URL = 'https://github.com/FrancoisBotha/ombutocode.git';
8
+ // Installer version is kept in lockstep with the workbench version
9
+ // (.ombutocode/src/package.json) — every workbench release bumps both
10
+ // to the same number. See DeployInstructions.md §3 and §3.0.
11
+ const VERSION = '0.2.4';
12
+
13
+ // Pinned Ombuto Code workbench release to clone.
14
+ //
15
+ // This installer version ships paired with a specific, tested release of
16
+ // the workbench — not the tip of main — so that every `npx create-ombutocode`
17
+ // run is reproducible. To ship a new workbench release to users:
18
+ //
19
+ // 1. Tag and release the workbench on GitHub (see DeployInstructions.md §2)
20
+ // 2. Bump CLONE_REF below to the new tag
21
+ // 3. Bump this installer's VERSION (above) and the package.json version
22
+ // 4. `npm publish` the installer (see DeployInstructions.md §3)
23
+ const CLONE_REF = 'v0.2.4';
24
+
25
+ // Files and directories at the repo root that belong to the Ombuto Code
26
+ // upstream project and should be removed from a scaffolded user project.
27
+ //
28
+ // Two categories:
29
+ //
30
+ // 1. Maintainer docs — describe how to contribute to / release Ombuto Code
31
+ // itself, not anything the user's new project should inherit.
32
+ //
33
+ // 2. Sample / demo app files — the upstream repo contains an example
34
+ // Electron + Vue app at the repo root (DropSync) that is used as a
35
+ // test bed for the workbench. It is NOT meant to be a starter template
36
+ // for user projects, so it is stripped too.
37
+ const UPSTREAM_FILES_TO_STRIP = [
38
+ // Maintainer docs
39
+ 'README.md',
40
+ 'CLA.md',
41
+ 'CONTRIBUTING.md',
42
+ 'DeployInstructions.md',
43
+ 'UPGRADING.md',
44
+ 'CLAUDE.md',
45
+ 'LICENSE', // upstream Apache 2.0 lives under .ombutocode/LICENSE
46
+
47
+ // Sample / demo app at the repo root (not a user-facing starter)
48
+ 'src',
49
+ 'scripts',
50
+ 'package.json',
51
+ 'package-lock.json',
52
+ 'vite.config.js',
53
+ 'eslint.config.js',
54
+ 'tsconfig.json',
55
+
56
+ // Maintainer-only tooling — not part of what a user's new project needs
57
+ 'migration-tool',
58
+ ];
59
+
60
+ // Files in create-ombutocode/template/ that are copied into the scaffolded
61
+ // project after stripping. Any occurrence of {{PROJECT_NAME}} in these
62
+ // files is substituted with the user's project name at copy time.
63
+ const TEMPLATE_FILES = [
64
+ 'README.md',
65
+ 'CLAUDE.md',
66
+ 'GettingStarted.md',
67
+ ];
68
+
69
+ // ── Helpers ──
70
+
71
+ function log(msg) { console.log(` ${msg}`); }
72
+ function heading(msg) { console.log(`\n── ${msg} ──`); }
73
+
74
+ function fatal(msg) {
75
+ console.error(`\n✖ ${msg}`);
76
+ process.exit(1);
77
+ }
78
+
79
+ function run(cmd, opts = {}) {
80
+ try {
81
+ execSync(cmd, { stdio: 'inherit', ...opts });
82
+ } catch {
83
+ fatal(`Command failed: ${cmd}`);
84
+ }
85
+ }
86
+
87
+ function copyDirSync(src, dest) {
88
+ fs.mkdirSync(dest, { recursive: true });
89
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
90
+ const srcPath = path.join(src, entry.name);
91
+ const destPath = path.join(dest, entry.name);
92
+ if (entry.isDirectory()) {
93
+ copyDirSync(srcPath, destPath);
94
+ } else {
95
+ fs.copyFileSync(srcPath, destPath);
96
+ }
97
+ }
98
+ }
99
+
100
+ function stripUpstreamFiles(projectDir) {
101
+ for (const name of UPSTREAM_FILES_TO_STRIP) {
102
+ const target = path.join(projectDir, name);
103
+ if (fs.existsSync(target)) {
104
+ // Use recursive + force so this handles both files and directories.
105
+ fs.rmSync(target, { recursive: true, force: true });
106
+ log(`Removed upstream ${name}`);
107
+ }
108
+ }
109
+ }
110
+
111
+ function writeTemplateFiles(projectDir, projectName) {
112
+ // Template files ship inside the installer package at ../template
113
+ // relative to this script (bin/create-ombutocode.js).
114
+ const templateDir = path.resolve(__dirname, '..', 'template');
115
+ if (!fs.existsSync(templateDir)) {
116
+ log('Template directory not found — skipping template overlay.');
117
+ return;
118
+ }
119
+
120
+ for (const name of TEMPLATE_FILES) {
121
+ const src = path.join(templateDir, name);
122
+ if (!fs.existsSync(src)) {
123
+ log(`Template file missing: ${name} (skipping)`);
124
+ continue;
125
+ }
126
+ const content = fs.readFileSync(src, 'utf-8')
127
+ .replace(/\{\{PROJECT_NAME\}\}/g, projectName);
128
+ fs.writeFileSync(path.join(projectDir, name), content);
129
+ log(`Wrote ${name}`);
130
+ }
131
+ }
132
+
133
+ // ── CLI ──
134
+
135
+ const args = process.argv.slice(2);
136
+ if (args.includes('--help') || args.includes('-h')) {
137
+ console.log(`
138
+ create-ombutocode v${VERSION}
139
+
140
+ Create a new Ombuto Code project — Agentic Software Engineering Workbench
141
+
142
+ Usage:
143
+ npx create-ombutocode <project-name>
144
+
145
+ Example:
146
+ npx create-ombutocode my-app
147
+ cd my-app
148
+ .ombutocode/buildandrun.bat # Windows
149
+ bash .ombutocode/buildandrun # macOS / Linux
150
+ `);
151
+ process.exit(0);
152
+ }
153
+
154
+ const projectName = args[0];
155
+ if (!projectName) {
156
+ fatal('Please specify a project name:\n\n npx create-ombutocode my-app\n');
157
+ }
158
+
159
+ if (fs.existsSync(projectName)) {
160
+ fatal(`Directory "${projectName}" already exists.`);
161
+ }
162
+
163
+ // ── Banner ──
164
+
165
+ console.log(`
166
+ ╔═══════════════════════════════════════════╗
167
+ ║ create-ombutocode v${VERSION} ║
168
+ ║ Agentic Software Engineering Workbench ║
169
+ ╚═══════════════════════════════════════════╝
170
+ `);
171
+
172
+ console.log(`Creating project: ${projectName}`);
173
+
174
+ // ── Step 1: Clone the repository at the pinned release tag ──
175
+
176
+ heading(`Cloning Ombuto Code ${CLONE_REF}`);
177
+ run(`git clone --depth 1 --branch ${CLONE_REF} ${REPO_URL} "${projectName}"`);
178
+
179
+ const projectDir = path.resolve(projectName);
180
+
181
+ // Remove the .git directory so the user starts fresh
182
+ const gitDir = path.join(projectDir, '.git');
183
+ if (fs.existsSync(gitDir)) {
184
+ log('Removing upstream .git history...');
185
+ fs.rmSync(gitDir, { recursive: true, force: true });
186
+ }
187
+
188
+ // Remove create-ombutocode directory (the installer itself)
189
+ const installerDir = path.join(projectDir, 'create-ombutocode');
190
+ if (fs.existsSync(installerDir)) {
191
+ log('Removing installer package...');
192
+ fs.rmSync(installerDir, { recursive: true, force: true });
193
+ }
194
+
195
+ // ── Step 1b: Strip upstream maintainer files & write project templates ──
196
+ //
197
+ // The Ombuto Code repo we just cloned contains files that belong to the
198
+ // upstream project (README, CLA, CONTRIBUTING, DeployInstructions, CLAUDE,
199
+ // root LICENSE) — they should not travel into the user's new project.
200
+ // Replace them with minimal project-specific templates.
201
+
202
+ heading('Preparing project files');
203
+ stripUpstreamFiles(projectDir);
204
+ writeTemplateFiles(projectDir, projectName);
205
+
206
+ // ── Step 2: Install dependencies ──
207
+
208
+ heading('Installing dependencies');
209
+ const srcDir = path.join(projectDir, '.ombutocode', 'src');
210
+ if (fs.existsSync(path.join(srcDir, 'package.json'))) {
211
+ run('npm install --no-audit --no-fund', { cwd: srcDir });
212
+ } else {
213
+ fatal('.ombutocode/src/package.json not found — repository may be corrupted.');
214
+ }
215
+
216
+ // ── Step 3: Initialise project data ──
217
+
218
+ heading('Initialising project');
219
+
220
+ // Run initombuto with --clear to create fresh docs/
221
+ const isWindows = process.platform === 'win32';
222
+ const initScript = path.join(projectDir, '.ombutocode', isWindows ? 'initombuto.bat' : 'initombuto');
223
+
224
+ if (fs.existsSync(initScript)) {
225
+ if (isWindows) {
226
+ run(`"${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
227
+ } else {
228
+ // Ensure executable
229
+ try { fs.chmodSync(initScript, 0o755); } catch {}
230
+ run(`bash "${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
231
+ }
232
+ } else {
233
+ log('initombuto script not found — creating docs/ structure manually...');
234
+ const dirs = [
235
+ 'Structure', 'Product Requirements Document', 'Architecture',
236
+ 'Functional Requirements', 'Non-Functional Requirements', 'Epics',
237
+ 'BDD Use Cases', 'Use Cases', 'Use Case Diagrams', 'Class Diagrams',
238
+ 'Data Model', 'Style Guide', 'Mockups', 'References', 'Skills', 'ScratchPad'
239
+ ];
240
+ for (const dir of dirs) {
241
+ fs.mkdirSync(path.join(projectDir, 'docs', dir), { recursive: true });
242
+ }
243
+ }
244
+
245
+ // ── Step 4: Initialise git ──
246
+
247
+ heading('Initialising Git repository');
248
+ run('git init', { cwd: projectDir });
249
+ run('git add -A', { cwd: projectDir });
250
+ run('git commit -m "Initial commit — Ombuto Code project"', { cwd: projectDir });
251
+
252
+ // ── Done ──
253
+
254
+ console.log(`
255
+ ╔═══════════════════════════════════════════╗
256
+ ║ Project ready! ║
257
+ ╚═══════════════════════════════════════════╝
258
+
259
+ cd ${projectName}
260
+
261
+ # Read this first:
262
+ GettingStarted.md — what's in the project and what to do next
263
+
264
+ # Launch the workbench:
265
+ .ombutocode/buildandrun.bat # Windows
266
+ bash .ombutocode/buildandrun # macOS / Linux
267
+
268
+ Happy building!
269
+ `);
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "create-ombutocode",
3
- "version": "0.2.1",
4
- "description": "Create a new Ombuto Code project — Agentic Software Engineering Workbench",
5
- "author": "Francois Botha",
6
- "license": "Apache-2.0",
7
- "bin": {
8
- "create-ombutocode": "bin/create-ombutocode.js"
9
- },
10
- "keywords": [
11
- "ombuto",
12
- "ombutocode",
13
- "agentic",
14
- "ai",
15
- "coding",
16
- "workbench",
17
- "electron",
18
- "vue"
19
- ],
20
- "repository": {
21
- "type": "git",
22
- "url": "https://github.com/FrancoisBotha/ombutocode.git"
23
- },
24
- "files": [
25
- "bin/",
26
- "template/"
27
- ],
28
- "engines": {
29
- "node": ">=18"
30
- }
31
- }
1
+ {
2
+ "name": "create-ombutocode",
3
+ "version": "0.2.4",
4
+ "description": "Create a new Ombuto Code project — Agentic Software Engineering Workbench",
5
+ "author": "Francois Botha",
6
+ "license": "Apache-2.0",
7
+ "bin": {
8
+ "create-ombutocode": "bin/create-ombutocode.js"
9
+ },
10
+ "keywords": [
11
+ "ombuto",
12
+ "ombutocode",
13
+ "agentic",
14
+ "ai",
15
+ "coding",
16
+ "workbench",
17
+ "electron",
18
+ "vue"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/FrancoisBotha/ombutocode.git"
23
+ },
24
+ "files": [
25
+ "bin/",
26
+ "template/"
27
+ ],
28
+ "engines": {
29
+ "node": ">=18"
30
+ }
31
+ }