diff --git a/.npmignore b/.npmignore index 39afc5d3..78495fdb 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,5 @@ *.test.js *.test.d.ts -*.test.d.ts.map src/ tests/ *.tgz @@ -10,3 +9,6 @@ TODO.todo .env coverage/ action/ +__snapshots__/ +__fixtures__/ +*.ts.map diff --git a/src/rules/hosting/aws.ts b/src/rules/hosting/aws.ts index a4385eca..93c50295 100644 --- a/src/rules/hosting/aws.ts +++ b/src/rules/hosting/aws.ts @@ -13,5 +13,6 @@ register({ { type: 'golang', name: 'github.com/aws/aws-sdk-go-v2' }, { type: 'rust', name: /^aws-sdk/, example: 'aws-sdk-e2' }, { type: 'ruby', name: /^aws-sdk/, example: 'aws-sdk-e2' }, + { type: 'docker', name: 'amazon/aws-cli' }, ], }); diff --git a/src/rules/spec/deno/__snapshots__/lockfile.test.ts.snap b/src/rules/spec/deno/__snapshots__/lockfile.test.ts.snap index 984bb1db..e6cd7e16 100644 --- a/src/rules/spec/deno/__snapshots__/lockfile.test.ts.snap +++ b/src/rules/spec/deno/__snapshots__/lockfile.test.ts.snap @@ -7,3 +7,18 @@ exports[`deno > should match everything 1`] = ` "sqlite", ] `; + +exports[`deno > should match everything 2`] = ` +[ + [ + "deno", + "https://deno.land/x/postgres@v0.17.0/mod.ts", + "60cb4ec8bd335bf241ef785ccec51e809d576ff8e8d29da43d2273b69ce2a6ff", + ], + [ + "deno", + "https://deno.land/x/sqlite3@1.3.5/lib/shim.ts", + "60cb4ec8bd335bf241ef785ccec51e809d576ff8e8d29da43d2273b69ce2a6ff", + ], +] +`; diff --git a/src/rules/spec/deno/lockfile.test.ts b/src/rules/spec/deno/lockfile.test.ts index 216ebbab..08653b2b 100644 --- a/src/rules/spec/deno/lockfile.test.ts +++ b/src/rules/spec/deno/lockfile.test.ts @@ -32,8 +32,9 @@ describe('deno', () => { }, }), }); - expect( - Array.from(flatten(res, { merge: true }).techs).sort() - ).toMatchSnapshot(); + + const merged = flatten(res, { merge: true }); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); + expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); }); }); diff --git a/src/rules/spec/docker/__snapshots__/component.test.ts.snap b/src/rules/spec/docker/__snapshots__/component.test.ts.snap index b58292b5..5030c9e4 100644 --- a/src/rules/spec/docker/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/docker/__snapshots__/component.test.ts.snap @@ -32,3 +32,148 @@ exports[`docker > should match everything 1`] = ` "zookeeper", ] `; + +exports[`docker > should match everything 2`] = ` +[ + [ + "docker", + "adobe/s3mock", + "0.0.0", + ], + [ + "docker", + "amazon/aws-cli", + "0.0.0", + ], + [ + "docker", + "amazon/dynamodb-local", + "0.0.0", + ], + [ + "docker", + "caddy", + "0.0.0", + ], + [ + "docker", + "cassandra", + "0.0.0", + ], + [ + "docker", + "couchbase", + "0.0.0", + ], + [ + "docker", + "cypress", + "0.0.0", + ], + [ + "docker", + "denoland/deno", + "0.0.0", + ], + [ + "docker", + "elasticsearch", + "0.0.0", + ], + [ + "docker", + "httpd", + "0.0.0", + ], + [ + "docker", + "influxdb", + "0.0.0", + ], + [ + "docker", + "jenkins-docker", + "0.0.0", + ], + [ + "docker", + "kibana", + "0.0.0", + ], + [ + "docker", + "mariadb", + "0.0.0", + ], + [ + "docker", + "memcached", + "0.0.0", + ], + [ + "docker", + "mongo", + "0.0.0", + ], + [ + "docker", + "mysql", + "0.0.0", + ], + [ + "docker", + "neo4j", + "0.0.0", + ], + [ + "docker", + "nginx", + "0.0.0", + ], + [ + "docker", + "nodejs", + "0.0.0", + ], + [ + "docker", + "percona", + "0.0.0", + ], + [ + "docker", + "postgres", + "0.0.0", + ], + [ + "docker", + "rabbitmq", + "0.0.0", + ], + [ + "docker", + "redis", + "0.0.0", + ], + [ + "docker", + "ruby", + "0.0.0", + ], + [ + "docker", + "strapi", + "0.0.0", + ], + [ + "docker", + "vault", + "0.0.0", + ], + [ + "docker", + "zookeeper", + "0.0.0", + ], +] +`; diff --git a/src/rules/spec/docker/component.test.ts b/src/rules/spec/docker/component.test.ts index 64ee003e..5376e29e 100644 --- a/src/rules/spec/docker/component.test.ts +++ b/src/rules/spec/docker/component.test.ts @@ -38,9 +38,9 @@ describe('docker', () => { }), }); - expect( - Array.from(flatten(res, { merge: true }).techs).sort() - ).toMatchSnapshot(); + const merged = flatten(res, { merge: true }); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); + expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); }); it.each([ diff --git a/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap b/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap index ce6343b6..e399cf78 100644 --- a/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap +++ b/src/rules/spec/golang/__snapshots__/lockfile.test.ts.snap @@ -1,10 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`golang (lockfile) > should match everything 1`] = ` -Set { +[ "aws", "golang", -} +] `; exports[`golang (lockfile) > should match everything 2`] = ` diff --git a/src/rules/spec/golang/lockfile.test.ts b/src/rules/spec/golang/lockfile.test.ts index f65210b2..fb722084 100644 --- a/src/rules/spec/golang/lockfile.test.ts +++ b/src/rules/spec/golang/lockfile.test.ts @@ -40,7 +40,7 @@ require ( }); const merged = flatten(res, { merge: true }); - expect(merged.techs).toMatchSnapshot(); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); }); }); diff --git a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap index 88ee815e..209e23ee 100644 --- a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap @@ -94,3 +94,563 @@ exports[`npm > should match everything 1`] = ` "webpack", ] `; + +exports[`npm > should match everything 2`] = ` +[ + [ + "npm", + "@algolia/client", + "0.0.0", + ], + [ + "npm", + "@angular/forms", + "0.0.0", + ], + [ + "npm", + "@auth0/auth0-react", + "0.0.0", + ], + [ + "npm", + "@aws-sdk/client-dynamodb-streams", + "0.0.0", + ], + [ + "npm", + "@aws-sdk/client-ec2", + "0.0.0", + ], + [ + "npm", + "@aws-sdk/client-rds", + "0.0.0", + ], + [ + "npm", + "@aws-sdk/client-s3", + "0.0.0", + ], + [ + "npm", + "@aws-sdk/middleware-sdk-rds", + "0.0.0", + ], + [ + "npm", + "@datadog/cli", + "0.0.0", + ], + [ + "npm", + "@defer/client", + "0.0.0", + ], + [ + "npm", + "@docsearch/react", + "0.0.0", + ], + [ + "npm", + "@elastic/elasticsearch", + "0.0.0", + ], + [ + "npm", + "@fastly/performance-observer-polyfill", + "0.0.0", + ], + [ + "npm", + "@firebase/auth", + "0.0.0", + ], + [ + "npm", + "@google-cloud/aiplatform", + "0.0.0", + ], + [ + "npm", + "@google-cloud/bigquery", + "0.0.0", + ], + [ + "npm", + "@google-cloud/bigtable", + "0.0.0", + ], + [ + "npm", + "@google-cloud/cloud-sql-connector", + "0.0.0", + ], + [ + "npm", + "@google-cloud/cloudbuild", + "0.0.0", + ], + [ + "npm", + "@google-cloud/compute", + "0.0.0", + ], + [ + "npm", + "@google-cloud/dataproc", + "0.0.0", + ], + [ + "npm", + "@google-cloud/datastore", + "0.0.0", + ], + [ + "npm", + "@google-cloud/dns", + "0.0.0", + ], + [ + "npm", + "@google-cloud/functions-framework", + "0.0.0", + ], + [ + "npm", + "@google-cloud/language", + "0.0.0", + ], + [ + "npm", + "@google-cloud/maps", + "0.0.0", + ], + [ + "npm", + "@google-cloud/pubsub", + "0.0.0", + ], + [ + "npm", + "@google-cloud/run", + "0.0.0", + ], + [ + "npm", + "@google-cloud/secret-manager", + "0.0.0", + ], + [ + "npm", + "@google-cloud/speech", + "0.0.0", + ], + [ + "npm", + "@google-cloud/storage", + "0.0.0", + ], + [ + "npm", + "@google-cloud/translate", + "0.0.0", + ], + [ + "npm", + "@google-cloud/vision", + "0.0.0", + ], + [ + "npm", + "@hotjar/browser", + "0.0.0", + ], + [ + "npm", + "@huggingface/inference", + "0.0.0", + ], + [ + "npm", + "@influxdata/influxdb-client", + "0.0.0", + ], + [ + "npm", + "@kubernetes/client-node", + "0.0.0", + ], + [ + "npm", + "@mikro-orm/mongodb", + "0.0.0", + ], + [ + "npm", + "@mikro-orm/postgresql", + "0.0.0", + ], + [ + "npm", + "@netlify/plugin-emails", + "0.0.0", + ], + [ + "npm", + "@nuxtjs/algolia", + "0.0.0", + ], + [ + "npm", + "@octokit/types", + "0.0.0", + ], + [ + "npm", + "@okta/okta-signin-widget", + "0.0.0", + ], + [ + "npm", + "@ovh-api/api", + "0.0.0", + ], + [ + "npm", + "@pagerduty/pdjs", + "0.0.0", + ], + [ + "npm", + "@relative-ci/agent", + "0.0.0", + ], + [ + "npm", + "@scaleway/sdk", + "0.0.0", + ], + [ + "npm", + "@sentry/browser", + "0.0.0", + ], + [ + "npm", + "@slack/web-api", + "0.0.0", + ], + [ + "npm", + "@strapi/strapi", + "0.0.0", + ], + [ + "npm", + "algoliasearch", + "0.0.0", + ], + [ + "npm", + "amqplib", + "0.0.0", + ], + [ + "npm", + "angular", + "0.0.0", + ], + [ + "npm", + "auth0", + "0.0.0", + ], + [ + "npm", + "aws-sdk", + "0.0.0", + ], + [ + "npm", + "bootstrap", + "0.0.0", + ], + [ + "npm", + "browserstack", + "0.0.0", + ], + [ + "npm", + "couchbase", + "0.0.0", + ], + [ + "npm", + "create-instantsearch-app", + "0.0.0", + ], + [ + "npm", + "cypress", + "0.0.0", + ], + [ + "npm", + "dd-trace", + "0.0.0", + ], + [ + "npm", + "docsearch.js", + "0.0.0", + ], + [ + "npm", + "esbuild", + "0.0.0", + ], + [ + "npm", + "eslint", + "0.0.0", + ], + [ + "npm", + "express", + "0.0.0", + ], + [ + "npm", + "fastify", + "0.0.0", + ], + [ + "npm", + "fastly", + "0.0.0", + ], + [ + "npm", + "firebase", + "0.0.0", + ], + [ + "npm", + "gatsby-plugin-algolia", + "0.0.0", + ], + [ + "npm", + "googleapis", + "0.0.0", + ], + [ + "npm", + "instantsearch.js", + "0.0.0", + ], + [ + "npm", + "ioredis", + "0.0.0", + ], + [ + "npm", + "koa", + "0.0.0", + ], + [ + "npm", + "logrocket", + "0.0.0", + ], + [ + "npm", + "mariadb", + "0.0.0", + ], + [ + "npm", + "memcached", + "0.0.0", + ], + [ + "npm", + "mongoose", + "0.0.0", + ], + [ + "npm", + "mysql", + "0.0.0", + ], + [ + "npm", + "neo4j-driver", + "0.0.0", + ], + [ + "npm", + "netlify", + "0.0.0", + ], + [ + "npm", + "netlify-cli", + "0.0.0", + ], + [ + "npm", + "newrelic", + "0.0.0", + ], + [ + "npm", + "node-mailjet", + "0.0.0", + ], + [ + "npm", + "oci-sdk", + "0.0.0", + ], + [ + "npm", + "octokit", + "0.0.0", + ], + [ + "npm", + "openai", + "0.0.0", + ], + [ + "npm", + "pg", + "0.0.0", + ], + [ + "npm", + "prettier", + "0.0.0", + ], + [ + "npm", + "prisma", + "0.0.0", + ], + [ + "npm", + "puppeteer", + "0.0.0", + ], + [ + "npm", + "react", + "0.0.0", + ], + [ + "npm", + "react-email", + "0.0.0", + ], + [ + "npm", + "react-instantsearch", + "0.0.0", + ], + [ + "npm", + "redis", + "0.0.0", + ], + [ + "npm", + "renovate", + "0.0.0", + ], + [ + "npm", + "resend", + "0.0.0", + ], + [ + "npm", + "rollup", + "0.0.0", + ], + [ + "npm", + "sequelize", + "0.0.0", + ], + [ + "npm", + "snyk", + "0.0.0", + ], + [ + "npm", + "socket.io", + "0.0.0", + ], + [ + "npm", + "sqlite3", + "0.0.0", + ], + [ + "npm", + "sqreen", + "0.0.0", + ], + [ + "npm", + "storybook", + "0.0.0", + ], + [ + "npm", + "strapi", + "0.0.0", + ], + [ + "npm", + "tailwindcss", + "0.0.0", + ], + [ + "npm", + "typescript", + "0.0.0", + ], + [ + "npm", + "vercel", + "0.0.0", + ], + [ + "npm", + "vite", + "0.0.0", + ], + [ + "npm", + "vue", + "0.0.0", + ], + [ + "npm", + "vue-instantsearch", + "0.0.0", + ], + [ + "npm", + "webpack", + "0.0.0", + ], +] +`; diff --git a/src/rules/spec/nodejs/component.test.ts b/src/rules/spec/nodejs/component.test.ts index 1a5a798d..b3174037 100644 --- a/src/rules/spec/nodejs/component.test.ts +++ b/src/rules/spec/nodejs/component.test.ts @@ -33,9 +33,10 @@ describe('npm', () => { }, }), }); - expect( - Array.from(flatten(res, { merge: true }).techs).sort() - ).toMatchSnapshot(); + + const merged = flatten(res, { merge: true }); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); + expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); }); it('should match nothing', async () => { diff --git a/src/rules/spec/ruby/__snapshots__/component.test.ts.snap b/src/rules/spec/ruby/__snapshots__/component.test.ts.snap index a84b75dd..7e83ef3f 100644 --- a/src/rules/spec/ruby/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/ruby/__snapshots__/component.test.ts.snap @@ -1,65 +1,65 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`ruby (component) > should match everything 1`] = ` -Set { - "gcp", - "gcp.aiplatform", - "gcp.language", - "gcp.maps", - "gcp.speech", - "gcp.translate", - "gcp.vision", - "zookeeper", +[ + "algolia", + "auth0", "aws", "aws.dynamodb", + "aws.ec2", "aws.rds", + "aws.s3", + "azure", "couchbase", + "datadog", "elasticsearch", + "fastly", + "firebase", + "gcp", + "gcp.aiplatform", "gcp.bigquery", "gcp.bigtable", + "gcp.cloudrun", + "gcp.dataproc", "gcp.datastore", + "gcp.dns", + "gcp.functions", + "gcp.gce", + "gcp.gcs", + "gcp.language", + "gcp.maps", + "gcp.pubsub", "gcp.secretmanager", + "gcp.speech", "gcp.sql", + "gcp.translate", + "gcp.vision", + "github", "hashicorp_vault", + "heroku", "influxdb", + "kubernetes", + "mailjet", "mariadb", "memcached", "mongodb", "mysql", "neo4j", - "postgresql", - "redis", - "snowflake", - "sqlite", - "gcp.dataproc", - "aws.ec2", - "aws.s3", - "azure", - "fastly", - "firebase", - "gcp.cloudrun", - "gcp.functions", - "gcp.gce", - "gcp.gcs", - "heroku", - "kubernetes", - "oraclecloud", - "rabbitmq", - "gcp.pubsub", - "gcp.dns", - "algolia", - "auth0", - "datadog", - "github", - "mailjet", "newrelic", "okta", + "oraclecloud", "pagerduty", + "postgresql", + "rabbitmq", + "redis", + "ruby", "sentry", "slack", + "snowflake", + "sqlite", "sqreen", - "ruby", -} + "zookeeper", +] `; exports[`ruby (component) > should match everything 2`] = ` diff --git a/src/rules/spec/ruby/component.test.ts b/src/rules/spec/ruby/component.test.ts index bff60839..7d81b4c2 100644 --- a/src/rules/spec/ruby/component.test.ts +++ b/src/rules/spec/ruby/component.test.ts @@ -37,7 +37,7 @@ source "https://rubygems.org" }); const merged = flatten(res, { merge: true }); - expect(merged.techs).toMatchSnapshot(); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); }); }); diff --git a/src/rules/spec/rust/__snapshots__/component.test.ts.snap b/src/rules/spec/rust/__snapshots__/component.test.ts.snap index 54d7c6dc..917bc989 100644 --- a/src/rules/spec/rust/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/rust/__snapshots__/component.test.ts.snap @@ -1,47 +1,47 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`rust (component) > should match everything 1`] = ` -Set { - "zookeeper", +[ + "algolia", + "auth0", "aws", "aws.dynamodb", + "aws.ec2", "aws.rds", + "aws.s3", + "azure", "cassandra", "couchbase", + "datadog", "elasticsearch", + "fastly", + "firebase", "gcp", "gcp.bigquery", + "gcp.gcs", + "gcp.pubsub", + "gitlab", "hashicorp_vault", "influxdb", + "kubernetes", + "mailjet", "memcached", "mongodb", "mysql", "neo4j", + "okta", + "pagerduty", "postgresql", + "rabbitmq", "redis", + "rust", + "sentry", + "slack", "snowflake", "sqlite", - "aws.ec2", - "aws.s3", - "azure", - "fastly", - "firebase", - "gcp.gcs", - "kubernetes", "vercel", - "rabbitmq", - "gcp.pubsub", - "algolia", - "auth0", - "datadog", - "mailjet", - "okta", - "pagerduty", - "sentry", - "slack", - "gitlab", - "rust", -} + "zookeeper", +] `; exports[`rust (component) > should match everything 2`] = ` diff --git a/src/rules/spec/rust/component.test.ts b/src/rules/spec/rust/component.test.ts index 3c57c351..5390f89a 100644 --- a/src/rules/spec/rust/component.test.ts +++ b/src/rules/spec/rust/component.test.ts @@ -39,7 +39,7 @@ version = "1.8.0" }); const merged = flatten(res, { merge: true }); - expect(merged.techs).toMatchSnapshot(); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); });