@monorepolint/rules 0.6.0-alpha.1 → 0.6.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-clean.log +1 -1
- package/.turbo/turbo-compile-typescript.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +212 -667
- package/.turbo/turbo-transpile-typescript.log +5 -5
- package/CHANGELOG.md +33 -0
- package/build/js/index.js +12 -17
- package/build/js/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/__tests__/utils.d.ts +4 -9
- package/build/types/__tests__/utils.d.ts.map +1 -1
- package/build/types/fileContents.d.ts +1 -1
- package/build/types/fileContents.d.ts.map +1 -1
- package/build/types/standardTsconfig.d.ts.map +1 -1
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +1546 -0
- package/coverage/coverage-final.json +19 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +131 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/src/alphabeticalDependencies.ts.html +142 -0
- package/coverage/src/alphabeticalScripts.ts.html +136 -0
- package/coverage/src/bannedDependencies.ts.html +559 -0
- package/coverage/src/consistentDependencies.ts.html +355 -0
- package/coverage/src/consistentVersions.ts.html +508 -0
- package/coverage/src/fileContents.ts.html +385 -0
- package/coverage/src/index.html +311 -0
- package/coverage/src/index.ts.html +169 -0
- package/coverage/src/mustSatisfyPeerDependencies.ts.html +2317 -0
- package/coverage/src/nestedWorkspaces.ts.html +265 -0
- package/coverage/src/packageEntry.ts.html +355 -0
- package/coverage/src/packageOrder.ts.html +454 -0
- package/coverage/src/packageScript.ts.html +382 -0
- package/coverage/src/requireDependency.ts.html +298 -0
- package/coverage/src/standardTsconfig.ts.html +490 -0
- package/coverage/src/util/checkAlpha.ts.html +262 -0
- package/coverage/src/util/createRuleFactory.ts.html +184 -0
- package/coverage/src/util/index.html +161 -0
- package/coverage/src/util/makeDirectory.ts.html +157 -0
- package/coverage/src/util/packageDependencyGraphService.ts.html +427 -0
- package/package.json +16 -20
- package/src/__tests__/alphabeticalScripts.spec.ts +2 -2
- package/src/__tests__/bannedDependencies.spec.ts +3 -3
- package/src/__tests__/consistentDependencies.spec.ts +2 -2
- package/src/__tests__/consistentVersions.spec.ts +3 -3
- package/src/__tests__/fileContents.spec.ts +3 -3
- package/src/__tests__/mustSatisfyPeerDependencies.spec.ts +3 -3
- package/src/__tests__/nestedWorkspaces.spec.ts +3 -3
- package/src/__tests__/packageEntry.spec.ts +2 -2
- package/src/__tests__/packageOrder.spec.ts +2 -2
- package/src/__tests__/packageScript.spec.ts +3 -3
- package/src/__tests__/requireDependency.spec.ts +2 -2
- package/src/__tests__/utils.ts +3 -3
- package/src/fileContents.ts +9 -3
- package/src/standardTsconfig.ts +1 -0
- package/vitest.config.mjs +14 -0
- package/jest.config.cjs +0 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @monorepolint/rules@0.6.0-alpha.
|
|
2
|
+
> @monorepolint/rules@0.6.0-alpha.2 transpile-typescript /home/runner/work/monorepolint/monorepolint/packages/rules
|
|
3
3
|
> tsup --config ../../tsup.config.cjs
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.
|
|
7
|
+
[34mCLI[39m tsup v8.3.5
|
|
8
8
|
[34mCLI[39m Using tsup config: /home/runner/work/monorepolint/monorepolint/tsup.config.cjs
|
|
9
9
|
[34mCLI[39m Target: node16
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mbuild/js/index.js [22m[32m50.
|
|
13
|
-
[32mESM[39m [1mbuild/js/index.js.map [22m[
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mbuild/js/index.js [22m[32m50.83 KB[39m
|
|
13
|
+
[32mESM[39m [1mbuild/js/index.js.map [22m[32m102.29 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 82ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @monorepolint/rules
|
|
2
2
|
|
|
3
|
+
## 0.6.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4f42aad: Updated docs with example of removing a file with fileContents rule
|
|
8
|
+
- 4f42aad: Improved message and longMessage for the fileContents rule
|
|
9
|
+
- 4f42aad: Upgraded dependencies
|
|
10
|
+
|
|
11
|
+
- `@docusaurus/*`: 3.7.0
|
|
12
|
+
- `@mdx-js/react`: 3.1.0
|
|
13
|
+
- `chalk`: 5.4.1
|
|
14
|
+
- `eslint`: 9.18.0
|
|
15
|
+
- `gh-pages`: 6.3.0
|
|
16
|
+
- `gh-pages`: 6.3.0
|
|
17
|
+
- `globals`: 15.14.0
|
|
18
|
+
- `globby`: 14.0.2
|
|
19
|
+
- `husky`: 15.14.0
|
|
20
|
+
- `lint-staged`: 15.3.0
|
|
21
|
+
- `micromatch`: 4.0.8
|
|
22
|
+
- `mock-fs`: 5.4.1
|
|
23
|
+
- `prettier`: 3.4.2
|
|
24
|
+
- `prism-react-renderer`:2.4.1
|
|
25
|
+
- `semver`: 7.6.3
|
|
26
|
+
- `tslib`: 2.8.1
|
|
27
|
+
- `tsup`: 8.3.5
|
|
28
|
+
- `typescript-eslint`: 8.20.0
|
|
29
|
+
- `turbo`: 2.x
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [4f42aad]
|
|
32
|
+
- @monorepolint/config@0.6.0-alpha.2
|
|
33
|
+
- @monorepolint/utils@0.6.0-alpha.2
|
|
34
|
+
- @monorepolint/core@0.6.0-alpha.2
|
|
35
|
+
|
|
3
36
|
## 0.6.0-alpha.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/build/js/index.js
CHANGED
|
@@ -183,12 +183,9 @@ var bannedDependencies = createRuleFactory({
|
|
|
183
183
|
const exacts = banned && (Array.isArray(banned) ? void 0 : banned.exact);
|
|
184
184
|
const violations = /* @__PURE__ */ new Set();
|
|
185
185
|
if (globs) {
|
|
186
|
-
if (curDeps)
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
populateProblemsGlobs(globs, curDevDeps, violations);
|
|
190
|
-
if (curPeerDeps)
|
|
191
|
-
populateProblemsGlobs(globs, curPeerDeps, violations);
|
|
186
|
+
if (curDeps) populateProblemsGlobs(globs, curDeps, violations);
|
|
187
|
+
if (curDevDeps) populateProblemsGlobs(globs, curDevDeps, violations);
|
|
188
|
+
if (curPeerDeps) populateProblemsGlobs(globs, curPeerDeps, violations);
|
|
192
189
|
}
|
|
193
190
|
if (exacts) {
|
|
194
191
|
let set = setCache.get(exacts);
|
|
@@ -196,12 +193,9 @@ var bannedDependencies = createRuleFactory({
|
|
|
196
193
|
set = new Set(exacts);
|
|
197
194
|
setCache.set(exacts, set);
|
|
198
195
|
}
|
|
199
|
-
if (curDeps)
|
|
200
|
-
|
|
201
|
-
if (
|
|
202
|
-
populateProblemsExact(set, curDevDeps, violations);
|
|
203
|
-
if (curPeerDeps)
|
|
204
|
-
populateProblemsExact(set, curPeerDeps, violations);
|
|
196
|
+
if (curDeps) populateProblemsExact(set, curDeps, violations);
|
|
197
|
+
if (curDevDeps) populateProblemsExact(set, curDevDeps, violations);
|
|
198
|
+
if (curPeerDeps) populateProblemsExact(set, curPeerDeps, violations);
|
|
205
199
|
}
|
|
206
200
|
if (violations.size > 0) {
|
|
207
201
|
context.addError({
|
|
@@ -431,7 +425,7 @@ var Options4 = r4.Union(
|
|
|
431
425
|
r4.Record({
|
|
432
426
|
file: r4.String,
|
|
433
427
|
generator: r4.Undefined.optional(),
|
|
434
|
-
template: r4.String,
|
|
428
|
+
template: r4.String.Or(r4.Undefined),
|
|
435
429
|
templateFile: r4.Undefined.optional()
|
|
436
430
|
}),
|
|
437
431
|
r4.Record({
|
|
@@ -449,14 +443,15 @@ var fileContents = createRuleFactory({
|
|
|
449
443
|
const pathExists = context.host.exists(fullPath);
|
|
450
444
|
const actualContent = pathExists ? context.host.readFile(fullPath, { encoding: "utf-8" }) : void 0;
|
|
451
445
|
if (actualContent !== expectedContent) {
|
|
446
|
+
const longMessage = pathExists && expectedContent == void 0 ? void 0 : diff3(expectedContent, actualContent, { expand: true });
|
|
447
|
+
const message = pathExists && expectedContent == void 0 ? "File should not exist" : "Expect file contents to match";
|
|
452
448
|
context.addError({
|
|
453
449
|
file: fullPath,
|
|
454
|
-
message
|
|
455
|
-
longMessage
|
|
450
|
+
message,
|
|
451
|
+
longMessage,
|
|
456
452
|
fixer: () => {
|
|
457
453
|
if (expectedContent === void 0) {
|
|
458
|
-
if (pathExists)
|
|
459
|
-
context.host.deleteFile(fullPath);
|
|
454
|
+
if (pathExists) context.host.deleteFile(fullPath);
|
|
460
455
|
} else {
|
|
461
456
|
context.host.mkdir(path3.dirname(fullPath), { recursive: true });
|
|
462
457
|
context.host.writeFile(fullPath, expectedContent, { encoding: "utf-8" });
|