@archest/vitest 1.0.0 → 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.
Files changed (95) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.js +1 -17
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +118 -551
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/matchers/index.d.ts +21 -0
  7. package/dist/matchers/models.d.ts +201 -0
  8. package/node_modules/@archest/core/dist/classes/classCheckExtendClass.d.ts +3 -0
  9. package/node_modules/@archest/core/dist/classes/classCheckHaveMaxCyclomaticComplexity.d.ts +3 -0
  10. package/node_modules/@archest/core/dist/classes/classCheckHaveModifier.d.ts +3 -0
  11. package/node_modules/@archest/core/dist/classes/classCheckHaveNameMatchingFileName.d.ts +3 -0
  12. package/node_modules/@archest/core/dist/classes/classCheckImplementInterface.d.ts +3 -0
  13. package/node_modules/@archest/core/dist/classes/classCheckMatchNamePattern.d.ts +3 -0
  14. package/node_modules/@archest/core/dist/classes/classCheckResideInFolder.d.ts +3 -0
  15. package/node_modules/@archest/core/dist/classes/locateClasses.d.ts +5 -0
  16. package/node_modules/@archest/core/dist/classes/types.d.ts +25 -0
  17. package/node_modules/@archest/core/dist/dto.d.ts +78 -0
  18. package/node_modules/@archest/core/dist/files/checkDependOnExternalModule.d.ts +3 -0
  19. package/node_modules/@archest/core/dist/files/checkDependOnFilesInFolder.d.ts +3 -0
  20. package/node_modules/@archest/core/dist/files/fileCheckBeFreeOfCycles.d.ts +3 -0
  21. package/node_modules/@archest/core/dist/files/fileCheckHaveMaxCyclomaticComplexity.d.ts +3 -0
  22. package/node_modules/@archest/core/dist/files/fileCheckHaveMaxExportedFunctions.d.ts +3 -0
  23. package/node_modules/@archest/core/dist/files/fileCheckHaveMinMaintainabilityIndex.d.ts +3 -0
  24. package/node_modules/@archest/core/dist/files/fileCheckMatchNamePattern.d.ts +3 -0
  25. package/node_modules/@archest/core/dist/files/getFileDependencies.d.ts +2 -0
  26. package/node_modules/@archest/core/dist/files/locateFiles.d.ts +4 -0
  27. package/node_modules/@archest/core/dist/files/types.d.ts +17 -0
  28. package/node_modules/@archest/core/dist/functions/functionCheckHaveExplicitReturnType.d.ts +3 -0
  29. package/node_modules/@archest/core/dist/functions/functionCheckHaveMaxCyclomaticComplexity.d.ts +3 -0
  30. package/node_modules/@archest/core/dist/functions/functionCheckHaveMinMaintainabilityIndex.d.ts +3 -0
  31. package/node_modules/@archest/core/dist/functions/functionCheckHaveModifier.d.ts +3 -0
  32. package/node_modules/@archest/core/dist/functions/functionCheckHaveNameMatchingFileName.d.ts +3 -0
  33. package/node_modules/@archest/core/dist/functions/functionCheckMatchNamePattern.d.ts +3 -0
  34. package/node_modules/@archest/core/dist/functions/locateFunctions.d.ts +5 -0
  35. package/node_modules/@archest/core/dist/functions/types.d.ts +19 -0
  36. package/node_modules/@archest/core/dist/index.d.ts +43 -0
  37. package/node_modules/@archest/core/dist/index.js +14 -0
  38. package/node_modules/@archest/core/dist/index.js.map +1 -0
  39. package/node_modules/@archest/core/dist/index.mjs +615 -0
  40. package/node_modules/@archest/core/dist/index.mjs.map +1 -0
  41. package/node_modules/@archest/core/dist/layers/checkLayeredArchitecture.d.ts +3 -0
  42. package/node_modules/@archest/core/dist/layers/createLayeredArchitecture.d.ts +3 -0
  43. package/node_modules/@archest/core/dist/layers/getLayerDependencies.d.ts +2 -0
  44. package/node_modules/@archest/core/dist/layers/layer.d.ts +2 -0
  45. package/node_modules/@archest/core/dist/layers/layerShouldNotBeAccessedByAnyLayer.d.ts +2 -0
  46. package/node_modules/@archest/core/dist/layers/layerShouldOnlyBeAccessedBy.d.ts +2 -0
  47. package/node_modules/@archest/core/dist/layers/types.d.ts +8 -0
  48. package/node_modules/@archest/core/dist/metrics/calculateCyclomaticComplexity.d.ts +2 -0
  49. package/node_modules/@archest/core/dist/metrics/calculateMaintainabilityIndex.d.ts +2 -0
  50. package/node_modules/@archest/core/dist/project/parseProject.d.ts +55 -0
  51. package/node_modules/@archest/core/dist/properties/locateProperties.d.ts +5 -0
  52. package/node_modules/@archest/core/dist/properties/propertyCheckBeReadonly.d.ts +3 -0
  53. package/node_modules/@archest/core/dist/properties/types.d.ts +17 -0
  54. package/node_modules/@archest/core/dist/shared/sharedCheckHaveMaxCyclomaticComplexity.d.ts +1 -0
  55. package/node_modules/@archest/core/dist/shared/sharedCheckHaveMinMaintainabilityIndex.d.ts +1 -0
  56. package/node_modules/@archest/core/dist/shared/sharedCheckHaveModifier.d.ts +7 -0
  57. package/node_modules/@archest/core/dist/shared/sharedCheckHaveNameMatchingFileName.d.ts +3 -0
  58. package/node_modules/@archest/core/dist/shared/sharedCheckMatchNamePattern.d.ts +1 -0
  59. package/node_modules/@archest/core/dist/slices/locateSlices.d.ts +3 -0
  60. package/node_modules/@archest/core/dist/slices/sliceCheckBeFreeOfCycles.d.ts +3 -0
  61. package/node_modules/@archest/core/dist/slices/sliceCheckHaveMaxDistanceFromMainSequence.d.ts +3 -0
  62. package/node_modules/@archest/core/dist/slices/types.d.ts +8 -0
  63. package/node_modules/@archest/core/dist/types.d.ts +11 -0
  64. package/node_modules/@archest/core/dist/utils/ruleBuilder.d.ts +6 -0
  65. package/node_modules/@archest/core/package.json +49 -0
  66. package/node_modules/@archest/core-rust/core-rust.darwin-arm64.node +0 -0
  67. package/node_modules/@archest/core-rust/core-rust.linux-x64-gnu.node +0 -0
  68. package/node_modules/@archest/core-rust/core-rust.win32-x64-msvc.node +0 -0
  69. package/node_modules/@archest/core-rust/index.d.ts +16 -0
  70. package/node_modules/@archest/core-rust/index.js +316 -0
  71. package/node_modules/@archest/core-rust/package.json +34 -0
  72. package/package.json +12 -1
  73. package/dist/src/core/ClassLocator.d.ts +0 -20
  74. package/dist/src/core/FileLocator.d.ts +0 -15
  75. package/dist/src/core/FunctionLocator.d.ts +0 -15
  76. package/dist/src/core/LayerLocator.d.ts +0 -23
  77. package/dist/src/core/Project.d.ts +0 -20
  78. package/dist/src/core/PropertyLocator.d.ts +0 -12
  79. package/dist/src/core/SliceLocator.d.ts +0 -10
  80. package/dist/src/core/types.d.ts +0 -4
  81. package/dist/src/index.d.ts +0 -9
  82. package/dist/src/matchers/index.d.ts +0 -15
  83. package/src/core/ClassLocator.ts +0 -226
  84. package/src/core/FileLocator.ts +0 -168
  85. package/src/core/FunctionLocator.ts +0 -105
  86. package/src/core/LayerLocator.ts +0 -119
  87. package/src/core/Project.ts +0 -171
  88. package/src/core/PropertyLocator.ts +0 -50
  89. package/src/core/SliceLocator.ts +0 -92
  90. package/src/core/types.ts +0 -4
  91. package/src/index.ts +0 -9
  92. package/src/matchers/index.ts +0 -113
  93. package/test/architecture.test.ts +0 -59
  94. package/tsconfig.json +0 -17
  95. package/vite.config.ts +0 -18
