@canonical/webarchitect 0.9.0-experimental.12 → 0.10.0-experimental.1
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/LICENSE +166 -0
- package/dist/esm/cli.js +0 -0
- package/package.json +6 -4
- package/dist/esm/ajv.js +0 -46
- package/dist/esm/ajv.js.map +0 -1
- package/dist/esm/executeValidationRules.js +0 -26
- package/dist/esm/executeValidationRules.js.map +0 -1
- package/dist/esm/listDirectory.js +0 -12
- package/dist/esm/listDirectory.js.map +0 -1
- package/dist/esm/loadFullSchema.js +0 -15
- package/dist/esm/loadFullSchema.js.map +0 -1
- package/dist/esm/resolveSchema.js +0 -67
- package/dist/esm/resolveSchema.js.map +0 -1
- package/dist/esm/validateDirectoryRule.js +0 -120
- package/dist/esm/validateDirectoryRule.js.map +0 -1
- package/dist/esm/validateFileRule.js +0 -119
- package/dist/esm/validateFileRule.js.map +0 -1
- package/dist/esm/validateProject.js +0 -31
- package/dist/esm/validateProject.js.map +0 -1
- package/dist/types/ajv.d.ts +0 -4
- package/dist/types/ajv.d.ts.map +0 -1
- package/dist/types/executeValidationRules.d.ts +0 -3
- package/dist/types/executeValidationRules.d.ts.map +0 -1
- package/dist/types/listDirectory.d.ts +0 -5
- package/dist/types/listDirectory.d.ts.map +0 -1
- package/dist/types/loadFullSchema.d.ts +0 -3
- package/dist/types/loadFullSchema.d.ts.map +0 -1
- package/dist/types/resolveSchema.d.ts +0 -3
- package/dist/types/resolveSchema.d.ts.map +0 -1
- package/dist/types/validateDirectoryRule.d.ts +0 -3
- package/dist/types/validateDirectoryRule.d.ts.map +0 -1
- package/dist/types/validateFileRule.d.ts +0 -3
- package/dist/types/validateFileRule.d.ts.map +0 -1
- package/dist/types/validateProject.d.ts +0 -8
- package/dist/types/validateProject.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
166
|
+
|
package/dist/esm/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/webarchitect",
|
|
3
3
|
"description": "A tool to test the compliance with architecture specifications for packages and applications.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.0-experimental.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -35,14 +35,16 @@
|
|
|
35
35
|
"test": "echo 'No tests defined yet'"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@canonical/biome-config": "^0.9.0",
|
|
39
|
-
"@canonical/typescript-config-base": "^0.9.0",
|
|
40
38
|
"@biomejs/biome": "^2.0.0",
|
|
39
|
+
"@canonical/biome-config": "^0.10.0-experimental.0",
|
|
40
|
+
"@canonical/typescript-config-base": "^0.10.0-experimental.0",
|
|
41
41
|
"@types/json-schema": "^7.0.15",
|
|
42
42
|
"typescript": "^5.8.2"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"ajv": "^8.17.1",
|
|
46
|
+
"chalk": "^5.4.1",
|
|
46
47
|
"commander": "^14.0.0"
|
|
47
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "cee6d1a320680e51c78bd301e53ed3f60182e004"
|
|
48
50
|
}
|
package/dist/esm/ajv.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import ajvPackage from "ajv";
|
|
2
|
-
import draft202012 from "./schemas/draft-2020-12.json" with { type: "json" };
|
|
3
|
-
import metaApplicator from "./schemas/meta/applicator.json" with {
|
|
4
|
-
type: "json"
|
|
5
|
-
};
|
|
6
|
-
import metaContent from "./schemas/meta/content.json" with { type: "json" };
|
|
7
|
-
import metaCore from "./schemas/meta/core.json" with { type: "json" };
|
|
8
|
-
import metaFormatAnnotation from "./schemas/meta/format-annotation.json" with {
|
|
9
|
-
type: "json"
|
|
10
|
-
};
|
|
11
|
-
import metaMetaData from "./schemas/meta/meta-data.json" with { type: "json" };
|
|
12
|
-
import metaUnevaluated from "./schemas/meta/unevaluated.json" with {
|
|
13
|
-
type: "json"
|
|
14
|
-
};
|
|
15
|
-
import metaValidation from "./schemas/meta/validation.json" with {
|
|
16
|
-
type: "json"
|
|
17
|
-
};
|
|
18
|
-
const Ajv = ajvPackage.default;
|
|
19
|
-
// Create AJV instance with configuration optimized for our use case
|
|
20
|
-
const ajv = new Ajv({
|
|
21
|
-
strict: false, // Allow unknown keywords without throwing errors
|
|
22
|
-
allErrors: true, // Collect all validation errors, not just the first one
|
|
23
|
-
validateSchema: false, // Temporarily disable automatic schema validation during setup
|
|
24
|
-
});
|
|
25
|
-
// Step 1: Register all the foundational meta-schemas first
|
|
26
|
-
// These are the building blocks that the main Draft 2020-12 schema depends on
|
|
27
|
-
ajv.addSchema(metaCore, "https://json-schema.org/draft/2020-12/meta/core");
|
|
28
|
-
ajv.addSchema(metaApplicator, "https://json-schema.org/draft/2020-12/meta/applicator");
|
|
29
|
-
ajv.addSchema(metaUnevaluated, "https://json-schema.org/draft/2020-12/meta/unevaluated");
|
|
30
|
-
ajv.addSchema(metaValidation, "https://json-schema.org/draft/2020-12/meta/validation");
|
|
31
|
-
ajv.addSchema(metaMetaData, "https://json-schema.org/draft/2020-12/meta/meta-data");
|
|
32
|
-
ajv.addSchema(metaFormatAnnotation, "https://json-schema.org/draft/2020-12/meta/format-annotation");
|
|
33
|
-
ajv.addSchema(metaContent, "https://json-schema.org/draft/2020-12/meta/content");
|
|
34
|
-
// Step 2: Now register the main Draft 2020-12 schema
|
|
35
|
-
// This schema composes all the meta-schemas above into the complete specification
|
|
36
|
-
ajv.addSchema(draft202012, "https://json-schema.org/draft/2020-12/schema");
|
|
37
|
-
ajv.addSchema(draft202012, "http://json-schema.org/draft/2020-12/schema");
|
|
38
|
-
// Step 3: Re-enable schema validation now that all pieces are in place
|
|
39
|
-
ajv.opts.validateSchema = true;
|
|
40
|
-
// Step 4: Add format validation support manually to avoid type issues
|
|
41
|
-
// Instead of using ajv-formats, we'll add the most common formats we need
|
|
42
|
-
ajv.addFormat("email", /^[^\s@]+@[^\s@]+\.[^\s@]+$/);
|
|
43
|
-
ajv.addFormat("uri", /^https?:\/\/[^\s]+$/);
|
|
44
|
-
ajv.addFormat("uri-reference", /^[^\s]*$/);
|
|
45
|
-
export default ajv;
|
|
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,CACzD,CAAC;AACF,GAAG,CAAC,SAAS,CACX,cAAc,EACd,uDAAuD,CACxD,CAAC;AACF,GAAG,CAAC,SAAS,CACX,YAAY,EACZ,sDAAsD,CACvD,CAAC;AACF,GAAG,CAAC,SAAS,CACX,oBAAoB,EACpB,8DAA8D,CAC/D,CAAC;AACF,GAAG,CAAC,SAAS,CACX,WAAW,EACX,oDAAoD,CACrD,CAAC;AAEF,qDAAqD;AACrD,kFAAkF;AAClF,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,8CAA8C,CAAC,CAAC;AAC3E,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,6CAA6C,CAAC,CAAC;AAE1E,uEAAuE;AACvE,GAAG,CAAC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;AAE/B,sEAAsE;AACtE,0EAA0E;AAC1E,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC;AACrD,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;AAC5C,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAE3C,eAAe,GAAG,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import validateDirectoryRule from "./validateDirectoryRule.js";
|
|
2
|
-
import validateFileRule from "./validateFileRule.js";
|
|
3
|
-
export default async function executeValidationRules(projectPath, schema) {
|
|
4
|
-
const results = [];
|
|
5
|
-
// Iterate through each rule in the schema
|
|
6
|
-
for (const [ruleName, rule] of Object.entries(schema)) {
|
|
7
|
-
// Skip meta-properties that aren't validation rules
|
|
8
|
-
if (ruleName === "$schema" || ruleName === "name" || ruleName === "extends")
|
|
9
|
-
continue;
|
|
10
|
-
// Type guard to ensure rule is an object with 'file' or 'directory'
|
|
11
|
-
if (typeof rule === "object" && rule !== null) {
|
|
12
|
-
if ("file" in rule) {
|
|
13
|
-
// Pass the rule name context to file validation
|
|
14
|
-
const fileResults = await validateFileRule(projectPath, rule.file, ruleName);
|
|
15
|
-
results.push(...fileResults);
|
|
16
|
-
}
|
|
17
|
-
else if ("directory" in rule) {
|
|
18
|
-
// Pass the rule name context to directory validation
|
|
19
|
-
const dirResults = await validateDirectoryRule(projectPath, rule.directory, ruleName);
|
|
20
|
-
results.push(...dirResults);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return results;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=executeValidationRules.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executeValidationRules.js","sourceRoot":"","sources":["../../src/executeValidationRules.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,sBAAsB,CAClD,WAAmB,EACnB,MAAc;IAEd,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,0CAA0C;IAC1C,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,oDAAoD;QACpD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS;YACzE,SAAS;QAEX,oEAAoE;QACpE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC9C,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,gDAAgD;gBAChD,MAAM,WAAW,GAAG,MAAM,gBAAgB,CACxC,WAAW,EACX,IAAI,CAAC,IAAI,EACT,QAAQ,CACT,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;YAC/B,CAAC;iBAAM,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;gBAC/B,qDAAqD;gBACrD,MAAM,UAAU,GAAG,MAAM,qBAAqB,CAC5C,WAAW,EACX,IAAI,CAAC,SAAS,EACd,QAAQ,CACT,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { readdir } from "node:fs/promises";
|
|
2
|
-
export default async function listDirectory(path) {
|
|
3
|
-
const entries = await readdir(path, { withFileTypes: true });
|
|
4
|
-
const files = entries
|
|
5
|
-
.filter((entry) => entry.isFile())
|
|
6
|
-
.map((entry) => entry.name);
|
|
7
|
-
const directories = entries
|
|
8
|
-
.filter((entry) => entry.isDirectory())
|
|
9
|
-
.map((entry) => entry.name);
|
|
10
|
-
return { files, directories };
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=listDirectory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listDirectory.js","sourceRoot":"","sources":["../../src/listDirectory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,aAAa,CACzC,IAAY;IAEZ,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,OAAO;SAClB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;SACjC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,OAAO;SACxB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;SACtC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import resolveSchema from "./resolveSchema.js";
|
|
2
|
-
export default async function loadFullSchema(schemaArg) {
|
|
3
|
-
const schema = await resolveSchema(schemaArg);
|
|
4
|
-
if (schema.extends) {
|
|
5
|
-
const baseSchemas = await Promise.all(schema.extends.map(loadFullSchema));
|
|
6
|
-
const baseRules = baseSchemas.reduce((acc, s) => {
|
|
7
|
-
const { $schema, name, extends: _, ...rules } = s;
|
|
8
|
-
return Object.assign(acc, rules);
|
|
9
|
-
}, {});
|
|
10
|
-
const { $schema, name, extends: _, ...rules } = schema;
|
|
11
|
-
return Object.assign({}, baseRules, rules, { $schema, name });
|
|
12
|
-
}
|
|
13
|
-
return schema;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=loadFullSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadFullSchema.js","sourceRoot":"","sources":["../../src/loadFullSchema.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAG/C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,cAAc,CAC1C,SAAiB;IAEjB,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;QAC1E,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAC9C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;YAClD,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACvD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import ajv from "./ajv.js";
|
|
5
|
-
import motherSchema from "./schema.json" with { type: "json" };
|
|
6
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = dirname(__filename);
|
|
8
|
-
const validateSchema = ajv.compile(motherSchema);
|
|
9
|
-
function formatValidationErrors(errors) {
|
|
10
|
-
// Group errors by property path
|
|
11
|
-
const errorsByPath = new Map();
|
|
12
|
-
for (const error of errors) {
|
|
13
|
-
const path = error.instancePath || "/";
|
|
14
|
-
const message = error.message || "validation failed";
|
|
15
|
-
if (!errorsByPath.has(path)) {
|
|
16
|
-
errorsByPath.set(path, []);
|
|
17
|
-
}
|
|
18
|
-
// Safe access using optional chaining
|
|
19
|
-
errorsByPath.get(path)?.push(message);
|
|
20
|
-
}
|
|
21
|
-
// Format as readable list
|
|
22
|
-
const formattedErrors = Array.from(errorsByPath.entries())
|
|
23
|
-
.map(([path, messages]) => {
|
|
24
|
-
const uniqueMessages = [...new Set(messages)]; // Remove duplicates
|
|
25
|
-
const property = path === "/" ? "root" : path.replace("/", "");
|
|
26
|
-
return ` ${property}: ${uniqueMessages.join(", ")}`;
|
|
27
|
-
})
|
|
28
|
-
.join("\n");
|
|
29
|
-
return `Schema validation failed:\n${formattedErrors}`;
|
|
30
|
-
}
|
|
31
|
-
export default async function resolveSchema(schemaArg) {
|
|
32
|
-
let schemaData;
|
|
33
|
-
let schemaSource;
|
|
34
|
-
if (schemaArg.startsWith("http://") || schemaArg.startsWith("https://")) {
|
|
35
|
-
schemaSource = schemaArg;
|
|
36
|
-
const response = await fetch(schemaArg);
|
|
37
|
-
schemaData = (await response.json());
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
let schemaPath = schemaArg;
|
|
41
|
-
if (!schemaPath.endsWith(".json")) {
|
|
42
|
-
schemaPath += ".json";
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
schemaSource = schemaPath;
|
|
46
|
-
schemaData = JSON.parse(await readFile(schemaPath, "utf-8"));
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
const bundledPath = join(__dirname, "../../rulesets", schemaPath);
|
|
50
|
-
try {
|
|
51
|
-
schemaSource = bundledPath;
|
|
52
|
-
schemaData = JSON.parse(await readFile(bundledPath, "utf-8"));
|
|
53
|
-
}
|
|
54
|
-
catch (bundledError) {
|
|
55
|
-
throw new Error(`Could not find ruleset: '${schemaArg}'. Checked local path '${schemaPath}' and bundled path '${bundledPath}'. Available bundled rulesets: base, package, package-react`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// Log where the ruleset was successfully loaded from
|
|
60
|
-
console.log(`Loaded ruleset from: ${schemaSource}`);
|
|
61
|
-
if (!validateSchema(schemaData)) {
|
|
62
|
-
const errorMessage = formatValidationErrors(validateSchema.errors || []);
|
|
63
|
-
throw new Error(`Invalid ruleset from ${schemaSource}:\n${errorMessage}`);
|
|
64
|
-
}
|
|
65
|
-
return schemaData;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=resolveSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSchema.js","sourceRoot":"","sources":["../../src/resolveSchema.ts"],"names":[],"mappings":"AAAA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C,MAAM,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,YAAY,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CACb,4BAA4B,SAAS,0BAA0B,UAAU,uBAAuB,WAAW,6DAA6D,CACzK,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,qDAAqD;IACrD,OAAO,CAAC,GAAG,CAAC,wBAAwB,YAAY,EAAE,CAAC,CAAC;IAEpD,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,MAAM,YAAY,GAAG,sBAAsB,CAAC,cAAc,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,wBAAwB,YAAY,MAAM,YAAY,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { stat } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import listDirectory from "./listDirectory.js";
|
|
4
|
-
import validateFileRule from "./validateFileRule.js";
|
|
5
|
-
export default async function validateDirectoryRule(projectPath, dirRule, ruleName) {
|
|
6
|
-
const dirPath = join(projectPath, dirRule.name);
|
|
7
|
-
const results = [];
|
|
8
|
-
// Check if directory exists
|
|
9
|
-
try {
|
|
10
|
-
const stats = await stat(dirPath);
|
|
11
|
-
if (!stats.isDirectory()) {
|
|
12
|
-
return [
|
|
13
|
-
{
|
|
14
|
-
rule: ruleName, // Use the rule name from schema
|
|
15
|
-
passed: false,
|
|
16
|
-
message: `Expected directory but found file: ${dirPath}`,
|
|
17
|
-
context: {
|
|
18
|
-
type: "directory",
|
|
19
|
-
target: dirPath,
|
|
20
|
-
description: `Validates directory structure for ${dirRule.name}`,
|
|
21
|
-
actualValue: "[File found instead of directory]",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
if (e.code === "ENOENT") {
|
|
29
|
-
return [
|
|
30
|
-
{
|
|
31
|
-
rule: ruleName, // Use the rule name from schema
|
|
32
|
-
passed: false,
|
|
33
|
-
message: `Directory not found: ${dirPath}`,
|
|
34
|
-
context: {
|
|
35
|
-
type: "directory",
|
|
36
|
-
target: dirPath,
|
|
37
|
-
description: `Validates directory structure for ${dirRule.name}`,
|
|
38
|
-
actualValue: "[Directory not found]",
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
return [
|
|
44
|
-
{
|
|
45
|
-
rule: ruleName, // Use the rule name from schema
|
|
46
|
-
passed: false,
|
|
47
|
-
message: `Error accessing directory: ${e.message}`,
|
|
48
|
-
context: {
|
|
49
|
-
type: "directory",
|
|
50
|
-
target: dirPath,
|
|
51
|
-
description: `Validates directory structure for ${dirRule.name}`,
|
|
52
|
-
actualValue: `[Access Error: ${e.message}]`,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
];
|
|
56
|
-
}
|
|
57
|
-
// Validate contained files and directories
|
|
58
|
-
if (dirRule.contains) {
|
|
59
|
-
if (dirRule.contains.files) {
|
|
60
|
-
for (const fileRule of dirRule.contains.files) {
|
|
61
|
-
// When validating files within a directory rule, use a combined rule name
|
|
62
|
-
const fileRuleName = `${ruleName}/${fileRule.name}`;
|
|
63
|
-
const fileResults = await validateFileRule(dirPath, fileRule, fileRuleName);
|
|
64
|
-
results.push(...fileResults);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
if (dirRule.contains.directories) {
|
|
68
|
-
for (const subDirRule of dirRule.contains.directories) {
|
|
69
|
-
// When validating subdirectories, use a combined rule name
|
|
70
|
-
const subDirRuleName = `${ruleName}/${subDirRule.name}`;
|
|
71
|
-
const subDirResults = await validateDirectoryRule(dirPath, subDirRule, subDirRuleName);
|
|
72
|
-
results.push(...subDirResults);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Strict mode validation
|
|
77
|
-
if (dirRule.strict) {
|
|
78
|
-
const { files, directories } = await listDirectory(dirPath);
|
|
79
|
-
const expectedFiles = dirRule.contains?.files?.map((f) => f.name) || [];
|
|
80
|
-
const expectedDirs = dirRule.contains?.directories?.map((d) => d.name) || [];
|
|
81
|
-
const extraFiles = files.filter((f) => !expectedFiles.includes(f));
|
|
82
|
-
const extraDirs = directories.filter((d) => !expectedDirs.includes(d));
|
|
83
|
-
if (extraFiles.length > 0 || extraDirs.length > 0) {
|
|
84
|
-
let message = "Strict mode: ";
|
|
85
|
-
if (extraFiles.length > 0)
|
|
86
|
-
message += `extra files found: ${extraFiles.join(", ")}`;
|
|
87
|
-
if (extraDirs.length > 0) {
|
|
88
|
-
if (extraFiles.length > 0)
|
|
89
|
-
message += "; ";
|
|
90
|
-
message += `extra directories found: ${extraDirs.join(", ")}`;
|
|
91
|
-
}
|
|
92
|
-
results.push({
|
|
93
|
-
rule: ruleName, // Use the rule name from schema
|
|
94
|
-
passed: false,
|
|
95
|
-
message,
|
|
96
|
-
context: {
|
|
97
|
-
type: "directory",
|
|
98
|
-
target: dirPath,
|
|
99
|
-
description: `Strict validation for ${dirRule.name}`,
|
|
100
|
-
actualValue: { extraFiles, extraDirs },
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// If no errors were found (or all were passing), add a success result
|
|
106
|
-
if (results.length === 0 || results.every((r) => r.passed)) {
|
|
107
|
-
results.push({
|
|
108
|
-
rule: ruleName, // Use the rule name from schema
|
|
109
|
-
passed: true,
|
|
110
|
-
context: {
|
|
111
|
-
type: "directory",
|
|
112
|
-
target: dirPath,
|
|
113
|
-
description: `Validates directory structure for ${dirRule.name}`,
|
|
114
|
-
actualValue: "[Directory exists and structure is valid]",
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
return results;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=validateDirectoryRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateDirectoryRule.js","sourceRoot":"","sources":["../../src/validateDirectoryRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,qBAAqB,CACjD,WAAmB,EACnB,OAAsB,EACtB,QAAgB;IAEhB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,4BAA4B;IAC5B,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACzB,OAAO;gBACL;oBACE,IAAI,EAAE,QAAQ,EAAE,gCAAgC;oBAChD,MAAM,EAAE,KAAK;oBACb,OAAO,EAAE,sCAAsC,OAAO,EAAE;oBACxD,OAAO,EAAE;wBACP,IAAI,EAAE,WAAoB;wBAC1B,MAAM,EAAE,OAAO;wBACf,WAAW,EAAE,qCAAqC,OAAO,CAAC,IAAI,EAAE;wBAChE,WAAW,EAAE,mCAAmC;qBACjD;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAK,CAA2B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACnD,OAAO;gBACL;oBACE,IAAI,EAAE,QAAQ,EAAE,gCAAgC;oBAChD,MAAM,EAAE,KAAK;oBACb,OAAO,EAAE,wBAAwB,OAAO,EAAE;oBAC1C,OAAO,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AC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChE,CAAC;YACD,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,QAAQ,EAAE,gCAAgC;gBAChD,MAAM,EAAE,KAAK;gBACb,OAAO;gBACP,OAAO,EAAE;oBACP,IAAI,EAAE,WAAoB;oBAC1B,MAAM,EAAE,OAAO;oBACf,WAAW,EAAE,yBAAyB,OAAO,CAAC,IAAI,EAAE;oBACpD,WAAW,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;iBACvC;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,sEAAsE;IACtE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,QAAQ,EAAE,gCAAgC;YAChD,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,WAAoB;gBAC1B,MAAM,EAAE,OAAO;gBACf,WAAW,EAAE,qCAAqC,OAAO,CAAC,IAAI,EAAE;gBAChE,WAAW,EAAE,2CAA2C;aACzD;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import ajv from "./ajv.js";
|
|
4
|
-
// Generate a human-readable description of what a schema validates
|
|
5
|
-
// Using JSONSchema7 type for better type safety than 'any'
|
|
6
|
-
function describeSchema(schema) {
|
|
7
|
-
const descriptions = [];
|
|
8
|
-
if (schema.type) {
|
|
9
|
-
if (typeof schema.type === "string") {
|
|
10
|
-
descriptions.push(`must be ${schema.type}`);
|
|
11
|
-
}
|
|
12
|
-
else if (Array.isArray(schema.type)) {
|
|
13
|
-
descriptions.push(`must be one of: ${schema.type.join(", ")}`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (schema.const !== undefined) {
|
|
17
|
-
descriptions.push(`must equal "${schema.const}"`);
|
|
18
|
-
}
|
|
19
|
-
if (typeof schema.pattern === "string") {
|
|
20
|
-
descriptions.push(`must match pattern /${schema.pattern}/`);
|
|
21
|
-
}
|
|
22
|
-
if (schema.required && Array.isArray(schema.required)) {
|
|
23
|
-
descriptions.push(`must have properties: ${schema.required.join(", ")}`);
|
|
24
|
-
}
|
|
25
|
-
if (schema.properties && typeof schema.properties === "object") {
|
|
26
|
-
const propNames = Object.keys(schema.properties);
|
|
27
|
-
if (propNames.length <= 3) {
|
|
28
|
-
descriptions.push(`expected properties: ${propNames.join(", ")}`);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
descriptions.push(`validates ${propNames.length} properties`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (descriptions.length === 0) {
|
|
35
|
-
return "validates file content structure";
|
|
36
|
-
}
|
|
37
|
-
return descriptions.join(", ");
|
|
38
|
-
}
|
|
39
|
-
export default async function validateFileRule(projectPath, fileRule, ruleName) {
|
|
40
|
-
const filePath = join(projectPath, fileRule.name);
|
|
41
|
-
// Prepare base context for verbose output using the actual rule name
|
|
42
|
-
const baseContext = {
|
|
43
|
-
type: "file",
|
|
44
|
-
target: filePath,
|
|
45
|
-
description: `Validates that ${fileRule.name} ${describeSchema(fileRule.contains)}`,
|
|
46
|
-
schema: fileRule.contains,
|
|
47
|
-
};
|
|
48
|
-
try {
|
|
49
|
-
const content = await readFile(filePath, "utf-8");
|
|
50
|
-
try {
|
|
51
|
-
const json = JSON.parse(content);
|
|
52
|
-
const validate = ajv.compile(fileRule.contains);
|
|
53
|
-
const valid = validate(json);
|
|
54
|
-
if (valid) {
|
|
55
|
-
return [
|
|
56
|
-
{
|
|
57
|
-
rule: ruleName, // Use the rule name from schema, not filename
|
|
58
|
-
passed: true,
|
|
59
|
-
context: {
|
|
60
|
-
...baseContext,
|
|
61
|
-
actualValue: json,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
return [
|
|
67
|
-
{
|
|
68
|
-
rule: ruleName, // Use the rule name from schema, not filename
|
|
69
|
-
passed: false,
|
|
70
|
-
message: `Validation failed: ${JSON.stringify(validate.errors)}`,
|
|
71
|
-
context: {
|
|
72
|
-
...baseContext,
|
|
73
|
-
actualValue: json,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
catch (parseError) {
|
|
79
|
-
return [
|
|
80
|
-
{
|
|
81
|
-
rule: ruleName, // Use the rule name from schema, not filename
|
|
82
|
-
passed: false,
|
|
83
|
-
message: `Invalid JSON: ${parseError.message}`,
|
|
84
|
-
context: {
|
|
85
|
-
...baseContext,
|
|
86
|
-
actualValue: `[Parse Error: ${parseError.message}]`,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (readError) {
|
|
93
|
-
if (readError.code === "ENOENT") {
|
|
94
|
-
return [
|
|
95
|
-
{
|
|
96
|
-
rule: ruleName, // Use the rule name from schema, not filename
|
|
97
|
-
passed: false,
|
|
98
|
-
message: `File not found: ${filePath}`,
|
|
99
|
-
context: {
|
|
100
|
-
...baseContext,
|
|
101
|
-
actualValue: "[File not found]",
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
];
|
|
105
|
-
}
|
|
106
|
-
return [
|
|
107
|
-
{
|
|
108
|
-
rule: ruleName, // Use the rule name from schema, not filename
|
|
109
|
-
passed: false,
|
|
110
|
-
message: `Error reading file: ${readError.message}`,
|
|
111
|
-
context: {
|
|
112
|
-
...baseContext,
|
|
113
|
-
actualValue: `[Read Error: ${readError.message}]`,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
];
|
|
117
|
-
}
|
|
118
|
-
}
|
|
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AAE,QAAQ,EAAE,8CAA8C;gBAC9D,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,uBAAwB,SAAmB,CAAC,OAAO,EAAE;gBAC9D,OAAO,EAAE;oBACP,GAAG,WAAW;oBACd,WAAW,EAAE,gBAAiB,SAAmB,CAAC,OAAO,GAAG;iBAC7D;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import validateDirectoryRule from "./validateDirectoryRule.js";
|
|
2
|
-
import validateFileRule from "./validateFileRule.js";
|
|
3
|
-
/**
|
|
4
|
-
* Legacy validation function maintained for backward compatibility.
|
|
5
|
-
* Consider using executeValidationRules.ts for new code as it provides
|
|
6
|
-
* better rule name tracking and inheritance support.
|
|
7
|
-
*/
|
|
8
|
-
export default async function validateProject(projectPath, schema) {
|
|
9
|
-
const results = [];
|
|
10
|
-
// Iterate through schema rules, similar to executeValidationRules but simpler
|
|
11
|
-
for (const [ruleName, rule] of Object.entries(schema)) {
|
|
12
|
-
// Skip meta-properties that aren't validation rules
|
|
13
|
-
if (ruleName === "$schema" || ruleName === "name" || ruleName === "extends")
|
|
14
|
-
continue;
|
|
15
|
-
// Type guard to ensure rule is an object with 'file' or 'directory'
|
|
16
|
-
if (typeof rule === "object" && rule !== null) {
|
|
17
|
-
if ("file" in rule) {
|
|
18
|
-
// Pass the rule name context to match current function signature
|
|
19
|
-
const fileResults = await validateFileRule(projectPath, rule.file, ruleName);
|
|
20
|
-
results.push(...fileResults);
|
|
21
|
-
}
|
|
22
|
-
else if ("directory" in rule) {
|
|
23
|
-
// Pass the rule name context to match current function signature
|
|
24
|
-
const dirResults = await validateDirectoryRule(projectPath, rule.directory, ruleName);
|
|
25
|
-
results.push(...dirResults);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return results;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=validateProject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateProject.js","sourceRoot":"","sources":["../../src/validateProject.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AAErD;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,eAAe,CAC3C,WAAmB,EACnB,MAAc;IAEd,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,8EAA8E;IAC9E,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,oDAAoD;QACpD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS;YACzE,SAAS;QAEX,oEAAoE;QACpE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAC9C,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,iEAAiE;gBACjE,MAAM,WAAW,GAAG,MAAM,gBAAgB,CACxC,WAAW,EACX,IAAI,CAAC,IAAI,EACT,QAAQ,CACT,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;YAC/B,CAAC;iBAAM,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;gBAC/B,iEAAiE;gBACjE,MAAM,UAAU,GAAG,MAAM,qBAAqB,CAC5C,WAAW,EACX,IAAI,CAAC,SAAS,EACd,QAAQ,CACT,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/types/ajv.d.ts
DELETED
package/dist/types/ajv.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ajv.d.ts","sourceRoot":"","sources":["../../src/ajv.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,KAAK,CAAC;AAqB7B,QAAA,MAAM,GAAG,gBAIP,CAAC;AA4CH,eAAe,GAAG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executeValidationRules.d.ts","sourceRoot":"","sources":["../../src/executeValidationRules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI3D,wBAA8B,sBAAsB,CAClD,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA+B7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listDirectory.d.ts","sourceRoot":"","sources":["../../src/listDirectory.ts"],"names":[],"mappings":"AAEA,wBAA8B,aAAa,CACzC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CASrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loadFullSchema.d.ts","sourceRoot":"","sources":["../../src/loadFullSchema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,wBAA8B,cAAc,CAC1C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAYjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSchema.d.ts","sourceRoot":"","sources":["../../src/resolveSchema.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAkCzC,wBAA8B,aAAa,CACzC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAuCjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateDirectoryRule.d.ts","sourceRoot":"","sources":["../../src/validateDirectoryRule.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGlE,wBAA8B,qBAAqB,CACjD,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8H7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateFileRule.d.ts","sourceRoot":"","sources":["../../src/validateFileRule.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AA2C7D,wBAA8B,gBAAgB,CAC5C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAiF7B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Schema, ValidationResult } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Legacy validation function maintained for backward compatibility.
|
|
4
|
-
* Consider using executeValidationRules.ts for new code as it provides
|
|
5
|
-
* better rule name tracking and inheritance support.
|
|
6
|
-
*/
|
|
7
|
-
export default function validateProject(projectPath: string, schema: Schema): Promise<ValidationResult[]>;
|
|
8
|
-
//# sourceMappingURL=validateProject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateProject.d.ts","sourceRoot":"","sources":["../../src/validateProject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI3D;;;;GAIG;AACH,wBAA8B,eAAe,CAC3C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA+B7B"}
|