@firestartr/cli 1.53.0 → 1.54.0-snapshot-0
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/build/index.js
CHANGED
|
@@ -359560,6 +359560,7 @@ var ajv_default = /*#__PURE__*/__nccwpck_require__.n(dist_ajv);
|
|
|
359560
359560
|
|
|
359561
359561
|
|
|
359562
359562
|
|
|
359563
|
+
|
|
359563
359564
|
function validate_validate(featurePath) {
|
|
359564
359565
|
__validateDirStructure(featurePath);
|
|
359565
359566
|
const configData = __validateFeatureConfig(featurePath);
|
|
@@ -359574,6 +359575,17 @@ function __validateDirStructure(featurePath) {
|
|
|
359574
359575
|
if (!isFile(external_path_.join(featurePath, 'config.yaml'))) {
|
|
359575
359576
|
throw `Feature: ${featurePath}/config.yaml not found or not a file`;
|
|
359576
359577
|
}
|
|
359578
|
+
if (!isDirectory(external_path_.join(featurePath, 'templates/docs'))) {
|
|
359579
|
+
throw `Feature: ${featurePath}templates/docs not a directory`;
|
|
359580
|
+
}
|
|
359581
|
+
if (!__validateDocsHasReadmes(featurePath)) {
|
|
359582
|
+
throw `Feature: ${featurePath}: should have at least one .md file in the templates/docs`;
|
|
359583
|
+
}
|
|
359584
|
+
}
|
|
359585
|
+
function __validateDocsHasReadmes(featurePath) {
|
|
359586
|
+
const dirEntries = external_fs_default().readdirSync(external_path_.join(featurePath, 'templates/docs'));
|
|
359587
|
+
return (dirEntries.some((entryFile) => !isDirectory(external_path_.join(featurePath, '/templates/docs', entryFile)) &&
|
|
359588
|
+
entryFile.endsWith('.md')) !== undefined);
|
|
359577
359589
|
}
|
|
359578
359590
|
function __validateFeatureConfig(featurePath) {
|
|
359579
359591
|
try {
|
|
@@ -360629,6 +360641,7 @@ function buildExpectedOutput(config, renderDir) {
|
|
|
360629
360641
|
localPath: external_node_path_.join(renderDir, f.dest),
|
|
360630
360642
|
repoPath: f.dest,
|
|
360631
360643
|
userManaged: f.user_managed,
|
|
360644
|
+
targetBranch: f.target_branch ?? '',
|
|
360632
360645
|
}));
|
|
360633
360646
|
return {
|
|
360634
360647
|
files,
|
|
@@ -5,6 +5,7 @@ export interface ConfigFile {
|
|
|
5
5
|
dest: string;
|
|
6
6
|
src: string;
|
|
7
7
|
user_managed: boolean;
|
|
8
|
+
target_branch: string;
|
|
8
9
|
}
|
|
9
10
|
export interface FeatureConfig {
|
|
10
11
|
files?: ConfigFile[];
|
|
@@ -14,6 +15,7 @@ export interface ExpectedFile {
|
|
|
14
15
|
localPath: string;
|
|
15
16
|
repoPath: string;
|
|
16
17
|
userManaged: boolean;
|
|
18
|
+
targetBranch: string;
|
|
17
19
|
}
|
|
18
20
|
export interface ExpectedOutput {
|
|
19
21
|
files: ExpectedFile[];
|