@@ -0,0 +1,316 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /* prettier-ignore */
4
+
5
+ /* auto-generated by NAPI-RS */
6
+
7
+ const { existsSync, readFileSync } = require('fs')
8
+ const { join } = require('path')
9
+
10
+ const { platform, arch } = process
11
+
12
+ let nativeBinding = null
13
+ let localFileExisted = false
14
+ let loadError = null
15
+
16
+ function isMusl() {
17
+ // For Node 10
18
+ if (!process.report || typeof process.report.getReport !== 'function') {
19
+ try {
20
+ const lddPath = require('child_process').execSync('which ldd').toString().trim()
21
+ return readFileSync(lddPath, 'utf8').includes('musl')
22
+ } catch (e) {
23
+ return true
24
+ }
25
+ } else {
26
+ const { glibcVersionRuntime } = process.report.getReport().header
27
+ return !glibcVersionRuntime
28
+ }
29
+ }
30
+
31
+ switch (platform) {
32
+ case 'android':
33
+ switch (arch) {
34
+ case 'arm64':
35
+ localFileExisted = existsSync(join(__dirname, 'core-rust.android-arm64.node'))
36
+ try {
37
+ if (localFileExisted) {
38
+ nativeBinding = require('./core-rust.android-arm64.node')
39
+ } else {
40
+ nativeBinding = require('@archest/core-rust-android-arm64')
41
+ }
42
+ } catch (e) {
43
+ loadError = e
44
+ }
45
+ break
46
+ case 'arm':
47
+ localFileExisted = existsSync(join(__dirname, 'core-rust.android-arm-eabi.node'))
48
+ try {
49
+ if (localFileExisted) {
50
+ nativeBinding = require('./core-rust.android-arm-eabi.node')
51
+ } else {
52
+ nativeBinding = require('@archest/core-rust-android-arm-eabi')
53
+ }
54
+ } catch (e) {
55
+ loadError = e
56
+ }
57
+ break
58
+ default:
59
+ throw new Error(`Unsupported architecture on Android ${arch}`)
60
+ }
61
+ break
62
+ case 'win32':
63
+ switch (arch) {
64
+ case 'x64':
65
+ localFileExisted = existsSync(
66
+ join(__dirname, 'core-rust.win32-x64-msvc.node')
67
+ )
68
+ try {
69
+ if (localFileExisted) {
70
+ nativeBinding = require('./core-rust.win32-x64-msvc.node')
71
+ } else {
72
+ nativeBinding = require('@archest/core-rust-win32-x64-msvc')
73
+ }
74
+ } catch (e) {
75
+ loadError = e
76
+ }
77
+ break
78
+ case 'ia32':
79
+ localFileExisted = existsSync(
80
+ join(__dirname, 'core-rust.win32-ia32-msvc.node')
81
+ )
82
+ try {
83
+ if (localFileExisted) {
84
+ nativeBinding = require('./core-rust.win32-ia32-msvc.node')
85
+ } else {
86
+ nativeBinding = require('@archest/core-rust-win32-ia32-msvc')
87
+ }
88
+ } catch (e) {
89
+ loadError = e
90
+ }
91
+ break
92
+ case 'arm64':
93
+ localFileExisted = existsSync(
94
+ join(__dirname, 'core-rust.win32-arm64-msvc.node')
95
+ )
96
+ try {
97
+ if (localFileExisted) {
98
+ nativeBinding = require('./core-rust.win32-arm64-msvc.node')
99
+ } else {
100
+ nativeBinding = require('@archest/core-rust-win32-arm64-msvc')
101
+ }
102
+ } catch (e) {
103
+ loadError = e
104
+ }
105
+ break
106
+ default:
107
+ throw new Error(`Unsupported architecture on Windows: ${arch}`)
108
+ }
109
+ break
110
+ case 'darwin':
111
+ localFileExisted = existsSync(join(__dirname, 'core-rust.darwin-universal.node'))
112
+ try {
113
+ if (localFileExisted) {
114
+ nativeBinding = require('./core-rust.darwin-universal.node')
115
+ } else {
116
+ nativeBinding = require('@archest/core-rust-darwin-universal')
117
+ }
118
+ break
119
+ } catch {}
120
+ switch (arch) {
121
+ case 'x64':
122
+ localFileExisted = existsSync(join(__dirname, 'core-rust.darwin-x64.node'))
123
+ try {
124
+ if (localFileExisted) {
125
+ nativeBinding = require('./core-rust.darwin-x64.node')
126
+ } else {
127
+ nativeBinding = require('@archest/core-rust-darwin-x64')
128
+ }
129
+ } catch (e) {
130
+ loadError = e
131
+ }
132
+ break
133
+ case 'arm64':
134
+ localFileExisted = existsSync(
135
+ join(__dirname, 'core-rust.darwin-arm64.node')
136
+ )
137
+ try {
138
+ if (localFileExisted) {
139
+ nativeBinding = require('./core-rust.darwin-arm64.node')
140
+ } else {
141
+ nativeBinding = require('@archest/core-rust-darwin-arm64')
142
+ }
143
+ } catch (e) {
144
+ loadError = e
145
+ }
146
+ break
147
+ default:
148
+ throw new Error(`Unsupported architecture on macOS: ${arch}`)
149
+ }
150
+ break
151
+ case 'freebsd':
152
+ if (arch !== 'x64') {
153
+ throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
154
+ }
155
+ localFileExisted = existsSync(join(__dirname, 'core-rust.freebsd-x64.node'))
156
+ try {
157
+ if (localFileExisted) {
158
+ nativeBinding = require('./core-rust.freebsd-x64.node')
159
+ } else {
160
+ nativeBinding = require('@archest/core-rust-freebsd-x64')
161
+ }
162
+ } catch (e) {
163
+ loadError = e
164
+ }
165
+ break
166
+ case 'linux':
167
+ switch (arch) {
168
+ case 'x64':
169
+ if (isMusl()) {
170
+ localFileExisted = existsSync(
171
+ join(__dirname, 'core-rust.linux-x64-musl.node')
172
+ )
173
+ try {
174
+ if (localFileExisted) {
175
+ nativeBinding = require('./core-rust.linux-x64-musl.node')
176
+ } else {
177
+ nativeBinding = require('@archest/core-rust-linux-x64-musl')
178
+ }
179
+ } catch (e) {
180
+ loadError = e
181
+ }
182
+ } else {
183
+ localFileExisted = existsSync(
184
+ join(__dirname, 'core-rust.linux-x64-gnu.node')
185
+ )
186
+ try {
187
+ if (localFileExisted) {
188
+ nativeBinding = require('./core-rust.linux-x64-gnu.node')
189
+ } else {
190
+ nativeBinding = require('@archest/core-rust-linux-x64-gnu')
191
+ }
192
+ } catch (e) {
193
+ loadError = e
194
+ }
195
+ }
196
+ break
197
+ case 'arm64':
198
+ if (isMusl()) {
199
+ localFileExisted = existsSync(
200
+ join(__dirname, 'core-rust.linux-arm64-musl.node')
201
+ )
202
+ try {
203
+ if (localFileExisted) {
204
+ nativeBinding = require('./core-rust.linux-arm64-musl.node')
205
+ } else {
206
+ nativeBinding = require('@archest/core-rust-linux-arm64-musl')
207
+ }
208
+ } catch (e) {
209
+ loadError = e
210
+ }
211
+ } else {
212
+ localFileExisted = existsSync(
213
+ join(__dirname, 'core-rust.linux-arm64-gnu.node')
214
+ )
215
+ try {
216
+ if (localFileExisted) {
217
+ nativeBinding = require('./core-rust.linux-arm64-gnu.node')
218
+ } else {
219
+ nativeBinding = require('@archest/core-rust-linux-arm64-gnu')
220
+ }
221
+ } catch (e) {
222
+ loadError = e
223
+ }
224
+ }
225
+ break
226
+ case 'arm':
227
+ if (isMusl()) {
228
+ localFileExisted = existsSync(
229
+ join(__dirname, 'core-rust.linux-arm-musleabihf.node')
230
+ )
231
+ try {
232
+ if (localFileExisted) {
233
+ nativeBinding = require('./core-rust.linux-arm-musleabihf.node')
234
+ } else {
235
+ nativeBinding = require('@archest/core-rust-linux-arm-musleabihf')
236
+ }
237
+ } catch (e) {
238
+ loadError = e
239
+ }
240
+ } else {
241
+ localFileExisted = existsSync(
242
+ join(__dirname, 'core-rust.linux-arm-gnueabihf.node')
243
+ )
244
+ try {
245
+ if (localFileExisted) {
246
+ nativeBinding = require('./core-rust.linux-arm-gnueabihf.node')
247
+ } else {
248
+ nativeBinding = require('@archest/core-rust-linux-arm-gnueabihf')
249
+ }
250
+ } catch (e) {
251
+ loadError = e
252
+ }
253
+ }
254
+ break
255
+ case 'riscv64':
256
+ if (isMusl()) {
257
+ localFileExisted = existsSync(
258
+ join(__dirname, 'core-rust.linux-riscv64-musl.node')
259
+ )
260
+ try {
261
+ if (localFileExisted) {
262
+ nativeBinding = require('./core-rust.linux-riscv64-musl.node')
263
+ } else {
264
+ nativeBinding = require('@archest/core-rust-linux-riscv64-musl')
265
+ }
266
+ } catch (e) {
267
+ loadError = e
268
+ }
269
+ } else {
270
+ localFileExisted = existsSync(
271
+ join(__dirname, 'core-rust.linux-riscv64-gnu.node')
272
+ )
273
+ try {
274
+ if (localFileExisted) {
275
+ nativeBinding = require('./core-rust.linux-riscv64-gnu.node')
276
+ } else {
277
+ nativeBinding = require('@archest/core-rust-linux-riscv64-gnu')
278
+ }
279
+ } catch (e) {
280
+ loadError = e
281
+ }
282
+ }
283
+ break
284
+ case 's390x':
285
+ localFileExisted = existsSync(
286
+ join(__dirname, 'core-rust.linux-s390x-gnu.node')
287
+ )
288
+ try {
289
+ if (localFileExisted) {
290
+ nativeBinding = require('./core-rust.linux-s390x-gnu.node')
291
+ } else {
292
+ nativeBinding = require('@archest/core-rust-linux-s390x-gnu')
293
+ }
294
+ } catch (e) {
295
+ loadError = e
296
+ }
297
+ break
298
+ default:
299
+ throw new Error(`Unsupported architecture on Linux: ${arch}`)
300
+ }
301
+ break
302
+ default:
303
+ throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
304
+ }
305
+
306
+ if (!nativeBinding) {
307
+ if (loadError) {
308
+ throw loadError
309
+ }
310
+ throw new Error(`Failed to load native binding`)
311
+ }
312
+
313
+ const { ArchestProject, parseProjectRust } = nativeBinding
314
+
315
+ module.exports.ArchestProject = ArchestProject
316
+ module.exports.parseProjectRust = parseProjectRust
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@archest/core-rust",
3
+ "version": "1.0.2",
4
+ "private": true,
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "files": [
8
+ "index.js",
9
+ "index.d.ts",
10
+ "*.node"
11
+ ],
12
+ "napi": {
13
+ "name": "core-rust",
14
+ "triples": {
15
+ "defaults": false,
16
+ "additional": [
17
+ "x86_64-apple-darwin",
18
+ "aarch64-apple-darwin",
19
+ "x86_64-pc-windows-msvc",
20
+ "aarch64-pc-windows-msvc",
21
+ "x86_64-unknown-linux-gnu",
22
+ "aarch64-unknown-linux-gnu"
23
+ ]
24
+ }
25
+ },
26
+ "scripts": {
27
+ "build": "napi build --platform --release",
28
+ "build:debug": "napi build --platform",
29
+ "artifacts": "napi artifacts"
30
+ },
31
+ "devDependencies": {
32
+ "@napi-rs/cli": "^2.18.4"
33
+ }
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archest/vitest",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/hinterdupfinger/archest.git"
@@ -19,6 +19,9 @@
19
19
  "types": "./dist/index.d.ts"
