stackscan 0.1.17 → 0.1.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/dist/chunk-2R4IRVBW.mjs +19 -0
- package/dist/chunk-3JWM3QKI.mjs +2013 -0
- package/dist/chunk-5XOMETBV.mjs +158 -0
- package/dist/chunk-75Z7C4SW.mjs +19 -0
- package/dist/chunk-AU42WGBI.mjs +158 -0
- package/dist/chunk-BPDLELPJ.mjs +235 -0
- package/dist/chunk-JFE6WNCW.mjs +235 -0
- package/dist/chunk-MEH6MW3S.mjs +235 -0
- package/dist/chunk-NWUJIUCE.mjs +2028 -0
- package/dist/chunk-OX7SYHLD.mjs +235 -0
- package/dist/chunk-QNTMPVPN.mjs +19 -0
- package/dist/chunk-RRAAD3VC.mjs +2075 -0
- package/dist/chunk-TEUMOU3M.mjs +158 -0
- package/dist/cli.js +224 -95
- package/dist/cli.mjs +7 -5
- package/dist/index.js +220 -93
- package/dist/index.mjs +4 -4
- package/dist/scan.d.mts +2 -1
- package/dist/scan.d.ts +2 -1
- package/dist/scan.js +220 -93
- package/dist/scan.mjs +3 -3
- package/dist/scan.old.d.mts +8 -0
- package/dist/scan.old.d.ts +8 -0
- package/dist/scan.old.js +5770 -0
- package/dist/scan.old.mjs +205 -0
- package/dist/sync.js +129 -34
- package/dist/sync.mjs +3 -3
- package/dist/techDefinitions.js +129 -34
- package/dist/techDefinitions.mjs +1 -1
- package/dist/techMap.js +129 -34
- package/dist/techMap.mjs +2 -2
- package/package.json +1 -1
- package/public/assets/logos/backend/convex.svg +5 -0
- package/public/assets/logos/backend/springboot.svg +1 -0
- package/public/assets/logos/css/shadcn.svg +6 -0
- package/public/assets/logos/defaults/package.svg +18 -0
- package/public/assets/logos/language/css3.svg +6 -0
- package/public/assets/logos/language/html5.svg +6 -0
- package/public/assets/logos/language/typescript.svg +1 -1
package/dist/scan.js
CHANGED
|
@@ -168,7 +168,10 @@ var techDefinitions = [
|
|
|
168
168
|
"id": "remix",
|
|
169
169
|
"name": "Remix",
|
|
170
170
|
"aliases": [
|
|
171
|
-
"remix"
|
|
171
|
+
"remix",
|
|
172
|
+
"@remix-run/react",
|
|
173
|
+
"@remix-run/node",
|
|
174
|
+
"@remix-run/serve"
|
|
172
175
|
],
|
|
173
176
|
"category": "frontend",
|
|
174
177
|
"logo": "frontend/remix.svg",
|
|
@@ -248,7 +251,10 @@ var techDefinitions = [
|
|
|
248
251
|
"id": "angular",
|
|
249
252
|
"name": "Angular",
|
|
250
253
|
"aliases": [
|
|
251
|
-
"@angular/core"
|
|
254
|
+
"@angular/core",
|
|
255
|
+
"@angular/common",
|
|
256
|
+
"@angular/platform-browser",
|
|
257
|
+
"@angular/cli"
|
|
252
258
|
],
|
|
253
259
|
"category": "frontend",
|
|
254
260
|
"logo": "frontend/angular.svg",
|
|
@@ -258,7 +264,9 @@ var techDefinitions = [
|
|
|
258
264
|
"id": "lit",
|
|
259
265
|
"name": "Lit",
|
|
260
266
|
"aliases": [
|
|
261
|
-
"lit"
|
|
267
|
+
"lit",
|
|
268
|
+
"lit-element",
|
|
269
|
+
"lit-html"
|
|
262
270
|
],
|
|
263
271
|
"category": "frontend",
|
|
264
272
|
"logo": "frontend/lit.svg",
|
|
@@ -278,7 +286,8 @@ var techDefinitions = [
|
|
|
278
286
|
"id": "ember",
|
|
279
287
|
"name": "Ember",
|
|
280
288
|
"aliases": [
|
|
281
|
-
"ember-source"
|
|
289
|
+
"ember-source",
|
|
290
|
+
"ember-cli"
|
|
282
291
|
],
|
|
283
292
|
"category": "frontend",
|
|
284
293
|
"logo": "frontend/emberdotjs.svg",
|
|
@@ -378,22 +387,14 @@ var techDefinitions = [
|
|
|
378
387
|
"id": "mantine",
|
|
379
388
|
"name": "Mantine",
|
|
380
389
|
"aliases": [
|
|
381
|
-
"@mantine/core"
|
|
390
|
+
"@mantine/core",
|
|
391
|
+
"@mantine/hooks",
|
|
392
|
+
"@mantine/form"
|
|
382
393
|
],
|
|
383
394
|
"category": "css",
|
|
384
395
|
"logo": "fallback/mantine-logo.svg",
|
|
385
396
|
"frameworks": []
|
|
386
397
|
},
|
|
387
|
-
{
|
|
388
|
-
"id": "shadcnui",
|
|
389
|
-
"name": "shadcn/ui",
|
|
390
|
-
"aliases": [
|
|
391
|
-
"shadcn"
|
|
392
|
-
],
|
|
393
|
-
"category": "css",
|
|
394
|
-
"logo": "css/shadcnui.svg",
|
|
395
|
-
"frameworks": []
|
|
396
|
-
},
|
|
397
398
|
{
|
|
398
399
|
"id": "daisyui",
|
|
399
400
|
"name": "DaisyUI",
|
|
@@ -428,7 +429,8 @@ var techDefinitions = [
|
|
|
428
429
|
"id": "headlessui",
|
|
429
430
|
"name": "Headless UI",
|
|
430
431
|
"aliases": [
|
|
431
|
-
"@headlessui/react"
|
|
432
|
+
"@headlessui/react",
|
|
433
|
+
"@headlessui/vue"
|
|
432
434
|
],
|
|
433
435
|
"category": "css",
|
|
434
436
|
"logo": "css/headlessui.svg",
|
|
@@ -438,7 +440,9 @@ var techDefinitions = [
|
|
|
438
440
|
"id": "emotion",
|
|
439
441
|
"name": "Emotion",
|
|
440
442
|
"aliases": [
|
|
441
|
-
"@emotion/react"
|
|
443
|
+
"@emotion/react",
|
|
444
|
+
"@emotion/styled",
|
|
445
|
+
"@emotion/css"
|
|
442
446
|
],
|
|
443
447
|
"category": "css",
|
|
444
448
|
"logo": "css/emotion.svg",
|
|
@@ -498,7 +502,9 @@ var techDefinitions = [
|
|
|
498
502
|
"id": "redux",
|
|
499
503
|
"name": "Redux",
|
|
500
504
|
"aliases": [
|
|
501
|
-
"redux"
|
|
505
|
+
"redux",
|
|
506
|
+
"react-redux",
|
|
507
|
+
"@reduxjs/toolkit"
|
|
502
508
|
],
|
|
503
509
|
"category": "state",
|
|
504
510
|
"logo": "state/redux.svg",
|
|
@@ -508,7 +514,9 @@ var techDefinitions = [
|
|
|
508
514
|
"id": "mobx",
|
|
509
515
|
"name": "MobX",
|
|
510
516
|
"aliases": [
|
|
511
|
-
"mobx"
|
|
517
|
+
"mobx",
|
|
518
|
+
"mobx-react",
|
|
519
|
+
"mobx-react-lite"
|
|
512
520
|
],
|
|
513
521
|
"category": "state",
|
|
514
522
|
"logo": "state/mobx.svg",
|
|
@@ -548,7 +556,9 @@ var techDefinitions = [
|
|
|
548
556
|
"id": "xstate",
|
|
549
557
|
"name": "XState",
|
|
550
558
|
"aliases": [
|
|
551
|
-
"xstate"
|
|
559
|
+
"xstate",
|
|
560
|
+
"@xstate/react",
|
|
561
|
+
"@xstate/fsm"
|
|
552
562
|
],
|
|
553
563
|
"category": "state",
|
|
554
564
|
"logo": "state/xstate.svg",
|
|
@@ -558,7 +568,10 @@ var techDefinitions = [
|
|
|
558
568
|
"id": "tanstackquery",
|
|
559
569
|
"name": "TanStack Query",
|
|
560
570
|
"aliases": [
|
|
561
|
-
"@tanstack/react-query"
|
|
571
|
+
"@tanstack/react-query",
|
|
572
|
+
"@tanstack/vue-query",
|
|
573
|
+
"@tanstack/svelte-query",
|
|
574
|
+
"react-query"
|
|
562
575
|
],
|
|
563
576
|
"category": "state",
|
|
564
577
|
"logo": "fallback/reactquery.svg",
|
|
@@ -768,7 +781,11 @@ var techDefinitions = [
|
|
|
768
781
|
"id": "storybook",
|
|
769
782
|
"name": "Storybook",
|
|
770
783
|
"aliases": [
|
|
771
|
-
"
|
|
784
|
+
"storybook",
|
|
785
|
+
"@storybook/react",
|
|
786
|
+
"@storybook/vue",
|
|
787
|
+
"@storybook/angular",
|
|
788
|
+
"@storybook/addon-essentials"
|
|
772
789
|
],
|
|
773
790
|
"category": "testing",
|
|
774
791
|
"logo": "testing/storybook.svg",
|
|
@@ -948,7 +965,8 @@ var techDefinitions = [
|
|
|
948
965
|
"id": "prisma",
|
|
949
966
|
"name": "Prisma",
|
|
950
967
|
"aliases": [
|
|
951
|
-
"prisma"
|
|
968
|
+
"prisma",
|
|
969
|
+
"@prisma/client"
|
|
952
970
|
],
|
|
953
971
|
"category": "orm",
|
|
954
972
|
"logo": "orm/prisma.svg",
|
|
@@ -988,7 +1006,9 @@ var techDefinitions = [
|
|
|
988
1006
|
"id": "postgresql",
|
|
989
1007
|
"name": "PostgreSQL",
|
|
990
1008
|
"aliases": [
|
|
991
|
-
"pg"
|
|
1009
|
+
"pg",
|
|
1010
|
+
"pg-promise",
|
|
1011
|
+
"node-postgres"
|
|
992
1012
|
],
|
|
993
1013
|
"category": "database",
|
|
994
1014
|
"logo": "database/postgresql.svg",
|
|
@@ -1019,7 +1039,8 @@ var techDefinitions = [
|
|
|
1019
1039
|
"id": "sqlite",
|
|
1020
1040
|
"name": "SQLite",
|
|
1021
1041
|
"aliases": [
|
|
1022
|
-
"sqlite3"
|
|
1042
|
+
"sqlite3",
|
|
1043
|
+
"better-sqlite3"
|
|
1023
1044
|
],
|
|
1024
1045
|
"category": "database",
|
|
1025
1046
|
"logo": "database/sqlite.svg",
|
|
@@ -1039,7 +1060,9 @@ var techDefinitions = [
|
|
|
1039
1060
|
"id": "redis",
|
|
1040
1061
|
"name": "Redis",
|
|
1041
1062
|
"aliases": [
|
|
1042
|
-
"redis"
|
|
1063
|
+
"redis",
|
|
1064
|
+
"ioredis",
|
|
1065
|
+
"@redis/client"
|
|
1043
1066
|
],
|
|
1044
1067
|
"category": "database",
|
|
1045
1068
|
"logo": "database/redis.svg",
|
|
@@ -1219,7 +1242,11 @@ var techDefinitions = [
|
|
|
1219
1242
|
"id": "auth0",
|
|
1220
1243
|
"name": "Auth0",
|
|
1221
1244
|
"aliases": [
|
|
1222
|
-
"auth0"
|
|
1245
|
+
"auth0",
|
|
1246
|
+
"auth0-js",
|
|
1247
|
+
"@auth0/auth0-react",
|
|
1248
|
+
"@auth0/auth0-vue",
|
|
1249
|
+
"@auth0/auth0-angular"
|
|
1223
1250
|
],
|
|
1224
1251
|
"category": "auth",
|
|
1225
1252
|
"logo": "auth/auth0.svg",
|
|
@@ -1229,7 +1256,9 @@ var techDefinitions = [
|
|
|
1229
1256
|
"id": "clerk",
|
|
1230
1257
|
"name": "Clerk",
|
|
1231
1258
|
"aliases": [
|
|
1232
|
-
"@clerk/nextjs"
|
|
1259
|
+
"@clerk/nextjs",
|
|
1260
|
+
"@clerk/clerk-react",
|
|
1261
|
+
"@clerk/clerk-sdk-node"
|
|
1233
1262
|
],
|
|
1234
1263
|
"category": "auth",
|
|
1235
1264
|
"logo": "auth/clerk.svg",
|
|
@@ -1239,7 +1268,9 @@ var techDefinitions = [
|
|
|
1239
1268
|
"id": "supabaseauth",
|
|
1240
1269
|
"name": "Supabase Auth",
|
|
1241
1270
|
"aliases": [
|
|
1242
|
-
"@supabase/auth-helpers-nextjs"
|
|
1271
|
+
"@supabase/auth-helpers-nextjs",
|
|
1272
|
+
"@supabase/auth-helpers-react",
|
|
1273
|
+
"@supabase/ssr"
|
|
1243
1274
|
],
|
|
1244
1275
|
"category": "auth",
|
|
1245
1276
|
"logo": "database/supabase.svg",
|
|
@@ -1249,7 +1280,10 @@ var techDefinitions = [
|
|
|
1249
1280
|
"id": "firebaseauth",
|
|
1250
1281
|
"name": "Firebase Auth",
|
|
1251
1282
|
"aliases": [
|
|
1252
|
-
"firebase"
|
|
1283
|
+
"firebase",
|
|
1284
|
+
"firebase-admin",
|
|
1285
|
+
"@firebase/app",
|
|
1286
|
+
"@firebase/auth"
|
|
1253
1287
|
],
|
|
1254
1288
|
"category": "auth",
|
|
1255
1289
|
"logo": "auth/firebase.svg",
|
|
@@ -1331,7 +1365,9 @@ var techDefinitions = [
|
|
|
1331
1365
|
"id": "langchain",
|
|
1332
1366
|
"name": "LangChain",
|
|
1333
1367
|
"aliases": [
|
|
1334
|
-
"langchain"
|
|
1368
|
+
"langchain",
|
|
1369
|
+
"@langchain/core",
|
|
1370
|
+
"@langchain/openai"
|
|
1335
1371
|
],
|
|
1336
1372
|
"category": "ai",
|
|
1337
1373
|
"logo": "ai/langchain.svg",
|
|
@@ -1511,7 +1547,10 @@ var techDefinitions = [
|
|
|
1511
1547
|
"id": "aws",
|
|
1512
1548
|
"name": "AWS",
|
|
1513
1549
|
"aliases": [
|
|
1514
|
-
"aws-sdk"
|
|
1550
|
+
"aws-sdk",
|
|
1551
|
+
"@aws-sdk/client-s3",
|
|
1552
|
+
"@aws-sdk/client-dynamodb",
|
|
1553
|
+
"@aws-sdk/client-lambda"
|
|
1515
1554
|
],
|
|
1516
1555
|
"category": "cloud",
|
|
1517
1556
|
"logo": "cloud/amazonwebservices.svg",
|
|
@@ -1731,7 +1770,8 @@ var techDefinitions = [
|
|
|
1731
1770
|
"id": "shopify",
|
|
1732
1771
|
"name": "Shopify",
|
|
1733
1772
|
"aliases": [
|
|
1734
|
-
"@shopify/shopify-api"
|
|
1773
|
+
"@shopify/shopify-api",
|
|
1774
|
+
"shopify"
|
|
1735
1775
|
],
|
|
1736
1776
|
"category": "cms",
|
|
1737
1777
|
"logo": "cms/shopify.svg",
|
|
@@ -1991,7 +2031,9 @@ var techDefinitions = [
|
|
|
1991
2031
|
"id": "stripe",
|
|
1992
2032
|
"name": "Stripe",
|
|
1993
2033
|
"aliases": [
|
|
1994
|
-
"stripe"
|
|
2034
|
+
"stripe",
|
|
2035
|
+
"@stripe/stripe-js",
|
|
2036
|
+
"@stripe/react-stripe-js"
|
|
1995
2037
|
],
|
|
1996
2038
|
"category": "payment",
|
|
1997
2039
|
"logo": "payment/stripe.svg",
|
|
@@ -2016,6 +2058,59 @@ var techDefinitions = [
|
|
|
2016
2058
|
"category": "payment",
|
|
2017
2059
|
"logo": "fallback/lemonsqueezy.svg",
|
|
2018
2060
|
"frameworks": []
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
"id": "css",
|
|
2064
|
+
"name": "CSS",
|
|
2065
|
+
"aliases": [
|
|
2066
|
+
"css"
|
|
2067
|
+
],
|
|
2068
|
+
"category": "language",
|
|
2069
|
+
"logo": "language/css3.svg",
|
|
2070
|
+
"frameworks": []
|
|
2071
|
+
},
|
|
2072
|
+
{
|
|
2073
|
+
"id": "html",
|
|
2074
|
+
"name": "HTML",
|
|
2075
|
+
"aliases": [
|
|
2076
|
+
"html"
|
|
2077
|
+
],
|
|
2078
|
+
"category": "language",
|
|
2079
|
+
"logo": "language/html5.svg",
|
|
2080
|
+
"frameworks": []
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"id": "convex",
|
|
2084
|
+
"name": "Convex",
|
|
2085
|
+
"aliases": [
|
|
2086
|
+
"convex",
|
|
2087
|
+
"convex-dev"
|
|
2088
|
+
],
|
|
2089
|
+
"category": "backend",
|
|
2090
|
+
"logo": "backend/convex.svg",
|
|
2091
|
+
"frameworks": []
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
"id": "shadcn",
|
|
2095
|
+
"name": "shadcn/ui",
|
|
2096
|
+
"aliases": [
|
|
2097
|
+
"shadcn",
|
|
2098
|
+
"shadcn-ui",
|
|
2099
|
+
"shadcn/ui"
|
|
2100
|
+
],
|
|
2101
|
+
"category": "css",
|
|
2102
|
+
"logo": "css/shadcn.svg",
|
|
2103
|
+
"frameworks": []
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
"id": "springboot",
|
|
2107
|
+
"name": "Spring Boot",
|
|
2108
|
+
"aliases": [
|
|
2109
|
+
"spring-boot"
|
|
2110
|
+
],
|
|
2111
|
+
"category": "backend",
|
|
2112
|
+
"logo": "backend/springboot.svg",
|
|
2113
|
+
"frameworks": []
|
|
2019
2114
|
}
|
|
2020
2115
|
];
|
|
2021
2116
|
|
|
@@ -5618,12 +5713,99 @@ var getCategoryPriority = (cat) => {
|
|
|
5618
5713
|
const idx = CATEGORY_PRIORITY.indexOf(cat ? cat.toLowerCase() : "");
|
|
5619
5714
|
return idx === -1 ? 999 : idx;
|
|
5620
5715
|
};
|
|
5621
|
-
async function
|
|
5716
|
+
async function analyzeProject(projectPath, options) {
|
|
5717
|
+
const packageJsonPath = import_path2.default.join(projectPath, "package.json");
|
|
5718
|
+
if (!import_fs.default.existsSync(packageJsonPath)) {
|
|
5719
|
+
throw new Error(`No package.json found at ${packageJsonPath}`);
|
|
5720
|
+
}
|
|
5721
|
+
const content = import_fs.default.readFileSync(packageJsonPath, "utf-8");
|
|
5722
|
+
const pkg = JSON.parse(content);
|
|
5723
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
5724
|
+
const detectedTechs = [];
|
|
5725
|
+
Object.keys(allDeps).forEach((dep) => {
|
|
5726
|
+
if (SKIPPED_TECHS.includes(dep)) return;
|
|
5727
|
+
if (techMap[dep]) {
|
|
5728
|
+
const tech = techMap[dep];
|
|
5729
|
+
let color = null;
|
|
5730
|
+
if (options.color === "white") color = "#FFFFFF";
|
|
5731
|
+
else if (options.color === "black") color = "#000000";
|
|
5732
|
+
else if (options.color && options.color.startsWith("#")) color = options.color;
|
|
5733
|
+
else {
|
|
5734
|
+
const depSlug = dep.toLowerCase();
|
|
5735
|
+
const nameSlug = tech.name.toLowerCase();
|
|
5736
|
+
const nameSlugNoSpaces = tech.name.toLowerCase().replace(/\s+/g, "");
|
|
5737
|
+
const hex = simple_icons_hex_default[depSlug] || simple_icons_hex_default[nameSlug] || simple_icons_hex_default[nameSlugNoSpaces];
|
|
5738
|
+
if (hex) color = `#${hex}`;
|
|
5739
|
+
}
|
|
5740
|
+
detectedTechs.push({
|
|
5741
|
+
name: tech.name,
|
|
5742
|
+
slug: dep,
|
|
5743
|
+
logo: tech.logo,
|
|
5744
|
+
type: tech.type,
|
|
5745
|
+
color
|
|
5746
|
+
});
|
|
5747
|
+
}
|
|
5748
|
+
});
|
|
5749
|
+
const uniqueSlugs = Array.from(new Set(detectedTechs.map((t) => t.slug)));
|
|
5750
|
+
let uniqueTechs = uniqueSlugs.map((slug) => detectedTechs.find((t) => t.slug === slug));
|
|
5751
|
+
const seenLogos = /* @__PURE__ */ new Set();
|
|
5752
|
+
uniqueTechs = uniqueTechs.filter((t) => {
|
|
5753
|
+
if (seenLogos.has(t.logo)) {
|
|
5754
|
+
return false;
|
|
5755
|
+
}
|
|
5756
|
+
seenLogos.add(t.logo);
|
|
5757
|
+
return true;
|
|
5758
|
+
});
|
|
5759
|
+
uniqueTechs.sort((a, b) => {
|
|
5760
|
+
const pA = getCategoryPriority(a.type);
|
|
5761
|
+
const pB = getCategoryPriority(b.type);
|
|
5762
|
+
if (pA !== pB) return pA - pB;
|
|
5763
|
+
return a.name.localeCompare(b.name);
|
|
5764
|
+
});
|
|
5765
|
+
const assetsDir = import_path2.default.join(process.cwd(), "public", "assets", "logos");
|
|
5766
|
+
if (options.copyAssets !== false) {
|
|
5767
|
+
await copyAssets(uniqueTechs, assetsDir, { colorMode: options.color });
|
|
5768
|
+
}
|
|
5769
|
+
return uniqueTechs.map((t) => ({
|
|
5770
|
+
...t,
|
|
5771
|
+
logo: `https://raw.githubusercontent.com/benjamindotdev/stackscan/main/public/assets/logos/${t.logo}`,
|
|
5772
|
+
relativePath: `./public/assets/logos/${t.logo}`
|
|
5773
|
+
}));
|
|
5774
|
+
}
|
|
5775
|
+
async function scan(targetPath, optionsOrUndefined) {
|
|
5776
|
+
let options = {};
|
|
5777
|
+
let pathArg = void 0;
|
|
5778
|
+
if (typeof targetPath === "string") {
|
|
5779
|
+
pathArg = targetPath;
|
|
5780
|
+
options = optionsOrUndefined || {};
|
|
5781
|
+
} else if (typeof targetPath === "object") {
|
|
5782
|
+
options = targetPath;
|
|
5783
|
+
}
|
|
5622
5784
|
if (options.readme === void 0) options.readme = true;
|
|
5623
5785
|
console.log("\u{1F680} Starting Scan...");
|
|
5624
5786
|
if (options.color) {
|
|
5625
5787
|
console.log(`\u{1F3A8} Color mode: ${options.color}`);
|
|
5626
5788
|
}
|
|
5789
|
+
if (pathArg) {
|
|
5790
|
+
const absPath = import_path2.default.resolve(pathArg);
|
|
5791
|
+
console.log(`Scanning single project at: ${absPath}`);
|
|
5792
|
+
try {
|
|
5793
|
+
const techsWithUrls = await analyzeProject(absPath, options);
|
|
5794
|
+
if (options.out) {
|
|
5795
|
+
const outPath = import_path2.default.resolve(options.out);
|
|
5796
|
+
import_fs.default.writeFileSync(outPath, JSON.stringify(techsWithUrls, null, 2));
|
|
5797
|
+
console.log(`\u2705 Generated stack output to: ${options.out}`);
|
|
5798
|
+
} else {
|
|
5799
|
+
const outPath = import_path2.default.join(absPath, "stack.json");
|
|
5800
|
+
import_fs.default.writeFileSync(outPath, JSON.stringify(techsWithUrls, null, 2));
|
|
5801
|
+
console.log(`\u2705 Generated stack.json at: ${outPath}`);
|
|
5802
|
+
}
|
|
5803
|
+
} catch (err) {
|
|
5804
|
+
console.error(`\u274C Error scanning project:`, err.message);
|
|
5805
|
+
process.exit(1);
|
|
5806
|
+
}
|
|
5807
|
+
return;
|
|
5808
|
+
}
|
|
5627
5809
|
if (!import_fs.default.existsSync(BASE_DIR)) {
|
|
5628
5810
|
console.log(`Creating stackscan directory at: ${BASE_DIR}`);
|
|
5629
5811
|
import_fs.default.mkdirSync(BASE_DIR, { recursive: true });
|
|
@@ -5639,66 +5821,11 @@ async function scan(options = {}) {
|
|
|
5639
5821
|
console.log(`Found ${projectDirs.length} projects to process.
|
|
5640
5822
|
`);
|
|
5641
5823
|
const allProjects = [];
|
|
5642
|
-
const allTechs = [];
|
|
5643
5824
|
for (const dir of projectDirs) {
|
|
5644
5825
|
const projectPath = import_path2.default.join(BASE_DIR, dir.name);
|
|
5645
|
-
|
|
5646
|
-
if (import_fs.default.existsSync(packageJsonPath)) {
|
|
5826
|
+
if (import_fs.default.existsSync(import_path2.default.join(projectPath, "package.json"))) {
|
|
5647
5827
|
try {
|
|
5648
|
-
const
|
|
5649
|
-
const pkg = JSON.parse(content);
|
|
5650
|
-
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
5651
|
-
const detectedTechs = [];
|
|
5652
|
-
Object.keys(allDeps).forEach((dep) => {
|
|
5653
|
-
if (SKIPPED_TECHS.includes(dep)) return;
|
|
5654
|
-
if (techMap[dep]) {
|
|
5655
|
-
const tech = techMap[dep];
|
|
5656
|
-
let color = null;
|
|
5657
|
-
if (options.color === "white") color = "#FFFFFF";
|
|
5658
|
-
else if (options.color === "black") color = "#000000";
|
|
5659
|
-
else if (options.color && options.color.startsWith("#")) color = options.color;
|
|
5660
|
-
else {
|
|
5661
|
-
const depSlug = dep.toLowerCase();
|
|
5662
|
-
const nameSlug = tech.name.toLowerCase();
|
|
5663
|
-
const nameSlugNoSpaces = tech.name.toLowerCase().replace(/\s+/g, "");
|
|
5664
|
-
const hex = simple_icons_hex_default[depSlug] || simple_icons_hex_default[nameSlug] || simple_icons_hex_default[nameSlugNoSpaces];
|
|
5665
|
-
if (hex) color = `#${hex}`;
|
|
5666
|
-
}
|
|
5667
|
-
detectedTechs.push({
|
|
5668
|
-
name: tech.name,
|
|
5669
|
-
slug: dep,
|
|
5670
|
-
logo: tech.logo,
|
|
5671
|
-
// Raw path for resolution
|
|
5672
|
-
type: tech.type,
|
|
5673
|
-
color
|
|
5674
|
-
});
|
|
5675
|
-
}
|
|
5676
|
-
});
|
|
5677
|
-
let uniqueTechs = Array.from(new Set(detectedTechs.map((t) => t.slug))).map((slug) => detectedTechs.find((t) => t.slug === slug));
|
|
5678
|
-
const seenLogos = /* @__PURE__ */ new Set();
|
|
5679
|
-
uniqueTechs = uniqueTechs.filter((t) => {
|
|
5680
|
-
if (seenLogos.has(t.logo)) {
|
|
5681
|
-
return false;
|
|
5682
|
-
}
|
|
5683
|
-
seenLogos.add(t.logo);
|
|
5684
|
-
return true;
|
|
5685
|
-
});
|
|
5686
|
-
uniqueTechs.sort((a, b) => {
|
|
5687
|
-
const pA = getCategoryPriority(a.type);
|
|
5688
|
-
const pB = getCategoryPriority(b.type);
|
|
5689
|
-
if (pA !== pB) return pA - pB;
|
|
5690
|
-
return a.name.localeCompare(b.name);
|
|
5691
|
-
});
|
|
5692
|
-
const assetsDir = import_path2.default.join(process.cwd(), "public", "assets", "logos");
|
|
5693
|
-
if (options.copyAssets !== false) {
|
|
5694
|
-
await copyAssets(uniqueTechs, assetsDir, { colorMode: options.color });
|
|
5695
|
-
}
|
|
5696
|
-
const techsWithUrls = uniqueTechs.map((t) => ({
|
|
5697
|
-
...t,
|
|
5698
|
-
logo: `https://raw.githubusercontent.com/benjamindotdev/stackscan/main/public/assets/logos/${t.logo}`,
|
|
5699
|
-
relativePath: `./public/assets/logos/${t.logo}`
|
|
5700
|
-
}));
|
|
5701
|
-
allTechs.push(...techsWithUrls);
|
|
5828
|
+
const techsWithUrls = await analyzeProject(projectPath, options);
|
|
5702
5829
|
import_fs.default.writeFileSync(
|
|
5703
5830
|
import_path2.default.join(projectPath, "stack.json"),
|
|
5704
5831
|
JSON.stringify(techsWithUrls, null, 2)
|
|
@@ -5709,7 +5836,7 @@ async function scan(options = {}) {
|
|
|
5709
5836
|
name: dir.name,
|
|
5710
5837
|
techs: techsWithUrls
|
|
5711
5838
|
});
|
|
5712
|
-
console.log(`\u2705 ${dir.name.padEnd(20)} -> stack.json (${
|
|
5839
|
+
console.log(`\u2705 ${dir.name.padEnd(20)} -> stack.json (${techsWithUrls.length} techs)`);
|
|
5713
5840
|
} catch (err) {
|
|
5714
5841
|
console.error(`\u274C Error processing ${dir.name}:`, err.message);
|
|
5715
5842
|
}
|
package/dist/scan.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
scan
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-JFE6WNCW.mjs";
|
|
4
|
+
import "./chunk-2R4IRVBW.mjs";
|
|
5
|
+
import "./chunk-RRAAD3VC.mjs";
|
|
6
6
|
import "./chunk-UJM3S22V.mjs";
|
|
7
7
|
import "./chunk-NGEKE4DQ.mjs";
|
|
8
8
|
import "./chunk-EOKQCSHI.mjs";
|