diff --git a/src/common/techs.ts b/src/common/techs.ts index e454148e..9d9d44bf 100644 --- a/src/common/techs.ts +++ b/src/common/techs.ts @@ -8,7 +8,7 @@ export const list: TechItem[] = [ { key: 'auth0', name: 'Auth0', type: 'sass' }, { key: 'aws', name: 'AWS', type: 'hosting' }, { key: 'azure', name: 'Azure', type: 'hosting' }, - { key: 'azureci', name: 'AzureCi', type: 'ci' }, + { key: 'azure.ci', name: 'AzureCi', type: 'ci' }, { key: 'bash', name: 'Bash', type: 'language' }, { key: 'bootstrap', name: 'Bootstrap', type: 'tool' }, { key: 'browserstack', name: 'Browserstack', type: 'ci' }, @@ -47,8 +47,8 @@ export const list: TechItem[] = [ { key: 'gcp.gce', name: 'Compute Engine', type: 'hosting' }, { key: 'gitlabci', name: 'Gitlab CI', type: 'ci' }, { key: 'github', name: 'Github', type: 'tool' }, - { key: 'githubactions', name: 'Github Actions', type: 'ci' }, - { key: 'githubpages', name: 'Github Pages', type: 'hosting' }, + { key: 'github.actions', name: 'Github Actions', type: 'ci' }, + { key: 'github.pages', name: 'Github Pages', type: 'hosting' }, { key: 'golang', name: 'Go', type: 'language' }, { key: 'helm', name: 'Helm', type: 'tool' }, { key: 'heroku', name: 'Heroku', type: 'hosting' }, diff --git a/src/rules/ci.test.ts b/src/rules/ci.test.ts index bb2d19f3..03b5d509 100644 --- a/src/rules/ci.test.ts +++ b/src/rules/ci.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'; import { analyser } from '../analyser/index.js'; import { listIndexed } from '../common/techs.js'; +import type { AllowedKeys } from '../index.js'; import { FakeProvider } from '../provider/fake.js'; import { rawList } from '../rules.js'; import './index.js'; @@ -29,16 +30,16 @@ describe('ci', () => { files: {}, }), }); - expect(res.toJson('').techs).toStrictEqual([ + const match: AllowedKeys[] = [ 'appveyor', - 'azureci', + 'azure.ci', 'browserstack', 'circleci', 'cirrusci', 'codesandboxci', 'cypressci', 'dependabot', - 'githubactions', + 'github.actions', 'gitlabci', 'javascript', 'jenkins', @@ -47,7 +48,8 @@ describe('ci', () => { 'styleci', 'teamcity', 'travisci', - ]); + ]; + expect(res.toJson('').techs).toStrictEqual(match); }); it('enforce that we match .github', async () => { @@ -63,6 +65,7 @@ describe('ci', () => { }, }), }); - expect(res.toJson('').techs).toStrictEqual(['github', 'githubactions']); + const match: AllowedKeys[] = ['github', 'github.actions']; + expect(res.toJson('').techs).toStrictEqual(match); }); }); diff --git a/src/rules/ci/azureci.ts b/src/rules/ci/azure.ci.ts similarity index 82% rename from src/rules/ci/azureci.ts rename to src/rules/ci/azure.ci.ts index 8c391680..b06c9dce 100644 --- a/src/rules/ci/azureci.ts +++ b/src/rules/ci/azure.ci.ts @@ -1,6 +1,6 @@ import { register } from '../../rules.js'; register({ - tech: 'azureci', + tech: 'azure.ci', files: ['azure-pipelines.yml'], }); diff --git a/src/rules/ci/githubactions.ts b/src/rules/ci/github.actions.ts similarity index 86% rename from src/rules/ci/githubactions.ts rename to src/rules/ci/github.actions.ts index 33b160a4..2f5a6a15 100644 --- a/src/rules/ci/githubactions.ts +++ b/src/rules/ci/github.actions.ts @@ -1,7 +1,7 @@ import { register } from '../../rules.js'; register({ - tech: 'githubactions', + tech: 'github.actions', matchFullPath: true, files: /.github\/workflows\/.+\.yml/, example: '.github/workflows/ci.yml', diff --git a/src/rules/ci/index.ts b/src/rules/ci/index.ts index 686e2477..4766bfb0 100644 --- a/src/rules/ci/index.ts +++ b/src/rules/ci/index.ts @@ -1,12 +1,12 @@ import './appveyor.js'; -import './azureci.js'; +import './azure.ci.js'; import './browserstack.js'; import './circleci.js'; import './cirrusci.js'; import './codesandboxci.js'; import './cypressci.js'; import './dependabot.js'; -import './githubactions.js'; +import './github.actions.js'; import './gitlabci.js'; import './jenkins.js'; import './relativeci.js'; diff --git a/src/rules/hosting.test.ts b/src/rules/hosting.test.ts index 44f692b7..86864a28 100644 --- a/src/rules/hosting.test.ts +++ b/src/rules/hosting.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'; import { analyser } from '../analyser/index.js'; import { listIndexed } from '../common/techs.js'; +import type { AllowedKeys } from '../index.js'; import { FakeProvider } from '../provider/fake.js'; import { rawList } from '../rules.js'; import './index.js'; @@ -29,15 +30,16 @@ describe('hosting', () => { files: {}, }), }); - expect(res.toJson('').techs).toStrictEqual([ + const match: AllowedKeys[] = [ 'expodev', 'flyio', - 'githubpages', + 'github.pages', 'heroku', 'netlify', 'platformsh', 'render', 'vercel', - ]); + ]; + expect(res.toJson('').techs).toStrictEqual(match); }); }); diff --git a/src/rules/hosting/githubpages.ts b/src/rules/hosting/github.pages.ts similarity index 77% rename from src/rules/hosting/githubpages.ts rename to src/rules/hosting/github.pages.ts index 15212750..68d15f8c 100644 --- a/src/rules/hosting/githubpages.ts +++ b/src/rules/hosting/github.pages.ts @@ -1,6 +1,6 @@ import { register } from '../../rules.js'; register({ - tech: 'githubpages', + tech: 'github.pages', files: ['_config.yml'], }); diff --git a/src/rules/hosting/index.ts b/src/rules/hosting/index.ts index fefae994..6aa26c9d 100644 --- a/src/rules/hosting/index.ts +++ b/src/rules/hosting/index.ts @@ -7,7 +7,7 @@ import './flyio.js'; import './gcp.js'; import './gcp.cloudrun.js'; import './gcp.gce.js'; -import './githubpages.js'; +import './github.pages.js'; import './heroku.js'; import './kubernetes.js'; import './mongodbatlas.js'; diff --git a/src/rules/spec/docker/dependencies.test.ts b/src/rules/spec/docker/dependencies.test.ts index 7979e4b1..1eb86d63 100644 --- a/src/rules/spec/docker/dependencies.test.ts +++ b/src/rules/spec/docker/dependencies.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import { analyser } from '../../../analyser/index.js'; +import type { AllowedKeys } from '../../../index.js'; import { flatten } from '../../../payload/helpers.js'; import { FakeProvider } from '../../../provider/fake.js'; import { rawList } from '../../../rules.js'; @@ -36,9 +37,7 @@ describe('docker', () => { }), }); - expect( - Array.from(flatten(res, { merge: true }).techs).sort() - ).toStrictEqual([ + const match: AllowedKeys[] = [ 'caddy', 'cassandra', 'couchbase', @@ -64,6 +63,9 @@ describe('docker', () => { 'strapi', 'vault', 'zookeeper', - ]); + ]; + expect( + Array.from(flatten(res, { merge: true }).techs).sort() + ).toStrictEqual(match); }); }); diff --git a/src/rules/spec/nodejs/dependencies.test.ts b/src/rules/spec/nodejs/dependencies.test.ts index 8202ffdf..36a7369a 100644 --- a/src/rules/spec/nodejs/dependencies.test.ts +++ b/src/rules/spec/nodejs/dependencies.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import { analyser } from '../../../analyser/index.js'; +import type { AllowedKeys } from '../../../index.js'; import { flatten } from '../../../payload/helpers.js'; import { FakeProvider } from '../../../provider/fake.js'; import { rawList } from '../../../rules.js'; @@ -30,9 +31,7 @@ describe('npm', () => { }, }), }); - expect( - Array.from(flatten(res, { merge: true }).techs).sort() - ).toStrictEqual([ + const match: AllowedKeys[] = [ 'algolia', 'angular', 'auth0', @@ -89,6 +88,9 @@ describe('npm', () => { 'vite', 'vue', 'webpack', - ]); + ]; + expect( + Array.from(flatten(res, { merge: true }).techs).sort() + ).toStrictEqual(match); }); }); diff --git a/src/rules/spec/terraform/dependencies.test.ts b/src/rules/spec/terraform/dependencies.test.ts index 7ef1bb10..37d2f292 100644 --- a/src/rules/spec/terraform/dependencies.test.ts +++ b/src/rules/spec/terraform/dependencies.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import { analyser } from '../../../analyser/index.js'; +import type { AllowedKeys } from '../../../index.js'; import { flatten } from '../../../payload/helpers.js'; import { FakeProvider } from '../../../provider/fake.js'; import { rawList } from '../../../rules.js'; @@ -33,28 +34,29 @@ describe('terraform (lockfile)', () => { }), }); - expect(flatten(res, { merge: true }).techs).toStrictEqual( - new Set([ - 'alibabacloud', - 'auth0', - 'aws', - 'azure', - 'datadog', - 'elasticsearch', - 'elasticstack', - 'flyio', - 'gcp', - 'github', - 'helm', - 'kubernetes', - 'mongodbatlas', - 'newrelic', - 'oraclecloud', - 'terraform', - 'vault', - 'vercel', - ]) - ); + const match: AllowedKeys[] = [ + 'alibabacloud', + 'auth0', + 'aws', + 'azure', + 'datadog', + 'elasticsearch', + 'elasticstack', + 'flyio', + 'gcp', + 'github', + 'helm', + 'kubernetes', + 'mongodbatlas', + 'newrelic', + 'oraclecloud', + 'terraform', + 'vault', + 'vercel', + ]; + expect( + Array.from(flatten(res, { merge: true }).techs).sort() + ).toStrictEqual(match); }); }); @@ -89,8 +91,14 @@ describe('terraform (resource)', () => { }), }); + const match: AllowedKeys[] = [ + 'gcp.cloudrun', + 'gcp.gce', + 'gcp.pubsub', + 'terraform', + ]; expect( Array.from(flatten(res, { merge: true }).techs).sort() - ).toStrictEqual(['gcp.cloudrun', 'gcp.gce', 'gcp.pubsub', 'terraform']); + ).toStrictEqual(match); }); }); diff --git a/src/types/techs.ts b/src/types/techs.ts index 3949c7cc..d06f12d5 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -16,8 +16,8 @@ export type AllowedKeys = | 'appveyor' | 'auth0' | 'aws' + | 'azure.ci' | 'azure' - | 'azureci' | 'bash' | 'bootstrap' | 'browserstack' @@ -54,9 +54,9 @@ export type AllowedKeys = | 'gcp.gce' | 'gcp.pubsub' | 'gcp' + | 'github.actions' + | 'github.pages' | 'github' - | 'githubactions' - | 'githubpages' | 'gitlabci' | 'golang' | 'helm'