@canonical/webarchitect 0.12.0-experimental.0 → 0.12.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/README.md +2 -1
- package/package.json +4 -4
- package/rulesets/base.ruleset.json +1 -1
- package/rulesets/library.ruleset.json +1 -1
- package/rulesets/package-react.ruleset.json +1 -1
- package/rulesets/package-svelte.ruleset.json +101 -0
- package/rulesets/package.ruleset.json +1 -1
- package/rulesets/tool-ts.ruleset.json +1 -1
- package/rulesets/tool.ruleset.json +1 -1
package/README.md
CHANGED
|
@@ -105,6 +105,8 @@ Webarchitect comes with several built-in rulesets that cover common project patt
|
|
|
105
105
|
|
|
106
106
|
- `package-react`: - Extends base-package with React-specific requirements. This ruleset includes all the base package validations plus verification that React 19 or higher is specified as a dependency, ensuring your React projects use compatible versions.
|
|
107
107
|
|
|
108
|
+
- `package-svelte`: Extends the `package` ruleset for Svelte packages by redirecting output to a `dist/` folder built via **`svelte-package`** (necessary to compile components into valid JavaScript with the correct export conditions for bundlers) and requiring `check:ts` to run **`svelte-check`** (essential to leverage Svelte's additional type inference and specific validation logic that standard `tsc` does not provide).
|
|
109
|
+
|
|
108
110
|
### Ruleset Inheritance
|
|
109
111
|
|
|
110
112
|
Rulesets can extend other rulesets, creating a hierarchy of validation requirements. For example, package-react extends base-package, which extends base. This means when you validate against package-react, you're actually running all three sets of rules. This inheritance model allows you to build complex validation requirements while keeping individual rulesets focused and maintainable.
|
|
@@ -272,6 +274,5 @@ The programmatic API makes it easy to integrate webarchitect into existing build
|
|
|
272
274
|
|
|
273
275
|
- **Plain Text File Validation** - Webarchitect only validates JSON files. While it can verify that plain text files like LICENSE or README.md exist, it cannot validate their contents. This limitation affects license text verification, documentation standards, and configuration files that use non-JSON formats.
|
|
274
276
|
- **IDE Integration** - No real-time validation feedback is available yet in code editors. Developers must run webarchitect manually or through build scripts to see validation results. Real-time diagnostics would require Language Server Protocol implementation or editor-specific plugins.
|
|
275
|
-
- **Svelte support** - No svelte-specific ruleset has been developed yet.
|
|
276
277
|
- **Error Code Granularity** - All validation failures return the same exit code (1) regardless of failure type. Missing files, invalid JSON syntax, and schema validation failures are not distinguished programmatically. This limits automated error handling and reporting capabilities.
|
|
277
278
|
|
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.12.0
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "src/index.ts",
|
|
7
7
|
"types": "src/index.ts",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@biomejs/biome": "2.3.11",
|
|
41
|
-
"@canonical/biome-config": "^0.
|
|
42
|
-
"@canonical/typescript-config-base": "^0.
|
|
41
|
+
"@canonical/biome-config": "^0.12.0",
|
|
42
|
+
"@canonical/typescript-config-base": "^0.12.0",
|
|
43
43
|
"@types/json-schema": "^7.0.15",
|
|
44
44
|
"typescript": "^5.9.3"
|
|
45
45
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"chalk": "^5.6.2",
|
|
49
49
|
"commander": "^14.0.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "0b491caff8f797fef4ba4b7f5514a7c5b915a481"
|
|
52
52
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/canonical/pragma/refs/heads/main/packages/webarchitect/src/schema.json",
|
|
3
|
+
"name": "package-svelte",
|
|
4
|
+
"extends": ["package"],
|
|
5
|
+
"biome": {
|
|
6
|
+
"file": {
|
|
7
|
+
"name": "biome.json",
|
|
8
|
+
"contains": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"extends": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": { "const": "@canonical/biome-config-svelte" },
|
|
14
|
+
"minItems": 1,
|
|
15
|
+
"maxItems": 1
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": ["extends"]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"package-structure": {
|
|
23
|
+
"file": {
|
|
24
|
+
"name": "package.json",
|
|
25
|
+
"contains": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"name": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^@canonical/"
|
|
31
|
+
},
|
|
32
|
+
"version": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"type": {
|
|
36
|
+
"const": "module"
|
|
37
|
+
},
|
|
38
|
+
"module": {
|
|
39
|
+
"const": "dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"types": {
|
|
42
|
+
"const": "dist/index.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"files": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"contains": { "const": "dist" }
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"properties": {
|
|
51
|
+
"build": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"pattern": ".*svelte-package.*",
|
|
54
|
+
"description": "Build must use svelte-package"
|
|
55
|
+
},
|
|
56
|
+
"test": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Test command (implementation flexible)"
|
|
59
|
+
},
|
|
60
|
+
"check:ts": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^svelte-check\\s"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": ["build", "test", "check:ts"]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": [
|
|
69
|
+
"name",
|
|
70
|
+
"version",
|
|
71
|
+
"type",
|
|
72
|
+
"module",
|
|
73
|
+
"types",
|
|
74
|
+
"files",
|
|
75
|
+
"scripts"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"package-svelte": {
|
|
81
|
+
"file": {
|
|
82
|
+
"name": "package.json",
|
|
83
|
+
"contains": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"properties": {
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"properties": {
|
|
89
|
+
"svelte": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"pattern": "^(\\^|~|>=)?5\\."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"required": ["svelte"]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": ["peerDependencies"]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|