@altotyler/alto-rootstock-cli 1.0.2 → 1.0.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/package.json +1 -1
- package/project-template/claude/CLAUDE.md +28 -0
- package/project-template/claude/skills/rootstock-core.md +93 -0
- package/project-template/claude/skills/rootstock-debug.md +65 -0
- package/project-template/claude/skills/rootstock-inventory.md +41 -0
- package/project-template/claude/skills/rootstock-manufacturing.md +33 -0
- package/project-template/claude/skills/rootstock-poloader.md +62 -0
- package/project-template/claude/skills/rootstock-session.md +104 -0
- package/project-template/claude/skills/rootstock-soapi.md +57 -0
- package/project-template/claude/skills/rootstock-sydata.md +47 -0
- package/project-template/claude/skills/rootstock-sydatat.md +40 -0
- package/project-template/claude/skills/rootstock-testing.md +63 -0
- package/project-template/cursor/rules/rootstock.mdc +34 -0
- package/project-template/github/agents/Rootstock Agent.agent.md +488 -0
- package/project-template/github/copilot-instructions.md +23 -0
- package/project-template/vscode/mcp.json +10 -0
- package/project-template/vscode/tasks.json +37 -0
- package/src/commands/new.js +3 -2
- package/src/lib/config.js +1 -1
- package/src/lib/scaffold.js +26 -23
package/src/lib/scaffold.js
CHANGED
|
@@ -5,24 +5,26 @@ const path = require('path');
|
|
|
5
5
|
const chalk = require('chalk');
|
|
6
6
|
const { fetchRemoteFile } = require('./fetcher');
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const TEMPLATE_DIR = path.join(__dirname, '../../project-template');
|
|
9
|
+
|
|
10
|
+
// Maps template-relative paths → local project paths
|
|
9
11
|
const SCAFFOLD_MANIFEST = [
|
|
10
|
-
{
|
|
11
|
-
{
|
|
12
|
-
{
|
|
13
|
-
{
|
|
14
|
-
{
|
|
15
|
-
{
|
|
16
|
-
{
|
|
17
|
-
{
|
|
18
|
-
{
|
|
19
|
-
{
|
|
20
|
-
{
|
|
21
|
-
{
|
|
22
|
-
{
|
|
23
|
-
{
|
|
24
|
-
{
|
|
25
|
-
{
|
|
12
|
+
{ template: 'claude/CLAUDE.md', local: '.claude/CLAUDE.md' },
|
|
13
|
+
{ template: 'claude/skills/rootstock-core.md', local: '.claude/skills/rootstock-core.md' },
|
|
14
|
+
{ template: 'claude/skills/rootstock-soapi.md', local: '.claude/skills/rootstock-soapi.md' },
|
|
15
|
+
{ template: 'claude/skills/rootstock-sydata.md', local: '.claude/skills/rootstock-sydata.md' },
|
|
16
|
+
{ template: 'claude/skills/rootstock-sydatat.md', local: '.claude/skills/rootstock-sydatat.md' },
|
|
17
|
+
{ template: 'claude/skills/rootstock-poloader.md', local: '.claude/skills/rootstock-poloader.md' },
|
|
18
|
+
{ template: 'claude/skills/rootstock-manufacturing.md', local: '.claude/skills/rootstock-manufacturing.md' },
|
|
19
|
+
{ template: 'claude/skills/rootstock-inventory.md', local: '.claude/skills/rootstock-inventory.md' },
|
|
20
|
+
{ template: 'claude/skills/rootstock-testing.md', local: '.claude/skills/rootstock-testing.md' },
|
|
21
|
+
{ template: 'claude/skills/rootstock-debug.md', local: '.claude/skills/rootstock-debug.md' },
|
|
22
|
+
{ template: 'claude/skills/rootstock-session.md', local: '.claude/skills/rootstock-session.md' },
|
|
23
|
+
{ template: 'cursor/rules/rootstock.mdc', local: '.cursor/rules/rootstock.mdc' },
|
|
24
|
+
{ template: 'github/agents/Rootstock Agent.agent.md', local: '.github/agents/Rootstock Agent.agent.md' },
|
|
25
|
+
{ template: 'github/copilot-instructions.md', local: '.github/copilot-instructions.md' },
|
|
26
|
+
{ template: 'vscode/mcp.json', local: '.vscode/mcp.json' },
|
|
27
|
+
{ template: 'vscode/tasks.json', local: '.vscode/tasks.json' },
|
|
26
28
|
];
|
|
27
29
|
|
|
28
30
|
function writeFile(projectRoot, relPath, content) {
|
|
@@ -32,18 +34,19 @@ function writeFile(projectRoot, relPath, content) {
|
|
|
32
34
|
fs.writeFileSync(full, content, 'utf8');
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
// Used by `altors new` — reads from bundled project-template (fast, works offline)
|
|
35
38
|
async function injectScaffolding(projectRoot) {
|
|
36
39
|
const results = { ok: [], failed: [] };
|
|
37
40
|
|
|
38
41
|
for (const entry of SCAFFOLD_MANIFEST) {
|
|
42
|
+
const src = path.join(TEMPLATE_DIR, entry.template);
|
|
39
43
|
try {
|
|
40
|
-
|
|
41
|
-
const content = await fetchRemoteFile(entry.remote);
|
|
44
|
+
const content = fs.readFileSync(src, 'utf8');
|
|
42
45
|
writeFile(projectRoot, entry.local, content);
|
|
43
|
-
|
|
46
|
+
console.log(` ${chalk.green('✓')} ${entry.local}`);
|
|
44
47
|
results.ok.push(entry.local);
|
|
45
48
|
} catch (err) {
|
|
46
|
-
|
|
49
|
+
console.log(` ${chalk.red('✗')} ${entry.local} ${chalk.dim(`(${err.message})`)}`);
|
|
47
50
|
results.failed.push(entry.local);
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -51,8 +54,8 @@ async function injectScaffolding(projectRoot) {
|
|
|
51
54
|
return results;
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
// Used by `altors update` — fetches latest from remote distribution repo
|
|
54
58
|
async function updateScaffolding(projectRoot) {
|
|
55
|
-
// Same as inject but reports updated vs new
|
|
56
59
|
const results = { updated: [], added: [], failed: [] };
|
|
57
60
|
|
|
58
61
|
for (const entry of SCAFFOLD_MANIFEST) {
|
|
@@ -60,7 +63,7 @@ async function updateScaffolding(projectRoot) {
|
|
|
60
63
|
const exists = fs.existsSync(fullPath);
|
|
61
64
|
try {
|
|
62
65
|
process.stdout.write(chalk.dim(` Fetching ${entry.local}...`));
|
|
63
|
-
const content = await fetchRemoteFile(entry.
|
|
66
|
+
const content = await fetchRemoteFile(`project-template/${entry.template}`);
|
|
64
67
|
writeFile(projectRoot, entry.local, content);
|
|
65
68
|
const label = exists ? chalk.blue('↑') : chalk.green('+');
|
|
66
69
|
process.stdout.write(`\r ${label} ${entry.local}\n`);
|