@specdest/devkit 0.4.18 → 0.4.19
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 +4 -2
- package/dist/npm/cli.js +2 -0
- package/dist/npm/commands.d.ts +1 -0
- package/dist/npm/commands.js +15 -9
- package/dist/npm/github-doppler-secrets.d.ts +8 -0
- package/dist/npm/github-doppler-secrets.js +156 -0
- package/dist/npm/host-automation.js +22 -1
- package/dist/npm/index.js +2 -1
- package/dist/npm/predefined-packages/abac.js +30 -7
- package/dist/npm/predefined-packages/admin-ui-templates/AdminAccessAssignments.tsx.template +67 -0
- package/dist/npm/predefined-packages/admin-ui-templates/AdminMembershipManager.tsx.template +56 -0
- package/dist/npm/predefined-packages/admin-ui-templates/AdminPermissionMatrix.tsx.template +54 -0
- package/dist/npm/predefined-packages/admin-ui-templates/AdminRoleManager.tsx.template +81 -0
- package/dist/npm/predefined-packages/admin-ui.js +5 -1
- package/dist/npm/predefined-packages/auth-templates/README.md.template +9 -0
- package/dist/npm/predefined-packages/auth-templates/convex.ts.template +18 -0
- package/dist/npm/predefined-packages/auth-templates/identity.ts.template +2 -0
- package/dist/npm/predefined-packages/auth-templates/supabase.ts.template +36 -0
- package/dist/npm/predefined-packages/auth.js +22 -7
- package/dist/npm/predefined-packages/multi-tenancy.js +21 -5
- package/dist/npm/predefined-packages/security-templates/README.md.template +15 -0
- package/dist/npm/predefined-packages/security-templates/convex-authorization.ts.template +109 -0
- package/dist/npm/predefined-packages/security-templates/permissions.ts.template +40 -0
- package/dist/npm/predefined-packages/security-templates/supabase-admin-rpc.sql.template +54 -0
- package/dist/npm/predefined-packages/security-templates/supabase-authorization.sql.template +138 -0
- package/dist/npm/predefined-packages/security-templates/supabase-posts-example.sql.template +39 -0
- package/dist/npm/predefined-packages/tenant-templates/README.md.template +11 -0
- package/dist/npm/predefined-packages/tenant-templates/tenant-context.ts.template +22 -0
- package/dist/npm/project-check.d.ts +12 -0
- package/dist/npm/project-check.js +54 -1
- package/dist/npm/supabase-local.js +1 -0
- package/package.json +1 -1
|
@@ -7,6 +7,53 @@ import { readRuleProfile } from "./project-context.js";
|
|
|
7
7
|
import { loadCanonicalProjectContext, prepareCanonicalManifest } from "./project-runtime.js";
|
|
8
8
|
import { assertPredefinedPackageState } from "./predefined-packages/health.js";
|
|
9
9
|
import { readInstalledState, writeChecksState } from "./state.js";
|
|
10
|
+
function diagnosticFromLine(rawLine) {
|
|
11
|
+
const line = rawLine.trim().replace(/^-\s+/u, '');
|
|
12
|
+
if (!line || /^#\s/u.test(line) || /\b(?:ok|not applicable|not affected)$/iu.test(line))
|
|
13
|
+
return null;
|
|
14
|
+
const located = line.match(/^(.+?):(\d+)(?::(\d+))?(?::|\s)+(.*)$/u);
|
|
15
|
+
if (located) {
|
|
16
|
+
return {
|
|
17
|
+
path: located[1],
|
|
18
|
+
line: Number(located[2]),
|
|
19
|
+
...(located[3] ? { column: Number(located[3]) } : {}),
|
|
20
|
+
message: located[4],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const fileOnly = line.match(/^([^:]+\.[A-Za-z0-9]+):\s+(.+)$/u);
|
|
24
|
+
if (fileOnly)
|
|
25
|
+
return { path: fileOnly[1], message: fileOnly[2] };
|
|
26
|
+
return { message: line };
|
|
27
|
+
}
|
|
28
|
+
export function collectCheckerDiagnostics(output) {
|
|
29
|
+
const diagnostics = [];
|
|
30
|
+
const seen = new Set();
|
|
31
|
+
for (const stream of [output.stdout ?? '', output.stderr ?? '']) {
|
|
32
|
+
for (const rawLine of stream.split(/\r?\n/u)) {
|
|
33
|
+
const diagnostic = diagnosticFromLine(rawLine);
|
|
34
|
+
if (!diagnostic)
|
|
35
|
+
continue;
|
|
36
|
+
const key = JSON.stringify(diagnostic);
|
|
37
|
+
if (!seen.has(key)) {
|
|
38
|
+
seen.add(key);
|
|
39
|
+
diagnostics.push(diagnostic);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return diagnostics;
|
|
44
|
+
}
|
|
45
|
+
export function formatCheckerDiagnostics(diagnostics) {
|
|
46
|
+
return diagnostics
|
|
47
|
+
.map((diagnostic) => {
|
|
48
|
+
if (!diagnostic.path)
|
|
49
|
+
return ` ${diagnostic.message}\n`;
|
|
50
|
+
const location = [diagnostic.path, diagnostic.line, diagnostic.column]
|
|
51
|
+
.filter((value) => value !== undefined)
|
|
52
|
+
.join(':');
|
|
53
|
+
return ` ${location}\n ${diagnostic.message}\n`;
|
|
54
|
+
})
|
|
55
|
+
.join('');
|
|
56
|
+
}
|
|
10
57
|
function execute(command, args, cwd) {
|
|
11
58
|
return new Promise((resolve, reject) => {
|
|
12
59
|
const child = spawn(command, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
@@ -150,7 +197,12 @@ export async function canonicalCheck(projectRoot, source, options = {}) {
|
|
|
150
197
|
return { group, execution };
|
|
151
198
|
});
|
|
152
199
|
for (const { group, execution } of groupExecutions) {
|
|
153
|
-
const
|
|
200
|
+
const diagnostics = collectCheckerDiagnostics(execution);
|
|
201
|
+
const result = {
|
|
202
|
+
status: execution.exitCode === 0 ? 'pass' : 'fail',
|
|
203
|
+
...execution,
|
|
204
|
+
diagnostics,
|
|
205
|
+
};
|
|
154
206
|
for (const id of group.ids)
|
|
155
207
|
results[id] = result;
|
|
156
208
|
if (execution.exitCode !== 0)
|
|
@@ -173,6 +225,7 @@ export async function canonicalCheck(projectRoot, source, options = {}) {
|
|
|
173
225
|
exitCode: execution.exitCode,
|
|
174
226
|
stdout: execution.stdout,
|
|
175
227
|
stderr: execution.stderr,
|
|
228
|
+
diagnostics: collectCheckerDiagnostics(execution),
|
|
176
229
|
})),
|
|
177
230
|
};
|
|
178
231
|
}
|