@zaaxch/grasp-cli 0.0.0-stage → 0.2.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 +7 -2
- package/bin/grasp.mjs +5 -0
- package/dist/check.d.ts +22 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +479 -0
- package/dist/check.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +141 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-loader.d.ts +8 -0
- package/dist/config-loader.d.ts.map +1 -0
- package/dist/config-loader.js +49 -0
- package/dist/config-loader.js.map +1 -0
- package/dist/feature.d.ts +15 -0
- package/dist/feature.d.ts.map +1 -0
- package/dist/feature.js +262 -0
- package/dist/feature.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/new.d.ts +19 -0
- package/dist/new.d.ts.map +1 -0
- package/dist/new.js +321 -0
- package/dist/new.js.map +1 -0
- package/dist/sync.d.ts +27 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +94 -0
- package/dist/sync.js.map +1 -0
- package/dist/templates.d.ts +14 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +1376 -0
- package/dist/templates.js.map +1 -0
- package/package.json +61 -3
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@zaaxch/grasp-cli`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI and static guardrail engine for Grasp application repositories:
|
|
4
|
+
|
|
5
|
+
- `grasp new <name> [--db mongo|postgres]` — Scaffolds a clean single-package Grasp app
|
|
6
|
+
- `grasp feature <name>` — Scaffolds a full-stack vertical slice (`contracts`, `server`, `web`)
|
|
7
|
+
- `grasp sync [--check]` — Regenerates/verifies all byte-locked Docker, Caddy, GHCR/DO CI, boot entrypoints, and agent guidance files
|
|
8
|
+
- `grasp check [--json]` — Static AST + manifest + dependency allowlist enforcer
|
package/bin/grasp.mjs
ADDED
package/dist/check.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface CheckViolation {
|
|
2
|
+
readonly code: 'LOCKED_FILE_MODIFIED' | 'LOCKED_FILE_MISSING' | 'LOCKFILE_STALE' | 'FORBIDDEN_VENDOR_IMPORT' | 'FORBIDDEN_BROWSER_FETCH' | 'IMPURE_CONTRACT_IMPORT' | 'CROSS_RUNTIME_BOUNDARY_IMPORT' | 'CROSS_FEATURE_REPO_IMPORT' | 'FORBIDDEN_DIRECTORY' | 'FORBIDDEN_FEATURE_FILE' | 'FORBIDDEN_DEPENDENCY' | 'UNAPPROVED_DEPENDENCY';
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly line?: number;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CheckProjectResult {
|
|
8
|
+
readonly ok: boolean;
|
|
9
|
+
readonly violations: readonly CheckViolation[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Enforces full Grasp architectural lockdown:
|
|
13
|
+
* 1) byte-locked files & grasp.lock.json integrity
|
|
14
|
+
* 2) vendor/browser-fetch/cross-boundary AST import rules
|
|
15
|
+
* 3) vertical feature directory & filename lockdown
|
|
16
|
+
* 4) package.json dependency allowlist verification
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkProject(options: {
|
|
19
|
+
readonly rootDir: string;
|
|
20
|
+
readonly cliVersion?: string;
|
|
21
|
+
}): Promise<CheckProjectResult>;
|
|
22
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EACT,sBAAsB,GACtB,qBAAqB,GACrB,gBAAgB,GAChB,yBAAyB,GACzB,yBAAyB,GACzB,wBAAwB,GACxB,+BAA+B,GAC/B,2BAA2B,GAC3B,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,uBAAuB,CAAA;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAA;CAC/C;AAqcD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA0E9B"}
|
package/dist/check.js
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { join, relative, resolve } from 'node:path';
|
|
3
|
+
import { FORBIDDEN_APP_DEPENDENCIES } from '@zaaxch/grasp-core';
|
|
4
|
+
import ts from 'typescript';
|
|
5
|
+
import { loadGraspConfig } from './config-loader.js';
|
|
6
|
+
import { normalizeLockedHashInput, sha256Hex, syncProject } from './sync.js';
|
|
7
|
+
const BANNED_FEATURE_PACKAGES = new Set([
|
|
8
|
+
...FORBIDDEN_APP_DEPENDENCIES,
|
|
9
|
+
'nodemailer',
|
|
10
|
+
'winston',
|
|
11
|
+
'cron-parser',
|
|
12
|
+
'http',
|
|
13
|
+
'https',
|
|
14
|
+
'node:http',
|
|
15
|
+
'node:https',
|
|
16
|
+
]);
|
|
17
|
+
const BASELINE_PROD_DEPS = new Set(['@zaaxch/grasp-core', '@zaaxch/grasp-server', 'zod']);
|
|
18
|
+
const BASELINE_DEV_DEPS = new Set([
|
|
19
|
+
'@zaaxch/grasp-vue',
|
|
20
|
+
'@zaaxch/grasp-cli',
|
|
21
|
+
'@primeuix/themes',
|
|
22
|
+
'@tailwindcss/vite',
|
|
23
|
+
'@types/node',
|
|
24
|
+
'@vitejs/plugin-vue',
|
|
25
|
+
'@vue/test-utils',
|
|
26
|
+
'firebase',
|
|
27
|
+
'happy-dom',
|
|
28
|
+
'pinia',
|
|
29
|
+
'prettier',
|
|
30
|
+
'primevue',
|
|
31
|
+
'tailwindcss',
|
|
32
|
+
'typescript',
|
|
33
|
+
'vite',
|
|
34
|
+
'vitest',
|
|
35
|
+
'vue',
|
|
36
|
+
'vue-router',
|
|
37
|
+
'vue-tsc',
|
|
38
|
+
]);
|
|
39
|
+
function packageRootOf(specifier) {
|
|
40
|
+
if (specifier.startsWith('@')) {
|
|
41
|
+
const parts = specifier.split('/');
|
|
42
|
+
return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : specifier;
|
|
43
|
+
}
|
|
44
|
+
return specifier.split('/')[0] ?? specifier;
|
|
45
|
+
}
|
|
46
|
+
function walkFiles(dir) {
|
|
47
|
+
if (!existsSync(dir))
|
|
48
|
+
return [];
|
|
49
|
+
const out = [];
|
|
50
|
+
for (const entry of readdirSync(dir)) {
|
|
51
|
+
const full = join(dir, entry);
|
|
52
|
+
const st = statSync(full);
|
|
53
|
+
if (st.isDirectory()) {
|
|
54
|
+
out.push(...walkFiles(full));
|
|
55
|
+
}
|
|
56
|
+
else if (st.isFile()) {
|
|
57
|
+
out.push(full);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
function extractScriptBlocks(filePath, content) {
|
|
63
|
+
if (!filePath.endsWith('.vue')) {
|
|
64
|
+
return [{ code: content, lineOffset: 0 }];
|
|
65
|
+
}
|
|
66
|
+
const blocks = [];
|
|
67
|
+
const scriptRegex = /<script\b[^>]*>([\s\S]*?)<\/script>/gi;
|
|
68
|
+
let match;
|
|
69
|
+
while ((match = scriptRegex.exec(content)) !== null) {
|
|
70
|
+
const before = content.slice(0, match.index);
|
|
71
|
+
const tagHeaderEnd = match[0].indexOf('>') + 1;
|
|
72
|
+
const tagHeader = match[0].slice(0, tagHeaderEnd);
|
|
73
|
+
const linesBefore = (before + tagHeader).split('\n').length - 1;
|
|
74
|
+
blocks.push({ code: match[1] ?? '', lineOffset: linesBefore });
|
|
75
|
+
}
|
|
76
|
+
return blocks;
|
|
77
|
+
}
|
|
78
|
+
function scanSourceAst(relPath, content, config, violations) {
|
|
79
|
+
const normalizedPath = relPath.replace(/\\/g, '/');
|
|
80
|
+
const isContract = normalizedPath.startsWith('src/contracts/');
|
|
81
|
+
const isServerFeature = normalizedPath.startsWith('src/server/features/');
|
|
82
|
+
const isWebCode = normalizedPath.startsWith('src/web/') && normalizedPath !== 'src/web/main.ts';
|
|
83
|
+
const isLockedBoot = normalizedPath === 'src/server/main.ts' ||
|
|
84
|
+
normalizedPath === 'src/server/worker.ts' ||
|
|
85
|
+
normalizedPath === 'src/server/schema.ts' ||
|
|
86
|
+
normalizedPath === 'src/server/ops.ts' ||
|
|
87
|
+
normalizedPath === 'src/server/mcp.ts' ||
|
|
88
|
+
normalizedPath === 'src/web/main.ts';
|
|
89
|
+
if (isLockedBoot)
|
|
90
|
+
return;
|
|
91
|
+
const blocks = extractScriptBlocks(normalizedPath, content);
|
|
92
|
+
for (const block of blocks) {
|
|
93
|
+
const sf = ts.createSourceFile(normalizedPath, block.code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
94
|
+
const lineOf = (pos) => sf.getLineAndCharacterOfPosition(pos).line + 1 + block.lineOffset;
|
|
95
|
+
const checkSpecifier = (specifier, node) => {
|
|
96
|
+
const line = lineOf(node.getStart(sf));
|
|
97
|
+
const isRelative = specifier.startsWith('.') || specifier.startsWith('/');
|
|
98
|
+
if (isContract) {
|
|
99
|
+
if (!isRelative) {
|
|
100
|
+
const root = packageRootOf(specifier);
|
|
101
|
+
if (root !== 'zod' && root !== '@zaaxch/grasp-core') {
|
|
102
|
+
violations.push({
|
|
103
|
+
code: 'IMPURE_CONTRACT_IMPORT',
|
|
104
|
+
path: normalizedPath,
|
|
105
|
+
line,
|
|
106
|
+
message: `Contract file cannot import "${specifier}"; only zod and @zaaxch/grasp-core are allowed`,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!isRelative) {
|
|
113
|
+
const root = packageRootOf(specifier);
|
|
114
|
+
if (BANNED_FEATURE_PACKAGES.has(root) || BANNED_FEATURE_PACKAGES.has(specifier)) {
|
|
115
|
+
violations.push({
|
|
116
|
+
code: 'FORBIDDEN_VENDOR_IMPORT',
|
|
117
|
+
path: normalizedPath,
|
|
118
|
+
line,
|
|
119
|
+
message: `Direct import of "${specifier}" is forbidden in app code; use @zaaxch/grasp-* abstractions`,
|
|
120
|
+
});
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (isWebCode) {
|
|
124
|
+
if (root === '@zaaxch/grasp-server' ||
|
|
125
|
+
root === '@zaaxch/grasp-mongo' ||
|
|
126
|
+
root === '@zaaxch/grasp-postgres' ||
|
|
127
|
+
root === '@zaaxch/grasp-cli') {
|
|
128
|
+
violations.push({
|
|
129
|
+
code: 'CROSS_RUNTIME_BOUNDARY_IMPORT',
|
|
130
|
+
path: normalizedPath,
|
|
131
|
+
line,
|
|
132
|
+
message: `Web code cannot import server/DB package "${specifier}"`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (isServerFeature && root === '@zaaxch/grasp-vue') {
|
|
137
|
+
violations.push({
|
|
138
|
+
code: 'CROSS_RUNTIME_BOUNDARY_IMPORT',
|
|
139
|
+
path: normalizedPath,
|
|
140
|
+
line,
|
|
141
|
+
message: `Server code cannot import frontend package "${specifier}"`,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
const target = resolve(join('/app', normalizedPath, '..'), specifier).replace(/\\/g, '/');
|
|
147
|
+
if (isWebCode && target.startsWith('/app/src/server')) {
|
|
148
|
+
violations.push({
|
|
149
|
+
code: 'CROSS_RUNTIME_BOUNDARY_IMPORT',
|
|
150
|
+
path: normalizedPath,
|
|
151
|
+
line,
|
|
152
|
+
message: `Web code cannot import server module "${specifier}"`,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (isServerFeature && target.startsWith('/app/src/web')) {
|
|
156
|
+
violations.push({
|
|
157
|
+
code: 'CROSS_RUNTIME_BOUNDARY_IMPORT',
|
|
158
|
+
path: normalizedPath,
|
|
159
|
+
line,
|
|
160
|
+
message: `Server code cannot import web module "${specifier}"`,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
// Private .repo boundary check: feature A cannot import feature B's .repo
|
|
164
|
+
const serverFeatureMatch = /^src\/server\/features\/([^/]+)\//.exec(normalizedPath);
|
|
165
|
+
const targetRepoMatch = /^\/app\/src\/server\/features\/([^/]+)\/[^/]+\.repo(?:\.[mc]?[jt]s)?$/.exec(target);
|
|
166
|
+
if (serverFeatureMatch && targetRepoMatch && serverFeatureMatch[1] !== targetRepoMatch[1]) {
|
|
167
|
+
violations.push({
|
|
168
|
+
code: 'CROSS_FEATURE_REPO_IMPORT',
|
|
169
|
+
path: normalizedPath,
|
|
170
|
+
line,
|
|
171
|
+
message: `Feature "${serverFeatureMatch[1]}" cannot import private repo "${specifier}" from "${targetRepoMatch[1]}"; import its .service.ts instead`,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const visit = (node) => {
|
|
177
|
+
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
|
|
178
|
+
checkSpecifier(node.moduleSpecifier.text, node);
|
|
179
|
+
}
|
|
180
|
+
else if (ts.isExportDeclaration(node) &&
|
|
181
|
+
node.moduleSpecifier &&
|
|
182
|
+
ts.isStringLiteral(node.moduleSpecifier)) {
|
|
183
|
+
checkSpecifier(node.moduleSpecifier.text, node);
|
|
184
|
+
}
|
|
185
|
+
else if (ts.isCallExpression(node)) {
|
|
186
|
+
const expr = node.expression;
|
|
187
|
+
if (expr.kind === ts.SyntaxKind.ImportKeyword &&
|
|
188
|
+
node.arguments[0] &&
|
|
189
|
+
ts.isStringLiteral(node.arguments[0])) {
|
|
190
|
+
checkSpecifier(node.arguments[0].text, node);
|
|
191
|
+
}
|
|
192
|
+
else if (ts.isIdentifier(expr) &&
|
|
193
|
+
expr.text === 'require' &&
|
|
194
|
+
node.arguments[0] &&
|
|
195
|
+
ts.isStringLiteral(node.arguments[0])) {
|
|
196
|
+
checkSpecifier(node.arguments[0].text, node);
|
|
197
|
+
}
|
|
198
|
+
if (isWebCode) {
|
|
199
|
+
const isDirectFetch = ts.isIdentifier(expr) && expr.text === 'fetch';
|
|
200
|
+
const isMemberFetch = ts.isPropertyAccessExpression(expr) &&
|
|
201
|
+
expr.name.text === 'fetch' &&
|
|
202
|
+
ts.isIdentifier(expr.expression) &&
|
|
203
|
+
(expr.expression.text === 'window' || expr.expression.text === 'globalThis');
|
|
204
|
+
if (isDirectFetch || isMemberFetch) {
|
|
205
|
+
violations.push({
|
|
206
|
+
code: 'FORBIDDEN_BROWSER_FETCH',
|
|
207
|
+
path: normalizedPath,
|
|
208
|
+
line: lineOf(node.getStart(sf)),
|
|
209
|
+
message: `Direct global fetch() is forbidden in web code; use useGraspApi() / useGraspShell()`,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else if (isWebCode && ts.isNewExpression(node)) {
|
|
215
|
+
if (ts.isIdentifier(node.expression) && node.expression.text === 'EventSource') {
|
|
216
|
+
violations.push({
|
|
217
|
+
code: 'FORBIDDEN_BROWSER_FETCH',
|
|
218
|
+
path: normalizedPath,
|
|
219
|
+
line: lineOf(node.getStart(sf)),
|
|
220
|
+
message: `Direct EventSource usage is forbidden; use contract streams via useGraspApi()`,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
ts.forEachChild(node, visit);
|
|
225
|
+
};
|
|
226
|
+
visit(sf);
|
|
227
|
+
}
|
|
228
|
+
void config;
|
|
229
|
+
}
|
|
230
|
+
function checkDirectoryStructure(absRoot, config, violations) {
|
|
231
|
+
const srcDir = join(absRoot, 'src');
|
|
232
|
+
if (!existsSync(srcDir))
|
|
233
|
+
return;
|
|
234
|
+
for (const entry of readdirSync(srcDir)) {
|
|
235
|
+
if (entry !== 'contracts' && entry !== 'server' && entry !== 'web') {
|
|
236
|
+
violations.push({
|
|
237
|
+
code: 'FORBIDDEN_DIRECTORY',
|
|
238
|
+
path: `src/${entry}`,
|
|
239
|
+
message: `Top-level directory "src/${entry}" is not permitted; use src/contracts, src/server, or src/web`,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const serverDir = join(srcDir, 'server');
|
|
244
|
+
if (existsSync(serverDir)) {
|
|
245
|
+
const allowedServerEntries = new Set([
|
|
246
|
+
'main.ts',
|
|
247
|
+
'worker.ts',
|
|
248
|
+
'schema.ts',
|
|
249
|
+
'ops.ts',
|
|
250
|
+
...(config.mcp.enabled ? ['mcp.ts'] : []),
|
|
251
|
+
'features',
|
|
252
|
+
]);
|
|
253
|
+
for (const entry of readdirSync(serverDir)) {
|
|
254
|
+
if (!allowedServerEntries.has(entry)) {
|
|
255
|
+
violations.push({
|
|
256
|
+
code: 'FORBIDDEN_DIRECTORY',
|
|
257
|
+
path: `src/server/${entry}`,
|
|
258
|
+
message: `Unexpected server path "src/server/${entry}"; feature code belongs in src/server/features/<feature>/`,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const featuresDir = join(serverDir, 'features');
|
|
263
|
+
if (existsSync(featuresDir)) {
|
|
264
|
+
for (const feat of readdirSync(featuresDir)) {
|
|
265
|
+
const featPath = join(featuresDir, feat);
|
|
266
|
+
if (statSync(featPath).isFile()) {
|
|
267
|
+
if (feat !== 'index.ts') {
|
|
268
|
+
violations.push({
|
|
269
|
+
code: 'FORBIDDEN_FEATURE_FILE',
|
|
270
|
+
path: `src/server/features/${feat}`,
|
|
271
|
+
message: `Only index.ts is allowed directly under src/server/features/`,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
const allowedFiles = new Set([
|
|
277
|
+
`${feat}.repo.ts`,
|
|
278
|
+
`${feat}.procedures.ts`,
|
|
279
|
+
`${feat}.service.ts`,
|
|
280
|
+
`${feat}.jobs.ts`,
|
|
281
|
+
`${feat}.eraser.ts`,
|
|
282
|
+
`${feat}.http.ts`,
|
|
283
|
+
`${feat}.mcp.ts`,
|
|
284
|
+
`${feat}.ops.ts`,
|
|
285
|
+
'__tests__',
|
|
286
|
+
]);
|
|
287
|
+
for (const item of readdirSync(featPath)) {
|
|
288
|
+
if (!allowedFiles.has(item)) {
|
|
289
|
+
violations.push({
|
|
290
|
+
code: 'FORBIDDEN_FEATURE_FILE',
|
|
291
|
+
path: `src/server/features/${feat}/${item}`,
|
|
292
|
+
message: `File "${item}" is not a valid Grasp server feature slice member for "${feat}"`,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
const webDir = join(srcDir, 'web');
|
|
300
|
+
if (existsSync(webDir)) {
|
|
301
|
+
const allowedWebEntries = new Set([
|
|
302
|
+
'main.ts',
|
|
303
|
+
'theme.ts',
|
|
304
|
+
'styles.css',
|
|
305
|
+
'LandingPage.vue',
|
|
306
|
+
'features',
|
|
307
|
+
...(config.ui.layout === 'custom' ? ['AppLayout.vue'] : []),
|
|
308
|
+
]);
|
|
309
|
+
for (const entry of readdirSync(webDir)) {
|
|
310
|
+
if (!allowedWebEntries.has(entry)) {
|
|
311
|
+
violations.push({
|
|
312
|
+
code: 'FORBIDDEN_DIRECTORY',
|
|
313
|
+
path: `src/web/${entry}`,
|
|
314
|
+
message: `Unexpected web path "src/web/${entry}"; feature views/stores belong in src/web/features/<feature>/`,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
const webFeaturesDir = join(webDir, 'features');
|
|
319
|
+
if (existsSync(webFeaturesDir)) {
|
|
320
|
+
for (const feat of readdirSync(webFeaturesDir)) {
|
|
321
|
+
const featPath = join(webFeaturesDir, feat);
|
|
322
|
+
if (statSync(featPath).isFile()) {
|
|
323
|
+
if (feat !== 'index.ts') {
|
|
324
|
+
violations.push({
|
|
325
|
+
code: 'FORBIDDEN_FEATURE_FILE',
|
|
326
|
+
path: `src/web/features/${feat}`,
|
|
327
|
+
message: `Only index.ts is allowed directly under src/web/features/`,
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
const allowedWebFeatureItems = new Set([
|
|
333
|
+
'views',
|
|
334
|
+
'components',
|
|
335
|
+
`${feat}.store.ts`,
|
|
336
|
+
'__tests__',
|
|
337
|
+
]);
|
|
338
|
+
for (const item of readdirSync(featPath)) {
|
|
339
|
+
if (!allowedWebFeatureItems.has(item)) {
|
|
340
|
+
violations.push({
|
|
341
|
+
code: 'FORBIDDEN_FEATURE_FILE',
|
|
342
|
+
path: `src/web/features/${feat}/${item}`,
|
|
343
|
+
message: `Item "${item}" is not a valid Grasp web feature slice member for "${feat}"`,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function checkPackageDependencies(absRoot, config, violations) {
|
|
352
|
+
const pkgPath = join(absRoot, 'package.json');
|
|
353
|
+
if (!existsSync(pkgPath))
|
|
354
|
+
return;
|
|
355
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
356
|
+
const dbPkg = config.database === 'mongo' ? '@zaaxch/grasp-mongo' : '@zaaxch/grasp-postgres';
|
|
357
|
+
const allowedServerSet = new Set([
|
|
358
|
+
...BASELINE_PROD_DEPS,
|
|
359
|
+
dbPkg,
|
|
360
|
+
...config.allowedDependencies.server,
|
|
361
|
+
]);
|
|
362
|
+
const allowedWebSet = new Set([
|
|
363
|
+
...BASELINE_PROD_DEPS,
|
|
364
|
+
dbPkg,
|
|
365
|
+
...BASELINE_DEV_DEPS,
|
|
366
|
+
...config.allowedDependencies.server,
|
|
367
|
+
...config.allowedDependencies.web,
|
|
368
|
+
]);
|
|
369
|
+
for (const dep of Object.keys(pkg.dependencies ?? {})) {
|
|
370
|
+
if (FORBIDDEN_APP_DEPENDENCIES.has(dep)) {
|
|
371
|
+
violations.push({
|
|
372
|
+
code: 'FORBIDDEN_DEPENDENCY',
|
|
373
|
+
path: 'package.json',
|
|
374
|
+
message: `Forbidden shell-owned dependency "${dep}" in dependencies`,
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
else if (!allowedServerSet.has(dep)) {
|
|
378
|
+
violations.push({
|
|
379
|
+
code: 'UNAPPROVED_DEPENDENCY',
|
|
380
|
+
path: 'package.json',
|
|
381
|
+
message: `Dependency "${dep}" is not declared in grasp.config.ts -> allowedDependencies.server`,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
for (const dep of Object.keys(pkg.devDependencies ?? {})) {
|
|
386
|
+
if (BASELINE_DEV_DEPS.has(dep))
|
|
387
|
+
continue;
|
|
388
|
+
if (FORBIDDEN_APP_DEPENDENCIES.has(dep)) {
|
|
389
|
+
violations.push({
|
|
390
|
+
code: 'FORBIDDEN_DEPENDENCY',
|
|
391
|
+
path: 'package.json',
|
|
392
|
+
message: `Forbidden shell-owned dependency "${dep}" in devDependencies`,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
else if (!allowedWebSet.has(dep)) {
|
|
396
|
+
violations.push({
|
|
397
|
+
code: 'UNAPPROVED_DEPENDENCY',
|
|
398
|
+
path: 'package.json',
|
|
399
|
+
message: `DevDependency "${dep}" is not declared in grasp.config.ts -> allowedDependencies`,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Enforces full Grasp architectural lockdown:
|
|
406
|
+
* 1) byte-locked files & grasp.lock.json integrity
|
|
407
|
+
* 2) vendor/browser-fetch/cross-boundary AST import rules
|
|
408
|
+
* 3) vertical feature directory & filename lockdown
|
|
409
|
+
* 4) package.json dependency allowlist verification
|
|
410
|
+
*/
|
|
411
|
+
export async function checkProject(options) {
|
|
412
|
+
const absRoot = resolve(options.rootDir);
|
|
413
|
+
const config = await loadGraspConfig(absRoot);
|
|
414
|
+
const violations = [];
|
|
415
|
+
const syncCheck = await syncProject({
|
|
416
|
+
rootDir: absRoot,
|
|
417
|
+
checkOnly: true,
|
|
418
|
+
...(options.cliVersion !== undefined ? { cliVersion: options.cliVersion } : {}),
|
|
419
|
+
});
|
|
420
|
+
const lockPath = join(absRoot, 'grasp.lock.json');
|
|
421
|
+
const lockMissing = !existsSync(lockPath);
|
|
422
|
+
if (lockMissing) {
|
|
423
|
+
violations.push({
|
|
424
|
+
code: 'LOCKFILE_STALE',
|
|
425
|
+
path: 'grasp.lock.json',
|
|
426
|
+
message: 'Missing grasp.lock.json; run "grasp sync"',
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
const manifest = JSON.parse(readFileSync(lockPath, 'utf8'));
|
|
431
|
+
for (const [relPath, expectedHash] of Object.entries(manifest.files ?? {})) {
|
|
432
|
+
const fullPath = join(absRoot, relPath);
|
|
433
|
+
if (!existsSync(fullPath)) {
|
|
434
|
+
violations.push({
|
|
435
|
+
code: 'LOCKED_FILE_MISSING',
|
|
436
|
+
path: relPath,
|
|
437
|
+
message: `Locked file "${relPath}" is missing; run "grasp sync"`,
|
|
438
|
+
});
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
const actualHash = sha256Hex(normalizeLockedHashInput(relPath, readFileSync(fullPath, 'utf8')));
|
|
442
|
+
if (actualHash !== expectedHash) {
|
|
443
|
+
violations.push({
|
|
444
|
+
code: 'LOCKED_FILE_MODIFIED',
|
|
445
|
+
path: relPath,
|
|
446
|
+
message: `Locked file "${relPath}" was modified outside grasp sync`,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
if (!syncCheck.ok) {
|
|
451
|
+
for (const drifted of syncCheck.drifted) {
|
|
452
|
+
const alreadyReported = violations.some((v) => v.path === drifted);
|
|
453
|
+
if (!alreadyReported) {
|
|
454
|
+
violations.push({
|
|
455
|
+
code: drifted === 'grasp.lock.json' ? 'LOCKFILE_STALE' : 'LOCKED_FILE_MODIFIED',
|
|
456
|
+
path: drifted,
|
|
457
|
+
message: `Locked artifact "${drifted}" is out of sync with grasp.config.ts; run "grasp sync"`,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
checkDirectoryStructure(absRoot, config, violations);
|
|
464
|
+
checkPackageDependencies(absRoot, config, violations);
|
|
465
|
+
for (const absFile of walkFiles(join(absRoot, 'src'))) {
|
|
466
|
+
if (!absFile.endsWith('.ts') && !absFile.endsWith('.vue'))
|
|
467
|
+
continue;
|
|
468
|
+
const relPath = relative(absRoot, absFile);
|
|
469
|
+
if (relPath.includes('__tests__'))
|
|
470
|
+
continue;
|
|
471
|
+
const content = readFileSync(absFile, 'utf8');
|
|
472
|
+
scanSourceAst(relPath, content, config, violations);
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
ok: violations.length === 0,
|
|
476
|
+
violations,
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],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