quackage 1.0.45 → 1.0.47
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/.quackage-templates.json +3 -3
- package/README.md +6 -0
- package/debug/Harness.js +1 -1
- package/package.json +4 -3
- package/source/Default-Quackage-Configuration.json +4 -1
- package/source/Quackage-CLIProgram.js +12 -1
- package/source/commands/Quackage-Command-Build.js +0 -1
- package/source/commands/Quackage-Command-BuildTemplates.js +0 -1
- package/source/commands/Quackage-Command-CopyFilesFromTo.js +1 -0
- package/source/commands/Quackage-Command-DocuserveInject.js +90 -0
- package/source/commands/Quackage-Command-DocuserveServe.js +79 -0
- package/source/commands/Quackage-Command-GenerateDocumentation.js +136 -2
- package/source/commands/Quackage-Command-Indoctrinate.js +88 -0
- package/source/commands/Quackage-Command-IndoctrinateIndex.js +83 -0
- package/source/commands/Quackage-Command-ListTemplates.js +1 -0
- package/source/commands/Quackage-Command-PrepareDocs.js +156 -0
- package/source/commands/Quackage-Command-RunMochaTests.js +1 -3
- package/source/commands/Quackage-Command-UpdatePackage-Luxury.js +1 -1
- package/source/commands/Quackage-Command-UpdatePackage.js +1 -1
- package/source/commands/stricture/Quackage-Command-Stricture-Compile.js +37 -0
- package/source/commands/stricture/Quackage-Command-StrictureLegacy.js +37 -0
- package/source/commands/stricture/services/Fable-Service-Stricture-Compile.js +327 -0
- package/templates/fableservice/{Fable-Service.js → Fable-Service-QUACKAGESCOPE.js} +4 -5
- package/source/commands/Quackage-JSDoc-Wrapper.js +0 -147
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
// file: jsdoc-explain.cjs
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
const { spawn } = require('node:child_process');
|
|
5
|
-
const { createWriteStream } = require('node:fs');
|
|
6
|
-
const { once } = require('node:events');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Run the real JSDoc CLI with -X and return parsed JSON (like `jsdoc -X`).
|
|
10
|
-
*
|
|
11
|
-
* @param {string[]|string} files Files/dirs/globs to parse. (e.g., ['src'] or 'src')
|
|
12
|
-
* @param {string|null} config Path to jsdoc config file (e.g., 'jsdoc.conf.json') or null.
|
|
13
|
-
* @param {boolean} quiet Suppress non-essential CLI output (defaults true).
|
|
14
|
-
* @param {string} cwd Working directory (defaults process.cwd()).
|
|
15
|
-
* @param {number} timeoutMs Kill the process after N ms (0 = no timeout).
|
|
16
|
-
* @param {string[]} extraArgs Extra CLI args (e.g., ['--recurse']).
|
|
17
|
-
* @param {string|null} outFile If set, also write raw JSON to this file.
|
|
18
|
-
* @returns {Promise<any>} Parsed JSON doclets.
|
|
19
|
-
*/
|
|
20
|
-
function jsdocExplainCLI(
|
|
21
|
-
files,
|
|
22
|
-
config,
|
|
23
|
-
quiet,
|
|
24
|
-
cwd,
|
|
25
|
-
timeoutMs,
|
|
26
|
-
extraArgs,
|
|
27
|
-
outFile,
|
|
28
|
-
fCallback
|
|
29
|
-
) {
|
|
30
|
-
// defaults
|
|
31
|
-
if (!files || (Array.isArray(files) && files.length === 0)) files = ['.'];
|
|
32
|
-
if (typeof files === 'string') files = [files];
|
|
33
|
-
if (typeof config === 'undefined') config = null;
|
|
34
|
-
if (typeof quiet === 'undefined') quiet = true;
|
|
35
|
-
if (!cwd) cwd = process.cwd();
|
|
36
|
-
if (!timeoutMs) timeoutMs = 0;
|
|
37
|
-
if (!Array.isArray(extraArgs)) extraArgs = [];
|
|
38
|
-
if (typeof outFile === 'undefined') outFile = null;
|
|
39
|
-
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
// Resolve local CLI for exact parity; fallback to `npx jsdoc`
|
|
42
|
-
let cmd, args;
|
|
43
|
-
let usingNode = true;
|
|
44
|
-
try {
|
|
45
|
-
const jsdocBin = require.resolve('jsdoc/jsdoc.js', { paths: [cwd] });
|
|
46
|
-
cmd = process.execPath;
|
|
47
|
-
args = [
|
|
48
|
-
jsdocBin,
|
|
49
|
-
'-X',
|
|
50
|
-
...(quiet ? ['--quiet'] : []),
|
|
51
|
-
...(config ? ['-c', config] : []),
|
|
52
|
-
...extraArgs,
|
|
53
|
-
...files,
|
|
54
|
-
];
|
|
55
|
-
} catch {
|
|
56
|
-
usingNode = false;
|
|
57
|
-
cmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
58
|
-
args = [
|
|
59
|
-
'-y',
|
|
60
|
-
'jsdoc',
|
|
61
|
-
'-X',
|
|
62
|
-
...(quiet ? ['--quiet'] : []),
|
|
63
|
-
...(config ? ['-c', config] : []),
|
|
64
|
-
...extraArgs,
|
|
65
|
-
...files,
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const child = spawn(cmd, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
70
|
-
|
|
71
|
-
let stdout = '';
|
|
72
|
-
let stderr = '';
|
|
73
|
-
|
|
74
|
-
const killer =
|
|
75
|
-
timeoutMs > 0 ? setTimeout(() => child.kill('SIGKILL'), timeoutMs) : null;
|
|
76
|
-
|
|
77
|
-
// collect stdout (and optionally tee to file)
|
|
78
|
-
let outStream = null;
|
|
79
|
-
if (outFile) outStream = createWriteStream(outFile, { encoding: 'utf8' });
|
|
80
|
-
|
|
81
|
-
child.stdout.setEncoding('utf8');
|
|
82
|
-
child.stderr.setEncoding('utf8');
|
|
83
|
-
|
|
84
|
-
child.stdout.on('data', (chunk) => {
|
|
85
|
-
stdout += chunk;
|
|
86
|
-
if (outStream) outStream.write(chunk);
|
|
87
|
-
});
|
|
88
|
-
child.stderr.on('data', (chunk) => {
|
|
89
|
-
stderr += chunk;
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
const finalize = async (code) => {
|
|
93
|
-
if (killer) clearTimeout(killer);
|
|
94
|
-
if (outStream) {
|
|
95
|
-
await new Promise((r) => outStream.end(r));
|
|
96
|
-
}
|
|
97
|
-
if (code !== 0) {
|
|
98
|
-
const how = usingNode ? 'node jsdoc/jsdoc.js' : 'npx jsdoc';
|
|
99
|
-
const err = new Error(
|
|
100
|
-
`JSDoc exited with code ${code} (${how}).\n${stderr || ''}`
|
|
101
|
-
);
|
|
102
|
-
err.code = code;
|
|
103
|
-
err.stderr = stderr;
|
|
104
|
-
err.stdout = stdout;
|
|
105
|
-
reject(err);
|
|
106
|
-
return fCallback(err);
|
|
107
|
-
}
|
|
108
|
-
try {
|
|
109
|
-
resolve(JSON.parse(stdout));
|
|
110
|
-
} catch (e) {
|
|
111
|
-
const head = stdout.slice(0, 3000);
|
|
112
|
-
const err = new Error(
|
|
113
|
-
`Failed to parse JSDoc JSON. Ensure --quiet and plugins don't write to stdout.\n` +
|
|
114
|
-
`Parse error: ${e.message}\n--- stdout (head) ---\n${head}`
|
|
115
|
-
);
|
|
116
|
-
err.stderr = stderr;
|
|
117
|
-
err.stdout = stdout;
|
|
118
|
-
reject(err);
|
|
119
|
-
}
|
|
120
|
-
return fCallback();
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
child.on('close', finalize);
|
|
124
|
-
child.on('error', reject);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
module.exports = jsdocExplainCLI;
|
|
129
|
-
|
|
130
|
-
/*
|
|
131
|
-
Example usage:
|
|
132
|
-
|
|
133
|
-
const explain = require('./jsdoc-explain.cjs');
|
|
134
|
-
|
|
135
|
-
(async () => {
|
|
136
|
-
const data = await explain(
|
|
137
|
-
['modules/pict/pict-view/source/Pict-View.js'], // files
|
|
138
|
-
'jsdoc.conf.json', // config
|
|
139
|
-
true, // quiet
|
|
140
|
-
process.cwd(), // cwd
|
|
141
|
-
0, // timeoutMs
|
|
142
|
-
['--recurse'], // extraArgs
|
|
143
|
-
'docs.json' // outFile (optional)
|
|
144
|
-
);
|
|
145
|
-
console.log('Doclets:', data.length);
|
|
146
|
-
})();
|
|
147
|
-
*/
|