@voxgig/model 11.0.1 → 11.0.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/bin/voxgig-model +38 -2
- package/package.json +1 -1
package/bin/voxgig-model
CHANGED
|
@@ -41,6 +41,8 @@ async function run() {
|
|
|
41
41
|
|
|
42
42
|
options = validateOptions(options)
|
|
43
43
|
|
|
44
|
+
warnNoConfig(options)
|
|
45
|
+
|
|
44
46
|
await generate(options)
|
|
45
47
|
}
|
|
46
48
|
catch(err) {
|
|
@@ -49,6 +51,37 @@ async function run() {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
|
|
54
|
+
// `--no-config` is a MODEL-LAYER DEBUGGING MODE THAT STILL WRITES.
|
|
55
|
+
//
|
|
56
|
+
// Skipping the .model-config build means no configured action runs, and
|
|
57
|
+
// those actions are most of what populates a model: an SDK project loads
|
|
58
|
+
// apidef and sdkgen through exactly this mechanism. The build then writes
|
|
59
|
+
// its result anyway, replacing the model file with one missing whatever
|
|
60
|
+
// the actions contribute.
|
|
61
|
+
//
|
|
62
|
+
// NOTHING FAILS when that happens, which is the problem. A reduced model
|
|
63
|
+
// is a valid model; it simply has less in it. One project committed the
|
|
64
|
+
// reduced form repeatedly and its model alternated between two shapes for
|
|
65
|
+
// months before anyone noticed, because the only symptom is a tree that
|
|
66
|
+
// disagrees with the build.
|
|
67
|
+
//
|
|
68
|
+
// `--dryrun` is the side-effect-free way to inspect the model layer, so
|
|
69
|
+
// say so at the point the damage would otherwise be silent. Warn only when
|
|
70
|
+
// the run will actually write.
|
|
71
|
+
function warnNoConfig(options) {
|
|
72
|
+
if(options.config || options.dryrun) {
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
console.error(
|
|
77
|
+
'WARNING: --no-config skips the .model-config build, so no configured\n' +
|
|
78
|
+
' action runs, and the model is still written. The result omits\n' +
|
|
79
|
+
' whatever those actions contribute. Use --dryrun to inspect without\n' +
|
|
80
|
+
' writing.'
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
52
85
|
function resolveOptions() {
|
|
53
86
|
|
|
54
87
|
const args = parseArgs({
|
|
@@ -83,7 +116,8 @@ function resolveOptions() {
|
|
|
83
116
|
default: ''
|
|
84
117
|
},
|
|
85
118
|
|
|
86
|
-
// Skip the .model-config build and run the model on its own.
|
|
119
|
+
// Skip the .model-config build and run the model on its own. See
|
|
120
|
+
// warnNoConfig below: this still WRITES the model.
|
|
87
121
|
'no-config': {
|
|
88
122
|
type: 'boolean',
|
|
89
123
|
},
|
|
@@ -251,7 +285,9 @@ Usage:
|
|
|
251
285
|
--build <spec> Provide a jsonic specification for build actions.
|
|
252
286
|
-b
|
|
253
287
|
|
|
254
|
-
--no-config Skip the .model-config build
|
|
288
|
+
--no-config Skip the .model-config build: NO configured action runs.
|
|
289
|
+
The model is still WRITTEN, omitting whatever those
|
|
290
|
+
actions contribute. Use --dryrun to inspect safely.
|
|
255
291
|
|
|
256
292
|
--debug Set log level (default: info): trace, error, debug, info, warn, fatal.
|
|
257
293
|
-g
|