quackage 1.0.65 → 1.0.67
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/docs/css/docuserve.css +73 -0
- package/docs/index.html +1 -1
- package/docs/retold-catalog.json +2 -33
- package/docs/retold-keyword-index.json +1982 -1495
- package/package.json +3 -3
- package/source/commands/Quackage-Command-PrepareDocs.js +63 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quackage",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.67",
|
|
4
4
|
"description": "Building. Testing. Quacking. Reloading.",
|
|
5
5
|
"main": "source/Quackage-CLIProgram.js",
|
|
6
6
|
"scripts": {
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
"gulp-env": "^0.4.0",
|
|
61
61
|
"gulp-sourcemaps": "^3.0.0",
|
|
62
62
|
"gulp-terser": "^2.1.0",
|
|
63
|
-
"indoctrinate": "^1.0.
|
|
63
|
+
"indoctrinate": "^1.0.10",
|
|
64
64
|
"jsdoc": "^4.0.5",
|
|
65
65
|
"mocha": "10.4.0",
|
|
66
66
|
"npm-check-updates": "^18.0.1",
|
|
67
67
|
"nyc": "^15.1.0",
|
|
68
68
|
"pict-docuserve": "^0.0.32",
|
|
69
69
|
"pict-service-commandlineutility": "^1.0.19",
|
|
70
|
-
"retold-harness": "^1.1.
|
|
70
|
+
"retold-harness": "^1.1.6",
|
|
71
71
|
"vinyl-buffer": "^1.0.1",
|
|
72
72
|
"vinyl-source-stream": "^2.0.0"
|
|
73
73
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const libCommandLineCommand = require('pict-service-commandlineutility').ServiceCommandLineCommand;
|
|
2
2
|
const libFS = require('fs');
|
|
3
3
|
const libPath = require('path');
|
|
4
|
+
const libChildProcess = require('child_process');
|
|
4
5
|
|
|
5
6
|
class QuackageCommandPrepareDocs extends libCommandLineCommand
|
|
6
7
|
{
|
|
@@ -16,6 +17,7 @@ class QuackageCommandPrepareDocs extends libCommandLineCommand
|
|
|
16
17
|
this.options.CommandOptions.push({ Name: '-d, --directory_root [directory_root]', Description: 'Root directory to scan for modules (defaults to CWD).', Default: '' });
|
|
17
18
|
this.options.CommandOptions.push({ Name: '-b, --branch [branch]', Description: 'Git branch for GitHub raw URLs (defaults to master).', Default: 'master' });
|
|
18
19
|
this.options.CommandOptions.push({ Name: '-g, --github_org [github_org]', Description: 'GitHub organization for raw URLs (defaults to stevenvelozo).', Default: 'stevenvelozo' });
|
|
20
|
+
this.options.CommandOptions.push({ Name: '-x, --excluded_modules [excluded_modules]', Description: 'Comma-separated list of module names to exclude from the catalog and keyword index. Merged with any ExcludedModules list in indoctrinate\'s loaded config file (e.g. .indoctrinate.config.json).', Default: '' });
|
|
19
21
|
|
|
20
22
|
this.options.Aliases.push('docs');
|
|
21
23
|
this.options.Aliases.push('prep-docs');
|
|
@@ -30,6 +32,15 @@ class QuackageCommandPrepareDocs extends libCommandLineCommand
|
|
|
30
32
|
let tmpBranch = this.CommandOptions.branch || 'master';
|
|
31
33
|
let tmpGitHubOrg = this.CommandOptions.github_org || 'stevenvelozo';
|
|
32
34
|
|
|
35
|
+
// Exclusion list passthrough. When set, both indoctrinate sub-commands
|
|
36
|
+
// get -x <list>. Comma-separated; indoctrinate will merge this with
|
|
37
|
+
// any ExcludedModules entries in its loaded config file.
|
|
38
|
+
let tmpExcludedModulesArgs = [];
|
|
39
|
+
if (this.CommandOptions.excluded_modules && this.CommandOptions.excluded_modules.length > 0)
|
|
40
|
+
{
|
|
41
|
+
tmpExcludedModulesArgs = ['-x', this.CommandOptions.excluded_modules];
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
this.log.info(`Preparing documentation in [${tmpDocsFolder}]...`);
|
|
34
45
|
|
|
35
46
|
// Ensure the output folder exists
|
|
@@ -81,7 +92,7 @@ class QuackageCommandPrepareDocs extends libCommandLineCommand
|
|
|
81
92
|
'-o', tmpCatalogFile,
|
|
82
93
|
'-b', tmpBranch,
|
|
83
94
|
'-g', tmpGitHubOrg
|
|
84
|
-
],
|
|
95
|
+
].concat(tmpExcludedModulesArgs),
|
|
85
96
|
{ cwd: this.fable.AppData.CWD },
|
|
86
97
|
fNext
|
|
87
98
|
);
|
|
@@ -98,17 +109,65 @@ class QuackageCommandPrepareDocs extends libCommandLineCommand
|
|
|
98
109
|
'generate_keyword_index',
|
|
99
110
|
'-d', tmpDirectoryRoot,
|
|
100
111
|
'-o', tmpKeywordIndexFile
|
|
101
|
-
].concat(tmpExtraScanArgs),
|
|
112
|
+
].concat(tmpExtraScanArgs).concat(tmpExcludedModulesArgs),
|
|
102
113
|
{ cwd: this.fable.AppData.CWD },
|
|
103
114
|
fNext
|
|
104
115
|
);
|
|
105
116
|
}.bind(this));
|
|
106
117
|
|
|
107
|
-
// Step 3:
|
|
118
|
+
// Step 3: Write _version.json version placard sidecar
|
|
119
|
+
tmpAnticipate.anticipate(
|
|
120
|
+
function (fNext)
|
|
121
|
+
{
|
|
122
|
+
this.log.info(`###############################[ STEP 3: VERSION PLACARD ]###############################`);
|
|
123
|
+
try
|
|
124
|
+
{
|
|
125
|
+
let tmpPackageJsonPath = libPath.join(tmpDirectoryRoot, 'package.json');
|
|
126
|
+
if (!libFS.existsSync(tmpPackageJsonPath))
|
|
127
|
+
{
|
|
128
|
+
this.log.warn(`No package.json at [${tmpPackageJsonPath}]; skipping _version.json generation.`);
|
|
129
|
+
return fNext();
|
|
130
|
+
}
|
|
131
|
+
let tmpPackage = JSON.parse(libFS.readFileSync(tmpPackageJsonPath, 'utf8'));
|
|
132
|
+
|
|
133
|
+
let tmpGitCommit = null;
|
|
134
|
+
try
|
|
135
|
+
{
|
|
136
|
+
tmpGitCommit = libChildProcess.execSync('git rev-parse --short HEAD',
|
|
137
|
+
{ cwd: tmpDirectoryRoot, stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
|
|
138
|
+
}
|
|
139
|
+
catch (pGitErr)
|
|
140
|
+
{
|
|
141
|
+
// Non-git repo or no commits yet — omit GitCommit.
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let tmpVersionPayload = {
|
|
145
|
+
Name: tmpPackage.name || '',
|
|
146
|
+
Version: tmpPackage.version || '',
|
|
147
|
+
Description: tmpPackage.description || '',
|
|
148
|
+
GeneratedAt: new Date().toISOString()
|
|
149
|
+
};
|
|
150
|
+
if (tmpGitCommit)
|
|
151
|
+
{
|
|
152
|
+
tmpVersionPayload.GitCommit = tmpGitCommit;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
let tmpVersionFile = libPath.join(tmpDocsFolder, '_version.json');
|
|
156
|
+
libFS.writeFileSync(tmpVersionFile, JSON.stringify(tmpVersionPayload, null, '\t'));
|
|
157
|
+
this.log.info(`Wrote version placard: ${tmpVersionFile} (${tmpVersionPayload.Name} v${tmpVersionPayload.Version}${tmpGitCommit ? ' @ ' + tmpGitCommit : ''})`);
|
|
158
|
+
}
|
|
159
|
+
catch (pError)
|
|
160
|
+
{
|
|
161
|
+
this.log.warn(`Failed to write _version.json: ${pError.message}`);
|
|
162
|
+
}
|
|
163
|
+
return fNext();
|
|
164
|
+
}.bind(this));
|
|
165
|
+
|
|
166
|
+
// Step 4: Inject pict-docuserve assets
|
|
108
167
|
tmpAnticipate.anticipate(
|
|
109
168
|
function (fNext)
|
|
110
169
|
{
|
|
111
|
-
this.log.info(`###############################[ STEP
|
|
170
|
+
this.log.info(`###############################[ STEP 4: DOCUSERVE INJECT ]###############################`);
|
|
112
171
|
this.fable.QuackageProcess.execute(
|
|
113
172
|
tmpDocuserveLocation,
|
|
114
173
|
[
|