@vwala/tooling-config 1.4.0 → 1.4.1
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 +2 -0
- package/package.json +1 -1
- package/src/biome/_scripts/check-naming.mjs +23 -2
package/README.md
CHANGED
|
@@ -93,6 +93,8 @@ They are warnings because the convention applies to new code and asks that exist
|
|
|
93
93
|
|
|
94
94
|
`__tests__`, `__mocks__`, `_scripts`, hidden folders, and the `[slug]` / `(group)` / `@slot` segments Next.js and Expo give meaning to are exempt from the folder check.
|
|
95
95
|
|
|
96
|
+
Paths under `prisma/migrations/` at any depth are ignored entirely because Prisma owns each migration directory name and persists that exact identity in the database, so it cannot be renamed to kebab-case.
|
|
97
|
+
|
|
96
98
|
### Exports
|
|
97
99
|
|
|
98
100
|
Entry points are declared in a package's `package.json` `exports`, not assembled by a barrel that re-exports the world. A feature's own `index.ts` is a different thing — an internal boundary, and one [`vwala-engineering-principles`](https://github.com/vwala-be/skills) requires — so nothing here touches it. Three of Biome's own rules carry the syntax half:
|
package/package.json
CHANGED
|
@@ -35,11 +35,19 @@ const KEBAB_CASE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
|
35
35
|
// runnable helpers, anything hidden, and the bracket/paren/@ segments that
|
|
36
36
|
// Next.js and Expo routing give meaning to.
|
|
37
37
|
const RESERVED_FOLDER = /^(__[a-z]+__|_[a-z-]+|\..+|\[.+\]|\(.+\)|@.+|\+.+)$/;
|
|
38
|
+
// Paths whose names another tool owns. Prisma generates a migration directory as
|
|
39
|
+
// `<timestamp>_<name>` and records that exact string in the `_prisma_migrations`
|
|
40
|
+
// table, so the name is an identity rather than a choice: no migration can ever
|
|
41
|
+
// satisfy KEBAB_CASE, and renaming one to try makes the database disagree with
|
|
42
|
+
// the repository about which migrations have run.
|
|
43
|
+
const IGNORED_PATH = /(^|\/)prisma\/migrations\//;
|
|
38
44
|
|
|
39
45
|
const trackedFiles = git(["ls-files"]);
|
|
40
46
|
const untrackedFiles = git(["ls-files", "--others", "--exclude-standard"]);
|
|
41
47
|
const files = [...trackedFiles, ...untrackedFiles].filter(
|
|
42
|
-
(file) =>
|
|
48
|
+
(file) =>
|
|
49
|
+
!IGNORED_PREFIXES.some((prefix) => file.startsWith(prefix)) &&
|
|
50
|
+
!IGNORED_PATH.test(file),
|
|
43
51
|
);
|
|
44
52
|
const newFiles = new Set([...untrackedFiles, ...addedSinceBaseRef()]);
|
|
45
53
|
|
|
@@ -146,7 +154,20 @@ function addedSinceBaseRef() {
|
|
|
146
154
|
);
|
|
147
155
|
return [];
|
|
148
156
|
}
|
|
149
|
-
|
|
157
|
+
// Copy and rename detection runs after `--diff-filter`, so filtering directly
|
|
158
|
+
// would classify a legacy-path migration copy as a new file. Parse the status
|
|
159
|
+
// after detection and retain only additions Git could not associate with a
|
|
160
|
+
// tracked source file.
|
|
161
|
+
return git([
|
|
162
|
+
"diff",
|
|
163
|
+
"--name-status",
|
|
164
|
+
"-C",
|
|
165
|
+
"--find-copies-harder",
|
|
166
|
+
mergeBase,
|
|
167
|
+
]).flatMap((line) => {
|
|
168
|
+
const [status, file] = line.split("\t");
|
|
169
|
+
return status === "A" ? [file] : [];
|
|
170
|
+
});
|
|
150
171
|
}
|
|
151
172
|
|
|
152
173
|
function git(args) {
|