shel-neos-schema 1.0.1 → 1.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/validate.js +11 -2
- package/package.json +3 -2
package/bin/validate.js
CHANGED
|
@@ -44,6 +44,12 @@ const schemas = [
|
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
const DEFAULTS = {
|
|
48
|
+
ignoredFolders: [
|
|
49
|
+
'node_modules',
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
|
|
47
53
|
/**
|
|
48
54
|
* Recursively list yaml files in a directory
|
|
49
55
|
*
|
|
@@ -68,7 +74,10 @@ function listYamlFiles(dir) {
|
|
|
68
74
|
|
|
69
75
|
// If it's a directory, recurse into it
|
|
70
76
|
if (stat && stat.isDirectory()) {
|
|
71
|
-
|
|
77
|
+
// If it's not an ignored folder, recurse into it
|
|
78
|
+
if (!DEFAULTS.ignoredFolders.includes(file)) {
|
|
79
|
+
results = results.concat(listYamlFiles(filePath));
|
|
80
|
+
}
|
|
72
81
|
} else if (file.endsWith('.yaml') || file.endsWith('.yml')) {
|
|
73
82
|
// If it's a YAML file, add to results
|
|
74
83
|
results.push(filePath);
|
|
@@ -132,7 +141,7 @@ function validateFolder(folder, verbose) {
|
|
|
132
141
|
}
|
|
133
142
|
}
|
|
134
143
|
|
|
135
|
-
if (verbose) {
|
|
144
|
+
if (verbose || hasError) {
|
|
136
145
|
console.info('Valid files %d, skipped %d, invalid %d', validFiles, skippedFiles, invalidFiles);
|
|
137
146
|
}
|
|
138
147
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shel-neos-schema",
|
|
3
3
|
"description": "A tool to validate Neos YAML schema files like nodetypes and other configuration",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"main": "bin/validate.js",
|
|
6
6
|
"author": "Sebastian Helzle <sebastian@helzle.it>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"node": ">=20"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"test": "validate -v validate examples"
|
|
20
|
+
"test": "validate -v validate examples",
|
|
21
|
+
"validate": "validate"
|
|
21
22
|
},
|
|
22
23
|
"bin": {
|
|
23
24
|
"validate": "bin/validate.js"
|