@machineblocks/cli 0.1.0 → 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/blocks/com/machineblocks/bml/cli/Library.bml +1 -1
- package/blocks/com/machineblocks/bml/cli/README.bml +1 -0
- package/blocks/com/machineblocks/bml/cli/documentation/Commands.bml +16 -67
- package/blocks/com/machineblocks/bml/cli/documentation/CompileCommand.bml +126 -0
- package/blocks/com/machineblocks/bml/cli/documentation/DualCliModel.bml +5 -0
- package/blocks/com/machineblocks/bml/cli/documentation/Help.bml +49 -0
- package/blocks/com/machineblocks/bml/cli/documentation/InitCommand.bml +92 -0
- package/blocks/com/machineblocks/bml/cli/documentation/Installation.bml +14 -3
- package/blocks/com/machineblocks/bml/cli/documentation/ValidateCommand.bml +59 -0
- package/dist/args.d.ts +10 -1
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +56 -12
- package/dist/args.js.map +1 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +7 -3
- package/dist/execute.js.map +1 -1
- package/dist/help.d.ts +16 -2
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +158 -17
- package/dist/help.js.map +1 -1
- package/dist/init-command.d.ts +4 -0
- package/dist/init-command.d.ts.map +1 -0
- package/dist/init-command.js +128 -0
- package/dist/init-command.js.map +1 -0
- package/package.json +10 -7
|
@@ -8,81 +8,30 @@
|
|
|
8
8
|
core:Documentation
|
|
9
9
|
</baseType>
|
|
10
10
|
<is>
|
|
11
|
-
|
|
11
|
+
Command inventory
|
|
12
12
|
</is>
|
|
13
|
-
<documentation
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
<documentation>
|
|
14
|
+
<![CDATA[
|
|
15
|
+
Host commands:
|
|
16
|
+
• validate — parser + semantic check; no SCAD target; no output files
|
|
17
|
+
• compile — render machineblocks-v3-scad for one type selector; writes under srcDir
|
|
18
|
+
• init — scaffold a BlockML project and record the MachineBlocks profile
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- Exit 0 success, 1 diagnostics, 2 config or usage.
|
|
20
|
-
- Does not register the SCAD target and does not write SCAD.
|
|
21
|
-
- A file argument validates that file. --all validates the reachable corpus.
|
|
22
|
-
file and --all together exit 2.
|
|
23
|
-
|
|
24
|
-
machineblocks compile <source-selector>
|
|
25
|
-
- Compiles with target machineblocks-v3-scad.
|
|
26
|
-
- The selector is one BlockML type selector: an exact block FQN, a package
|
|
27
|
-
selector ending in .*, or a recursive selector ending in .**.
|
|
28
|
-
Resolution is scanTypes from the BlockML framework. This host does not
|
|
29
|
-
define a second selector language.
|
|
30
|
-
- --source-package <FQN> is the source package root for an explicit mapping.
|
|
31
|
-
- --target-package <FQN> is the target package root. It is not a directory
|
|
32
|
-
and not the FQN of one output file.
|
|
33
|
-
- --help shows this command.
|
|
34
|
-
- There is no --out and no --all. The output root is the configured srcDir
|
|
35
|
-
(default blocks).
|
|
36
|
-
- A selector only chooses blocks. It does not by itself choose the target
|
|
37
|
-
package, except that a package selector (a final .* or .** segment)
|
|
38
|
-
supplies the source root when --target-package is set and
|
|
39
|
-
--source-package is omitted. An exact block FQN does not supply a source
|
|
40
|
-
root.
|
|
41
|
-
- --source-package without --target-package exits 2 with
|
|
42
|
-
MB_SOURCE_PACKAGE_ALONE.
|
|
43
|
-
- --target-package without a derivable source root exits 2 with
|
|
44
|
-
MB_SOURCE_PACKAGE_REQUIRED.
|
|
45
|
-
- A missing selector, an unknown flag, or a selector scanTypes rejects
|
|
46
|
-
exits 2.
|
|
47
|
-
- Types whose baseType chain is neither com.machineblocks.bml.core.Block
|
|
48
|
-
nor com.machineblocks.bml.core.Set are skipped. If none remain, the host
|
|
49
|
-
exits 1 with MB_SELECTOR_EMPTY and the selector text.
|
|
50
|
-
- Mapping failures, collisions, and paths that leave srcDir or would
|
|
51
|
-
overwrite a .bml file exit 1. No output file is written unless every
|
|
52
|
-
selected block has a target FQN and a legal path, and every compile
|
|
53
|
-
succeeded.
|
|
54
|
-
- Exit 0 writes the SCAD or preset JSON files and a sibling .map when the
|
|
55
|
-
target attached a source map.
|
|
56
|
-
|
|
57
|
-
Host diagnostic codes:
|
|
58
|
-
|
|
59
|
-
- MB_SOURCE_PACKAGE_ALONE — --source-package without --target-package.
|
|
60
|
-
- MB_SOURCE_PACKAGE_REQUIRED — --target-package and the source root is not
|
|
61
|
-
determined. The message names --source-package.
|
|
62
|
-
- MB_SELECTOR_EMPTY — the selector matched no Block or Set.
|
|
63
|
-
- MB_TARGET_COLLISION — two selected blocks share a target FQN or output path.
|
|
64
|
-
- MB_OUTPUT_ESCAPES_SRC — a resolved path is outside srcDir.
|
|
65
|
-
- MB_OUTPUT_OVERWRITES_BML — a resolved path is an existing .bml file.
|
|
66
|
-
|
|
67
|
-
Mapping codes MB_TARGET_PACKAGE_UNDETERMINED, MB_TARGET_PACKAGE_AMBIGUOUS,
|
|
68
|
-
and MB_SOURCE_OUTSIDE_ROOT are defined with the manifestation rules.
|
|
69
|
-
|
|
70
|
-
machineblocks --help
|
|
71
|
-
- Lists these commands.
|
|
72
|
-
- Points advanced users to blockml --help for search, inspect, graph,
|
|
73
|
-
transform, new, and init.
|
|
74
|
-
|
|
75
|
-
Not in this host surface (still available via blockml if that package
|
|
76
|
-
is installed): watch, search, inspect, graph, transform, scaffolding, xsd
|
|
77
|
-
toggle, thumbnail generation.
|
|
20
|
+
Not on this host (use blockml when that package is installed): watch, search,
|
|
21
|
+
scan, inspect, graph, transform, new, agents-md, xsd toggle, thumbnail generation.
|
|
78
22
|
|
|
79
23
|
Per-target matrix entry this host satisfies:
|
|
80
24
|
|
|
81
25
|
machineblocks-v3-scad — document target; selected by type selector;
|
|
82
26
|
written under srcDir; registered by @machineblocks/cli, not by @blockml/cli.
|
|
83
27
|
|
|
84
|
-
|
|
28
|
+
Printed operator help: clidoc:Help (root) and each command documentation Printed help section.
|
|
29
|
+
]]>
|
|
30
|
+
</documentation>
|
|
85
31
|
<references>
|
|
86
|
-
<see type="clidoc:
|
|
32
|
+
<see type="clidoc:Help" relation="ReadNext" />
|
|
33
|
+
<see type="clidoc:ValidateCommand" relation="SeeAlso" />
|
|
34
|
+
<see type="clidoc:CompileCommand" relation="SeeAlso" />
|
|
35
|
+
<see type="clidoc:InitCommand" relation="SeeAlso" />
|
|
87
36
|
</references>
|
|
88
37
|
</clidoc:Commands>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<!--CLI Documentation — CompileCommand
|
|
2
|
+
FQN: com.machineblocks.bml.cli.documentation.CompileCommand-->
|
|
3
|
+
<clidoc:CompileCommand xmlns="http://blockml.org/bml"
|
|
4
|
+
xmlns:core="org.blockml.bml.core"
|
|
5
|
+
xmlns:clidoc="com.machineblocks.bml.cli.documentation"
|
|
6
|
+
xmlns:rdoc="com.machineblocks.bml.target.render.documentation">
|
|
7
|
+
|
|
8
|
+
<baseType>
|
|
9
|
+
core:Documentation
|
|
10
|
+
</baseType>
|
|
11
|
+
<is>
|
|
12
|
+
machineblocks compile specification
|
|
13
|
+
</is>
|
|
14
|
+
<documentation>
|
|
15
|
+
<![CDATA[
|
|
16
|
+
Syntax:
|
|
17
|
+
machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
18
|
+
|
|
19
|
+
Compiles with target machineblocks-v3-scad. The command does not take a
|
|
20
|
+
target name.
|
|
21
|
+
The selector is one BlockML type selector: an exact block FQN, a package
|
|
22
|
+
selector ending in .*, or a recursive selector ending in .**.
|
|
23
|
+
Resolution is scanTypes from the BlockML framework. This host does not
|
|
24
|
+
define a second selector language.
|
|
25
|
+
Quote tokens that contain * or ** so the shell does not expand them.
|
|
26
|
+
--source-package <FQN> is the source package root for an explicit mapping.
|
|
27
|
+
--target-package <FQN> is the target package root. It is not a directory
|
|
28
|
+
and not the FQN of one output file.
|
|
29
|
+
There is no --out and no --all. The output root is the configured srcDir
|
|
30
|
+
(default blocks).
|
|
31
|
+
A selector only chooses blocks. It does not by itself choose the target
|
|
32
|
+
package, except that a package selector (a final .* or .** segment)
|
|
33
|
+
supplies the source root when --target-package is set and
|
|
34
|
+
--source-package is omitted. An exact block FQN does not supply a source
|
|
35
|
+
root.
|
|
36
|
+
--source-package without --target-package exits 2 with
|
|
37
|
+
MB_SOURCE_PACKAGE_ALONE.
|
|
38
|
+
--target-package without a derivable source root exits 2 with
|
|
39
|
+
MB_SOURCE_PACKAGE_REQUIRED. The message names --source-package.
|
|
40
|
+
A missing selector, an unknown flag, or a selector scanTypes rejects
|
|
41
|
+
exits 2.
|
|
42
|
+
Types whose baseType chain is neither com.machineblocks.bml.core.Block
|
|
43
|
+
nor com.machineblocks.bml.core.Set are skipped. If none remain, the host
|
|
44
|
+
exits 1 with MB_SELECTOR_EMPTY and the selector text.
|
|
45
|
+
Mapping failures, collisions, and paths that leave srcDir or would
|
|
46
|
+
overwrite a .bml file exit 1. No output file is written unless every
|
|
47
|
+
selected block has a target FQN and a legal path, and every compile
|
|
48
|
+
succeeded.
|
|
49
|
+
Exit 0 writes the SCAD or preset JSON files and a sibling .map when the
|
|
50
|
+
target attached a source map, then prints Wrote N file(s) to <srcDir>.
|
|
51
|
+
N counts every written file, including a sibling .map.
|
|
52
|
+
|
|
53
|
+
Automatic mapping replaces the one bml segment with scad. An explicit
|
|
54
|
+
mapping swaps sourcePackage for targetPackage and does not apply that
|
|
55
|
+
replacement on top. The path rules and the codes
|
|
56
|
+
MB_TARGET_PACKAGE_UNDETERMINED, MB_TARGET_PACKAGE_AMBIGUOUS, and
|
|
57
|
+
MB_SOURCE_OUTSIDE_ROOT are specified by rdoc:FqnNaming.
|
|
58
|
+
|
|
59
|
+
Host diagnostic codes:
|
|
60
|
+
|
|
61
|
+
- MB_SOURCE_PACKAGE_ALONE — --source-package without --target-package.
|
|
62
|
+
- MB_SOURCE_PACKAGE_REQUIRED — --target-package and the source root is not
|
|
63
|
+
determined. The message names --source-package.
|
|
64
|
+
- MB_SELECTOR_EMPTY — the selector matched no Block or Set.
|
|
65
|
+
- MB_TARGET_COLLISION — two selected blocks share a target FQN or output path.
|
|
66
|
+
- MB_OUTPUT_ESCAPES_SRC — a resolved path is outside srcDir.
|
|
67
|
+
- MB_OUTPUT_OVERWRITES_BML — a resolved path is an existing .bml file.
|
|
68
|
+
- MB_EMPTY_BLOCK — a composite has nothing to render.
|
|
69
|
+
|
|
70
|
+
blockml.config.json srcDir is the output root. mbLibPath defaults to the
|
|
71
|
+
installed @machineblocks/core package. openscadPath is unused by compile.
|
|
72
|
+
A missing mbLibPath and a missing @machineblocks/core install exit 2.
|
|
73
|
+
|
|
74
|
+
Printed help:
|
|
75
|
+
Usage: machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
76
|
+
machineblocks compile --help
|
|
77
|
+
|
|
78
|
+
When: render selected Block and Set types to OpenSCAD. Change BML first, then recompile.
|
|
79
|
+
|
|
80
|
+
Target is machineblocks-v3-scad. The command does not take a target name.
|
|
81
|
+
The selector is one BlockML type selector: an exact FQN, pkg.*, or pkg.**.
|
|
82
|
+
Quote tokens that contain * or ** so the shell does not expand them.
|
|
83
|
+
Resolution is scanTypes. This host does not define a second selector language.
|
|
84
|
+
Types whose baseType chain is neither com.machineblocks.bml.core.Block nor
|
|
85
|
+
com.machineblocks.bml.core.Set are skipped.
|
|
86
|
+
|
|
87
|
+
Output is written under the configured srcDir (default blocks). There is no --out and no --all.
|
|
88
|
+
A package selector (a final .* or .** segment) supplies the source root when
|
|
89
|
+
--target-package is set and --source-package is omitted. An exact block FQN does not.
|
|
90
|
+
Automatic mapping replaces the one bml segment with scad.
|
|
91
|
+
com.example.bml.bricks.MyBrick becomes blocks/com/example/scad/bricks/MyBrick.scad.
|
|
92
|
+
Explicit mapping swaps --source-package for --target-package and does not apply that replacement again.
|
|
93
|
+
|
|
94
|
+
Flags:
|
|
95
|
+
--source-package <FQN> source package root for an explicit mapping
|
|
96
|
+
--target-package <FQN> target package root. Not a directory and not one output file.
|
|
97
|
+
|
|
98
|
+
--source-package without --target-package exits 2 (MB_SOURCE_PACKAGE_ALONE).
|
|
99
|
+
--target-package without a derivable source root exits 2 (MB_SOURCE_PACKAGE_REQUIRED).
|
|
100
|
+
A missing selector, an unknown flag, or a selector scanTypes rejects exits 2.
|
|
101
|
+
If no Block or Set remains, exit 1 (MB_SELECTOR_EMPTY) and the message names the selector.
|
|
102
|
+
|
|
103
|
+
Exit 0 writes the SCAD or preset JSON files and a sibling .map when the target attached a source map.
|
|
104
|
+
The status line is Wrote N file(s) to <srcDir>. N counts every written file, including a sibling .map.
|
|
105
|
+
One failure writes nothing. Mapping failures, collisions, and illegal paths exit 1:
|
|
106
|
+
MB_TARGET_COLLISION — two selected blocks share a target FQN or output path.
|
|
107
|
+
MB_OUTPUT_ESCAPES_SRC — a resolved path is outside srcDir.
|
|
108
|
+
MB_OUTPUT_OVERWRITES_BML — a resolved path is an existing .bml file.
|
|
109
|
+
MB_TARGET_PACKAGE_UNDETERMINED — the source FQN has no bml segment.
|
|
110
|
+
MB_TARGET_PACKAGE_AMBIGUOUS — the source FQN has more than one bml segment.
|
|
111
|
+
MB_SOURCE_OUTSIDE_ROOT — a selected block is outside --source-package.
|
|
112
|
+
MB_EMPTY_BLOCK — a composite has nothing to render.
|
|
113
|
+
|
|
114
|
+
blockml.config.json srcDir is the output root. mbLibPath defaults to the installed
|
|
115
|
+
@machineblocks/core package. openscadPath is unused by compile.
|
|
116
|
+
A missing mbLibPath and a missing @machineblocks/core install exit 2.
|
|
117
|
+
|
|
118
|
+
Related: validate. Search, inspect, graph, and new stay on blockml.
|
|
119
|
+
]]>
|
|
120
|
+
</documentation>
|
|
121
|
+
<references>
|
|
122
|
+
<see type="clidoc:InitCommand" relation="ReadNext" />
|
|
123
|
+
<see type="clidoc:ValidateCommand" relation="SeeAlso" />
|
|
124
|
+
<see type="rdoc:FqnNaming" relation="SeeAlso" />
|
|
125
|
+
</references>
|
|
126
|
+
</clidoc:CompileCommand>
|
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
BlockRenderEngine.
|
|
28
28
|
- Same validate and compile facade underneath. Defaults differ.
|
|
29
29
|
- Does not reimplement parse, validate, or emit.
|
|
30
|
+
- init calls initProject from @blockml/cli, then adds devDependency
|
|
31
|
+
@machineblocks/cli and library dependency com.machineblocks.bml.Library.
|
|
32
|
+
--install then runs npm install and GenerateAgentsMd in that order:
|
|
33
|
+
profile first, then the same install and AGENTS.md step as initProject.
|
|
34
|
+
The universal init stays domain-agnostic.
|
|
30
35
|
|
|
31
36
|
Interop: a later plugin load (targetPackages in blockml.config.json mapping
|
|
32
37
|
machineblocks-v3-scad to @machineblocks/render-target) may let the universal
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!--CLI Documentation — Help
|
|
2
|
+
FQN: com.machineblocks.bml.cli.documentation.Help-->
|
|
3
|
+
<clidoc:Help xmlns="http://blockml.org/bml"
|
|
4
|
+
xmlns:core="org.blockml.bml.core"
|
|
5
|
+
xmlns:clidoc="com.machineblocks.bml.cli.documentation">
|
|
6
|
+
|
|
7
|
+
<baseType>
|
|
8
|
+
core:Documentation
|
|
9
|
+
</baseType>
|
|
10
|
+
<is>
|
|
11
|
+
Printed root help page for machineblocks --help
|
|
12
|
+
</is>
|
|
13
|
+
<documentation>
|
|
14
|
+
<![CDATA[
|
|
15
|
+
Usage: machineblocks <command> [options]
|
|
16
|
+
machineblocks --help
|
|
17
|
+
|
|
18
|
+
machineblocks is the MachineBlocks host CLI.
|
|
19
|
+
|
|
20
|
+
It renders BML to OpenSCAD that matches the V3 SCAD library.
|
|
21
|
+
BML is the editable source of truth. Change BML first, then compile.
|
|
22
|
+
This host registers target machineblocks-v3-scad. It does not reimplement parse, validate, or emit.
|
|
23
|
+
|
|
24
|
+
Invocation: npx machineblocks <command>
|
|
25
|
+
Requires Node.js 20 or newer.
|
|
26
|
+
A new project starts with npx @machineblocks/cli init <package-fqn>.
|
|
27
|
+
|
|
28
|
+
Commands:
|
|
29
|
+
validate Parser + semantic check. Same project check as blockml validate.
|
|
30
|
+
Does not write SCAD.
|
|
31
|
+
machineblocks validate [--all] [<file>]
|
|
32
|
+
compile Render selected Block and Set types to SCAD under srcDir.
|
|
33
|
+
machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
34
|
+
init Scaffold a BlockML project and record the MachineBlocks profile.
|
|
35
|
+
machineblocks init <package-fqn> [--src dir] [--install]
|
|
36
|
+
|
|
37
|
+
Search, scan, inspect, graph, new, agents-md, and transform stay on blockml.
|
|
38
|
+
Exit codes: 0 success, 1 diagnostic errors, 2 usage or configuration error.
|
|
39
|
+
|
|
40
|
+
Run `machineblocks <command> --help` for flags, defaults, output, and constraints.
|
|
41
|
+
]]>
|
|
42
|
+
</documentation>
|
|
43
|
+
<references>
|
|
44
|
+
<see type="clidoc:Commands" relation="SeeAlso" />
|
|
45
|
+
<see type="clidoc:ValidateCommand" relation="SeeAlso" />
|
|
46
|
+
<see type="clidoc:CompileCommand" relation="SeeAlso" />
|
|
47
|
+
<see type="clidoc:InitCommand" relation="SeeAlso" />
|
|
48
|
+
</references>
|
|
49
|
+
</clidoc:Help>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<!--CLI Documentation — InitCommand
|
|
2
|
+
FQN: com.machineblocks.bml.cli.documentation.InitCommand-->
|
|
3
|
+
<clidoc:InitCommand xmlns="http://blockml.org/bml"
|
|
4
|
+
xmlns:core="org.blockml.bml.core"
|
|
5
|
+
xmlns:clidoc="com.machineblocks.bml.cli.documentation">
|
|
6
|
+
|
|
7
|
+
<baseType>
|
|
8
|
+
core:Documentation
|
|
9
|
+
</baseType>
|
|
10
|
+
<is>
|
|
11
|
+
machineblocks init specification
|
|
12
|
+
</is>
|
|
13
|
+
<documentation>
|
|
14
|
+
<![CDATA[
|
|
15
|
+
Syntax:
|
|
16
|
+
machineblocks init <package-fqn> [--src dir] [--install]
|
|
17
|
+
|
|
18
|
+
Scaffolds a BlockML project by calling initProject from @blockml/cli
|
|
19
|
+
with install false, then records the MachineBlocks profile. It does not
|
|
20
|
+
spawn blockml init. The profile is recorded before npm install so the
|
|
21
|
+
installed corpus is the project this command just wrote.
|
|
22
|
+
PACKAGE-FQN is a dotted package identifier, not ….Library. A bml segment
|
|
23
|
+
after the domain is recommended. Compile maps a bml segment to scad.
|
|
24
|
+
--src changes the source directory (default blocks).
|
|
25
|
+
--install runs npm install after the profile is recorded, then generates
|
|
26
|
+
AGENTS.md when the file is missing, by the same step as initProject.
|
|
27
|
+
At least one section or rule writes AGENTS.md. No AgentInstructions
|
|
28
|
+
content leaves the file unwritten and prints
|
|
29
|
+
"No AgentInstructions blocks found."; the init exit code stays 0.
|
|
30
|
+
An existing AGENTS.md is left in place. The next-step line from the
|
|
31
|
+
earlier initProject pass is dropped, because install already ran.
|
|
32
|
+
Without --install, the only AGENTS.md pass is the one inside initProject,
|
|
33
|
+
before dependencies are installed. The file is written when those
|
|
34
|
+
packages already resolve. Otherwise initProject's next line remains:
|
|
35
|
+
npm install && npx blockml agents-md generate.
|
|
36
|
+
CLAUDE.md (@AGENTS.md) is written by initProject when missing.
|
|
37
|
+
The profile adds @machineblocks/cli to devDependencies when that package
|
|
38
|
+
is absent from dependencies and devDependencies. The range is the caret
|
|
39
|
+
range of this host. An existing dependencies entry stays put.
|
|
40
|
+
The project Library.bml gains a dependencies composition child
|
|
41
|
+
com.machineblocks.bml.Library. An existing child is left in place.
|
|
42
|
+
Existing files are not replaced.
|
|
43
|
+
A package FQN without a bml segment still exits 0 and warns:
|
|
44
|
+
Package FQN has no bml segment. Compile maps a bml segment to scad.
|
|
45
|
+
Exit codes match initProject: 0 success, 1 write or install failure,
|
|
46
|
+
2 usage or an invalid package FQN.
|
|
47
|
+
|
|
48
|
+
Printed help:
|
|
49
|
+
Usage: machineblocks init <package-fqn> [--src dir] [--install]
|
|
50
|
+
machineblocks init --help
|
|
51
|
+
|
|
52
|
+
When: turn a directory into a MachineBlocks project. Scaffolds a BlockML project,
|
|
53
|
+
then records the MachineBlocks profile.
|
|
54
|
+
|
|
55
|
+
PACKAGE-FQN is a dotted package identifier (not …Library). A bml segment after
|
|
56
|
+
the domain is recommended. Compile maps a bml segment to scad.
|
|
57
|
+
A package FQN without a bml segment still exits 0 and warns.
|
|
58
|
+
Does not overwrite existing files.
|
|
59
|
+
Does not spawn blockml init. Calls initProject from @blockml/cli with install
|
|
60
|
+
false, then records the profile before npm install.
|
|
61
|
+
|
|
62
|
+
The profile adds @machineblocks/cli to devDependencies when that package is
|
|
63
|
+
absent from dependencies and devDependencies. The range is the caret range of
|
|
64
|
+
this host. An existing dependencies entry stays put.
|
|
65
|
+
The project Library.bml gains com.machineblocks.bml.Library.
|
|
66
|
+
CLAUDE.md (@AGENTS.md) is written when missing.
|
|
67
|
+
|
|
68
|
+
Flags:
|
|
69
|
+
--src dir source directory (default blocks)
|
|
70
|
+
--install run npm install after the profile is recorded, then generate
|
|
71
|
+
AGENTS.md the same way as blockml init
|
|
72
|
+
|
|
73
|
+
Without --install, AGENTS.md is generated only inside initProject, before
|
|
74
|
+
dependencies are installed. The file is written when AgentInstructions already
|
|
75
|
+
resolve. Otherwise the next step remains: npm install && npx blockml agents-md generate.
|
|
76
|
+
With --install, an existing AGENTS.md is left in place. When the file is missing,
|
|
77
|
+
generation runs after npm install. Sections or rules write AGENTS.md.
|
|
78
|
+
No AgentInstructions content leaves the file unwritten and prints
|
|
79
|
+
No AgentInstructions blocks found. The init exit code stays 0.
|
|
80
|
+
The next-step line from the earlier initProject pass is dropped, because install already ran.
|
|
81
|
+
|
|
82
|
+
Exit codes match initProject: 0 success, 1 write or install failure,
|
|
83
|
+
2 usage or an invalid package FQN.
|
|
84
|
+
|
|
85
|
+
Related: validate, compile. agents-md and new stay on blockml.
|
|
86
|
+
]]>
|
|
87
|
+
</documentation>
|
|
88
|
+
<references>
|
|
89
|
+
<see type="clidoc:Configuration" relation="ReadNext" />
|
|
90
|
+
<see type="clidoc:Commands" relation="SeeAlso" />
|
|
91
|
+
</references>
|
|
92
|
+
</clidoc:InitCommand>
|
|
@@ -13,13 +13,24 @@
|
|
|
13
13
|
<documentation>
|
|
14
14
|
Consumer project (the usual path):
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
npx @machineblocks/cli init com.example.bml
|
|
17
17
|
npx machineblocks validate
|
|
18
18
|
npx machineblocks compile com.example.bml.bricks.MyBrick
|
|
19
19
|
|
|
20
|
+
init calls the universal project scaffold, then records @machineblocks/cli
|
|
21
|
+
as a devDependency and adds com.machineblocks.bml.Library to the project
|
|
22
|
+
library. Pass --install to run npm install after that profile is recorded
|
|
23
|
+
and then generate AGENTS.md the same way blockml init does. Without
|
|
24
|
+
--install, AGENTS.md is generated only when AgentInstructions already
|
|
25
|
+
resolve; otherwise the next step is npm install and
|
|
26
|
+
npx blockml agents-md generate. On a project that blockml init
|
|
27
|
+
already created, the same command adds only the missing profile and does
|
|
28
|
+
not replace existing files.
|
|
29
|
+
|
|
20
30
|
That install brings @machineblocks/render-target, @blockml/block-render-engine,
|
|
21
|
-
@machineblocks/core, and the BlockML compiler packages.
|
|
22
|
-
|
|
31
|
+
@machineblocks/core, and the BlockML compiler packages. init also records
|
|
32
|
+
@blockml/core and @blockml/cli. A bml segment in the package FQN lets
|
|
33
|
+
compile map the output package to scad.
|
|
23
34
|
|
|
24
35
|
From this monorepo while the bin is not published:
|
|
25
36
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!--CLI Documentation — ValidateCommand
|
|
2
|
+
FQN: com.machineblocks.bml.cli.documentation.ValidateCommand-->
|
|
3
|
+
<clidoc:ValidateCommand xmlns="http://blockml.org/bml"
|
|
4
|
+
xmlns:core="org.blockml.bml.core"
|
|
5
|
+
xmlns:clidoc="com.machineblocks.bml.cli.documentation">
|
|
6
|
+
|
|
7
|
+
<baseType>
|
|
8
|
+
core:Documentation
|
|
9
|
+
</baseType>
|
|
10
|
+
<is>
|
|
11
|
+
machineblocks validate specification
|
|
12
|
+
</is>
|
|
13
|
+
<documentation>
|
|
14
|
+
<![CDATA[
|
|
15
|
+
Syntax:
|
|
16
|
+
machineblocks validate [file] [--all]
|
|
17
|
+
|
|
18
|
+
Same project validate as blockml validate.
|
|
19
|
+
Does not register machineblocks-v3-scad and does not write SCAD.
|
|
20
|
+
A file argument parses that file and runs compileBmlToBom against the
|
|
21
|
+
full project registry.
|
|
22
|
+
Default (no file, no --all): semantic-validate project sources only
|
|
23
|
+
(this package srcDir plus local packages/*). npm libraries stay on the
|
|
24
|
+
registry for resolve.
|
|
25
|
+
--all semantic-validates every document in the registry, including npm.
|
|
26
|
+
file and --all together exit 2.
|
|
27
|
+
Exit 0 success, 1 diagnostics, 2 config or usage.
|
|
28
|
+
After diagnostics: Validated N block(s). or Validated N block(s) with errors.
|
|
29
|
+
This host does not accept --src, --libraries, or --verbose. Those flags
|
|
30
|
+
belong to blockml validate.
|
|
31
|
+
|
|
32
|
+
Printed help:
|
|
33
|
+
Usage: machineblocks validate [--all] [<file>]
|
|
34
|
+
machineblocks validate --help
|
|
35
|
+
|
|
36
|
+
When: check the model after edits. Ordinary project work.
|
|
37
|
+
|
|
38
|
+
Default (no file, no --all): semantic-validate project sources only (this package srcDir plus local packages/*). npm libraries stay on the registry for resolve.
|
|
39
|
+
--all: semantic-validate every document in the registry, including npm. Do not use --all as the default after every edit.
|
|
40
|
+
Single file: parse + compileBmlToBom against the full project registry.
|
|
41
|
+
file and --all together exit 2.
|
|
42
|
+
|
|
43
|
+
Does not register machineblocks-v3-scad. No output files written.
|
|
44
|
+
This host does not accept --src, --libraries, or --verbose.
|
|
45
|
+
|
|
46
|
+
Flags:
|
|
47
|
+
--all entire reachable corpus, including npm
|
|
48
|
+
|
|
49
|
+
Exit 0 on success; 1 on diagnostic errors; 2 on config or usage errors.
|
|
50
|
+
After diagnostics: Validated N block(s). or Validated N block(s) with errors.
|
|
51
|
+
|
|
52
|
+
Related: compile. Search, scan, inspect, and graph stay on blockml.
|
|
53
|
+
]]>
|
|
54
|
+
</documentation>
|
|
55
|
+
<references>
|
|
56
|
+
<see type="clidoc:CompileCommand" relation="ReadNext" />
|
|
57
|
+
<see type="clidoc:Help" relation="SeeAlso" />
|
|
58
|
+
</references>
|
|
59
|
+
</clidoc:ValidateCommand>
|
package/dist/args.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type HelpTopic = "validate" | "compile" | "init";
|
|
1
2
|
export interface ValidateArgs {
|
|
2
3
|
command: "validate";
|
|
3
4
|
file?: string;
|
|
@@ -9,11 +10,19 @@ export interface CompileArgs {
|
|
|
9
10
|
sourcePackage?: string;
|
|
10
11
|
targetPackage?: string;
|
|
11
12
|
}
|
|
13
|
+
export interface InitArgs {
|
|
14
|
+
command: "init";
|
|
15
|
+
packageFqn: string;
|
|
16
|
+
srcDir?: string;
|
|
17
|
+
install: boolean;
|
|
18
|
+
}
|
|
12
19
|
export type HostCommand = {
|
|
13
20
|
command: "help";
|
|
14
|
-
|
|
21
|
+
topic?: HelpTopic;
|
|
22
|
+
} | ValidateArgs | CompileArgs | InitArgs | {
|
|
15
23
|
command: "usage";
|
|
16
24
|
message: string;
|
|
25
|
+
topic?: HelpTopic;
|
|
17
26
|
};
|
|
18
27
|
export declare function parseArgs(argv: readonly string[]): HostCommand;
|
|
19
28
|
/** A final .* or .** segment denotes a package. An exact type FQN does not. */
|
package/dist/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,GACtC,YAAY,GACZ,WAAW,GACX,QAAQ,GACR;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE7D,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAe9D;AAoHD,+EAA+E;AAC/E,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO9E"}
|
package/dist/args.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { COMPILE_HELP } from "./help.js";
|
|
2
1
|
export function parseArgs(argv) {
|
|
3
2
|
if (argv.length === 0 || argv[0] === "--help" || argv[0] === "help") {
|
|
4
3
|
return { command: "help" };
|
|
@@ -10,35 +9,38 @@ export function parseArgs(argv) {
|
|
|
10
9
|
if (command === "compile") {
|
|
11
10
|
return parseCompile(rest);
|
|
12
11
|
}
|
|
12
|
+
if (command === "init") {
|
|
13
|
+
return parseInit(rest);
|
|
14
|
+
}
|
|
13
15
|
return { command: "usage", message: `Unknown command: ${command ?? ""}` };
|
|
14
16
|
}
|
|
15
17
|
function parseValidate(args) {
|
|
18
|
+
if (args.includes("--help")) {
|
|
19
|
+
return { command: "help", topic: "validate" };
|
|
20
|
+
}
|
|
16
21
|
let file;
|
|
17
22
|
let all = false;
|
|
18
23
|
for (const arg of args) {
|
|
19
|
-
if (arg === "--help") {
|
|
20
|
-
return { command: "help" };
|
|
21
|
-
}
|
|
22
24
|
if (arg === "--all") {
|
|
23
25
|
all = true;
|
|
24
26
|
continue;
|
|
25
27
|
}
|
|
26
28
|
if (arg.startsWith("--")) {
|
|
27
|
-
return { command: "usage", message: `Unknown option: ${arg}
|
|
29
|
+
return { command: "usage", message: `Unknown option: ${arg}`, topic: "validate" };
|
|
28
30
|
}
|
|
29
31
|
if (file !== undefined) {
|
|
30
|
-
return { command: "usage", message: "validate accepts one file." };
|
|
32
|
+
return { command: "usage", message: "validate accepts one file.", topic: "validate" };
|
|
31
33
|
}
|
|
32
34
|
file = arg;
|
|
33
35
|
}
|
|
34
36
|
if (file !== undefined && all) {
|
|
35
|
-
return { command: "usage", message: "Specify either <file> or --all, not both." };
|
|
37
|
+
return { command: "usage", message: "Specify either <file> or --all, not both.", topic: "validate" };
|
|
36
38
|
}
|
|
37
39
|
return file === undefined ? { command: "validate", all } : { command: "validate", all, file };
|
|
38
40
|
}
|
|
39
41
|
function parseCompile(args) {
|
|
40
42
|
if (args.includes("--help")) {
|
|
41
|
-
return { command: "help" };
|
|
43
|
+
return { command: "help", topic: "compile" };
|
|
42
44
|
}
|
|
43
45
|
let selector;
|
|
44
46
|
let sourcePackage;
|
|
@@ -51,7 +53,7 @@ function parseCompile(args) {
|
|
|
51
53
|
if (arg === "--source-package" || arg === "--target-package") {
|
|
52
54
|
const value = args[index + 1];
|
|
53
55
|
if (value === undefined || value.startsWith("--")) {
|
|
54
|
-
return { command: "usage", message: `${arg} requires a package FQN
|
|
56
|
+
return { command: "usage", message: `${arg} requires a package FQN.`, topic: "compile" };
|
|
55
57
|
}
|
|
56
58
|
if (arg === "--source-package") {
|
|
57
59
|
sourcePackage = value;
|
|
@@ -63,15 +65,15 @@ function parseCompile(args) {
|
|
|
63
65
|
continue;
|
|
64
66
|
}
|
|
65
67
|
if (arg.startsWith("--")) {
|
|
66
|
-
return { command: "usage", message: `Unknown option: ${arg}
|
|
68
|
+
return { command: "usage", message: `Unknown option: ${arg}`, topic: "compile" };
|
|
67
69
|
}
|
|
68
70
|
if (selector !== undefined) {
|
|
69
|
-
return { command: "usage", message: "compile accepts one source selector." };
|
|
71
|
+
return { command: "usage", message: "compile accepts one source selector.", topic: "compile" };
|
|
70
72
|
}
|
|
71
73
|
selector = arg;
|
|
72
74
|
}
|
|
73
75
|
if (selector === undefined) {
|
|
74
|
-
return { command: "usage", message:
|
|
76
|
+
return { command: "usage", message: "compile requires a source selector.", topic: "compile" };
|
|
75
77
|
}
|
|
76
78
|
const parsed = { command: "compile", selector };
|
|
77
79
|
if (sourcePackage !== undefined) {
|
|
@@ -82,6 +84,48 @@ function parseCompile(args) {
|
|
|
82
84
|
}
|
|
83
85
|
return parsed;
|
|
84
86
|
}
|
|
87
|
+
function parseInit(args) {
|
|
88
|
+
if (args.includes("--help")) {
|
|
89
|
+
return { command: "help", topic: "init" };
|
|
90
|
+
}
|
|
91
|
+
let packageFqn;
|
|
92
|
+
let srcDir;
|
|
93
|
+
let install = false;
|
|
94
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
95
|
+
const arg = args[index];
|
|
96
|
+
if (arg === undefined) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (arg === "--install") {
|
|
100
|
+
install = true;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (arg === "--src") {
|
|
104
|
+
const value = args[index + 1];
|
|
105
|
+
if (value === undefined || value.startsWith("--")) {
|
|
106
|
+
return { command: "usage", message: "--src requires a directory.", topic: "init" };
|
|
107
|
+
}
|
|
108
|
+
srcDir = value;
|
|
109
|
+
index += 1;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
if (arg.startsWith("--")) {
|
|
113
|
+
return { command: "usage", message: `Unknown option: ${arg}`, topic: "init" };
|
|
114
|
+
}
|
|
115
|
+
if (packageFqn !== undefined) {
|
|
116
|
+
return { command: "usage", message: "init accepts one package FQN.", topic: "init" };
|
|
117
|
+
}
|
|
118
|
+
packageFqn = arg;
|
|
119
|
+
}
|
|
120
|
+
if (packageFqn === undefined) {
|
|
121
|
+
return { command: "usage", message: "init requires a package FQN.", topic: "init" };
|
|
122
|
+
}
|
|
123
|
+
const parsed = { command: "init", packageFqn, install };
|
|
124
|
+
if (srcDir !== undefined) {
|
|
125
|
+
parsed.srcDir = srcDir;
|
|
126
|
+
}
|
|
127
|
+
return parsed;
|
|
128
|
+
}
|
|
85
129
|
/** A final .* or .** segment denotes a package. An exact type FQN does not. */
|
|
86
130
|
export function sourcePackageFromSelector(selector) {
|
|
87
131
|
const parts = selector.split(".");
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AA6BA,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;QACpE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAC3B,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,E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C;IACrC,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC"}
|
package/dist/execute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKnE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAe5E"}
|
package/dist/execute.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { parseArgs } from "./args.js";
|
|
2
2
|
import { runCompile } from "./compile-command.js";
|
|
3
|
-
import {
|
|
3
|
+
import { helpFor, usageFor } from "./help.js";
|
|
4
|
+
import { runInit } from "./init-command.js";
|
|
4
5
|
import { runValidate } from "./validate-command.js";
|
|
5
6
|
export function execute(argv, rootDir) {
|
|
6
7
|
const parsed = parseArgs(argv);
|
|
7
8
|
if (parsed.command === "help") {
|
|
8
|
-
return { code: 0, lines: [
|
|
9
|
+
return { code: 0, lines: [helpFor(parsed.topic)] };
|
|
9
10
|
}
|
|
10
11
|
if (parsed.command === "usage") {
|
|
11
|
-
return { code: 2, lines: [parsed.message, "",
|
|
12
|
+
return { code: 2, lines: [parsed.message, "", usageFor(parsed.topic)] };
|
|
12
13
|
}
|
|
13
14
|
if (parsed.command === "validate") {
|
|
14
15
|
return runValidate(parsed, rootDir);
|
|
15
16
|
}
|
|
17
|
+
if (parsed.command === "init") {
|
|
18
|
+
return runInit(parsed, rootDir);
|
|
19
|
+
}
|
|
16
20
|
return runCompile(parsed, rootDir);
|
|
17
21
|
}
|
|
18
22
|
//# sourceMappingURL=execute.js.map
|
package/dist/execute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,UAAU,OAAO,CAAC,IAAuB,EAAE,OAAe;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IACrD,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IAC1E,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/help.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { HelpTopic } from "./args.js";
|
|
2
|
+
/** Short syntax printed on usage errors. Not the --help page. */
|
|
3
|
+
export declare const USAGE = "Usage: machineblocks validate [--all] [<file>]\n machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]\n machineblocks init <package-fqn> [--src dir] [--install]\n machineblocks --help";
|
|
4
|
+
export declare const VALIDATE_USAGE = "Usage: machineblocks validate [--all] [<file>]\n machineblocks validate --help";
|
|
5
|
+
export declare const COMPILE_USAGE = "Usage: machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]\n machineblocks compile --help";
|
|
6
|
+
export declare const INIT_USAGE = "Usage: machineblocks init <package-fqn> [--src dir] [--install]\n machineblocks init --help";
|
|
7
|
+
/** Root help page. SSOT: com.machineblocks.bml.cli.documentation.Help */
|
|
8
|
+
export declare const HELP = "Usage: machineblocks <command> [options]\n machineblocks --help\n\nmachineblocks is the MachineBlocks host CLI.\n\nIt renders BML to OpenSCAD that matches the V3 SCAD library.\nBML is the editable source of truth. Change BML first, then compile.\nThis host registers target machineblocks-v3-scad. It does not reimplement parse, validate, or emit.\n\nInvocation: npx machineblocks <command>\nRequires Node.js 20 or newer.\nA new project starts with npx @machineblocks/cli init <package-fqn>.\n\nCommands:\n validate Parser + semantic check. Same project check as blockml validate.\n Does not write SCAD.\n machineblocks validate [--all] [<file>]\n compile Render selected Block and Set types to SCAD under srcDir.\n machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]\n init Scaffold a BlockML project and record the MachineBlocks profile.\n machineblocks init <package-fqn> [--src dir] [--install]\n\nSearch, scan, inspect, graph, new, agents-md, and transform stay on blockml.\nExit codes: 0 success, 1 diagnostic errors, 2 usage or configuration error.\n\nRun `machineblocks <command> --help` for flags, defaults, output, and constraints.";
|
|
9
|
+
/** Printed help. SSOT: com.machineblocks.bml.cli.documentation.ValidateCommand */
|
|
10
|
+
export declare const VALIDATE_HELP = "Usage: machineblocks validate [--all] [<file>]\n machineblocks validate --help\n\nWhen: check the model after edits. Ordinary project work.\n\nDefault (no file, no --all): semantic-validate project sources only (this package srcDir plus local packages/*). npm libraries stay on the registry for resolve.\n--all: semantic-validate every document in the registry, including npm. Do not use --all as the default after every edit.\nSingle file: parse + compileBmlToBom against the full project registry.\nfile and --all together exit 2.\n\nDoes not register machineblocks-v3-scad. No output files written.\nThis host does not accept --src, --libraries, or --verbose.\n\nFlags:\n --all entire reachable corpus, including npm\n\nExit 0 on success; 1 on diagnostic errors; 2 on config or usage errors.\nAfter diagnostics: Validated N block(s). or Validated N block(s) with errors.\n\nRelated: compile. Search, scan, inspect, and graph stay on blockml.";
|
|
11
|
+
/** Printed help. SSOT: com.machineblocks.bml.cli.documentation.CompileCommand */
|
|
12
|
+
export declare const COMPILE_HELP = "Usage: machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]\n machineblocks compile --help\n\nWhen: render selected Block and Set types to OpenSCAD. Change BML first, then recompile.\n\nTarget is machineblocks-v3-scad. The command does not take a target name.\nThe selector is one BlockML type selector: an exact FQN, pkg.*, or pkg.**.\nQuote tokens that contain * or ** so the shell does not expand them.\nResolution is scanTypes. This host does not define a second selector language.\nTypes whose baseType chain is neither com.machineblocks.bml.core.Block nor\ncom.machineblocks.bml.core.Set are skipped.\n\nOutput is written under the configured srcDir (default blocks). There is no --out and no --all.\nA package selector (a final .* or .** segment) supplies the source root when\n--target-package is set and --source-package is omitted. An exact block FQN does not.\nAutomatic mapping replaces the one bml segment with scad.\ncom.example.bml.bricks.MyBrick becomes blocks/com/example/scad/bricks/MyBrick.scad.\nExplicit mapping swaps --source-package for --target-package and does not apply that replacement again.\n\nFlags:\n --source-package <FQN> source package root for an explicit mapping\n --target-package <FQN> target package root. Not a directory and not one output file.\n\n--source-package without --target-package exits 2 (MB_SOURCE_PACKAGE_ALONE).\n--target-package without a derivable source root exits 2 (MB_SOURCE_PACKAGE_REQUIRED).\nA missing selector, an unknown flag, or a selector scanTypes rejects exits 2.\nIf no Block or Set remains, exit 1 (MB_SELECTOR_EMPTY) and the message names the selector.\n\nExit 0 writes the SCAD or preset JSON files and a sibling .map when the target attached a source map.\nThe status line is Wrote N file(s) to <srcDir>. N counts every written file, including a sibling .map.\nOne failure writes nothing. Mapping failures, collisions, and illegal paths exit 1:\n MB_TARGET_COLLISION \u2014 two selected blocks share a target FQN or output path.\n MB_OUTPUT_ESCAPES_SRC \u2014 a resolved path is outside srcDir.\n MB_OUTPUT_OVERWRITES_BML \u2014 a resolved path is an existing .bml file.\n MB_TARGET_PACKAGE_UNDETERMINED \u2014 the source FQN has no bml segment.\n MB_TARGET_PACKAGE_AMBIGUOUS \u2014 the source FQN has more than one bml segment.\n MB_SOURCE_OUTSIDE_ROOT \u2014 a selected block is outside --source-package.\n MB_EMPTY_BLOCK \u2014 a composite has nothing to render.\n\nblockml.config.json srcDir is the output root. mbLibPath defaults to the installed\n@machineblocks/core package. openscadPath is unused by compile.\nA missing mbLibPath and a missing @machineblocks/core install exit 2.\n\nRelated: validate. Search, inspect, graph, and new stay on blockml.";
|
|
13
|
+
/** Printed help. SSOT: com.machineblocks.bml.cli.documentation.InitCommand */
|
|
14
|
+
export declare const INIT_HELP = "Usage: machineblocks init <package-fqn> [--src dir] [--install]\n machineblocks init --help\n\nWhen: turn a directory into a MachineBlocks project. Scaffolds a BlockML project,\nthen records the MachineBlocks profile.\n\nPACKAGE-FQN is a dotted package identifier (not \u2026Library). A bml segment after\nthe domain is recommended. Compile maps a bml segment to scad.\nA package FQN without a bml segment still exits 0 and warns.\nDoes not overwrite existing files.\nDoes not spawn blockml init. Calls initProject from @blockml/cli with install\nfalse, then records the profile before npm install.\n\nThe profile adds @machineblocks/cli to devDependencies when that package is\nabsent from dependencies and devDependencies. The range is the caret range of\nthis host. An existing dependencies entry stays put.\nThe project Library.bml gains com.machineblocks.bml.Library.\nCLAUDE.md (@AGENTS.md) is written when missing.\n\nFlags:\n --src dir source directory (default blocks)\n --install run npm install after the profile is recorded, then generate\n AGENTS.md the same way as blockml init\n\nWithout --install, AGENTS.md is generated only inside initProject, before\ndependencies are installed. The file is written when AgentInstructions already\nresolve. Otherwise the next step remains: npm install && npx blockml agents-md generate.\nWith --install, an existing AGENTS.md is left in place. When the file is missing,\ngeneration runs after npm install. Sections or rules write AGENTS.md.\nNo AgentInstructions content leaves the file unwritten and prints\nNo AgentInstructions blocks found. The init exit code stays 0.\nThe next-step line from the earlier initProject pass is dropped, because install already ran.\n\nExit codes match initProject: 0 success, 1 write or install failure,\n2 usage or an invalid package FQN.\n\nRelated: validate, compile. agents-md and new stay on blockml.";
|
|
15
|
+
export declare function helpFor(topic?: HelpTopic): string;
|
|
16
|
+
export declare function usageFor(topic?: HelpTopic): string;
|
|
3
17
|
//# sourceMappingURL=help.d.ts.map
|
package/dist/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,iEAAiE;AACjE,eAAO,MAAM,KAAK,mPAGU,CAAC;AAE7B,eAAO,MAAM,cAAc,yFACU,CAAC;AAEtC,eAAO,MAAM,aAAa,0IACU,CAAC;AAErC,eAAO,MAAM,UAAU,sGACU,CAAC;AAElC,yEAAyE;AACzE,eAAO,MAAM,IAAI,0uCAyBoE,CAAC;AAEtF,kFAAkF;AAClF,eAAO,MAAM,aAAa,o8BAmB0C,CAAC;AAErE,iFAAiF;AACjF,eAAO,MAAM,YAAY,yuFA2C2C,CAAC;AAErE,8EAA8E;AAC9E,eAAO,MAAM,SAAS,w4DAoCyC,CAAC;AAEhE,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAWjD;AAED,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAWlD"}
|
package/dist/help.js
CHANGED
|
@@ -1,26 +1,167 @@
|
|
|
1
|
-
|
|
1
|
+
/** Short syntax printed on usage errors. Not the --help page. */
|
|
2
|
+
export const USAGE = `Usage: machineblocks validate [--all] [<file>]
|
|
2
3
|
machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
4
|
+
machineblocks init <package-fqn> [--src dir] [--install]
|
|
5
|
+
machineblocks --help`;
|
|
6
|
+
export const VALIDATE_USAGE = `Usage: machineblocks validate [--all] [<file>]
|
|
7
|
+
machineblocks validate --help`;
|
|
8
|
+
export const COMPILE_USAGE = `Usage: machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
9
|
+
machineblocks compile --help`;
|
|
10
|
+
export const INIT_USAGE = `Usage: machineblocks init <package-fqn> [--src dir] [--install]
|
|
11
|
+
machineblocks init --help`;
|
|
12
|
+
/** Root help page. SSOT: com.machineblocks.bml.cli.documentation.Help */
|
|
13
|
+
export const HELP = `Usage: machineblocks <command> [options]
|
|
3
14
|
machineblocks --help
|
|
4
15
|
|
|
5
|
-
|
|
6
|
-
Same project check as blockml validate. Does not write SCAD.
|
|
16
|
+
machineblocks is the MachineBlocks host CLI.
|
|
7
17
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Output is written under the configured srcDir (default blocks).
|
|
12
|
-
--target-package names a package root, not a directory.
|
|
13
|
-
A package selector supplies the source root when --source-package is omitted.
|
|
14
|
-
An exact block FQN does not.
|
|
18
|
+
It renders BML to OpenSCAD that matches the V3 SCAD library.
|
|
19
|
+
BML is the editable source of truth. Change BML first, then compile.
|
|
20
|
+
This host registers target machineblocks-v3-scad. It does not reimplement parse, validate, or emit.
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
Invocation: npx machineblocks <command>
|
|
23
|
+
Requires Node.js 20 or newer.
|
|
24
|
+
A new project starts with npx @machineblocks/cli init <package-fqn>.
|
|
25
|
+
|
|
26
|
+
Commands:
|
|
27
|
+
validate Parser + semantic check. Same project check as blockml validate.
|
|
28
|
+
Does not write SCAD.
|
|
29
|
+
machineblocks validate [--all] [<file>]
|
|
30
|
+
compile Render selected Block and Set types to SCAD under srcDir.
|
|
31
|
+
machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
32
|
+
init Scaffold a BlockML project and record the MachineBlocks profile.
|
|
33
|
+
machineblocks init <package-fqn> [--src dir] [--install]
|
|
34
|
+
|
|
35
|
+
Search, scan, inspect, graph, new, agents-md, and transform stay on blockml.
|
|
36
|
+
Exit codes: 0 success, 1 diagnostic errors, 2 usage or configuration error.
|
|
37
|
+
|
|
38
|
+
Run \`machineblocks <command> --help\` for flags, defaults, output, and constraints.`;
|
|
39
|
+
/** Printed help. SSOT: com.machineblocks.bml.cli.documentation.ValidateCommand */
|
|
40
|
+
export const VALIDATE_HELP = `Usage: machineblocks validate [--all] [<file>]
|
|
41
|
+
machineblocks validate --help
|
|
42
|
+
|
|
43
|
+
When: check the model after edits. Ordinary project work.
|
|
44
|
+
|
|
45
|
+
Default (no file, no --all): semantic-validate project sources only (this package srcDir plus local packages/*). npm libraries stay on the registry for resolve.
|
|
46
|
+
--all: semantic-validate every document in the registry, including npm. Do not use --all as the default after every edit.
|
|
47
|
+
Single file: parse + compileBmlToBom against the full project registry.
|
|
48
|
+
file and --all together exit 2.
|
|
49
|
+
|
|
50
|
+
Does not register machineblocks-v3-scad. No output files written.
|
|
51
|
+
This host does not accept --src, --libraries, or --verbose.
|
|
52
|
+
|
|
53
|
+
Flags:
|
|
54
|
+
--all entire reachable corpus, including npm
|
|
55
|
+
|
|
56
|
+
Exit 0 on success; 1 on diagnostic errors; 2 on config or usage errors.
|
|
57
|
+
After diagnostics: Validated N block(s). or Validated N block(s) with errors.
|
|
58
|
+
|
|
59
|
+
Related: compile. Search, scan, inspect, and graph stay on blockml.`;
|
|
60
|
+
/** Printed help. SSOT: com.machineblocks.bml.cli.documentation.CompileCommand */
|
|
19
61
|
export const COMPILE_HELP = `Usage: machineblocks compile <source-selector> [--source-package <FQN>] [--target-package <FQN>]
|
|
20
62
|
machineblocks compile --help
|
|
21
63
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
64
|
+
When: render selected Block and Set types to OpenSCAD. Change BML first, then recompile.
|
|
65
|
+
|
|
66
|
+
Target is machineblocks-v3-scad. The command does not take a target name.
|
|
67
|
+
The selector is one BlockML type selector: an exact FQN, pkg.*, or pkg.**.
|
|
68
|
+
Quote tokens that contain * or ** so the shell does not expand them.
|
|
69
|
+
Resolution is scanTypes. This host does not define a second selector language.
|
|
70
|
+
Types whose baseType chain is neither com.machineblocks.bml.core.Block nor
|
|
71
|
+
com.machineblocks.bml.core.Set are skipped.
|
|
72
|
+
|
|
73
|
+
Output is written under the configured srcDir (default blocks). There is no --out and no --all.
|
|
74
|
+
A package selector (a final .* or .** segment) supplies the source root when
|
|
75
|
+
--target-package is set and --source-package is omitted. An exact block FQN does not.
|
|
76
|
+
Automatic mapping replaces the one bml segment with scad.
|
|
77
|
+
com.example.bml.bricks.MyBrick becomes blocks/com/example/scad/bricks/MyBrick.scad.
|
|
78
|
+
Explicit mapping swaps --source-package for --target-package and does not apply that replacement again.
|
|
79
|
+
|
|
80
|
+
Flags:
|
|
81
|
+
--source-package <FQN> source package root for an explicit mapping
|
|
82
|
+
--target-package <FQN> target package root. Not a directory and not one output file.
|
|
83
|
+
|
|
84
|
+
--source-package without --target-package exits 2 (MB_SOURCE_PACKAGE_ALONE).
|
|
85
|
+
--target-package without a derivable source root exits 2 (MB_SOURCE_PACKAGE_REQUIRED).
|
|
86
|
+
A missing selector, an unknown flag, or a selector scanTypes rejects exits 2.
|
|
87
|
+
If no Block or Set remains, exit 1 (MB_SELECTOR_EMPTY) and the message names the selector.
|
|
88
|
+
|
|
89
|
+
Exit 0 writes the SCAD or preset JSON files and a sibling .map when the target attached a source map.
|
|
90
|
+
The status line is Wrote N file(s) to <srcDir>. N counts every written file, including a sibling .map.
|
|
91
|
+
One failure writes nothing. Mapping failures, collisions, and illegal paths exit 1:
|
|
92
|
+
MB_TARGET_COLLISION — two selected blocks share a target FQN or output path.
|
|
93
|
+
MB_OUTPUT_ESCAPES_SRC — a resolved path is outside srcDir.
|
|
94
|
+
MB_OUTPUT_OVERWRITES_BML — a resolved path is an existing .bml file.
|
|
95
|
+
MB_TARGET_PACKAGE_UNDETERMINED — the source FQN has no bml segment.
|
|
96
|
+
MB_TARGET_PACKAGE_AMBIGUOUS — the source FQN has more than one bml segment.
|
|
97
|
+
MB_SOURCE_OUTSIDE_ROOT — a selected block is outside --source-package.
|
|
98
|
+
MB_EMPTY_BLOCK — a composite has nothing to render.
|
|
99
|
+
|
|
100
|
+
blockml.config.json srcDir is the output root. mbLibPath defaults to the installed
|
|
101
|
+
@machineblocks/core package. openscadPath is unused by compile.
|
|
102
|
+
A missing mbLibPath and a missing @machineblocks/core install exit 2.
|
|
103
|
+
|
|
104
|
+
Related: validate. Search, inspect, graph, and new stay on blockml.`;
|
|
105
|
+
/** Printed help. SSOT: com.machineblocks.bml.cli.documentation.InitCommand */
|
|
106
|
+
export const INIT_HELP = `Usage: machineblocks init <package-fqn> [--src dir] [--install]
|
|
107
|
+
machineblocks init --help
|
|
108
|
+
|
|
109
|
+
When: turn a directory into a MachineBlocks project. Scaffolds a BlockML project,
|
|
110
|
+
then records the MachineBlocks profile.
|
|
111
|
+
|
|
112
|
+
PACKAGE-FQN is a dotted package identifier (not …Library). A bml segment after
|
|
113
|
+
the domain is recommended. Compile maps a bml segment to scad.
|
|
114
|
+
A package FQN without a bml segment still exits 0 and warns.
|
|
115
|
+
Does not overwrite existing files.
|
|
116
|
+
Does not spawn blockml init. Calls initProject from @blockml/cli with install
|
|
117
|
+
false, then records the profile before npm install.
|
|
118
|
+
|
|
119
|
+
The profile adds @machineblocks/cli to devDependencies when that package is
|
|
120
|
+
absent from dependencies and devDependencies. The range is the caret range of
|
|
121
|
+
this host. An existing dependencies entry stays put.
|
|
122
|
+
The project Library.bml gains com.machineblocks.bml.Library.
|
|
123
|
+
CLAUDE.md (@AGENTS.md) is written when missing.
|
|
124
|
+
|
|
125
|
+
Flags:
|
|
126
|
+
--src dir source directory (default blocks)
|
|
127
|
+
--install run npm install after the profile is recorded, then generate
|
|
128
|
+
AGENTS.md the same way as blockml init
|
|
129
|
+
|
|
130
|
+
Without --install, AGENTS.md is generated only inside initProject, before
|
|
131
|
+
dependencies are installed. The file is written when AgentInstructions already
|
|
132
|
+
resolve. Otherwise the next step remains: npm install && npx blockml agents-md generate.
|
|
133
|
+
With --install, an existing AGENTS.md is left in place. When the file is missing,
|
|
134
|
+
generation runs after npm install. Sections or rules write AGENTS.md.
|
|
135
|
+
No AgentInstructions content leaves the file unwritten and prints
|
|
136
|
+
No AgentInstructions blocks found. The init exit code stays 0.
|
|
137
|
+
The next-step line from the earlier initProject pass is dropped, because install already ran.
|
|
138
|
+
|
|
139
|
+
Exit codes match initProject: 0 success, 1 write or install failure,
|
|
140
|
+
2 usage or an invalid package FQN.
|
|
141
|
+
|
|
142
|
+
Related: validate, compile. agents-md and new stay on blockml.`;
|
|
143
|
+
export function helpFor(topic) {
|
|
144
|
+
switch (topic) {
|
|
145
|
+
case "validate":
|
|
146
|
+
return VALIDATE_HELP;
|
|
147
|
+
case "compile":
|
|
148
|
+
return COMPILE_HELP;
|
|
149
|
+
case "init":
|
|
150
|
+
return INIT_HELP;
|
|
151
|
+
default:
|
|
152
|
+
return HELP;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
export function usageFor(topic) {
|
|
156
|
+
switch (topic) {
|
|
157
|
+
case "validate":
|
|
158
|
+
return VALIDATE_USAGE;
|
|
159
|
+
case "compile":
|
|
160
|
+
return COMPILE_USAGE;
|
|
161
|
+
case "init":
|
|
162
|
+
return INIT_USAGE;
|
|
163
|
+
default:
|
|
164
|
+
return USAGE;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
26
167
|
//# sourceMappingURL=help.js.map
|
package/dist/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,MAAM,CAAC,MAAM,KAAK,GAAG;;;4BAGO,CAAC;AAE7B,MAAM,CAAC,MAAM,cAAc,GAAG;qCACO,CAAC;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG;oCACO,CAAC;AAErC,MAAM,CAAC,MAAM,UAAU,GAAG;iCACO,CAAC;AAElC,yEAAyE;AACzE,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;qFAyBiE,CAAC;AAEtF,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;oEAmBuC,CAAC;AAErE,iFAAiF;AACjF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oEA2CwC,CAAC;AAErE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAoCsC,CAAC;AAEhE,MAAM,UAAU,OAAO,CAAC,KAAiB;IACvC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,UAAU;YACb,OAAO,aAAa,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,YAAY,CAAC;QACtB,KAAK,MAAM;YACT,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAiB;IACxC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,UAAU;YACb,OAAO,cAAc,CAAC;QACxB,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,UAAU,CAAC;QACpB;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-command.d.ts","sourceRoot":"","sources":["../src/init-command.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOvD,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CA4CnE"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, relative } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { BomBuilder } from "@blockml/builder";
|
|
6
|
+
import { generateAgentsMd, initProject } from "@blockml/cli";
|
|
7
|
+
import { parse } from "@blockml/parser";
|
|
8
|
+
import { serialize } from "@blockml/serializer";
|
|
9
|
+
const CLI_PACKAGE = "@machineblocks/cli";
|
|
10
|
+
const MACHINEBLOCKS_LIBRARY = "com.machineblocks.bml.Library";
|
|
11
|
+
const MACHINEBLOCKS_NAMESPACE = "com.machineblocks.bml";
|
|
12
|
+
const BLOCK_LIBRARY_BASE = "org.blockml.bml.core.BlockLibrary";
|
|
13
|
+
export function runInit(args, rootDir) {
|
|
14
|
+
const scaffold = initProject({
|
|
15
|
+
packageFqn: args.packageFqn,
|
|
16
|
+
rootDir,
|
|
17
|
+
...(args.srcDir === undefined ? {} : { srcDir: args.srcDir }),
|
|
18
|
+
install: false,
|
|
19
|
+
});
|
|
20
|
+
const lines = scaffold.lines.map((line) => line.text);
|
|
21
|
+
if (scaffold.code !== 0) {
|
|
22
|
+
return { code: scaffold.code, lines };
|
|
23
|
+
}
|
|
24
|
+
const srcDir = args.srcDir?.trim() || "blocks";
|
|
25
|
+
const dependency = ensureCliDevDependency(rootDir);
|
|
26
|
+
lines.push(...dependency.lines);
|
|
27
|
+
if (dependency.code !== 0) {
|
|
28
|
+
return { code: dependency.code, lines };
|
|
29
|
+
}
|
|
30
|
+
const library = ensureLibraryDependency(rootDir, srcDir, args.packageFqn);
|
|
31
|
+
lines.push(...library.lines);
|
|
32
|
+
if (library.code !== 0) {
|
|
33
|
+
return { code: library.code, lines };
|
|
34
|
+
}
|
|
35
|
+
if (!args.packageFqn.split(".").includes("bml")) {
|
|
36
|
+
lines.push("Package FQN has no bml segment. Compile maps a bml segment to scad.");
|
|
37
|
+
}
|
|
38
|
+
if (!args.install) {
|
|
39
|
+
return { code: 0, lines };
|
|
40
|
+
}
|
|
41
|
+
// initProject already tried GenerateAgentsMd, before this profile existed
|
|
42
|
+
// and before npm install. blockml init installs first, then generates.
|
|
43
|
+
const kept = lines.filter((line) => !line.startsWith("Next:"));
|
|
44
|
+
const installed = npmInstall(rootDir);
|
|
45
|
+
if (installed.code !== 0) {
|
|
46
|
+
return { code: installed.code, lines: [...kept, ...installed.lines] };
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
code: 0,
|
|
50
|
+
lines: [...kept, ...installed.lines, ...agentsMdAfterInstall(rootDir, srcDir)],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function agentsMdAfterInstall(rootDir, srcDir) {
|
|
54
|
+
if (existsSync(join(rootDir, "AGENTS.md"))) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
return generateAgentsMd({ rootDir, srcDir }).lines.map((line) => line.text);
|
|
58
|
+
}
|
|
59
|
+
function ensureCliDevDependency(rootDir) {
|
|
60
|
+
const pkgPath = join(rootDir, "package.json");
|
|
61
|
+
let pkg;
|
|
62
|
+
try {
|
|
63
|
+
pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return { code: 2, lines: ["Could not parse package.json."] };
|
|
67
|
+
}
|
|
68
|
+
if (pkg.dependencies?.[CLI_PACKAGE] !== undefined || pkg.devDependencies?.[CLI_PACKAGE] !== undefined) {
|
|
69
|
+
return { code: 0, lines: [`Skipped existing ${CLI_PACKAGE}`] };
|
|
70
|
+
}
|
|
71
|
+
pkg.devDependencies = { ...pkg.devDependencies, [CLI_PACKAGE]: `^${ownVersion()}` };
|
|
72
|
+
writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf8");
|
|
73
|
+
return { code: 0, lines: [`Recorded devDependency ${CLI_PACKAGE}`] };
|
|
74
|
+
}
|
|
75
|
+
function ensureLibraryDependency(rootDir, srcDir, packageFqn) {
|
|
76
|
+
const libraryPath = join(rootDir, srcDir, ...packageFqn.split("."), "Library.bml");
|
|
77
|
+
const display = displayPath(libraryPath, rootDir);
|
|
78
|
+
if (!existsSync(libraryPath)) {
|
|
79
|
+
return { code: 1, lines: [`Library not found: ${display}`] };
|
|
80
|
+
}
|
|
81
|
+
const parsed = parse(readFileSync(libraryPath, "utf8"), { filePath: libraryPath });
|
|
82
|
+
if (!parsed.success || parsed.document === null) {
|
|
83
|
+
return { code: 1, lines: [`Failed to parse ${display}`] };
|
|
84
|
+
}
|
|
85
|
+
if (dependsOn(parsed.document.block, MACHINEBLOCKS_LIBRARY)) {
|
|
86
|
+
return { code: 0, lines: [`Skipped existing ${MACHINEBLOCKS_LIBRARY}`] };
|
|
87
|
+
}
|
|
88
|
+
const builder = BomBuilder.edit(parsed.document);
|
|
89
|
+
if (!dependenciesAggregation(parsed.document.block)) {
|
|
90
|
+
builder.addAggregation({ name: "dependencies", typeFqn: BLOCK_LIBRARY_BASE, override: true });
|
|
91
|
+
}
|
|
92
|
+
builder.ensureNamespaceBinding("mb", MACHINEBLOCKS_NAMESPACE);
|
|
93
|
+
builder.addCompositionChild("dependencies", MACHINEBLOCKS_LIBRARY);
|
|
94
|
+
const emitted = serialize(builder.seal());
|
|
95
|
+
if (!emitted.success || emitted.text === null) {
|
|
96
|
+
return { code: 1, lines: [`Failed to serialize ${display}`] };
|
|
97
|
+
}
|
|
98
|
+
writeFileSync(libraryPath, emitted.text, "utf8");
|
|
99
|
+
return { code: 0, lines: [`Updated ${display}`] };
|
|
100
|
+
}
|
|
101
|
+
function dependsOn(block, typeFqn) {
|
|
102
|
+
const aggregation = dependenciesAggregation(block);
|
|
103
|
+
if (!aggregation?.composition) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return aggregation.composition.children.some((child) => child.kind === "blockInstance" && child.instance.typeFqn === typeFqn);
|
|
107
|
+
}
|
|
108
|
+
function dependenciesAggregation(block) {
|
|
109
|
+
const member = block.members.find((entry) => entry.kind === "aggregation" && entry.name === "dependencies");
|
|
110
|
+
return member?.kind === "aggregation" ? member : undefined;
|
|
111
|
+
}
|
|
112
|
+
function npmInstall(rootDir) {
|
|
113
|
+
const result = spawnSync("npm", ["install"], { cwd: rootDir, stdio: "inherit" });
|
|
114
|
+
if (result.status !== 0) {
|
|
115
|
+
return { code: 1, lines: ["npm install failed."] };
|
|
116
|
+
}
|
|
117
|
+
return { code: 0, lines: [] };
|
|
118
|
+
}
|
|
119
|
+
function ownVersion() {
|
|
120
|
+
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
121
|
+
const pkg = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8"));
|
|
122
|
+
return pkg.version ?? "0.0.0";
|
|
123
|
+
}
|
|
124
|
+
function displayPath(file, rootDir) {
|
|
125
|
+
const rel = relative(rootDir, file);
|
|
126
|
+
return rel && !rel.startsWith("..") ? rel : file;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=init-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-command.js","sourceRoot":"","sources":["../src/init-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIhD,MAAM,WAAW,GAAG,oBAAoB,CAAC;AACzC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC;AAC9D,MAAM,uBAAuB,GAAG,uBAAuB,CAAC;AACxD,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAE/D,MAAM,UAAU,OAAO,CAAC,IAAc,EAAE,OAAe;IACrD,MAAM,QAAQ,GAAG,WAAW,CAAC;QAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,OAAO;QACP,GAAG,CAAC,IAAI,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ACjB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAyB,CAAC;IACxG,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC;AAChC,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@machineblocks/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MachineBlocks host CLI — simplified BlockML entry that renders BML to SCAD",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -30,13 +30,16 @@
|
|
|
30
30
|
"test": "vitest run --root ../.. packages/machineblocks-cli/test"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@blockml/block-render-engine": "^0.1.
|
|
34
|
-
"@blockml/
|
|
35
|
-
"@blockml/
|
|
36
|
-
"@blockml/
|
|
37
|
-
"@blockml/
|
|
33
|
+
"@blockml/block-render-engine": "^0.1.2",
|
|
34
|
+
"@blockml/builder": "^0.9.14",
|
|
35
|
+
"@blockml/cli": "^0.9.14",
|
|
36
|
+
"@blockml/compiler": "^0.9.14",
|
|
37
|
+
"@blockml/core": "^1.4.5",
|
|
38
|
+
"@blockml/framework": "^0.9.14",
|
|
39
|
+
"@blockml/parser": "^0.9.14",
|
|
40
|
+
"@blockml/serializer": "^0.9.14",
|
|
38
41
|
"@machineblocks/core": "^3.0.0-A4",
|
|
39
|
-
"@machineblocks/render-target": "^0.1.
|
|
42
|
+
"@machineblocks/render-target": "^0.1.2"
|
|
40
43
|
},
|
|
41
44
|
"engines": {
|
|
42
45
|
"node": ">=20"
|