Skip to content

Commit

Permalink
fix(nodejs): add more dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Apr 26, 2023
1 parent 718011c commit 74ef1fe
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 4 deletions.
57 changes: 57 additions & 0 deletions TODO.todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Language detection:
- extension to language

NodeJs:
- Check import of others services
- Detect Elasticsearch
- Detect Sentry
- Detect Datadog
- Detect Hotjar
- Detect LogRocket
- Detect New Relic

Terraform:
- GCP
- Kubernetes
- Postgres
- GCE
- Cloud run
- GCS
- AWS
- ???

Prisma:
- Type of DB

Docker Compose:
- Parse images

Firebase:
- Hosting
- DB

Global:
- Detect Vercel
- Detect github pages
- Detect Cloudflare
- Detect Netlify
- Detect Zeit
- Detect Fly.io
- Detect Heroku
- Detect Render
- Detect Dependabot
- Detect Renovate


Don't forget:
- MySQL
- MariaDB
- Microsoft SQL Server
- Oracle DBMS
- PostgreSQL
- MongoDB
- Redis
- Cassandra
- Elasticsearch
- SQLite
- Snowflake
3 changes: 3 additions & 0 deletions src/analyser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function recursive(
): Promise<void> {
const files = await provider.listDir(filePath);

// Detect services
for (const rule of rulesServices) {
const res = await rule(files, provider);
if (!res) {
Expand All @@ -25,6 +26,7 @@ async function recursive(
ret.services.push(res);
}

// Detect Tech
for (const rule of rules) {
const res = await rule(files);
if (!res) {
Expand All @@ -34,6 +36,7 @@ async function recursive(
ret.tech.add(res.key);
}

// Recursively dive in folders
for (const file of files) {
if (file.type === 'file') {
continue;
Expand Down
2 changes: 2 additions & 0 deletions src/common/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ export const list: TechItem[] = [
{ key: 'gcp', name: 'GCP', type: 'hosting' },
{ key: 'github', name: 'Github', type: 'sass' },
{ key: 'golang', name: 'Go', type: 'language' },
{ key: 'hotjar', name: 'Hotjar', type: 'sass' },
{ key: 'html', name: 'HTML', type: 'language' },
{ key: 'java', name: 'Java', type: 'language' },
{ key: 'jest', name: 'Jest', type: 'tool' },
{ key: 'jira', name: 'Jira', type: 'sass' },
{ key: 'kotlin', name: 'Kotlin', type: 'language' },
{ key: 'kubernetes', name: 'Kubernetes', type: 'hosting' },
{ key: 'logrocket', name: 'LogRocket', type: 'sass' },
{ key: 'mailchimp', name: 'Mailchimp', type: 'sass' },
{ key: 'mailjet', name: 'Mailjet', type: 'sass' },
{ key: 'mongodb', name: 'MongoDB', type: 'db' },
Expand Down
20 changes: 16 additions & 4 deletions src/rules/nodejs/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,30 @@ import type { Service } from '../../types';
import type { TechItem } from '../../types/techs';

const DEPS: Record<string, TechItem[]> = {
'@algolia/autocomplete-js': [listIndexed.algolia],
'@datadog/browser-logs': [listIndexed.datadog],
'@datadog/browser-rum': [listIndexed.datadog],
'@datadog/cli': [listIndexed.datadog],
'@elastic/elasticsearch': [listIndexed.elasticsearch],
'@hotjar/browser': [listIndexed.hotjar],
'@sentry/browser': [listIndexed.sentry],
'@sentry/tracing': [listIndexed.sentry],
'@sentry/node': [listIndexed.sentry],
'@sentry/react': [listIndexed.sentry],
'dd-trace': [listIndexed.datadog],
'node-mailjet': [listIndexed.mailjet],
algoliasearch: [listIndexed.algolia],
angular: [listIndexed.angular],
amqplib: [listIndexed.rabbitmq],
angular: [listIndexed.angular],
bootstrap: [listIndexed.bootstrap],
eslint: [listIndexed.eslint],
express: [listIndexed.express],
fastify: [listIndexed.fastify],
jest: [listIndexed.jest],
'@algolia/autocomplete-js': [listIndexed.algolia],
logrocket: [listIndexed.logrocket],
mongoose: [listIndexed.mongodb],
mysql: [listIndexed.mysql],
'node-mailjet': [listIndexed.mailjet],
newrelic: [listIndexed.newrelic],
pg: [listIndexed.postgresql],
prettier: [listIndexed.prettier],
prisma: [listIndexed.prisma],
Expand All @@ -26,8 +38,8 @@ const DEPS: Record<string, TechItem[]> = {
sqreen: [listIndexed.sqreen],
tailwind: [listIndexed.tailwind],
typescript: [listIndexed.typescript],
vue: [listIndexed.vue],
vite: [listIndexed.vite],
vue: [listIndexed.vue],
};

export function detectDependencies(pkg: FullVersion): Service['tech'] {
Expand Down
2 changes: 2 additions & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ export type AllowedKeys =
| 'gcp'
| 'github'
| 'golang'
| 'hotjar'
| 'html'
| 'java'
| 'jest'
| 'jira'
| 'kotlin'
| 'kubernetes'
| 'logrocket'
| 'mailchimp'
| 'mailjet'
| 'mongodb'
Expand Down

0 comments on commit 74ef1fe

Please sign in to comment.