forgehive 1.0.1 → 1.0.2
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/cli.js +105 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3155,7 +3155,9 @@ var TIER1 = [
|
|
|
3155
3155
|
"go.mod",
|
|
3156
3156
|
"pom.xml",
|
|
3157
3157
|
"Gemfile",
|
|
3158
|
-
"composer.json"
|
|
3158
|
+
"composer.json",
|
|
3159
|
+
"global.json",
|
|
3160
|
+
"Directory.Build.props"
|
|
3159
3161
|
];
|
|
3160
3162
|
var TIER2_FILES = [
|
|
3161
3163
|
"Dockerfile",
|
|
@@ -3175,6 +3177,7 @@ var TIER3_PATTERNS = [
|
|
|
3175
3177
|
/^openapi\.(yaml|yml|json)$/,
|
|
3176
3178
|
/^\.pre-commit-config\.yaml$/
|
|
3177
3179
|
];
|
|
3180
|
+
var DOTNET_EXTENSIONS = [".sln", ".csproj", ".fsproj", ".vbproj"];
|
|
3178
3181
|
function scan(projectRoot2) {
|
|
3179
3182
|
const signals = [];
|
|
3180
3183
|
for (const filename of TIER1) {
|
|
@@ -3204,6 +3207,24 @@ function scan(projectRoot2) {
|
|
|
3204
3207
|
break;
|
|
3205
3208
|
}
|
|
3206
3209
|
}
|
|
3210
|
+
const ext = path.extname(entry).toLowerCase();
|
|
3211
|
+
if (DOTNET_EXTENSIONS.includes(ext)) {
|
|
3212
|
+
signals.push(signal(1, entry, entry));
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
for (const entry of fs.readdirSync(projectRoot2)) {
|
|
3216
|
+
const abs = path.join(projectRoot2, entry);
|
|
3217
|
+
if (!fs.existsSync(abs) || !fs.statSync(abs).isDirectory()) continue;
|
|
3218
|
+
try {
|
|
3219
|
+
for (const child of fs.readdirSync(abs)) {
|
|
3220
|
+
const ext = path.extname(child).toLowerCase();
|
|
3221
|
+
if ([".csproj", ".fsproj", ".vbproj"].includes(ext)) {
|
|
3222
|
+
const rel = path.join(entry, child);
|
|
3223
|
+
signals.push(signal(1, rel, child));
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
} catch {
|
|
3227
|
+
}
|
|
3207
3228
|
}
|
|
3208
3229
|
return {
|
|
3209
3230
|
scanned_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3214,17 +3235,45 @@ function scan(projectRoot2) {
|
|
|
3214
3235
|
}
|
|
3215
3236
|
function extractPackages(projectRoot2) {
|
|
3216
3237
|
const pkgPath = path.join(projectRoot2, "package.json");
|
|
3217
|
-
if (
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3238
|
+
if (fs.existsSync(pkgPath)) {
|
|
3239
|
+
try {
|
|
3240
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
3241
|
+
const all = /* @__PURE__ */ new Set([
|
|
3242
|
+
...Object.keys(pkg.dependencies ?? {}),
|
|
3243
|
+
...Object.keys(pkg.devDependencies ?? {})
|
|
3244
|
+
]);
|
|
3245
|
+
return [...all];
|
|
3246
|
+
} catch {
|
|
3247
|
+
return [];
|
|
3248
|
+
}
|
|
3227
3249
|
}
|
|
3250
|
+
return extractDotnetPackages(projectRoot2);
|
|
3251
|
+
}
|
|
3252
|
+
function extractDotnetPackages(projectRoot2) {
|
|
3253
|
+
const packages = /* @__PURE__ */ new Set();
|
|
3254
|
+
const pattern = /PackageReference\s+Include="([^"]+)"/gi;
|
|
3255
|
+
const scanDir = (dir) => {
|
|
3256
|
+
try {
|
|
3257
|
+
for (const entry of fs.readdirSync(dir)) {
|
|
3258
|
+
const abs = path.join(dir, entry);
|
|
3259
|
+
const ext = path.extname(entry).toLowerCase();
|
|
3260
|
+
if ([".csproj", ".fsproj", ".vbproj"].includes(ext)) {
|
|
3261
|
+
try {
|
|
3262
|
+
const content = fs.readFileSync(abs, "utf8");
|
|
3263
|
+
for (const match of content.matchAll(pattern)) {
|
|
3264
|
+
packages.add(match[1]);
|
|
3265
|
+
}
|
|
3266
|
+
} catch {
|
|
3267
|
+
}
|
|
3268
|
+
} else if (fs.statSync(abs).isDirectory() && !entry.startsWith(".")) {
|
|
3269
|
+
scanDir(abs);
|
|
3270
|
+
}
|
|
3271
|
+
}
|
|
3272
|
+
} catch {
|
|
3273
|
+
}
|
|
3274
|
+
};
|
|
3275
|
+
scanDir(projectRoot2);
|
|
3276
|
+
return [...packages];
|
|
3228
3277
|
}
|
|
3229
3278
|
function signal(tier, filePath, filename) {
|
|
3230
3279
|
return { tier, path: filePath, filename, exists: true };
|
|
@@ -3239,6 +3288,8 @@ var FILENAME_TO_IDS = {
|
|
|
3239
3288
|
"pom.xml": ["java", "maven"],
|
|
3240
3289
|
"Gemfile": ["ruby"],
|
|
3241
3290
|
"composer.json": ["php"],
|
|
3291
|
+
"global.json": ["dotnet"],
|
|
3292
|
+
"Directory.Build.props": ["dotnet"],
|
|
3242
3293
|
"Dockerfile": ["docker"],
|
|
3243
3294
|
"docker-compose.yml": ["docker-compose"],
|
|
3244
3295
|
".gitlab-ci.yml": ["gitlab-ci", "ci-cd"],
|
|
@@ -3256,7 +3307,11 @@ var TIER2_DIR_PREFIX_TO_IDS = {
|
|
|
3256
3307
|
var FILENAME_PREFIX_TO_IDS = [
|
|
3257
3308
|
[/^jest\.config\./, ["jest", "unit-testing"]],
|
|
3258
3309
|
[/^vitest\.config\./, ["vitest", "unit-testing"]],
|
|
3259
|
-
[/^\.eslintrc/, ["eslint", "linting"]]
|
|
3310
|
+
[/^\.eslintrc/, ["eslint", "linting"]],
|
|
3311
|
+
[/\.sln$/i, ["dotnet", "csharp"]],
|
|
3312
|
+
[/\.csproj$/i, ["dotnet", "csharp", "nuget"]],
|
|
3313
|
+
[/\.fsproj$/i, ["dotnet", "fsharp", "nuget"]],
|
|
3314
|
+
[/\.vbproj$/i, ["dotnet", "vbnet", "nuget"]]
|
|
3260
3315
|
];
|
|
3261
3316
|
var PACKAGE_TO_IDS = {
|
|
3262
3317
|
// JS Frameworks
|
|
@@ -3319,7 +3374,44 @@ var PACKAGE_TO_IDS = {
|
|
|
3319
3374
|
"flask": ["flask"],
|
|
3320
3375
|
"sqlalchemy": ["sqlalchemy"],
|
|
3321
3376
|
"pydantic": ["pydantic"],
|
|
3322
|
-
"alembic": ["alembic"]
|
|
3377
|
+
"alembic": ["alembic"],
|
|
3378
|
+
// .NET / NuGet packages
|
|
3379
|
+
"xunit": ["xunit", "unit-testing"],
|
|
3380
|
+
"NUnit": ["nunit", "unit-testing"],
|
|
3381
|
+
"MSTest.TestFramework": ["mstest", "unit-testing"],
|
|
3382
|
+
"Microsoft.NET.Test.Sdk": ["dotnet-test"],
|
|
3383
|
+
"Moq": ["moq", "mocking"],
|
|
3384
|
+
"NSubstitute": ["nsubstitute", "mocking"],
|
|
3385
|
+
"FluentAssertions": ["fluent-assertions"],
|
|
3386
|
+
"CommunityToolkit.Mvvm": ["wpf", "mvvm"],
|
|
3387
|
+
"Microsoft.Extensions.DependencyInjection": ["aspnet-di"],
|
|
3388
|
+
"Microsoft.AspNetCore.OpenApi": ["aspnet", "openapi"],
|
|
3389
|
+
"Swashbuckle.AspNetCore": ["aspnet", "swagger"],
|
|
3390
|
+
"Microsoft.EntityFrameworkCore": ["ef-core", "orm"],
|
|
3391
|
+
"Npgsql.EntityFrameworkCore.PostgreSQL": ["ef-core", "postgresql"],
|
|
3392
|
+
"Microsoft.EntityFrameworkCore.SqlServer": ["ef-core", "sql-server"],
|
|
3393
|
+
"Dapper": ["dapper", "orm"],
|
|
3394
|
+
"Serilog": ["serilog", "logging"],
|
|
3395
|
+
"NLog": ["nlog", "logging"],
|
|
3396
|
+
"AutoMapper": ["automapper"],
|
|
3397
|
+
"MediatR": ["mediatr", "cqrs"],
|
|
3398
|
+
"FluentValidation": ["fluent-validation"],
|
|
3399
|
+
"Newtonsoft.Json": ["newtonsoft-json"],
|
|
3400
|
+
"CsvHelper": ["csvhelper"],
|
|
3401
|
+
"Polly": ["polly", "resilience"],
|
|
3402
|
+
"Hangfire": ["hangfire", "background-jobs"],
|
|
3403
|
+
"MassTransit": ["masstransit", "messaging"],
|
|
3404
|
+
"StackExchange.Redis": ["redis"],
|
|
3405
|
+
"MongoDB.Driver": ["mongodb"],
|
|
3406
|
+
"AWSSDK.Core": ["aws-sdk"],
|
|
3407
|
+
"Azure.Identity": ["azure"],
|
|
3408
|
+
"Microsoft.Identity.Web": ["azure", "auth"],
|
|
3409
|
+
"Blazorise": ["blazor"],
|
|
3410
|
+
"Microsoft.AspNetCore.Components": ["blazor"],
|
|
3411
|
+
"Avalonia": ["avalonia"],
|
|
3412
|
+
"Uno.UI": ["uno-platform"],
|
|
3413
|
+
"MAUI": ["maui"],
|
|
3414
|
+
"Microsoft.Maui.Controls": ["maui"]
|
|
3323
3415
|
};
|
|
3324
3416
|
function mapSignalsToCapabilities(input) {
|
|
3325
3417
|
const seen = /* @__PURE__ */ new Set();
|