@driftless-sh/cli 0.1.1 → 0.1.3
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/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +140 -67
- package/dist/commands/init.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CA4FjD"}
|
package/dist/commands/init.js
CHANGED
|
@@ -3,96 +3,169 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initCommand = initCommand;
|
|
4
4
|
const api_client_1 = require("../api-client");
|
|
5
5
|
const git_1 = require("../git");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
6
8
|
async function initCommand() {
|
|
7
9
|
console.log('Driftless — context integrity for engineering teams\n');
|
|
8
10
|
if (!(0, git_1.isGitRepo)()) {
|
|
9
|
-
console.error('Error: not a git repository.
|
|
11
|
+
console.error('Error: not a git repository.');
|
|
10
12
|
process.exit(1);
|
|
11
13
|
}
|
|
12
14
|
const remote = (0, git_1.getGitRemote)();
|
|
13
15
|
if (!remote) {
|
|
14
|
-
console.error('Error: no git remote found.
|
|
16
|
+
console.error('Error: no git remote found.');
|
|
15
17
|
process.exit(1);
|
|
16
18
|
}
|
|
17
19
|
console.log(`Repository: ${remote.org}/${remote.repo}`);
|
|
18
|
-
// 1.
|
|
20
|
+
// 1. Get workspace from API key (not from git remote!)
|
|
21
|
+
console.log('\nConnecting to Driftless Cloud...');
|
|
19
22
|
let workspace;
|
|
20
23
|
try {
|
|
21
|
-
workspace = await api_client_1.api.get(
|
|
22
|
-
|
|
24
|
+
workspace = await api_client_1.api.get('/me');
|
|
25
|
+
if (!workspace?.workspace_id) {
|
|
26
|
+
console.error('Could not resolve workspace. Check your API key.');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
console.log(` Workspace: ${workspace.slug} ✓`);
|
|
23
30
|
}
|
|
24
|
-
catch {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
catch (err) {
|
|
32
|
+
console.error(` Failed: ${err?.message || 'unreachable'}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
const workspaceSlug = workspace.slug;
|
|
36
|
+
// 2. Local scan
|
|
37
|
+
console.log('\nScanning codebase locally...');
|
|
38
|
+
const cwd = process.cwd();
|
|
39
|
+
const summary = scanLocal(cwd);
|
|
40
|
+
console.log(` Framework: ${summary.framework} | Endpoints: ${summary.endpoints} | Services: ${summary.services}`);
|
|
41
|
+
console.log(` Modules: ${summary.modules} | Guards: ${summary.guards}`);
|
|
42
|
+
if (summary.auth_patterns.length > 0) {
|
|
43
|
+
console.log(` Auth: ${summary.auth_patterns.join(', ')}`);
|
|
30
44
|
}
|
|
31
|
-
//
|
|
45
|
+
// 3. Connect repo
|
|
32
46
|
let repo;
|
|
33
47
|
try {
|
|
34
|
-
const repos = (await api_client_1.api.get(`/workspaces/${
|
|
35
|
-
repo =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
48
|
+
const repos = (await api_client_1.api.get(`/workspaces/${workspaceSlug}/repos`));
|
|
49
|
+
repo = Array.isArray(repos)
|
|
50
|
+
? repos.find((r) => r.github_org === remote.org && r.github_repo === remote.repo)
|
|
51
|
+
: null;
|
|
39
52
|
}
|
|
40
|
-
catch {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (scanResult.error?.includes('clone') || scanResult.error?.includes('Cloning')) {
|
|
56
|
-
console.error('\nTip: Make sure the repo is public, or add a GitHub token.');
|
|
57
|
-
console.error('The scan runs server-side — the API clones your repo for AST analysis.');
|
|
53
|
+
catch { /* will create */ }
|
|
54
|
+
if (repo) {
|
|
55
|
+
console.log(`\n Repo: ${remote.repo} ✓`);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
try {
|
|
59
|
+
repo = await api_client_1.api.post(`/workspaces/${workspaceSlug}/repos`, {
|
|
60
|
+
github_org: remote.org,
|
|
61
|
+
github_repo: remote.repo,
|
|
62
|
+
});
|
|
63
|
+
console.log(` Repo: ${remote.repo} (connected)`);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
console.error(` Failed to connect repo: ${err?.message || 'unknown'}`);
|
|
67
|
+
process.exit(1);
|
|
58
68
|
}
|
|
59
|
-
process.exit(1);
|
|
60
69
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
console.
|
|
65
|
-
|
|
70
|
+
// 4. Upload baseline
|
|
71
|
+
try {
|
|
72
|
+
await api_client_1.api.post(`/workspaces/${workspaceSlug}/repos/${repo.id}/scan`, summary);
|
|
73
|
+
console.log(' Baseline uploaded ✓');
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
console.error(` Upload failed: ${err?.message || 'unknown'}`);
|
|
66
77
|
}
|
|
67
|
-
|
|
68
|
-
console.log(` Framework: ${summary.framework}`);
|
|
69
|
-
console.log(` Type: ${summary.system_type}`);
|
|
70
|
-
console.log(` Auth: ${summary.auth_patterns?.join(', ') || 'none'}`);
|
|
71
|
-
console.log(` Endpoints: ${summary.endpoints}`);
|
|
72
|
-
console.log(` Guards: ${summary.guards}`);
|
|
73
|
-
console.log(` Services: ${summary.services}`);
|
|
74
|
-
console.log(` Modules: ${summary.modules}`);
|
|
75
|
-
// 4. Suggest rules
|
|
78
|
+
// 5. Rules
|
|
76
79
|
console.log('\nSuggested rules:');
|
|
77
|
-
const suggestions = [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
: []),
|
|
81
|
-
...(summary.guards > 3 ? ['Services must not import controllers directly'] : []),
|
|
82
|
-
...(summary.endpoints > 50
|
|
83
|
-
? [`app.controller.ts should be split — over 50 endpoints detected`]
|
|
84
|
-
: []),
|
|
85
|
-
];
|
|
86
|
-
if (suggestions.length === 0) {
|
|
87
|
-
console.log(' No automatic suggestions for this repo.');
|
|
80
|
+
const suggestions = [];
|
|
81
|
+
if (summary.auth_patterns.includes('apikey') || summary.guards > 0) {
|
|
82
|
+
suggestions.push('Every B2B endpoint must use BusinessAccessGuard');
|
|
88
83
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
if (summary.services > summary.modules) {
|
|
85
|
+
suggestions.push('Services must not import controllers directly');
|
|
86
|
+
}
|
|
87
|
+
if (summary.endpoints > 50) {
|
|
88
|
+
suggestions.push('Split large controllers — over 50 endpoints detected');
|
|
89
|
+
}
|
|
90
|
+
if (suggestions.length === 0)
|
|
91
|
+
console.log(' No suggestions.');
|
|
92
|
+
else
|
|
93
|
+
suggestions.forEach((s) => console.log(` • ${s}`));
|
|
94
|
+
console.log(`\nView: https://driftless.icu/ecosystem`);
|
|
95
|
+
}
|
|
96
|
+
function scanLocal(rootPath) {
|
|
97
|
+
const pkg = readJson((0, node_path_1.join)(rootPath, 'package.json'));
|
|
98
|
+
const deps = { ...pkg?.dependencies, ...pkg?.devDependencies };
|
|
99
|
+
let framework = 'other';
|
|
100
|
+
if (deps?.['@nestjs/core'] || deps?.['@nestjs/common'])
|
|
101
|
+
framework = 'nestjs';
|
|
102
|
+
else if (deps?.['next'])
|
|
103
|
+
framework = 'nextjs';
|
|
104
|
+
else if (deps?.['express'])
|
|
105
|
+
framework = 'express';
|
|
106
|
+
let systemType = framework === 'nestjs' ? 'api' : 'unknown';
|
|
107
|
+
if (framework === 'nextjs' && (0, node_fs_1.existsSync)((0, node_path_1.join)(rootPath, 'pages')))
|
|
108
|
+
systemType = 'app';
|
|
109
|
+
const allFiles = listFiles((0, node_path_1.join)(rootPath, 'src'));
|
|
110
|
+
let endpoints = 0, services = 0, modules = 0, guards = 0;
|
|
111
|
+
for (const file of allFiles) {
|
|
112
|
+
try {
|
|
113
|
+
const content = (0, node_fs_1.readFileSync)(file, 'utf8');
|
|
114
|
+
if (content.includes('@Controller')) {
|
|
115
|
+
const matches = content.match(/@(Get|Post|Put|Patch|Delete|All)\s*\(/g);
|
|
116
|
+
if (matches)
|
|
117
|
+
endpoints += matches.length;
|
|
118
|
+
}
|
|
119
|
+
if (content.includes('@Injectable'))
|
|
120
|
+
services++;
|
|
121
|
+
if (content.includes('@Module'))
|
|
122
|
+
modules++;
|
|
123
|
+
if (content.match(/class\s+\w*Guard/) && content.includes('CanActivate'))
|
|
124
|
+
guards++;
|
|
125
|
+
}
|
|
126
|
+
catch { /* skip */ }
|
|
127
|
+
}
|
|
128
|
+
const authSet = new Set();
|
|
129
|
+
for (const file of allFiles.slice(0, 200)) {
|
|
130
|
+
try {
|
|
131
|
+
const c = (0, node_fs_1.readFileSync)(file, 'utf8');
|
|
132
|
+
if (c.includes('@clerk/') || c.includes('Clerk'))
|
|
133
|
+
authSet.add('clerk');
|
|
134
|
+
if (c.includes('Cognito') || c.includes('cognito'))
|
|
135
|
+
authSet.add('cognito');
|
|
136
|
+
if (c.includes('@UseGuards') || c.includes('AuthGuard'))
|
|
137
|
+
authSet.add('jwt');
|
|
138
|
+
if (c.includes('x-api-key') || c.includes('ApiKeyGuard') || c.includes('BusinessAccessGuard'))
|
|
139
|
+
authSet.add('apikey');
|
|
140
|
+
}
|
|
141
|
+
catch { /* skip */ }
|
|
142
|
+
}
|
|
143
|
+
return { framework, system_type: systemType, endpoints, services, modules, guards, auth_patterns: [...authSet] };
|
|
144
|
+
}
|
|
145
|
+
function listFiles(dir) {
|
|
146
|
+
const result = [];
|
|
147
|
+
if (!(0, node_fs_1.existsSync)(dir))
|
|
148
|
+
return result;
|
|
149
|
+
try {
|
|
150
|
+
for (const entry of (0, node_fs_1.readdirSync)(dir, { withFileTypes: true })) {
|
|
151
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules' || entry.name === 'dist')
|
|
152
|
+
continue;
|
|
153
|
+
const full = (0, node_path_1.join)(dir, entry.name);
|
|
154
|
+
if (entry.isDirectory())
|
|
155
|
+
result.push(...listFiles(full));
|
|
156
|
+
else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts'))
|
|
157
|
+
result.push(full);
|
|
92
158
|
}
|
|
93
|
-
console.log('\nAccept these suggestions? Run:');
|
|
94
|
-
console.log(` driftless rule accept --all`);
|
|
95
159
|
}
|
|
96
|
-
|
|
160
|
+
catch { /* skip */ }
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
function readJson(path) {
|
|
164
|
+
try {
|
|
165
|
+
return JSON.parse((0, node_fs_1.readFileSync)(path, 'utf8'));
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
97
170
|
}
|
|
98
171
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;AAKA,kCA4FC;AAjGD,8CAAmC;AACnC,gCAAgD;AAChD,qCAA+D;AAC/D,yCAAgC;AAEzB,KAAK,UAAU,WAAW;IAC/B,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAA;IAEpE,IAAI,CAAC,IAAA,eAAS,GAAE,EAAE,CAAC;QACjB,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACj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