20
20
  }
21
21
  },
22
+ "files": [
23
+ "dist"
24
+ ],
22
25
  "keywords": [
23
26
  "vitest",
24
27
  "architecture",
@@ -36,6 +39,14 @@
36
39
  "peerDependencies": {
37
40
  "typescript": "^5.x || ^6.x"
38
41
  },
42
+ "dependencies": {
43
+ "@archest/core": "1.0.2",
44
+ "@archest/core-rust": "1.0.2"
45
+ },
46
+ "bundledDependencies": [
47
+ "@archest/core",
48
+ "@archest/core-rust"
49
+ ],
39
50
  "scripts": {
40
51
  "build": "vite build",
41
52
  "test": "vitest run",
@@ -1,20 +0,0 @@
1
- import { RuleResult } from './types';
2
- import * as ts from 'typescript';
3
- export interface ClassQueryOptions {
4
- inFolder?: string;
5
- matchNamePattern?: string | RegExp;
6
- withDecorator?: string;
7
- extending?: string;
8
- implementing?: string;
9
- havingModifier?: string;
10
- }
11
- export declare class ClassLocator {
12
- private program;
13
- readonly classes: ts.ClassDeclaration[];
14
- constructor(classes: ts.ClassDeclaration[], program: ts.Program, options?: ClassQueryOptions);
15
- checkResideInFolder(targetFolder: string, isNot: boolean): RuleResult;
16
- checkMatchNamePattern(pattern: string | RegExp, isNot: boolean): RuleResult;
17
- checkExtendClass(className: string, isNot: boolean): RuleResult;
18
- checkImplementInterface(interfaceName: string, isNot: boolean): RuleResult;
19
- checkHaveModifier(modifierStr: string, isNot: boolean): RuleResult;
20
- }
@@ -1,15 +0,0 @@
1
- import { RuleResult } from './types';
2
- import * as ts from 'typescript';
3
- export interface FileQueryOptions {
4
- inFolder?: string;
5
- matchNamePattern?: string | RegExp;
6
- }
7
- export declare class FileLocator {
8
- private program;
9
- readonly files: ts.SourceFile[];
10
- constructor(sourceFiles: ts.SourceFile[], program: ts.Program, options?: FileQueryOptions);
11
- private getFileDependencies;
12
- checkDependOnFilesInFolder(targetFolder: string, isNot: boolean): RuleResult;
13
- checkBeFreeOfCycles(isNot: boolean): RuleResult;
14
- checkMatchNamePattern(pattern: string | RegExp, isNot: boolean): RuleResult;
15
- }
@@ -1,15 +0,0 @@
1
- import { RuleResult } from './types';
2
- import * as ts from 'typescript';
3
- export interface FunctionQueryOptions {
4
- inFolder?: string;
5
- matchNamePattern?: string | RegExp;
6
- isTopLevel?: boolean;
7
- }
8
- export declare class FunctionLocator {
9
- private program;
10
- readonly functions: ts.FunctionLikeDeclaration[];
11
- constructor(functions: ts.FunctionLikeDeclaration[], program: ts.Program, options?: FunctionQueryOptions);
12
- checkHaveModifier(modifierStr: string, isNot: boolean): RuleResult;
13
- checkHaveExplicitReturnType(isNot: boolean): RuleResult;
14
- checkMatchNamePattern(pattern: string | RegExp, isNot: boolean): RuleResult;
15
- }
@@ -1,23 +0,0 @@
1
- import { RuleResult } from './types';
2
- import * as ts from 'typescript';
3
- export declare class LayeredArchitectureBuilder {
4
- program: ts.Program;
5
- private files;
6
- private layers;
7
- private assertions;
8
- constructor(files: ts.SourceFile[], program: ts.Program);
9
- layer(name: string, folderPattern: string): this;
10
- whereLayer(name: string): LayerAssertionBuilder;
11
- addAssertion(assertion: (files: ts.SourceFile[]) => string[]): void;
12
- getFiles(): ts.SourceFile[];
13
- getLayerPattern(name: string): string;
14
- getFileDependencies(sourceFile: ts.SourceFile): string[];
15
- check(): RuleResult;
16
- }
17
- export declare class LayerAssertionBuilder {
18
- private parent;
19
- private targetLayer;
20
- constructor(parent: LayeredArchitectureBuilder, targetLayer: string);
21
- shouldNotBeAccessedByAnyLayer(): LayeredArchitectureBuilder;
22
- shouldOnlyBeAccessedBy(...allowedLayers: string[]): LayeredArchitectureBuilder;
23
- }
@@ -1,20 +0,0 @@
1
- import { FileLocator, FileQueryOptions } from './FileLocator';
2
- import { ClassLocator, ClassQueryOptions } from './ClassLocator';
3
- import { LayeredArchitectureBuilder } from './LayerLocator';
4
- import { FunctionLocator, FunctionQueryOptions } from './FunctionLocator';
5
- import { PropertyLocator, PropertyQueryOptions } from './PropertyLocator';
6
- import { SliceLocator } from './SliceLocator';
7
- export declare class Project {
8
- private program;
9
- private typeChecker;
10
- constructor(options?: {
11
- tsConfigFilePath?: string;
12
- });
13
- getFiles(options?: FileQueryOptions): FileLocator;
14
- getClasses(options?: ClassQueryOptions): ClassLocator;
15
- layeredArchitecture(): LayeredArchitectureBuilder;
16
- getFunctions(options?: FunctionQueryOptions): FunctionLocator;
17
- getProperties(options?: PropertyQueryOptions): PropertyLocator;
18
- getSlices(pattern: string): SliceLocator;
19
- }
20
- export declare function parseProject(tsConfigFilePath?: string): Project;
@@ -1,12 +0,0 @@
1
- import { RuleResult } from './types';
2
- import * as ts from 'typescript';
3
- export interface PropertyQueryOptions {
4
- inFolder?: string;
5
- matchNamePattern?: string | RegExp;
6
- }
7
- export declare class PropertyLocator {
8
- private program;
9
- readonly properties: ts.PropertyDeclaration[];
10
- constructor(properties: ts.PropertyDeclaration[], program: ts.Program, options?: PropertyQueryOptions);
11
- checkBeReadonly(isNot: boolean): RuleResult;
12
- }
@@ -1,10 +0,0 @@
1
- import { RuleResult } from './types';
2
- import * as ts from 'typescript';
3
- export declare class SliceLocator {
4
- private program;
5
- private slicePattern;
6
- private sliceIds;
7
- private sliceFiles;
8
- constructor(sourceFiles: ts.SourceFile[], program: ts.Program, pattern: string);
9
- checkBeFreeOfCycles(isNot: boolean): RuleResult;
10
- }
@@ -1,4 +0,0 @@
1
- export interface RuleResult {
2
- pass: boolean;
3
- message: () => string;
4
- }
@@ -1,9 +0,0 @@
1
- export { Project, parseProject } from './core/Project';
2
- export { setupMatchers } from './matchers';
3
- export * from './core/FileLocator';
4
- export * from './core/ClassLocator';
5
- export * from './core/FunctionLocator';
6
- export * from './core/PropertyLocator';
7
- export * from './core/SliceLocator';
8
- export * from './core/LayerLocator';
9
- export * from './core/types';
@@ -1,15 +0,0 @@
1
- export declare function setupMatchers(): void;
2
- declare module 'vitest' {
3
- interface Assertion<T = any> {
4
- toPass(): void;
5
- toResideInFolder(folder: string): void;
6
- toHaveModifier(modifier: 'export' | 'default' | 'abstract' | 'async' | 'private' | 'public'): void;
7
- toExtendClass(className: string): void;
8
- toImplementInterface(interfaceName: string): void;
9
- toHaveExplicitReturnType(): void;
10
- toBeReadonly(): void;
11
- toDependOnFilesInFolder(folder: string): void;
12
- toBeFreeOfCycles(): void;
13
- toMatchNamePattern(pattern: string | RegExp): void;
14
- }
15
- }