Skip to content

Commit

Permalink
fix(rules): add Discord, nodejs now returns 'nodejs' stack not javasc…
Browse files Browse the repository at this point in the history
…ript
  • Loading branch information
bodinsamuel committed Aug 23, 2023
1 parent 87a5764 commit 74956aa
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,4 @@ build/
output.json
dontcommit.*
action/
*.generated.ts
18 changes: 9 additions & 9 deletions src/analyser/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ exports[`analyser > should register only component of the same tech 1`] = `
"tech": null,
"techs": [
"docker",
"javascript",
"nodejs",
"postgresql",
],
},
Expand Down Expand Up @@ -88,7 +88,7 @@ exports[`analyser > should register only component of the same tech 1`] = `
"tech": null,
"techs": [
"docker",
"javascript",
"nodejs",
"postgresql",
],
}
Expand Down Expand Up @@ -178,7 +178,7 @@ exports[`analyser > should run correctly 1`] = `
"techs": [
"datadog",
"fastify",
"javascript",
"nodejs",
"prisma",
"typescript",
],
Expand Down Expand Up @@ -236,7 +236,7 @@ exports[`analyser > should run correctly 1`] = `
],
"tech": null,
"techs": [
"javascript",
"nodejs",
"react",
"typescript",
"vercel",
Expand Down Expand Up @@ -417,7 +417,7 @@ exports[`analyser > should run correctly 1`] = `
"docker",
"eslint",
"golang",
"javascript",
"nodejs",
"prettier",
"ruby",
"terraform",
Expand Down Expand Up @@ -526,7 +526,7 @@ exports[`analyser > should run correctly 2`] = `
"techs": [
"datadog",
"fastify",
"javascript",
"nodejs",
"prisma",
"typescript",
],
Expand Down Expand Up @@ -575,7 +575,7 @@ exports[`analyser > should run correctly 2`] = `
],
"tech": null,
"techs": [
"javascript",
"nodejs",
"react",
"typescript",
"vercel",
Expand Down Expand Up @@ -721,7 +721,7 @@ exports[`analyser > should run correctly 2`] = `
"docker",
"eslint",
"golang",
"javascript",
"nodejs",
"prettier",
"ruby",
"terraform",
Expand Down Expand Up @@ -981,7 +981,7 @@ exports[`analyser > should run correctly 2`] = `
"fastify",
"gcp",
"golang",
"javascript",
"nodejs",
"postgresql",
"prettier",
"prisma",
Expand Down
14 changes: 14 additions & 0 deletions src/rules/saas/discord.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { register } from '../../register.js';

register({
tech: 'discord',
name: 'Discord',
type: 'saas',
dependencies: [
{ type: 'npm', name: 'discord.js' },
{
type: 'npm',
name: 'discord-interactions',
},
],
});
1 change: 1 addition & 0 deletions src/rules/saas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import './algolia.js';
import './auth0.js';
import './datadog.js';
import './deferrun.js';
import './discord.js';
import './github.js';
import './huggingface.js';
import './logrocket.js';
Expand Down
2 changes: 1 addition & 1 deletion src/rules/spec/docker/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ exports[`docker > should match everything 1`] = `
"hashicorp_vault",
"httpd",
"influxdb",
"javascript",
"jenkins",
"kibana",
"mariadb",
Expand All @@ -24,6 +23,7 @@ exports[`docker > should match everything 1`] = `
"mysql",
"neo4j",
"nginx",
"nodejs",
"percona",
"postgresql",
"rabbitmq",
Expand Down
13 changes: 12 additions & 1 deletion src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports[`npm > should match everything 1`] = `
"cypressci",
"datadog",
"deferrun",
"discord",
"elasticsearch",
"esbuild",
"eslint",
Expand Down Expand Up @@ -52,7 +53,6 @@ exports[`npm > should match everything 1`] = `
"hotjar",
"huggingface",
"influxdb",
"javascript",
"koa",
"kubernetes",
"logrocket",
Expand All @@ -64,6 +64,7 @@ exports[`npm > should match everything 1`] = `
"neo4j",
"netlify",
"newrelic",
"nodejs",
"okta",
"openai",
"oraclecloud",
Expand Down Expand Up @@ -432,6 +433,16 @@ exports[`npm > should match everything 2`] = `
"dd-trace",
"0.0.0",
],
[
"npm",
"discord-interactions",
"0.0.0",
],
[
"npm",
"discord.js",
"0.0.0",
],
[
"npm",
"docsearch.js",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/spec/nodejs/component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('npm', () => {
},
}),
});
const match: AllowedKeys[] = ['javascript'];
const match: AllowedKeys[] = ['nodejs'];
expect(
Array.from(flatten(res, { merge: true }).techs).sort()
).toStrictEqual(match);
Expand Down
2 changes: 1 addition & 1 deletion src/rules/spec/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { register } from '../../../register.js';
import { detectNodeComponent } from './component.js';

register({
tech: 'javascript',
tech: 'nodejs',
name: 'NodeJS',
type: 'language',
files: ['package.json', '.nvmrc'],
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type AllowedKeys =
| 'deno'
| 'dependabot'
| 'digitalocean'
| 'discord'
| 'docker'
| 'elasticloud'
| 'elasticsearch'
Expand Down

0 comments on commit 74956aa

Please sign in to comment.