@monorepolint/rules 0.6.0-alpha.0 → 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.
Files changed (61) hide show
  1. package/.turbo/turbo-clean.log +1 -1
  2. package/.turbo/turbo-compile-typescript.log +1 -1
  3. package/.turbo/turbo-lint.log +1 -1
  4. package/.turbo/turbo-test.log +212 -665
  5. package/.turbo/turbo-transpile-typescript.log +5 -5
  6. package/CHANGELOG.md +42 -0
  7. package/build/js/index.js +12 -17
  8. package/build/js/index.js.map +1 -1
  9. package/build/tsconfig.tsbuildinfo +1 -1
  10. package/build/types/__tests__/utils.d.ts +4 -9
  11. package/build/types/__tests__/utils.d.ts.map +1 -1
  12. package/build/types/fileContents.d.ts +1 -1
  13. package/build/types/fileContents.d.ts.map +1 -1
  14. package/build/types/standardTsconfig.d.ts.map +1 -1
  15. package/coverage/base.css +224 -0
  16. package/coverage/block-navigation.js +87 -0
  17. package/coverage/clover.xml +1546 -0
  18. package/coverage/coverage-final.json +19 -0
  19. package/coverage/favicon.png +0 -0
  20. package/coverage/index.html +131 -0
  21. package/coverage/prettify.css +1 -0
  22. package/coverage/prettify.js +2 -0
  23. package/coverage/sort-arrow-sprite.png +0 -0
  24. package/coverage/sorter.js +196 -0
  25. package/coverage/src/alphabeticalDependencies.ts.html +142 -0
  26. package/coverage/src/alphabeticalScripts.ts.html +136 -0
  27. package/coverage/src/bannedDependencies.ts.html +559 -0
  28. package/coverage/src/consistentDependencies.ts.html +355 -0
  29. package/coverage/src/consistentVersions.ts.html +508 -0
  30. package/coverage/src/fileContents.ts.html +385 -0
  31. package/coverage/src/index.html +311 -0
  32. package/coverage/src/index.ts.html +169 -0
  33. package/coverage/src/mustSatisfyPeerDependencies.ts.html +2317 -0
  34. package/coverage/src/nestedWorkspaces.ts.html +265 -0
  35. package/coverage/src/packageEntry.ts.html +355 -0
  36. package/coverage/src/packageOrder.ts.html +454 -0
  37. package/coverage/src/packageScript.ts.html +382 -0
  38. package/coverage/src/requireDependency.ts.html +298 -0
  39. package/coverage/src/standardTsconfig.ts.html +490 -0
  40. package/coverage/src/util/checkAlpha.ts.html +262 -0
  41. package/coverage/src/util/createRuleFactory.ts.html +184 -0
  42. package/coverage/src/util/index.html +161 -0
  43. package/coverage/src/util/makeDirectory.ts.html +157 -0
  44. package/coverage/src/util/packageDependencyGraphService.ts.html +427 -0
  45. package/package.json +16 -20
  46. package/src/__tests__/alphabeticalScripts.spec.ts +2 -2
  47. package/src/__tests__/bannedDependencies.spec.ts +3 -3
  48. package/src/__tests__/consistentDependencies.spec.ts +2 -2
  49. package/src/__tests__/consistentVersions.spec.ts +3 -3
  50. package/src/__tests__/fileContents.spec.ts +3 -3
  51. package/src/__tests__/mustSatisfyPeerDependencies.spec.ts +3 -3
  52. package/src/__tests__/nestedWorkspaces.spec.ts +3 -3
  53. package/src/__tests__/packageEntry.spec.ts +2 -2
  54. package/src/__tests__/packageOrder.spec.ts +2 -2
  55. package/src/__tests__/packageScript.spec.ts +3 -3
  56. package/src/__tests__/requireDependency.spec.ts +2 -2
  57. package/src/__tests__/utils.ts +3 -3
  58. package/src/fileContents.ts +9 -3
  59. package/src/standardTsconfig.ts +1 -0
  60. package/vitest.config.mjs +14 -0
  61. package/jest.config.cjs +0 -4
@@ -1,14 +1,14 @@
1
1
 
2
- > @monorepolint/rules@0.6.0-alpha.0 transpile-typescript /home/runner/work/monorepolint/monorepolint/packages/rules
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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.0.2
7
+ CLI tsup v8.3.5
8
8
  CLI Using tsup config: /home/runner/work/monorepolint/monorepolint/tsup.config.cjs
9
9
  CLI Target: node16
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
- ESM build/js/index.js 50.71 KB
13
- ESM build/js/index.js.map 101.93 KB
14
- ESM ⚡️ Build success in 62ms
12
+ ESM build/js/index.js 50.83 KB
13
+ ESM build/js/index.js.map 102.29 KB
14
+ ESM ⚡️ Build success in 82ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
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
+
36
+ ## 0.6.0-alpha.1
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [c57d210]
41
+ - @monorepolint/config@0.6.0-alpha.1
42
+ - @monorepolint/core@0.6.0-alpha.1
43
+ - @monorepolint/utils@0.6.0-alpha.1
44
+
3
45
  ## 0.6.0-alpha.0
4
46
 
5
47
  ### 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
- populateProblemsGlobs(globs, curDeps, violations);
188
- if (curDevDeps)
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
- populateProblemsExact(set, curDeps, violations);
201
- if (curDevDeps)
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: "Expect file contents to match",
455
- longMessage: diff3(expectedContent, actualContent, { expand: true }),
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" });