@monorepolint/rules 0.6.0-alpha.4 → 0.6.0-alpha.6
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 +443 -92
- package/.turbo/turbo-transpile-typescript.log +5 -5
- package/CHANGELOG.md +112 -0
- package/build/js/index.js +413 -368
- package/build/js/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/REMOVE.d.ts +2 -0
- package/build/types/REMOVE.d.ts.map +1 -0
- package/build/types/__tests__/alphabeticalDependencies.spec.d.ts +8 -0
- package/build/types/__tests__/alphabeticalDependencies.spec.d.ts.map +1 -0
- package/build/types/__tests__/forceError.spec.d.ts +8 -0
- package/build/types/__tests__/forceError.spec.d.ts.map +1 -0
- package/build/types/__tests__/oncePerPackage.spec.d.ts +8 -0
- package/build/types/__tests__/oncePerPackage.spec.d.ts.map +1 -0
- package/build/types/__tests__/standardTsconfig.spec.d.ts +8 -0
- package/build/types/__tests__/standardTsconfig.spec.d.ts.map +1 -0
- package/build/types/bannedDependencies.d.ts +9 -33
- package/build/types/bannedDependencies.d.ts.map +1 -1
- package/build/types/consistentDependencies.d.ts +6 -6
- package/build/types/consistentDependencies.d.ts.map +1 -1
- package/build/types/consistentVersions.d.ts +6 -10
- package/build/types/consistentVersions.d.ts.map +1 -1
- package/build/types/fileContents.d.ts +3 -2
- package/build/types/fileContents.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/mustSatisfyPeerDependencies.d.ts +12 -190
- package/build/types/mustSatisfyPeerDependencies.d.ts.map +1 -1
- package/build/types/nestedWorkspaces.d.ts +2 -2
- package/build/types/nestedWorkspaces.d.ts.map +1 -1
- package/build/types/oncePerPackage.d.ts +6 -6
- package/build/types/oncePerPackage.d.ts.map +1 -1
- package/build/types/packageEntry.d.ts +11 -33
- package/build/types/packageEntry.d.ts.map +1 -1
- package/build/types/packageOrder.d.ts +2 -1
- package/build/types/packageOrder.d.ts.map +1 -1
- package/build/types/packageScript.d.ts +13 -22
- package/build/types/packageScript.d.ts.map +1 -1
- package/build/types/requireDependency.d.ts +5 -20
- package/build/types/requireDependency.d.ts.map +1 -1
- package/build/types/standardTsconfig.d.ts +12 -19
- package/build/types/standardTsconfig.d.ts.map +1 -1
- package/build/types/util/zodSchemas.d.ts +14 -0
- package/build/types/util/zodSchemas.d.ts.map +1 -0
- package/coverage/block-navigation.js +1 -1
- package/coverage/clover.xml +1420 -1452
- package/coverage/coverage-final.json +21 -19
- package/coverage/index.html +27 -27
- package/coverage/sorter.js +21 -7
- package/coverage/src/REMOVE.ts.html +88 -0
- package/coverage/src/alphabeticalDependencies.ts.html +15 -15
- package/coverage/src/alphabeticalScripts.ts.html +5 -5
- package/coverage/src/bannedDependencies.ts.html +20 -53
- package/coverage/src/consistentDependencies.ts.html +20 -14
- package/coverage/src/consistentVersions.ts.html +330 -183
- package/coverage/src/fileContents.ts.html +223 -88
- package/coverage/src/forceError.ts.html +31 -31
- package/coverage/src/index.html +104 -89
- package/coverage/src/index.ts.html +11 -5
- package/coverage/src/mustSatisfyPeerDependencies.ts.html +15 -501
- package/coverage/src/nestedWorkspaces.ts.html +5 -5
- package/coverage/src/oncePerPackage.ts.html +31 -31
- package/coverage/src/packageEntry.ts.html +121 -91
- package/coverage/src/packageOrder.ts.html +44 -14
- package/coverage/src/packageScript.ts.html +235 -88
- package/coverage/src/requireDependency.ts.html +241 -82
- package/coverage/src/standardTsconfig.ts.html +212 -212
- package/coverage/src/util/checkAlpha.ts.html +40 -40
- package/coverage/src/util/createRuleFactory.ts.html +19 -19
- package/coverage/src/util/index.html +30 -15
- package/coverage/src/util/makeDirectory.ts.html +11 -11
- package/coverage/src/util/packageDependencyGraphService.ts.html +1 -1
- package/coverage/src/util/zodSchemas.ts.html +130 -0
- package/package.json +15 -15
- package/src/REMOVE.ts +1 -0
- package/src/__tests__/alphabeticalDependencies.spec.ts +102 -0
- package/src/__tests__/alphabeticalScripts.spec.ts +18 -0
- package/src/__tests__/bannedDependencies.spec.ts +49 -0
- package/src/__tests__/consistentDependencies.spec.ts +23 -0
- package/src/__tests__/consistentVersions.spec.ts +142 -0
- package/src/__tests__/fileContents.spec.ts +348 -0
- package/src/__tests__/forceError.spec.ts +70 -0
- package/src/__tests__/mustSatisfyPeerDependencies.spec.ts +44 -0
- package/src/__tests__/nestedWorkspaces.spec.ts +14 -0
- package/src/__tests__/oncePerPackage.spec.ts +75 -0
- package/src/__tests__/packageEntry.spec.ts +177 -0
- package/src/__tests__/packageOrder.spec.ts +22 -0
- package/src/__tests__/packageScript.spec.ts +549 -0
- package/src/__tests__/requireDependency.spec.ts +259 -2
- package/src/__tests__/standardTsconfig.spec.ts +91 -0
- package/src/bannedDependencies.ts +14 -25
- package/src/consistentDependencies.ts +10 -8
- package/src/consistentVersions.ts +132 -83
- package/src/fileContents.ts +80 -35
- package/src/index.ts +2 -0
- package/src/mustSatisfyPeerDependencies.ts +10 -172
- package/src/nestedWorkspaces.ts +4 -4
- package/src/oncePerPackage.ts +6 -6
- package/src/packageEntry.ts +60 -50
- package/src/packageOrder.ts +19 -9
- package/src/packageScript.ts +67 -18
- package/src/requireDependency.ts +84 -31
- package/src/standardTsconfig.ts +26 -26
- package/src/util/zodSchemas.ts +15 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @monorepolint/rules@0.6.0-alpha.
|
|
2
|
+
> @monorepolint/rules@0.6.0-alpha.6 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.5.0
|
|
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[
|
|
13
|
-
[32mESM[39m [1mbuild/js/index.js.map [22m[
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mbuild/js/index.js [22m[32m55.70 KB[39m
|
|
13
|
+
[32mESM[39m [1mbuild/js/index.js.map [22m[32m114.08 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 79ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,117 @@
|
|
|
1
1
|
# @monorepolint/rules
|
|
2
2
|
|
|
3
|
+
## 0.6.0-alpha.6
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c1914bd: Dropping support for anything less than node 20
|
|
8
|
+
- b8d9bfb: Major Enhancement: Introducing the REMOVE symbol for declarative cleanup
|
|
9
|
+
|
|
10
|
+
This release introduces a powerful new `REMOVE` symbol that enables declarative removal of unwanted configurations, files, and dependencies across your monorepo. The REMOVE symbol provides a unified, intuitive API for cleanup operations across multiple rules.
|
|
11
|
+
|
|
12
|
+
**What's New:**
|
|
13
|
+
|
|
14
|
+
- **Universal REMOVE Symbol**: Import `{ REMOVE }` from `@monorepolint/rules` to use across all supported rules
|
|
15
|
+
- **Four Rules Enhanced**: Added REMOVE support to fileContents, packageScript, requireDependency, and packageEntry rules
|
|
16
|
+
- **Declarative Cleanup**: Specify what should NOT exist rather than just what should exist
|
|
17
|
+
- **Consistent API**: Same REMOVE symbol works across all supported rules with intuitive syntax
|
|
18
|
+
- **Safe Operations**: Handles non-existent items gracefully (no errors when removing something that doesn't exist)
|
|
19
|
+
|
|
20
|
+
**Import and Usage Examples:**
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import {
|
|
24
|
+
fileContents,
|
|
25
|
+
packageEntry,
|
|
26
|
+
packageScript,
|
|
27
|
+
REMOVE,
|
|
28
|
+
requireDependency,
|
|
29
|
+
} from "@monorepolint/rules";
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
rules: [
|
|
33
|
+
// fileContents: Remove unwanted files entirely
|
|
34
|
+
fileContents({
|
|
35
|
+
file: "unwanted-config.json",
|
|
36
|
+
template: REMOVE, // Delete file if it exists
|
|
37
|
+
}),
|
|
38
|
+
|
|
39
|
+
// packageScript: Remove scripts with direct or enhanced syntax
|
|
40
|
+
packageScript({
|
|
41
|
+
scripts: {
|
|
42
|
+
"outdated-script": REMOVE, // Direct removal syntax
|
|
43
|
+
build: "tsc", // Normal script management
|
|
44
|
+
"conditional-task": {
|
|
45
|
+
options: [
|
|
46
|
+
"old-command",
|
|
47
|
+
REMOVE,
|
|
48
|
+
], // Accept removal as valid option
|
|
49
|
+
fixValue: REMOVE, // Remove when fixing
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
|
|
54
|
+
// requireDependency: Remove dependencies across all types
|
|
55
|
+
requireDependency({
|
|
56
|
+
dependencies: {
|
|
57
|
+
lodash: REMOVE, // Remove from dependencies
|
|
58
|
+
react: "^18.0.0", // Keep with specific version
|
|
59
|
+
},
|
|
60
|
+
devDependencies: {
|
|
61
|
+
"old-test-lib": REMOVE, // Remove from devDependencies
|
|
62
|
+
vitest: "^1.0.0", // Keep this devDependency
|
|
63
|
+
},
|
|
64
|
+
peerDependencies: {
|
|
65
|
+
"deprecated-peer": REMOVE, // Remove from peerDependencies
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
|
|
69
|
+
// packageEntry: Remove top-level package.json fields
|
|
70
|
+
packageEntry({
|
|
71
|
+
entries: {
|
|
72
|
+
scripts: REMOVE, // Remove entire scripts field
|
|
73
|
+
description: "My package", // Keep with specific value
|
|
74
|
+
browser: REMOVE, // Remove browser field
|
|
75
|
+
main: "./index.js", // Keep this field
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Rule-Specific Features:**
|
|
83
|
+
|
|
84
|
+
- **fileContents**: Simple `template: REMOVE` syntax for file deletion
|
|
85
|
+
- **packageScript**: Direct syntax (`"script": REMOVE`) plus enhanced options syntax with `fixValue: REMOVE`
|
|
86
|
+
- **requireDependency**: Works across dependencies, devDependencies, peerDependencies, and optionalDependencies
|
|
87
|
+
- **packageEntry**: Remove any top-level package.json field while managing others normally
|
|
88
|
+
|
|
89
|
+
**Benefits:**
|
|
90
|
+
|
|
91
|
+
- **Maintainability**: Easier to specify and maintain cleanup rules across your monorepo
|
|
92
|
+
- **Consistency**: Same REMOVE pattern works across different types of configurations
|
|
93
|
+
- **Flexibility**: Mix removal with regular configuration management in the same rule
|
|
94
|
+
- **Safety**: Won't error on items that are already removed/missing
|
|
95
|
+
- **Integration**: Works seamlessly with `--fix` flag for automated cleanup operations
|
|
96
|
+
|
|
97
|
+
### Patch Changes
|
|
98
|
+
|
|
99
|
+
- 5cf4a93: Support protocols in consistentVersion rule, e.g. `catalog:`
|
|
100
|
+
- Updated dependencies [c1914bd]
|
|
101
|
+
- @monorepolint/config@0.6.0-alpha.6
|
|
102
|
+
- @monorepolint/core@0.6.0-alpha.6
|
|
103
|
+
- @monorepolint/utils@0.6.0-alpha.6
|
|
104
|
+
|
|
105
|
+
## 0.6.0-alpha.5
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- 9f6fea7: Upgraded versions to minor bumps
|
|
110
|
+
- Updated dependencies [9f6fea7]
|
|
111
|
+
- @monorepolint/config@0.6.0-alpha.5
|
|
112
|
+
- @monorepolint/utils@0.6.0-alpha.5
|
|
113
|
+
- @monorepolint/core@0.6.0-alpha.5
|
|
114
|
+
|
|
3
115
|
## 0.6.0-alpha.4
|
|
4
116
|
|
|
5
117
|
### Patch Changes
|