Skip to content

Commit

Permalink
fix(rules): add Cloudflare Workers
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Sep 13, 2023
1 parent a813809 commit a4574c9
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/__snapshots__/hosting.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`hosting > should match everything with files 1`] = `
[
"cloudflare.workers",
"expodev",
"firebase",
"flyio",
Expand Down
1 change: 1 addition & 0 deletions src/rules/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ exports[`all > should match everything 1`] = `
"cirrusci",
"clickhouse",
"cloudflare",
"cloudflare.workers",
"cockroachdb",
"codecov",
"codesandboxci",
Expand Down
19 changes: 19 additions & 0 deletions src/rules/hosting/cloudflare.workers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { register } from '../../register.js';

register({
tech: 'cloudflare.workers',
name: 'Cloudflare Workers',
type: 'hosting',
files: ['wrangler.toml'],
dependencies: [
{ type: 'npm', name: 'wrangler' },
{ type: 'npm', name: '@miniflare/cache' },
{ type: 'npm', name: 'miniflare' },
{
type: 'terraform.resource',
name: /^cloudflare_workers_/,
example: 'cloudflare_workers_kv_namespace',
},
{ type: 'githubAction', name: 'cloudflare/wrangler-action' },
],
});
1 change: 1 addition & 0 deletions src/rules/hosting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import './aws.js';
import './aws.lambda.js';
import './azure.js';
import './cloudflare.js';
import './cloudflare.workers.js';
import './digitalocean.js';
import './elasticstack.js';
import './equinix.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ exports[`docker > should match all dependencies 1`] = `
"aws.lambda",
"aws.s3",
"azure",
"cloudflare",
"cloudflare.workers",
"databricks",
"datadog",
"digitalocean",
Expand Down Expand Up @@ -218,6 +220,11 @@ exports[`docker > should match all dependencies 2`] = `
"bitovi/github-actions-deploy-docker-to-ec2",
"1",
],
[
"githubAction",
"cloudflare/wrangler-action",
"1",
],
[
"githubAction",
"codecov/codecov-action",
Expand Down
16 changes: 16 additions & 0 deletions src/rules/spec/nodejs/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ exports[`npm > should match everything 1`] = `
"browserstack",
"clickhouse",
"cloudflare",
"cloudflare.workers",
"contenful",
"couchbase",
"coveralls",
Expand Down Expand Up @@ -485,6 +486,11 @@ exports[`npm > should match everything 2`] = `
"@mikro-orm/mongodb",
"0.0.0",
],
[
"npm",
"@miniflare/cache",
"0.0.0",
],
[
"npm",
"@netlify/plugin-emails",
Expand Down Expand Up @@ -925,6 +931,11 @@ exports[`npm > should match everything 2`] = `
"meteor-node-stubs",
"0.0.0",
],
[
"npm",
"miniflare",
"0.0.0",
],
[
"npm",
"mithril",
Expand Down Expand Up @@ -1175,5 +1186,10 @@ exports[`npm > should match everything 2`] = `
"webpack",
"0.0.0",
],
[
"npm",
"wrangler",
"0.0.0",
],
]
`;
2 changes: 2 additions & 0 deletions src/rules/spec/terraform/__snapshots__/resource.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ exports[`terraform (resource) > should match everything 1`] = `
"aws.s3",
"aws.sns",
"aws.sqs",
"cloudflare",
"cloudflare.workers",
"datadog",
"firebase",
"firebase.firestore",
Expand Down
1 change: 1 addition & 0 deletions src/types/techs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type AllowedKeys =
| 'circleci'
| 'cirrusci'
| 'clickhouse'
| 'cloudflare.workers'
| 'cloudflare'
| 'cockroachdb'
| 'codecov'
Expand Down

0 comments on commit a4574c9

Please sign in to comment.