@geonosis/oxlint-plugin-biological-architecture 1.3.0 → 2.0.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 +1 -1
- package/corpus/.oxlintrc.json +97 -5
- package/corpus/domains/document/workflows/bad-per-kind-workflow.ts +5 -0
- package/corpus/domains/document/workflows/good-minted-workflow.ts +8 -0
- package/corpus/engine/bad-durable-free-read.ts +20 -0
- package/corpus/engine/bad-no-retry.ts +8 -0
- package/corpus/engine/good-durable-other-spelling.ts +10 -0
- package/corpus/engine/good-durable-read-is-a-step.ts +18 -0
- package/corpus/engine/good-durable-read-through-helper.ts +20 -0
- package/corpus/engine/good-inline-free-read.ts +7 -0
- package/corpus/engine/good-retry-budget.ts +9 -0
- package/corpus/floors/domains/alpha/src/good-downhill.ts +3 -0
- package/corpus/floors/domains/alpha/src/index.ts +1 -0
- package/corpus/floors/domains/alpha/src/reaches-own-ui.ts +3 -0
- package/corpus/floors/domains/alpha/src/reaches-sideways-type.ts +3 -0
- package/corpus/floors/domains/alpha/src/reaches-sideways.ts +3 -0
- package/corpus/floors/domains/alpha/src/ui/panel.ts +3 -0
- package/corpus/floors/domains/beta/src/index.ts +3 -0
- package/corpus/floors/foundations/above/src/good-downhill.ts +3 -0
- package/corpus/floors/foundations/base/src/good-downhill.ts +3 -0
- package/corpus/floors/foundations/base/src/index.ts +1 -0
- package/corpus/floors/foundations/base/src/reaches-sideways.ts +3 -0
- package/corpus/floors/foundations/base/src/reaches-up.ts +3 -0
- package/corpus/floors/packages/method/src/own.ts +1 -0
- package/corpus/floors/packages/method/src/reaches-up.ts +3 -0
- package/corpus/floors.oxlintrc.json +86 -0
- package/corpus/manifest.json +4 -0
- package/corpus/subpaths/bad-root-barrel.ts +5 -0
- package/corpus/subpaths/good-spans-two-subpaths.ts +5 -0
- package/corpus/subpaths/good-subpath.ts +4 -0
- package/corpus/subpaths/good-type-only.ts +4 -0
- package/corpus/time/bad-boundary-type.ts +3 -0
- package/corpus/time/bad-second-door.ts +6 -0
- package/corpus/time/door.ts +15 -0
- package/corpus/time/generated/from-openapi.ts +1 -0
- package/corpus/time/good-boundary-primitive.ts +3 -0
- package/corpus/todos/bad-unplanned.ts +2 -0
- package/corpus/todos/good-planned.ts +2 -0
- package/corpus/todos/good-string-not-a-comment.ts +2 -0
- package/corpus/workers/good-with-cells.ts +7 -0
- package/corpus/workers/good-with-connection.ts +7 -0
- package/corpus/workflows/bad-unscoped-host.ts +7 -0
- package/corpus/workflows/good-host-config-elsewhere.ts +6 -0
- package/corpus/workflows/good-scoped-entrypoint.ts +17 -0
- package/corpus/workflows/good-scoped-host.ts +11 -0
- package/dist/{chunk-UVENNNFM.js → chunk-LTDP2733.js} +36 -3
- package/dist/index.d.ts +17 -2
- package/dist/index.js +1115 -370
- package/dist/presets.d.ts +31 -2
- package/dist/presets.js +5 -1
- package/package.json +2 -2
- /package/corpus/{packages/workflows/src → domains/document/workflows}/bad-per-kind-saga.ts +0 -0
- /package/corpus/{apps/api/src → workers}/bad-unscoped-worker.ts +0 -0
|
@@ -38,21 +38,37 @@ var FRONTEND = [
|
|
|
38
38
|
"zustand-v5-best-practices"
|
|
39
39
|
];
|
|
40
40
|
var BACKEND_WORKFLOWS = [
|
|
41
|
+
"boundary-time-is-primitive",
|
|
41
42
|
"constants-in-constants-file",
|
|
42
43
|
"dialect-through-the-seam",
|
|
43
44
|
"document-sagas-are-generic",
|
|
44
45
|
"documents-share-one-table",
|
|
46
|
+
"durable-body-reads-through-steps",
|
|
47
|
+
"mutating-step-declares-retry",
|
|
45
48
|
"no-orm-outside-db",
|
|
46
49
|
"no-raw-sql-outside-allowed",
|
|
47
50
|
"no-void-port",
|
|
48
51
|
"queue-loop-is-the-library",
|
|
49
52
|
"ssot-no-inline-facts",
|
|
50
53
|
"ssot-no-process-env",
|
|
54
|
+
"step-declares-compensation-or-none",
|
|
51
55
|
"tables-declare-their-plane",
|
|
52
56
|
"time-through-the-door"
|
|
53
57
|
];
|
|
54
58
|
var BACKEND_D1 = ["no-d1-transaction", "worker-handles-are-scoped"];
|
|
55
|
-
var
|
|
59
|
+
var BACKEND_WORKFLOWS_CF = ["step-opens-its-own-cell"];
|
|
60
|
+
var RENAMED_TO = {
|
|
61
|
+
"backend-sagaflow-cf": "backend-workflows-cf"
|
|
62
|
+
};
|
|
63
|
+
var announced = /* @__PURE__ */ new Set();
|
|
64
|
+
var announceRename = (from) => {
|
|
65
|
+
if (announced.has(from)) return;
|
|
66
|
+
announced.add(from);
|
|
67
|
+
process.stderr.write(
|
|
68
|
+
`biological-architecture: preset "${from}" is now "${RENAMED_TO[from]}" \u2014 the old name resolves to the same rules for one release, then goes.
|
|
69
|
+
`
|
|
70
|
+
);
|
|
71
|
+
};
|
|
56
72
|
var BACKEND_MEDUSA = [
|
|
57
73
|
"emit-declares-attempts",
|
|
58
74
|
"mutating-step-declares-retry",
|
|
@@ -75,9 +91,10 @@ var TENANT_SCOPING = [
|
|
|
75
91
|
"tables-declare-their-plane",
|
|
76
92
|
"tenant-tables-carry-org-id"
|
|
77
93
|
];
|
|
78
|
-
var TOOLING = ["layer-walls"];
|
|
94
|
+
var TOOLING = ["layer-walls", "todo-names-its-plan"];
|
|
79
95
|
var THEMEKIT = ["font-roles-only", "tokens-only-colors"];
|
|
80
96
|
var TESTBED = ["no-mock-db-in-integration"];
|
|
97
|
+
var PACKAGE_SUBPATHS = ["subpath-over-barrel"];
|
|
81
98
|
var RULE_PREFIX = "biological-architecture";
|
|
82
99
|
var asRules = (names) => Object.fromEntries(names.map((name) => [`${RULE_PREFIX}/${name}`, "error"]));
|
|
83
100
|
var COMMENT_CEILING = {
|
|
@@ -86,15 +103,29 @@ var COMMENT_CEILING = {
|
|
|
86
103
|
"capitalized-comments": "error"
|
|
87
104
|
}
|
|
88
105
|
};
|
|
106
|
+
var PRESUMED_ENGINES = [
|
|
107
|
+
{
|
|
108
|
+
engine: "Medusa",
|
|
109
|
+
packages: ["@medusajs/framework", "@medusajs/medusa", "@medusajs/utils"],
|
|
110
|
+
rules: BACKEND_MEDUSA.filter((name) => !BACKEND_WORKFLOWS.includes(name))
|
|
111
|
+
}
|
|
112
|
+
];
|
|
89
113
|
var PRESETS = {
|
|
90
114
|
"backend-d1": { rules: asRules(BACKEND_D1) },
|
|
91
115
|
"backend-medusa": { rules: asRules(BACKEND_MEDUSA) },
|
|
92
|
-
"backend-sagaflow-cf": {
|
|
116
|
+
"backend-sagaflow-cf": {
|
|
117
|
+
get rules() {
|
|
118
|
+
announceRename("backend-sagaflow-cf");
|
|
119
|
+
return asRules(BACKEND_WORKFLOWS_CF);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
93
122
|
"backend-trpc": { rules: asRules(BACKEND_TRPC) },
|
|
94
123
|
"backend-workflows": { rules: asRules(BACKEND_WORKFLOWS) },
|
|
124
|
+
"backend-workflows-cf": { rules: asRules(BACKEND_WORKFLOWS_CF) },
|
|
95
125
|
"comment-ceiling": COMMENT_CEILING,
|
|
96
126
|
frontend: { rules: asRules(FRONTEND) },
|
|
97
127
|
integrations: { rules: asRules(INTEGRATIONS) },
|
|
128
|
+
"package-subpaths": { rules: asRules(PACKAGE_SUBPATHS) },
|
|
98
129
|
recommended: { rules: asRules(FRONTEND) },
|
|
99
130
|
"tenant-scoping": { rules: asRules(TENANT_SCOPING) },
|
|
100
131
|
themekit: { rules: asRules(THEMEKIT) },
|
|
@@ -104,6 +135,8 @@ var PRESETS = {
|
|
|
104
135
|
var rulesOfPreset = (preset) => Object.keys(PRESETS[preset].rules).filter((id) => id.startsWith(`${RULE_PREFIX}/`)).map((id) => id.slice(RULE_PREFIX.length + 1));
|
|
105
136
|
|
|
106
137
|
export {
|
|
138
|
+
RENAMED_TO,
|
|
139
|
+
PRESUMED_ENGINES,
|
|
107
140
|
PRESETS,
|
|
108
141
|
rulesOfPreset
|
|
109
142
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Preset } from './presets.js';
|
|
2
|
-
export { PRESETS, PresetName, rulesOfPreset } from './presets.js';
|
|
2
|
+
export { PRESETS, PresetName, RENAMED_TO, rulesOfPreset } from './presets.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The file a rule says MUST fire it, given the options it was handed.
|
|
@@ -54,6 +54,15 @@ type Rule = {
|
|
|
54
54
|
* nowhere stays a failure, which is the whole point of the check that reads this.
|
|
55
55
|
*/
|
|
56
56
|
probe?: ProbeFn;
|
|
57
|
+
/**
|
|
58
|
+
* The engine this rule presumes, and the packages a workspace's manifest proves it with. Present
|
|
59
|
+
* only on a rule that reaches ONE engine: enabled where the engine is absent, it has zero
|
|
60
|
+
* possible findings and reads exactly like compliance (#159). Declared once in `presets.ts`.
|
|
61
|
+
*/
|
|
62
|
+
presumes?: {
|
|
63
|
+
engine: string;
|
|
64
|
+
packages: readonly string[];
|
|
65
|
+
};
|
|
57
66
|
};
|
|
58
67
|
declare const rules: Record<string, Rule>;
|
|
59
68
|
type RuleName = string;
|
|
@@ -67,7 +76,7 @@ declare const plugin: {
|
|
|
67
76
|
rules: Record<string, "error">;
|
|
68
77
|
};
|
|
69
78
|
'backend-sagaflow-cf': {
|
|
70
|
-
rules: Record<string, "error">;
|
|
79
|
+
readonly rules: Record<string, "error">;
|
|
71
80
|
};
|
|
72
81
|
'backend-trpc': {
|
|
73
82
|
rules: Record<string, "error">;
|
|
@@ -75,6 +84,9 @@ declare const plugin: {
|
|
|
75
84
|
'backend-workflows': {
|
|
76
85
|
rules: Record<string, "error">;
|
|
77
86
|
};
|
|
87
|
+
'backend-workflows-cf': {
|
|
88
|
+
rules: Record<string, "error">;
|
|
89
|
+
};
|
|
78
90
|
'comment-ceiling': Preset;
|
|
79
91
|
frontend: {
|
|
80
92
|
rules: Record<string, "error">;
|
|
@@ -82,6 +94,9 @@ declare const plugin: {
|
|
|
82
94
|
integrations: {
|
|
83
95
|
rules: Record<string, "error">;
|
|
84
96
|
};
|
|
97
|
+
'package-subpaths': {
|
|
98
|
+
rules: Record<string, "error">;
|
|
99
|
+
};
|
|
85
100
|
recommended: {
|
|
86
101
|
rules: Record<string, "error">;
|
|
87
102
|
};
|