@kurvball/ashlar 1.10.0 → 1.10.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/CHANGELOG.md +8 -0
- package/dist/git.js +9 -8
- package/dist/knowledge/areas.js +5 -4
- package/dist/onboard/questions.js +2 -2
- package/dist/workspace.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ changesets merged since the release before it, under its version and release dat
|
|
|
6
6
|
and patch changes; see [RELEASING.md](RELEASING.md). Versions up to 1.0.1 follow
|
|
7
7
|
[Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/).
|
|
8
8
|
|
|
9
|
+
## 1.10.1
|
|
10
|
+
|
|
11
|
+
_Released 2026-12-06._
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- A project whose `include` names its root (`'.'`) works as one that names its folders. The guide, `brief`, `snapshot` and `decide` name each folder of the root as `src`, not `/src`, so `snapshot` counts each area's commits again, and an app at the root with `areas: ['*']` gets those folders as its areas. `ashlar affected` follows CSS imports and workspace packages there again, and an app at the root asks about its `README.md` once. `ashlar check` marks the breaks on the lines a change touched and follows renamed files, and `affected` reads a deleted file from git, whatever the root's files are named: git refused the empty path Ashlar gave it for the root.
|
|
16
|
+
|
|
9
17
|
## 1.10.0
|
|
10
18
|
|
|
11
19
|
_Released 2026-12-06._
|
package/dist/git.js
CHANGED
|
@@ -8,6 +8,7 @@ function git(root, args) {
|
|
|
8
8
|
const run = spawnSync('git', args, { cwd: root, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
|
|
9
9
|
return run.status === 0 ? run.stdout : null;
|
|
10
10
|
}
|
|
11
|
+
const pathspecs = (folders) => folders.map((folder) => folder || '.');
|
|
11
12
|
function lines(output) {
|
|
12
13
|
return (output ?? '').split('\n').filter((line) => line !== '');
|
|
13
14
|
}
|
|
@@ -36,18 +37,18 @@ function baseOf(root, since) {
|
|
|
36
37
|
return since === undefined ? defaultBase(root) : mergeBase(root, since);
|
|
37
38
|
}
|
|
38
39
|
export function untracked(root, folders) {
|
|
39
|
-
return lines(git(root, ['ls-files', '--others', '--exclude-standard', '--', ...folders]));
|
|
40
|
+
return lines(git(root, ['ls-files', '--others', '--exclude-standard', '--', ...pathspecs(folders)]));
|
|
40
41
|
}
|
|
41
42
|
export function changedSince(root, ref, folders = []) {
|
|
42
43
|
const base = mergeBase(root, ref);
|
|
43
|
-
const changed = lines(git(root, ['diff', '--relative', '--name-only', '--no-renames', base, '--', ...folders]));
|
|
44
|
+
const changed = lines(git(root, ['diff', '--relative', '--name-only', '--no-renames', base, '--', ...pathspecs(folders)]));
|
|
44
45
|
return [...new Set([...changed, ...untracked(root, folders)])].sort();
|
|
45
46
|
}
|
|
46
47
|
export function renamedSince(root, folders, since) {
|
|
47
48
|
const base = baseOf(root, since);
|
|
48
49
|
if (base === null)
|
|
49
50
|
return [];
|
|
50
|
-
const listed = git(root, ['diff', '--relative', '--name-status', '-M', base, '--', ...folders]);
|
|
51
|
+
const listed = git(root, ['diff', '--relative', '--name-status', '-M', base, '--', ...pathspecs(folders)]);
|
|
51
52
|
return lines(listed).flatMap((line) => {
|
|
52
53
|
const [status = '', from, to] = line.split('\t');
|
|
53
54
|
return status.startsWith('R') && from && to ? [{ from, to }] : [];
|
|
@@ -69,7 +70,7 @@ export function changedLines(root, folders, since) {
|
|
|
69
70
|
'-M',
|
|
70
71
|
base,
|
|
71
72
|
'--',
|
|
72
|
-
...folders,
|
|
73
|
+
...pathspecs(folders),
|
|
73
74
|
]);
|
|
74
75
|
let file = null;
|
|
75
76
|
for (const line of lines(diff)) {
|
|
@@ -112,8 +113,8 @@ function said(output) {
|
|
|
112
113
|
}
|
|
113
114
|
export function atRef(config, ref, read) {
|
|
114
115
|
knownRef(config.root, ref);
|
|
115
|
-
const wanted = [...config.include, 'tsconfig.json'];
|
|
116
|
-
const listing = spawnSync('git', ['ls-tree', '--name-only', ref, '--', ...wanted], {
|
|
116
|
+
const wanted = [...pathspecs(config.include), 'tsconfig.json'];
|
|
117
|
+
const listing = spawnSync('git', ['ls-tree', '-z', '--name-only', ref, '--', ...wanted], {
|
|
117
118
|
cwd: config.root,
|
|
118
119
|
encoding: 'utf8',
|
|
119
120
|
maxBuffer: 64 * 1024 * 1024,
|
|
@@ -121,10 +122,10 @@ export function atRef(config, ref, read) {
|
|
|
121
122
|
if (listing.status !== 0) {
|
|
122
123
|
throw new AshlarError(`git couldn't list the files at ${ref}: ${said(listing.stderr)}`, 'git');
|
|
123
124
|
}
|
|
124
|
-
const listed =
|
|
125
|
+
const listed = listing.stdout.split('\0').filter((name) => name !== '');
|
|
125
126
|
if (listed.length === 0)
|
|
126
127
|
return null;
|
|
127
|
-
const archive = spawnSync('git', ['archive', '--format=tar', ref, '--', ...listed], {
|
|
128
|
+
const archive = spawnSync('git', ['--literal-pathspecs', 'archive', '--format=tar', ref, '--', ...listed], {
|
|
128
129
|
cwd: config.root,
|
|
129
130
|
maxBuffer: 1024 * 1024 * 1024,
|
|
130
131
|
});
|
package/dist/knowledge/areas.js
CHANGED
|
@@ -7,14 +7,14 @@ import { byText } from '../order.js';
|
|
|
7
7
|
import { EVERYWHERE, HANDLE } from './decisions.js';
|
|
8
8
|
const isFolder = (path) => statSync(path, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
9
9
|
function foldersOf(config, pattern) {
|
|
10
|
-
if (!pattern.endsWith('/*'))
|
|
10
|
+
if (pattern !== '*' && !pattern.endsWith('/*'))
|
|
11
11
|
return isFolder(join(config.root, pattern)) ? [pattern] : [];
|
|
12
|
-
const parent = pattern.slice(0, -2);
|
|
12
|
+
const parent = pattern === '*' ? '' : pattern.slice(0, -2);
|
|
13
13
|
if (!isFolder(join(config.root, parent)))
|
|
14
14
|
return [];
|
|
15
15
|
return readdirSync(join(config.root, parent), { withFileTypes: true })
|
|
16
16
|
.filter((entry) => entry.isDirectory() && !entry.name.startsWith('.') && !config.ignore.includes(entry.name))
|
|
17
|
-
.map((entry) =>
|
|
17
|
+
.map((entry) => (parent ? `${parent}/${entry.name}` : entry.name));
|
|
18
18
|
}
|
|
19
19
|
export function areasOf(config, names = new Map()) {
|
|
20
20
|
const areas = new Map();
|
|
@@ -30,7 +30,8 @@ export function areasOf(config, names = new Map()) {
|
|
|
30
30
|
for (const path of foldersOf(config, pattern))
|
|
31
31
|
add(path, 'area', app.root);
|
|
32
32
|
}
|
|
33
|
-
const named = config.onboard.areas ??
|
|
33
|
+
const named = config.onboard.areas ??
|
|
34
|
+
(config.apps.length === 0 ? config.include.map((folder) => (folder ? `${folder}/*` : '*')) : []);
|
|
34
35
|
for (const pattern of named)
|
|
35
36
|
for (const path of foldersOf(config, pattern))
|
|
36
37
|
add(path, 'folder', null);
|
|
@@ -3,7 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { AshlarError } from '../config.js';
|
|
4
4
|
import { decisionCovers, ownerOf, ruleCoversArea } from '../knowledge/areas.js';
|
|
5
5
|
import { EVERYWHERE } from '../knowledge/decisions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { within } from '../layout.js';
|
|
7
7
|
import { byText } from '../order.js';
|
|
8
8
|
import { REACH_FILE } from '../reach.js';
|
|
9
9
|
export const QUESTION_KINDS = ['owner', 'reach', 'know', 'setup', 'trust'];
|
|
@@ -23,7 +23,7 @@ function scriptsOf(root, folder) {
|
|
|
23
23
|
export function documentsOf(config) {
|
|
24
24
|
const named = config.onboard.documents ?? [
|
|
25
25
|
'README.md',
|
|
26
|
-
...config.apps.map((app) =>
|
|
26
|
+
...config.apps.map((app) => (app.root ? `${app.root}/README.md` : 'README.md')),
|
|
27
27
|
];
|
|
28
28
|
return [...new Set(named)].filter((file) => existsSync(join(config.root, file))).sort();
|
|
29
29
|
}
|
package/dist/workspace.js
CHANGED
|
@@ -15,11 +15,12 @@ export function walkFolders(root, include, skip, onFile) {
|
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
for (const entry of entries) {
|
|
18
|
+
const path = folder ? `${folder}/${entry.name}` : entry.name;
|
|
18
19
|
if (entry.isFile())
|
|
19
|
-
onFile?.(
|
|
20
|
+
onFile?.(path);
|
|
20
21
|
if (!entry.isDirectory() || entry.name.startsWith('.') || skip.has(entry.name))
|
|
21
22
|
continue;
|
|
22
|
-
visit(
|
|
23
|
+
visit(path);
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
for (const folder of include)
|
|
@@ -105,7 +106,7 @@ function flatExports(json) {
|
|
|
105
106
|
export function readWorkspace(root, include, skip) {
|
|
106
107
|
const tsconfigs = [];
|
|
107
108
|
const packages = [];
|
|
108
|
-
for (const folder of ['', ...walkFolders(root, include, skip)]) {
|
|
109
|
+
for (const folder of new Set(['', ...walkFolders(root, include, skip)])) {
|
|
109
110
|
const tsconfig = join(root, folder, 'tsconfig.json');
|
|
110
111
|
if (existsSync(tsconfig)) {
|
|
111
112
|
const options = tsOptions(tsconfig, new Set());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurvball/ashlar",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "The rules for building software with agents: lint rules, an import graph with a shrink-only ratchet, a feature map and onboarding for TypeScript projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|