@brutalway/check-tree 0.6.0 → 0.8.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 +19 -6
- package/dist/checkTree.js +11 -4
- package/dist/sharedViolations.d.ts +1 -0
- package/dist/sharedViolations.js +6 -0
- package/dist/sliceViolations-DojT6WkL.js +139 -0
- package/dist/{treeViolations-CeTXg9WP.js → treeViolations-CEQ5ks7L.js} +33 -24
- package/dist/treeViolations.js +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# @brutalway/check-tree
|
|
2
2
|
|
|
3
|
-
Checks the folders of a source tree, which a linter does not see: only the folders the layout names, no empty folder, no category folder with a single child,
|
|
3
|
+
Checks the folders of a source tree, which a linter does not see: only the folders the layout names, no empty folder, no category folder with a single child, files of one kind grouped in that kind's folder once there are two of them, no file in a slice of `shared/` that a single feature uses, and no slice whose files never import each other.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install --save-dev @brutalway/check-tree
|
|
8
|
+
npm install --save-dev @brutalway/check-tree dependency-cruiser
|
|
9
9
|
npx check-tree src
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
check-tree runs from the folder that holds the dependency-cruiser config (`.dependency-cruiser.cjs` and the like) and reads it to resolve the imports, with the same tsconfig and aliases.
|
|
13
|
+
|
|
12
14
|
## Usage
|
|
13
15
|
|
|
14
16
|
### Use your own category folders
|
|
@@ -35,16 +37,22 @@ import { treeViolations } from '@brutalway/check-tree/treeViolations';
|
|
|
35
37
|
const violations = treeViolations('src');
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
It takes the category folders as second argument and `{ rootEntries: true }` as third, like `--categories` and `--root-entries`.
|
|
40
|
+
It takes the category folders as second argument and `{ rootEntries: true }` as third, like `--categories` and `--root-entries`. The checks on the slices of `shared/` read the imports, so they have their own export:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { sharedViolations } from '@brutalway/check-tree/sharedViolations';
|
|
44
|
+
|
|
45
|
+
const violations = await sharedViolations('src');
|
|
46
|
+
```
|
|
39
47
|
|
|
40
48
|
## Reference
|
|
41
49
|
|
|
42
50
|
### Rules
|
|
43
51
|
|
|
44
52
|
- a folder has a name the layout gives it:
|
|
45
|
-
- `src/` holds `app/`, `features
|
|
46
|
-
- `
|
|
47
|
-
- a feature (`features/<x>/`) or a
|
|
53
|
+
- `src/` holds `app/`, `features/` and `shared/`, next to its entry files. `app/` belongs to the router, so its folders are not checked and its files stay where they are, whatever their kind
|
|
54
|
+
- a `shared/`, at any depth, holds one folder per slice, named after its concept (`shared/todos/`, `shared/errors/`), and no file
|
|
55
|
+
- a feature (`features/<x>/`) or a slice (`shared/<x>/`), at any depth, holds kind folders, `features/` for its sub-features and `shared/` for the slices they share
|
|
48
56
|
- a kind folder holds kind folders only, like `presenters/` inside `components/`
|
|
49
57
|
- no empty folder
|
|
50
58
|
- a category folder (`components`, `hooks`, `stores`…) does not hold a single child: move the child up and delete the folder
|
|
@@ -69,6 +77,11 @@ It takes the category folders as second argument and `{ rootEntries: true }` as
|
|
|
69
77
|
| `stores/` | `xStore.ts` |
|
|
70
78
|
| `lib/` | any other `.ts` file, except `xContent.ts`, `xEnv.ts` and `.d.ts` |
|
|
71
79
|
|
|
80
|
+
- a file of a slice is used by at least two consumers. For `src/shared/`, a consumer is a feature or another slice, a sub-feature counting as the feature it sits in. For the `shared/` of a feature or a slice, a consumer is one of its sub-features, another of its slices, or its own files outside them. A file imported by another file of the same slice gets the consumers of that file. A test counts for the feature it sits in, since moving the file would make that test import another feature, and a test next to the file in the slice adds no consumer. A file of `src/shared/` used only by `app/` or by the entry files of `src/` passes. A file with a single consumer gets `src/shared/dates/format.ts is only used by src/features/cart: move it into src/features/cart`, which also catches a whole slice used by one feature.
|
|
81
|
+
- the files of a slice, tests aside, form one group in the import graph, whatever the direction of the imports. Since two slices never import each other, the folder then only names a boundary the graph already draws. A `shared/utils/` holding `errorMessage.ts`, `isRecord.ts` and `packageRoot.ts`, which do not import each other, gets `src/shared/utils holds 3 groups of files that never import each other (errorMessage.ts) (isRecord.ts) (packageRoot.ts): split it into one slice per group`. A slice of a single file is fine.
|
|
82
|
+
|
|
83
|
+
The first of these two rules says why a file is shared, the second why files sit together. Each one lets through what the other catches: in the `shared/utils/` above, each file has two consumers.
|
|
84
|
+
|
|
72
85
|
So a feature with two components puts them in `components/`, and a `components/` folder with two presenters puts them in `presenters/`. The `components/` rule does not apply inside `components/`, `orchestrators/` or `presenters/`.
|
|
73
86
|
|
|
74
87
|
Test files (`*.test.ts`, `*.test.tsx`) are not counted.
|
package/dist/checkTree.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as treeViolations } from "./treeViolations-
|
|
2
|
+
import { t as treeViolations } from "./treeViolations-CEQ5ks7L.js";
|
|
3
|
+
import { n as cruiseImports, t as sliceViolations } from "./sliceViolations-DojT6WkL.js";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { parseArgs } from "node:util";
|
|
5
6
|
// src/checkTree.ts
|
|
@@ -10,8 +11,14 @@ const { values, positionals } = parseArgs({
|
|
|
10
11
|
"root-entries": { type: "boolean" }
|
|
11
12
|
}
|
|
12
13
|
});
|
|
14
|
+
const folder = positionals[0] ?? "src";
|
|
13
15
|
const categories = values.categories?.split(",").map((category) => category.trim());
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
try {
|
|
17
|
+
const violations = [...treeViolations(resolve(folder), categories, { rootEntries: values["root-entries"] === true }), ...sliceViolations(folder, await cruiseImports(folder))];
|
|
18
|
+
for (const violation of violations) console.error(violation);
|
|
19
|
+
process.exitCode = violations.length === 0 ? 0 : 1;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
}
|
|
17
24
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sharedViolations(root: string): Promise<string[]>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { dirname, normalize } from "node:path";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { cruise } from "dependency-cruiser";
|
|
4
|
+
import extractDepcruiseOptions from "dependency-cruiser/config-utl/extract-depcruise-options";
|
|
5
|
+
import extractTSConfig from "dependency-cruiser/config-utl/extract-ts-config";
|
|
6
|
+
// src/features/shared-consumers/lib/cruiseImports.ts
|
|
7
|
+
const CONFIG_FILES = [
|
|
8
|
+
".dependency-cruiser.js",
|
|
9
|
+
".dependency-cruiser.cjs",
|
|
10
|
+
".dependency-cruiser.mjs",
|
|
11
|
+
".dependency-cruiser.json"
|
|
12
|
+
];
|
|
13
|
+
async function cruiseImports(root) {
|
|
14
|
+
const configFile = CONFIG_FILES.find((file) => existsSync(file));
|
|
15
|
+
if (configFile === void 0) throw new Error(`check-tree reads the dependency-cruiser config to resolve imports, and the current folder has none of ${CONFIG_FILES.join(", ")}`);
|
|
16
|
+
const options = await extractDepcruiseOptions(`./${configFile}`);
|
|
17
|
+
const tsConfigFile = options.tsConfig?.fileName;
|
|
18
|
+
const result = await cruise([root], {
|
|
19
|
+
...options,
|
|
20
|
+
validate: false,
|
|
21
|
+
tsPreCompilationDeps: true
|
|
22
|
+
}, {}, { tsConfig: tsConfigFile === void 0 ? void 0 : extractTSConfig(tsConfigFile) });
|
|
23
|
+
if (typeof result.output === "string") throw new Error(result.output);
|
|
24
|
+
return result.output.modules.map(({ source, dependencies }) => ({
|
|
25
|
+
source,
|
|
26
|
+
imports: dependencies.map(({ resolved }) => resolved)
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
// src/features/shared-consumers/SharedConsumersConfig.ts
|
|
30
|
+
const TEST_CODE = /\.test\.tsx?$/u;
|
|
31
|
+
const SLICE = /^(?:features|shared)\/[^/]+/u;
|
|
32
|
+
const SLICE_FILE = /^((.*)\/shared\/[^/]+)\//u;
|
|
33
|
+
// src/features/shared-consumers/lib/checkedPaths.ts
|
|
34
|
+
function checkedPaths(checkedFolder) {
|
|
35
|
+
const root = normalize(checkedFolder).replace(/\/$/u, "");
|
|
36
|
+
const parent = dirname(root);
|
|
37
|
+
return {
|
|
38
|
+
root,
|
|
39
|
+
shown: (path) => parent === "." ? path : path.slice(parent.length + 1)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// src/features/shared-consumers/lib/consumerSlots.ts
|
|
43
|
+
function slotOf(owner, importer) {
|
|
44
|
+
if (!importer.startsWith(`${owner}/`)) return importer;
|
|
45
|
+
const slice = SLICE.exec(importer.slice(owner.length + 1));
|
|
46
|
+
return slice === null ? owner : `${owner}/${slice[0]}`;
|
|
47
|
+
}
|
|
48
|
+
function importersByModule(modules) {
|
|
49
|
+
const importers = /* @__PURE__ */ new Map();
|
|
50
|
+
for (const { source, imports } of modules) for (const target of imports) importers.set(target, [...importers.get(target) ?? [], source]);
|
|
51
|
+
return importers;
|
|
52
|
+
}
|
|
53
|
+
function consumerSlots(modules) {
|
|
54
|
+
const importers = importersByModule(modules);
|
|
55
|
+
const slotsByModule = /* @__PURE__ */ new Map();
|
|
56
|
+
return function slots(path, slice) {
|
|
57
|
+
const key = `${slice.folder}:${path}`;
|
|
58
|
+
const known = slotsByModule.get(key);
|
|
59
|
+
if (known !== void 0) return known;
|
|
60
|
+
const found = /* @__PURE__ */ new Set();
|
|
61
|
+
slotsByModule.set(key, found);
|
|
62
|
+
for (const importer of importers.get(path) ?? []) if (importer.startsWith(`${slice.folder}/`)) for (const slot of slots(importer, slice)) found.add(slot);
|
|
63
|
+
else found.add(slotOf(slice.owner, importer));
|
|
64
|
+
return found;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// src/features/shared-consumers/lib/sliceOf.ts
|
|
68
|
+
function sliceOf(path) {
|
|
69
|
+
const [, folder, owner] = SLICE_FILE.exec(path) ?? [];
|
|
70
|
+
if (folder === void 0 || owner === void 0) return void 0;
|
|
71
|
+
return {
|
|
72
|
+
owner,
|
|
73
|
+
folder
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
// src/features/shared-consumers/lib/sharedConsumerViolations.ts
|
|
77
|
+
function violation(path, owner, slot) {
|
|
78
|
+
if (slot === owner) return `${path} is only used by ${owner} outside its sub-features: move it out of shared/ into the kind folders of ${owner}`;
|
|
79
|
+
return `${path} is only used by ${slot}: move it into ${slot}`;
|
|
80
|
+
}
|
|
81
|
+
function sharedConsumerViolations(checkedFolder, modules) {
|
|
82
|
+
const { root, shown } = checkedPaths(checkedFolder);
|
|
83
|
+
const slots = consumerSlots(modules);
|
|
84
|
+
return modules.flatMap(({ source }) => {
|
|
85
|
+
const slice = sliceOf(source);
|
|
86
|
+
if (slice === void 0 || TEST_CODE.test(source) || !source.startsWith(`${root}/`)) return [];
|
|
87
|
+
const [slot, ...others] = slots(source, slice);
|
|
88
|
+
if (slot === void 0 || others.length > 0) return [];
|
|
89
|
+
if (slice.owner === root && !SLICE.test(slot.slice(root.length + 1))) return [];
|
|
90
|
+
return [violation(shown(source), shown(slice.owner), shown(slot))];
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// src/features/shared-consumers/lib/sliceGroupViolations.ts
|
|
94
|
+
function sliceFolders(root, modules) {
|
|
95
|
+
const folders = /* @__PURE__ */ new Map();
|
|
96
|
+
for (const { source } of modules) {
|
|
97
|
+
const slice = sliceOf(source);
|
|
98
|
+
if (slice !== void 0 && !TEST_CODE.test(source) && source.startsWith(`${root}/`)) folders.set(source, slice.folder);
|
|
99
|
+
}
|
|
100
|
+
return folders;
|
|
101
|
+
}
|
|
102
|
+
function linkedGroups(modules, folders) {
|
|
103
|
+
const parents = new Map([...folders.keys()].map((file) => [file, file]));
|
|
104
|
+
function head(file) {
|
|
105
|
+
const parent = parents.get(file) ?? file;
|
|
106
|
+
if (parent === file) return file;
|
|
107
|
+
const found = head(parent);
|
|
108
|
+
parents.set(file, found);
|
|
109
|
+
return found;
|
|
110
|
+
}
|
|
111
|
+
for (const { source, imports } of modules) {
|
|
112
|
+
const folder = folders.get(source);
|
|
113
|
+
for (const target of imports) if (folder !== void 0 && folders.get(target) === folder) parents.set(head(source), head(target));
|
|
114
|
+
}
|
|
115
|
+
return head;
|
|
116
|
+
}
|
|
117
|
+
function groupsBySlice(folders, head) {
|
|
118
|
+
const slices = /* @__PURE__ */ new Map();
|
|
119
|
+
for (const [file, folder] of [...folders].toSorted(([a], [b]) => a.localeCompare(b))) {
|
|
120
|
+
const groups = slices.get(folder) ?? /* @__PURE__ */ new Map();
|
|
121
|
+
groups.set(head(file), [...groups.get(head(file)) ?? [], file.slice(folder.length + 1)]);
|
|
122
|
+
slices.set(folder, groups);
|
|
123
|
+
}
|
|
124
|
+
return slices;
|
|
125
|
+
}
|
|
126
|
+
function sliceGroupViolations(checkedFolder, modules) {
|
|
127
|
+
const { root, shown } = checkedPaths(checkedFolder);
|
|
128
|
+
const folders = sliceFolders(root, modules);
|
|
129
|
+
return [...groupsBySlice(folders, linkedGroups(modules, folders))].flatMap(([folder, groups]) => {
|
|
130
|
+
if (groups.size < 2) return [];
|
|
131
|
+
const listed = [...groups.values()].map((files) => `(${files.join(", ")})`).join(" ");
|
|
132
|
+
return [`${shown(folder)} holds ${groups.size} groups of files that never import each other ${listed}: split it into one slice per group`];
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
// src/features/shared-consumers/lib/sliceViolations.ts
|
|
136
|
+
function sliceViolations(checkedFolder, modules) {
|
|
137
|
+
return [...sharedConsumerViolations(checkedFolder, modules), ...sliceGroupViolations(checkedFolder, modules)];
|
|
138
|
+
}
|
|
139
|
+
export { cruiseImports as n, sliceViolations as t };
|
|
@@ -116,18 +116,13 @@ const FILE_GROUPS = [
|
|
|
116
116
|
appliesIn: outsideOwnFolder("lib")
|
|
117
117
|
}
|
|
118
118
|
];
|
|
119
|
-
// src/features/tree-violations/features/layout/childLayer.ts
|
|
119
|
+
// src/features/tree-violations/features/layout/lib/childLayer.ts
|
|
120
120
|
const SOURCE_LAYERS = /* @__PURE__ */ new Map([
|
|
121
|
-
["app", "
|
|
121
|
+
["app", "router"],
|
|
122
122
|
["features", "features"],
|
|
123
|
-
["shared
|
|
124
|
-
["shared", "shared"]
|
|
125
|
-
]);
|
|
126
|
-
const FEATURE_LAYERS = /* @__PURE__ */ new Map([
|
|
127
|
-
["features", "features"],
|
|
128
|
-
["shared-features", "features"],
|
|
129
|
-
["shared", "shared"]
|
|
123
|
+
["shared", "slices"]
|
|
130
124
|
]);
|
|
125
|
+
const FEATURE_LAYERS = /* @__PURE__ */ new Map([["features", "features"], ["shared", "slices"]]);
|
|
131
126
|
function kindFolder(path, categories, reason) {
|
|
132
127
|
if (categories.has(basename(path))) return {
|
|
133
128
|
layer: "kind",
|
|
@@ -146,7 +141,7 @@ function sourceChild(path) {
|
|
|
146
141
|
};
|
|
147
142
|
return {
|
|
148
143
|
layer: "free",
|
|
149
|
-
violations: [`${path} is not a layer: ${dirname(path)}/ holds app/, features
|
|
144
|
+
violations: [`${path} is not a layer: ${dirname(path)}/ holds app/, features/ and shared/ next to its entry files, move it into one of them`]
|
|
150
145
|
};
|
|
151
146
|
}
|
|
152
147
|
function featureChild(path, categories) {
|
|
@@ -155,33 +150,46 @@ function featureChild(path, categories) {
|
|
|
155
150
|
layer,
|
|
156
151
|
violations: []
|
|
157
152
|
};
|
|
158
|
-
return kindFolder(path, categories, "a feature holds kind folders, features/ for its sub-features
|
|
153
|
+
return kindFolder(path, categories, "a feature or a slice holds kind folders, features/ for its sub-features and shared/ for the slices they share, move it into features/ as a sub-feature, into shared/ as a slice, or spread its files into kind folders");
|
|
159
154
|
}
|
|
160
155
|
function childLayer(layer, path, categories) {
|
|
161
156
|
if (layer === "source") return sourceChild(path);
|
|
162
|
-
if (layer === "features") return {
|
|
157
|
+
if (layer === "features" || layer === "slices") return {
|
|
163
158
|
layer: "feature",
|
|
164
159
|
violations: []
|
|
165
160
|
};
|
|
166
161
|
if (layer === "feature") return featureChild(path, categories);
|
|
167
|
-
if (layer === "
|
|
162
|
+
if (layer === "router") return {
|
|
163
|
+
layer: "router",
|
|
164
|
+
violations: []
|
|
165
|
+
};
|
|
168
166
|
if (layer === "kind") return kindFolder(path, categories, `${dirname(path)}/ holds its files and kind folders only`);
|
|
169
167
|
return {
|
|
170
168
|
layer: "free",
|
|
171
169
|
violations: []
|
|
172
170
|
};
|
|
173
171
|
}
|
|
172
|
+
// src/features/tree-violations/features/layout/lib/filesCheck.ts
|
|
173
|
+
function filesCheck(layer, holdsEntries) {
|
|
174
|
+
if (layer === "slices") return "slices";
|
|
175
|
+
return layer === "router" || holdsEntries ? "none" : "groups";
|
|
176
|
+
}
|
|
177
|
+
// src/features/tree-violations/features/layout/lib/sliceFileViolations.ts
|
|
178
|
+
function sliceFileViolations(name, files) {
|
|
179
|
+
if (files.length === 0) return [];
|
|
180
|
+
return [`${name} holds ${files.join(", ")}: shared/ holds one folder per slice, move each file into the slice of its concept`];
|
|
181
|
+
}
|
|
174
182
|
// src/features/tree-violations/treeViolations.ts
|
|
175
183
|
function groupViolations(name, folderName, listing, categoryFolders) {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
if (!categoryFolders.has(folder) || !appliesIn(folderName))
|
|
184
|
+
const holdsFilesOnly = categoryFolders.has(folderName) && listing.folders.size === 0;
|
|
185
|
+
return FILE_GROUPS.flatMap(({ folder, belongs, appliesIn }) => {
|
|
186
|
+
if (!categoryFolders.has(folder) || !appliesIn(folderName)) return [];
|
|
179
187
|
const loose = listing.files.filter(belongs);
|
|
180
|
-
if (loose.length === 0)
|
|
181
|
-
if (listing.folders.has(folder))
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
if (loose.length === 0 || holdsFilesOnly && loose.length === listing.files.length) return [];
|
|
189
|
+
if (listing.folders.has(folder)) return [`${name} has a ${folder}/ folder: move ${loose.join(", ")} into it`];
|
|
190
|
+
if (loose.length === 1) return [];
|
|
191
|
+
return [`${name} holds ${loose.length} ${folder} files (${loose.join(", ")}): move them into ${folder}/`];
|
|
192
|
+
});
|
|
185
193
|
}
|
|
186
194
|
function folderListing(entries) {
|
|
187
195
|
return {
|
|
@@ -194,18 +202,19 @@ function shapeViolations(name, count, isCategory) {
|
|
|
194
202
|
if (count === 1 && isCategory) return [`${name} holds a single child: move it up one level and delete the folder`];
|
|
195
203
|
return [];
|
|
196
204
|
}
|
|
197
|
-
function folderViolations(folder, name, categoryFolders,
|
|
205
|
+
function folderViolations(folder, name, categoryFolders, check) {
|
|
198
206
|
const children = readdirSync(folder, { withFileTypes: true }).filter((entry) => !TEST_FILE.test(entry.name));
|
|
199
207
|
const violations = shapeViolations(name, children.length, categoryFolders.has(basename(folder)));
|
|
200
|
-
if (!groupsFiles) return violations;
|
|
201
208
|
const listing = folderListing(children);
|
|
209
|
+
if (check === "slices") return [...violations, ...sliceFileViolations(name, listing.files)];
|
|
210
|
+
if (check === "none") return violations;
|
|
202
211
|
return [...violations, ...groupViolations(name, basename(folder), listing, categoryFolders)];
|
|
203
212
|
}
|
|
204
213
|
function treeViolations(root, categoryFolders = DEFAULT_CATEGORY_FOLDERS, options = {}) {
|
|
205
214
|
const categories = new Set(categoryFolders);
|
|
206
215
|
function walk(folder, layer) {
|
|
207
216
|
const name = relative(join(root, ".."), folder);
|
|
208
|
-
return [...folderViolations(folder, name, categories, folder
|
|
217
|
+
return [...folderViolations(folder, name, categories, filesCheck(layer, folder === root && options.rootEntries === true)), ...readdirSync(folder, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => {
|
|
209
218
|
const child = childLayer(layer, `${name}/${entry.name}`, categories);
|
|
210
219
|
return [...child.violations, ...walk(join(folder, entry.name), child.layer)];
|
|
211
220
|
})];
|
package/dist/treeViolations.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as treeViolations } from "./treeViolations-
|
|
1
|
+
export { t as treeViolations } from "./treeViolations-CEQ5ks7L.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brutalway/check-tree",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Checks a source tree: only the folders the layout names, no empty folder, no category folder holding a single child, stylesheets grouped in styles
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Checks a source tree: only the folders the layout names, no empty folder, no category folder holding a single child, stylesheets grouped in styles/, no file of a slice of shared/ used by a single feature, no slice whose files never import each other.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lint",
|
|
7
7
|
"folder-structure",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"check-tree": "./dist/checkTree.js"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
|
-
"./treeViolations": "./dist/treeViolations.js"
|
|
31
|
+
"./treeViolations": "./dist/treeViolations.js",
|
|
32
|
+
"./sharedViolations": "./dist/sharedViolations.js"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
35
|
"build": "tsdown",
|
|
@@ -70,5 +71,8 @@
|
|
|
70
71
|
"eslint-plugin-no-comments": {
|
|
71
72
|
"minimatch": "^11.0.1"
|
|
72
73
|
}
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"dependency-cruiser": ">=18"
|
|
73
77
|
}
|
|
74
78
|
}
|