construct-hub 0.3.194 → 0.3.195

Sign up to get free protection for your applications and to get access to all the features.
package/.jsii CHANGED
@@ -1864,7 +1864,7 @@
1864
1864
  },
1865
1865
  "name": "construct-hub",
1866
1866
  "readme": {
1867
- "markdown": "# Construct Hub\n\nThis project maintains a [AWS Cloud Development Kit][aws-cdk] construct library\nthat can be used to deploy instances of the Construct Hub in any AWS Account.\n\nThis software backs the public instance of the\n[ConstructHub](https://constructs.dev), and can be used to deploy a self-hosted\ninstance with personalized configuration.\n\n[aws-cdk]: https://github.com/aws/aws-cdk\n\n## :question: Getting Started\n\n> :warning: Disclaimer\n>\n> The [public instance of ConstructHub](https://constructs.dev) is Generally Available.\n>\n> Self-hosted ConstructHub instances are however in active development and\n> should be considered *experimental*. Breaking changes to the public API of\n> this package are expected to be released without prior notice, and the\n> infrastructure and operational posture of ConstructHub instances may also\n> significantly change.\n>\n> You are welcome to deploy self-hosted instances of ConstructHub for evaluation\n> purposes, and we welcome any feedback (good or bad) from your experience in\n> doing so.\n\n### Quick Start\n\nOnce you have installed the `construct-hub` library in your project, the\nsimplest way to get started is to create an instance of the `ConstructHub`\nconstruct:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub');\n```\n\n### Personalization\n\n#### Using a custom domain name\n\nIn order to use a custom domain for your ConstructHub instance instead of the\ndefault CloudFront domain name, specify the `domain` property with the following\nelements:\n\nAttribute | Description\n------------------------------|---------------------------------------------------------------------\n`zone` | A Route53 Hosted Zone, where DNS records will be added.\n`cert` | An Amazon Certificate Manager certificate, which must be in the `us-east-1` region.\n`monitorCertificateExpiration`| Set to `false` if you do not want an alarm to be created when the certificate is close to expiry.\n\nYour self-hosted ConstructHub instance will be served from the root of the\nprovided `zone`, so the certificate must match this name.\n\n#### Alternate package sources\n\nBy default, ConstructHub has a single package source configured: the public\n`npmjs.com` registry. Self-hosted instances typically should list packages from\nalternate sources, either in addition to packages from `npmjs.com`, or instead\nof those.\n\nThe `packageSources` property can be used to replace the default set of package\nsources configured on the instance. ConstructHub provides `IPackageSource`\nimplementations for the public `npmjs.com` registry as well as for private\nCodeArtifact repositories:\n\n```ts\nimport * as codeartifact from '@aws-cdk/aws-codeartifact';\nimport { App, Stack } from '@aws-cdk/core';\nimport { sources, ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nconst registry = new codeartifact.CfnRegistry(stack, 'Registry', {\n // ....\n});\nnew ConstructHub(stack, 'ConstructHub', {\n packageSources: [\n new sources.NpmJs(), // Remove if you do NOT want npmjs.com packages\n new sources.CodeArtifact({ registry }),\n ],\n});\n```\n\nYou may also implement a custom `IPackageSource` if you want to index packages\nfrom alternate locations. In this case, the component you provide will be\nresponsible for sending notifications to an SQS Queue about newly discovered\npackages. You may refer to the [sources.NpmJs] and [sources.CodeArtifact]\nimplementations as a reference for hos this can be done.\n\nBy default, download counts of NPM packages will be fetched periodically from\nNPM's public API by a Lambda. Since this is not desirable if you are using a\nprivate package registry, this is automatically disabled if you specify your own\nvalue for `packageSources`. (But this can be re-enabled through the\n`fetchPackageStats` property if needed).\n\n[sources.NpmJs]: src/package-sources/npmjs.ts\n[sources.CodeArtifact]: src/package-sources/code-artifact.ts\n\n#### Package deny list\n\nCertain packages may be undesirable to show in your self-hosted ConstructHub\ninstance. In order to prevent a package from ever being listed in construct hub,\nthe `denyList` property can be configured with a set of `DenyListRule` objects\nthat specify which package or package versions should never be lested:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub', {\n denyList: [\n // Denying _all_ versions of the \"sneaky-hackery\" package\n { packageName: 'sneaky-hackery', reason: 'Mines bitcoins wherever it gets installed' },\n // Denying _a specific_ version of the \"bad-release\" package\n { packageName: 'bad-release', version: '1.2.3', reason: 'CVE-####-#####' },\n ],\n});\n```\n\n#### Redirecting from additional domains\n\nYou can add additional domains that will be redirected to your primary Construct\nHub domain:\n\n```ts\nimport * as r53 from '@aws-cdk/aws-route53';\n\nconst myDomainZone = r53.HostedZone.fromHostedZoneAttributes(this, 'MyDomainZone', {\n hostedZoneId: 'AZ1234',\n zoneName: 'my.domain.com',\n});\n\nnew ConstructHub(this, 'ConstructHub', {\n additionalDomains: [ { hostedZone: myDomainZone } ]\n});\n```\n\nThis will set up full domain redirect using Amazon S3 and Amazon CloudFront. All\nrequests will be redirected to your primary Construct Hub domain.\n\n#### Decrease deployment footprint\n\nBy default, ConstructHub executes the documentation rendering process in the\ncontext of isolated subnets. This is a defense-in-depth mechanism to mitigate\nthe risks associated with downloading aribtrary (un-trusted) *npm packages* and\ntheir dependency closures.\n\nThis layer of security implies the creation of a number of resources that can\nincrease the operating cost of your self-hosted instance: several VPC endpoints\nare created, an internal CodeArtifact repository needs to be provisioned, etc...\n\nWhile we generally recommend leaving these features enabled, if your self-hosted\nConstructHub instance only indexes *trusted* packages (as could be the case for\nan instance that does not list packages from the public `npmjs.com` registry),\nyou may set the `isolateLambdas` setting to `false`.\n\n## :gear: Operating a self-hosted instance\n\n1. [Application Overview](./docs/application-overview.md) provides a high-level\n description of the components that make a ConstructHub instance. This is a\n great starting point for people who consider operating a self-hosted instance\n of ConstructHub; and for new operators on-boarding the platform.\n\n1. [Operator Runbook](./docs/operator-runbook.md) is a series of diagnostics and\n troubleshooting guides indended for operators to have a quick and easy way to\n navigate a ConstructHub instance when they are reacting to an alarm or bug\n report.\n\n### :baby_chick: Deployment Canaries\n\nConstruct Hub provides several built-in validation mechanisms to make sure the\ndeployment of your instance is continuously operating as expected.\n\nThese mechanisms come in the form of canary testers that are part of the\nConstructHub deployment stack. Each canary runs periodically and performs a\ndifferent check, triggering a different CloudWatch alarm in case it detects a\nfailure.\n\nWe recommend that you use staged deployments, and block promotions to the\nproduction stage in case any preivous stage triggers an alarm within a specific\ntimeframe.\n\n#### Discovery Canary\n\nWhen configuring an `NpmJs` package source, a package discovery canary can be\nenabled using the `enableCanary` property (and optionally configured using the\n`canaryPackage` and `canarySla` properties). This feature is activated by\ndefault and monitors availability of releases of the `construct-hub-probe` npm\npackage in the ConstructHub instance.\n\nProbe packages, such as `construct-hub-probe` are published frequently (e.g:\nevery 3 hours or more frequently), and can be used to ensure the ConstructHub\ninstance correctly discovers, indexes and represents those packages.\n\nIf a different package or SLA should be used, you can configure the `NpmJs`\npackage source manually like so:\n\n```ts\nimport * as codeartifact from '@aws-cdk/aws-codeartifact';\nimport { App, Stack } from '@aws-cdk/core';\nimport { sources, ConstructHub } from 'construct-hub';\n\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\nnew ConstructHub(stack, 'ConstructHub', {\n // ...\n packageSources: [\n // ...\n new sources.NpmJs({\n enableCanary: true, // This is the default\n canaryPackage: '@acme/my-constructhub-probe',\n canarySla: Duration.minutes(30),\n }),\n // ...\n ],\n // ...\n});\n```\n\nIn case the new package isn't fully available in the predefined SLA, a\n**high severity** CloudWatch alarm will trigger, which will in turn trigger\nthe configured action for low severity alarms.\n\n> See [Monitoring & Alarms](./docs/application-overview.md#monitoring--alarming)\n\nThe operator runbook contains [instructions](./docs/operator-runbook.md) on how\nto diagnose and mitigate the root cause of the failure.\n\n### :nail_care: Customizing the frontend\n\nThere are a number of customizations available in order to make your private\nconstruct hub better tailored to your organization.\n\n#### Package Tags\n\nConfiguring package tags allows you to compute additional labels to be applied\nto packages. These can be used to indicate to users which packages are owned by\ntrusted organizations, or any other arbitrary conditions, and can be referenced\nwhile searching.\n\nFor example:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n id: 'official',\n condition: TagCondition.field('name').eq('construct-hub'),\n keyword: {\n label: 'Official',\n color: '#00FF00',\n },\n highlight: {\n label: 'Vended by AWS',\n color: '#00FF00',\n }\n }]\n});\n```\n\nThe above example will result in packages with the `name` of `construct-hub` to\nreceive the `Official` tag, which is colored green and displayed amongst the\nlist of keywords. Additionally the `highlight` key shows this as a highlighted\nitem on the package's card.\n\nThe `searchFilter` key can also be used to show tags as search filters grouped\ntogether.\n\n```ts\nconst authorsGroup = new PackageTagGroup(\"authors\", {\n label: \"Authors\",\n tooltip: \"Information about the authors filter\",\n filterType: FilterType.checkbox(),\n});\n\nconst isAws = TagCondition.field('name').eq('construct-hub');\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n id: 'AWS',\n condition: isAws,\n searchFilter: {\n group: authorsGroup,\n display: 'AWS',\n },\n }, {\n id: 'Community',\n condition: TagCondition.not(isAws),\n searchFilter: {\n group: authorsGroup,\n display: 'AWS',\n },\n }]\n});\n```\n\nThe above will show a list of `Authors` filters on the search results page\nwith a checkbox for each `AWS` and `Community` packages, allowing users to\nfilter results by the presence of these tags.\n\nCombinations of conditions are also supported:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n label: 'Official',\n color: '#00FF00',\n condition: TagCondition.or(\n TagCondition.field('name').eq('construct-hub'),\n TagCondition.field('name').eq('construct-hub-webapp'),\n ),\n }]\n});\n\n// or more succintly if you have a long list\ncondition: TagCondition.or(\n ...['construct-hub', 'construct-hub-webapp', '...',]\n .map(name => TagCondition.field('name').eq(name))\n),\n```\n\nYou can assert against any value within package json including nested ones.\n\n```ts\nTagCondition.field('constructHub', 'nested', 'key').eq('value');\n\n// checks\npackageJson?.constructHub?.nested?.key === value;\n```\n\n#### Package Links\n\nConfiguring package links allows you to replace the `Repository`, `License`,\nand `Registry` links on the package details page with whatever you choose.\n\nFor example:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageLinks: [{\n linkLabel: 'Service Level Agreement',\n configKey: 'SLA',\n }, {\n linkLabel: 'Contact',\n configKey: 'Contact',\n linkText: 'Email Me!',\n allowedDomains: ['me.com'],\n }]\n});\n```\n\nThis would allow publishers to add the following to their package.json:\n\n```json\n\"constructHub\": {\n \"packageLinks\": {\n \"SLA\": \"https://support.mypackage.com\",\n \"Contact\": \"me.com/contact\"\n }\n}\n```\n\nThen the links on the corresponding package page would show these items as\nconfigured.\n\n#### Home Page\n\nThe home page is divided into sections, each with a header and list of packages.\nCurrently, for a given section you can display either the most recently updated\npackages, or a curated list of packages.\n\nFor example:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n featuredPackages: {\n sections: [\n {\n name: \"Recently updated\",\n showLastUpdated: 4\n },\n {\n name: \"From the AWS CDK\",\n showPackages: [\n {\n name: \"@aws-cdk/core\"\n },\n {\n name: \"@aws-cdk/aws-s3\",\n comment: \"One of the most popular AWS CDK libraries!\"\n },\n {\n name: \"@aws-cdk/aws-lambda\"\n },\n {\n name: \"@aws-cdk/pipelines\"\n comment: \"The pipelines L3 construct library abstracts away many of the details of managing software deployment within AWS.\"\n }\n ]\n }\n ]\n }\n});\n```\n\n#### Browse Categories\n\nThe Construct Hub home page includes a section that displays a set of buttons\nthat represent browsing categories (e.g. \"Databases\", \"Monitoring\",\n\"Serverless\", etc).\n\nYou can use the `categories` option to configure these categories. Each category\nis defined by a `title` and a `url`, which will be the link associated with the\nbutton.\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n categories: [\n { title: 'Databases', url: '?keywords=databases' },\n { title: 'Monitoring', url: '?q=monitoring' },\n { title: 'Partners', url: '?tags=aws-partner' }\n ]\n});\n```\n\n#### Feature Flags\n\nFeature flags for the web app can be used to enable or disable experimental\nfeatures. These can be customized through the `featureFlags` property - for\nmore information about the available flags, check the documentation for\n<https://github.com/cdklabs/construct-hub-webapp/>.\n\n## :raised_hand: Contributing\n\nIf you are looking to contribute to this project, but don't know where to start,\nhave a look at our [contributing guide](CONTRIBUTING.md)!\n\n## :cop: Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n## :balance_scale: License\n\nThis project is licensed under the Apache-2.0 License.\n"
1867
+ "markdown": "# Construct Hub\n\nThis project maintains a [AWS Cloud Development Kit][aws-cdk] construct library\nthat can be used to deploy instances of the Construct Hub in any AWS Account.\n\nThis software backs the public instance of the\n[ConstructHub](https://constructs.dev), and can be used to deploy a self-hosted\ninstance with personalized configuration.\n\n[aws-cdk]: https://github.com/aws/aws-cdk\n\n## :question: Getting Started\n\n> :warning: Disclaimer\n>\n> The [public instance of ConstructHub](https://constructs.dev) is Generally Available.\n>\n> Self-hosted ConstructHub instances are however in active development and\n> should be considered *experimental*. Breaking changes to the public API of\n> this package are expected to be released without prior notice, and the\n> infrastructure and operational posture of ConstructHub instances may also\n> significantly change.\n>\n> You are welcome to deploy self-hosted instances of ConstructHub for evaluation\n> purposes, and we welcome any feedback (good or bad) from your experience in\n> doing so.\n\n### Quick Start\n\nOnce you have installed the `construct-hub` library in your project, the\nsimplest way to get started is to create an instance of the `ConstructHub`\nconstruct:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub');\n```\n\n### Personalization\n\n#### Using a custom domain name\n\nIn order to use a custom domain for your ConstructHub instance instead of the\ndefault CloudFront domain name, specify the `domain` property with the following\nelements:\n\nAttribute | Description\n------------------------------|---------------------------------------------------------------------\n`zone` | A Route53 Hosted Zone, where DNS records will be added.\n`cert` | An Amazon Certificate Manager certificate, which must be in the `us-east-1` region.\n`monitorCertificateExpiration`| Set to `false` if you do not want an alarm to be created when the certificate is close to expiry.\n\nYour self-hosted ConstructHub instance will be served from the root of the\nprovided `zone`, so the certificate must match this name.\n\n#### Alternate package sources\n\nBy default, ConstructHub has a single package source configured: the public\n`npmjs.com` registry. Self-hosted instances typically should list packages from\nalternate sources, either in addition to packages from `npmjs.com`, or instead\nof those.\n\nThe `packageSources` property can be used to replace the default set of package\nsources configured on the instance. ConstructHub provides `IPackageSource`\nimplementations for the public `npmjs.com` registry as well as for private\nCodeArtifact repositories:\n\n```ts\nimport * as codeartifact from '@aws-cdk/aws-codeartifact';\nimport { App, Stack } from '@aws-cdk/core';\nimport { sources, ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nconst registry = new codeartifact.CfnRegistry(stack, 'Registry', {\n // ....\n});\nnew ConstructHub(stack, 'ConstructHub', {\n packageSources: [\n new sources.NpmJs(), // Remove if you do NOT want npmjs.com packages\n new sources.CodeArtifact({ registry }),\n ],\n});\n```\n\nYou may also implement a custom `IPackageSource` if you want to index packages\nfrom alternate locations. In this case, the component you provide will be\nresponsible for sending notifications to an SQS Queue about newly discovered\npackages. You may refer to the [sources.NpmJs] and [sources.CodeArtifact]\nimplementations as a reference for hos this can be done.\n\nBy default, download counts of NPM packages will be fetched periodically from\nNPM's public API by a Lambda. Since this is not desirable if you are using a\nprivate package registry, this is automatically disabled if you specify your own\nvalue for `packageSources`. (But this can be re-enabled through the\n`fetchPackageStats` property if needed).\n\n[sources.NpmJs]: src/package-sources/npmjs.ts\n[sources.CodeArtifact]: src/package-sources/code-artifact.ts\n\n#### Package deny list\n\nCertain packages may be undesirable to show in your self-hosted ConstructHub\ninstance. In order to prevent a package from ever being listed in construct hub,\nthe `denyList` property can be configured with a set of `DenyListRule` objects\nthat specify which package or package versions should never be lested:\n\n```ts\nimport { App, Stack } from '@aws-cdk/core';\nimport { ConstructHub } from 'construct-hub';\n\n// The usual... you might have used `cdk init app` instead!\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\n// Now to business!\nnew ConstructHub(stack, 'ConstructHub', {\n denyList: [\n // Denying _all_ versions of the \"sneaky-hackery\" package\n { packageName: 'sneaky-hackery', reason: 'Mines bitcoins wherever it gets installed' },\n // Denying _a specific_ version of the \"bad-release\" package\n { packageName: 'bad-release', version: '1.2.3', reason: 'CVE-####-#####' },\n ],\n});\n```\n\n#### Redirecting from additional domains\n\nYou can add additional domains that will be redirected to your primary Construct\nHub domain:\n\n```ts\nimport * as r53 from '@aws-cdk/aws-route53';\n\nconst myDomainZone = r53.HostedZone.fromHostedZoneAttributes(this, 'MyDomainZone', {\n hostedZoneId: 'AZ1234',\n zoneName: 'my.domain.com',\n});\n\nnew ConstructHub(this, 'ConstructHub', {\n additionalDomains: [ { hostedZone: myDomainZone } ]\n});\n```\n\nThis will set up full domain redirect using Amazon S3 and Amazon CloudFront. All\nrequests will be redirected to your primary Construct Hub domain.\n\n#### Decrease deployment footprint\n\nBy default, ConstructHub executes the documentation rendering process in the\ncontext of isolated subnets. This is a defense-in-depth mechanism to mitigate\nthe risks associated with downloading aribtrary (un-trusted) *npm packages* and\ntheir dependency closures.\n\nThis layer of security implies the creation of a number of resources that can\nincrease the operating cost of your self-hosted instance: several VPC endpoints\nare created, an internal CodeArtifact repository needs to be provisioned, etc...\n\nWhile we generally recommend leaving these features enabled, if your self-hosted\nConstructHub instance only indexes *trusted* packages (as could be the case for\nan instance that does not list packages from the public `npmjs.com` registry),\nyou may set the `isolateLambdas` setting to `false`.\n\n## :gear: Operating a self-hosted instance\n\n1. [Application Overview](./docs/application-overview.md) provides a high-level\n description of the components that make a ConstructHub instance. This is a\n great starting point for people who consider operating a self-hosted instance\n of ConstructHub; and for new operators on-boarding the platform.\n\n1. [Operator Runbook](./docs/operator-runbook.md) is a series of diagnostics and\n troubleshooting guides indended for operators to have a quick and easy way to\n navigate a ConstructHub instance when they are reacting to an alarm or bug\n report.\n\n### :baby_chick: Deployment Canaries\n\nConstruct Hub provides several built-in validation mechanisms to make sure the\ndeployment of your instance is continuously operating as expected.\n\nThese mechanisms come in the form of canary testers that are part of the\nConstructHub deployment stack. Each canary runs periodically and performs a\ndifferent check, triggering a different CloudWatch alarm in case it detects a\nfailure.\n\nWe recommend that you use staged deployments, and block promotions to the\nproduction stage in case any preivous stage triggers an alarm within a specific\ntimeframe.\n\n#### Discovery Canary\n\nWhen configuring an `NpmJs` package source, a package discovery canary can be\nenabled using the `enableCanary` property (and optionally configured using the\n`canaryPackage` and `canarySla` properties). This feature is activated by\ndefault and monitors availability of releases of the `construct-hub-probe` npm\npackage in the ConstructHub instance.\n\nProbe packages, such as `construct-hub-probe` are published frequently (e.g:\nevery 3 hours or more frequently), and can be used to ensure the ConstructHub\ninstance correctly discovers, indexes and represents those packages.\n\nIf a different package or SLA should be used, you can configure the `NpmJs`\npackage source manually like so:\n\n```ts\nimport * as codeartifact from '@aws-cdk/aws-codeartifact';\nimport { App, Stack } from '@aws-cdk/core';\nimport { sources, ConstructHub } from 'construct-hub';\n\nconst app = new App();\nconst stack = new Stack(app, 'StackName', { /* ... */ });\n\nnew ConstructHub(stack, 'ConstructHub', {\n // ...\n packageSources: [\n // ...\n new sources.NpmJs({\n enableCanary: true, // This is the default\n canaryPackage: '@acme/my-constructhub-probe',\n canarySla: Duration.minutes(30),\n }),\n // ...\n ],\n // ...\n});\n```\n\nIn case the new package isn't fully available in the predefined SLA, a\n**high severity** CloudWatch alarm will trigger, which will in turn trigger\nthe configured action for low severity alarms.\n\n> See [Monitoring & Alarms](./docs/application-overview.md#monitoring--alarming)\n\nThe operator runbook contains [instructions](./docs/operator-runbook.md) on how\nto diagnose and mitigate the root cause of the failure.\n\n### :nail_care: Customizing the frontend\n\nThere are a number of customizations available in order to make your private\nconstruct hub better tailored to your organization.\n\n#### Package Tags\n\nConfiguring package tags allows you to compute additional labels to be applied\nto packages. These can be used to indicate to users which packages are owned by\ntrusted organizations, or any other arbitrary conditions, and can be referenced\nwhile searching.\n\nFor example:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n id: 'official',\n condition: TagCondition.field('name').eq('construct-hub'),\n keyword: {\n label: 'Official',\n color: '#00FF00',\n },\n highlight: {\n label: 'Vended by AWS',\n color: '#00FF00',\n }\n }]\n});\n```\n\nThe above example will result in packages with the `name` of `construct-hub` to\nreceive the `Official` tag, which is colored green and displayed amongst the\nlist of keywords. Additionally the `highlight` key shows this as a highlighted\nitem on the package's card.\n\nThe `searchFilter` key can also be used to show tags as search filters grouped\ntogether.\n\n```ts\nconst authorsGroup = new PackageTagGroup(\"authors\", {\n label: \"Authors\",\n tooltip: \"Information about the authors filter\",\n filterType: FilterType.checkbox(),\n});\n\nconst isAws = TagCondition.field('name').eq('construct-hub');\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n id: 'AWS',\n condition: isAws,\n searchFilter: {\n group: authorsGroup,\n display: 'AWS',\n },\n }, {\n id: 'Community',\n condition: TagCondition.not(isAws),\n searchFilter: {\n group: authorsGroup,\n display: 'AWS',\n },\n }]\n});\n```\n\nThe above will show a list of `Authors` filters on the search results page\nwith a checkbox for each `AWS` and `Community` packages, allowing users to\nfilter results by the presence of these tags.\n\nCombinations of conditions are also supported:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageTags: [{\n label: 'Official',\n color: '#00FF00',\n condition: TagCondition.or(\n TagCondition.field('name').eq('construct-hub'),\n TagCondition.field('name').eq('construct-hub-webapp'),\n ),\n }]\n});\n\n// or more succintly if you have a long list\ncondition: TagCondition.or(\n ...['construct-hub', 'construct-hub-webapp', '...',]\n .map(name => TagCondition.field('name').eq(name))\n),\n```\n\nYou can assert against any value within package json including nested ones.\n\n```ts\nTagCondition.field('constructHub', 'nested', 'key').eq('value');\n\n// checks\npackageJson?.constructHub?.nested?.key === value;\n```\n\nYou can also assert that a string occurs at least a certain number of times\nwithin the package's README.\n\n```ts\nTagCondition.readme().includes('ECS');\nTagCondition.readme().includes('fargate', { atLeast: 3, caseSensitive: false });\n```\n\n#### Package Links\n\nConfiguring package links allows you to replace the `Repository`, `License`,\nand `Registry` links on the package details page with whatever you choose.\n\nFor example:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n packageLinks: [{\n linkLabel: 'Service Level Agreement',\n configKey: 'SLA',\n }, {\n linkLabel: 'Contact',\n configKey: 'Contact',\n linkText: 'Email Me!',\n allowedDomains: ['me.com'],\n }]\n});\n```\n\nThis would allow publishers to add the following to their package.json:\n\n```json\n\"constructHub\": {\n \"packageLinks\": {\n \"SLA\": \"https://support.mypackage.com\",\n \"Contact\": \"me.com/contact\"\n }\n}\n```\n\nThen the links on the corresponding package page would show these items as\nconfigured.\n\n#### Home Page\n\nThe home page is divided into sections, each with a header and list of packages.\nCurrently, for a given section you can display either the most recently updated\npackages, or a curated list of packages.\n\nFor example:\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n featuredPackages: {\n sections: [\n {\n name: \"Recently updated\",\n showLastUpdated: 4\n },\n {\n name: \"From the AWS CDK\",\n showPackages: [\n {\n name: \"@aws-cdk/core\"\n },\n {\n name: \"@aws-cdk/aws-s3\",\n comment: \"One of the most popular AWS CDK libraries!\"\n },\n {\n name: \"@aws-cdk/aws-lambda\"\n },\n {\n name: \"@aws-cdk/pipelines\"\n comment: \"The pipelines L3 construct library abstracts away many of the details of managing software deployment within AWS.\"\n }\n ]\n }\n ]\n }\n});\n```\n\n#### Browse Categories\n\nThe Construct Hub home page includes a section that displays a set of buttons\nthat represent browsing categories (e.g. \"Databases\", \"Monitoring\",\n\"Serverless\", etc).\n\nYou can use the `categories` option to configure these categories. Each category\nis defined by a `title` and a `url`, which will be the link associated with the\nbutton.\n\n```ts\nnew ConstructHub(this, \"ConstructHub\", {\n ...myProps,\n categories: [\n { title: 'Databases', url: '?keywords=databases' },\n { title: 'Monitoring', url: '?q=monitoring' },\n { title: 'Partners', url: '?tags=aws-partner' }\n ]\n});\n```\n\n#### Feature Flags\n\nFeature flags for the web app can be used to enable or disable experimental\nfeatures. These can be customized through the `featureFlags` property - for\nmore information about the available flags, check the documentation for\n<https://github.com/cdklabs/construct-hub-webapp/>.\n\n## :raised_hand: Contributing\n\nIf you are looking to contribute to this project, but don't know where to start,\nhave a look at our [contributing guide](CONTRIBUTING.md)!\n\n## :cop: Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more\ninformation.\n\n## :balance_scale: License\n\nThis project is licensed under the Apache-2.0 License.\n"
1868
1868
  },
1869
1869
  "repository": {
1870
1870
  "type": "git",
@@ -4060,7 +4060,7 @@
4060
4060
  "kind": "interface",
4061
4061
  "locationInModule": {
4062
4062
  "filename": "src/package-tag/index.ts",
4063
- "line": 93
4063
+ "line": 100
4064
4064
  },
4065
4065
  "name": "PackageTagConfig",
4066
4066
  "properties": [
@@ -4072,7 +4072,7 @@
4072
4072
  "immutable": true,
4073
4073
  "locationInModule": {
4074
4074
  "filename": "src/package-tag/index.ts",
4075
- "line": 94
4075
+ "line": 101
4076
4076
  },
4077
4077
  "name": "condition",
4078
4078
  "type": {
@@ -13349,7 +13349,7 @@
13349
13349
  "kind": "class",
13350
13350
  "locationInModule": {
13351
13351
  "filename": "src/package-tag/index.ts",
13352
- "line": 100
13352
+ "line": 107
13353
13353
  },
13354
13354
  "methods": [
13355
13355
  {
@@ -13359,7 +13359,7 @@
13359
13359
  },
13360
13360
  "locationInModule": {
13361
13361
  "filename": "src/package-tag/index.ts",
13362
- "line": 105
13362
+ "line": 112
13363
13363
  },
13364
13364
  "name": "and",
13365
13365
  "parameters": [
@@ -13386,7 +13386,7 @@
13386
13386
  },
13387
13387
  "locationInModule": {
13388
13388
  "filename": "src/package-tag/index.ts",
13389
- "line": 130
13389
+ "line": 137
13390
13390
  },
13391
13391
  "name": "field",
13392
13392
  "parameters": [
@@ -13414,7 +13414,7 @@
13414
13414
  },
13415
13415
  "locationInModule": {
13416
13416
  "filename": "src/package-tag/index.ts",
13417
- "line": 120
13417
+ "line": 127
13418
13418
  },
13419
13419
  "name": "not",
13420
13420
  "parameters": [
@@ -13441,7 +13441,7 @@
13441
13441
  },
13442
13442
  "locationInModule": {
13443
13443
  "filename": "src/package-tag/index.ts",
13444
- "line": 113
13444
+ "line": 120
13445
13445
  },
13446
13446
  "name": "or",
13447
13447
  "parameters": [
@@ -13461,6 +13461,23 @@
13461
13461
  "static": true,
13462
13462
  "variadic": true
13463
13463
  },
13464
+ {
13465
+ "docs": {
13466
+ "stability": "experimental",
13467
+ "summary": "Create a condition with logic targeting the README of the package."
13468
+ },
13469
+ "locationInModule": {
13470
+ "filename": "src/package-tag/index.ts",
13471
+ "line": 144
13472
+ },
13473
+ "name": "readme",
13474
+ "returns": {
13475
+ "type": {
13476
+ "fqn": "construct-hub.TagConditionReadme"
13477
+ }
13478
+ },
13479
+ "static": true
13480
+ },
13464
13481
  {
13465
13482
  "abstract": true,
13466
13483
  "docs": {
@@ -13468,7 +13485,7 @@
13468
13485
  },
13469
13486
  "locationInModule": {
13470
13487
  "filename": "src/package-tag/index.ts",
13471
- "line": 134
13488
+ "line": 148
13472
13489
  },
13473
13490
  "name": "bind",
13474
13491
  "returns": {
@@ -13492,7 +13509,7 @@
13492
13509
  "kind": "interface",
13493
13510
  "locationInModule": {
13494
13511
  "filename": "src/package-tag/index.ts",
13495
- "line": 82
13512
+ "line": 87
13496
13513
  },
13497
13514
  "name": "TagConditionConfig",
13498
13515
  "properties": [
@@ -13504,7 +13521,7 @@
13504
13521
  "immutable": true,
13505
13522
  "locationInModule": {
13506
13523
  "filename": "src/package-tag/index.ts",
13507
- "line": 83
13524
+ "line": 88
13508
13525
  },
13509
13526
  "name": "type",
13510
13527
  "type": {
@@ -13519,7 +13536,7 @@
13519
13536
  "immutable": true,
13520
13537
  "locationInModule": {
13521
13538
  "filename": "src/package-tag/index.ts",
13522
- "line": 86
13539
+ "line": 93
13523
13540
  },
13524
13541
  "name": "children",
13525
13542
  "optional": true,
@@ -13540,7 +13557,7 @@
13540
13557
  "immutable": true,
13541
13558
  "locationInModule": {
13542
13559
  "filename": "src/package-tag/index.ts",
13543
- "line": 84
13560
+ "line": 90
13544
13561
  },
13545
13562
  "name": "key",
13546
13563
  "optional": true,
@@ -13561,7 +13578,44 @@
13561
13578
  "immutable": true,
13562
13579
  "locationInModule": {
13563
13580
  "filename": "src/package-tag/index.ts",
13564
- "line": 85
13581
+ "line": 92
13582
+ },
13583
+ "name": "options",
13584
+ "optional": true,
13585
+ "type": {
13586
+ "collection": {
13587
+ "elementtype": {
13588
+ "primitive": "any"
13589
+ },
13590
+ "kind": "map"
13591
+ }
13592
+ }
13593
+ },
13594
+ {
13595
+ "abstract": true,
13596
+ "docs": {
13597
+ "stability": "experimental"
13598
+ },
13599
+ "immutable": true,
13600
+ "locationInModule": {
13601
+ "filename": "src/package-tag/index.ts",
13602
+ "line": 89
13603
+ },
13604
+ "name": "source",
13605
+ "optional": true,
13606
+ "type": {
13607
+ "fqn": "construct-hub.TagConditionSource"
13608
+ }
13609
+ },
13610
+ {
13611
+ "abstract": true,
13612
+ "docs": {
13613
+ "stability": "experimental"
13614
+ },
13615
+ "immutable": true,
13616
+ "locationInModule": {
13617
+ "filename": "src/package-tag/index.ts",
13618
+ "line": 91
13565
13619
  },
13566
13620
  "name": "value",
13567
13621
  "optional": true,
@@ -13585,7 +13639,7 @@
13585
13639
  },
13586
13640
  "locationInModule": {
13587
13641
  "filename": "src/package-tag/index.ts",
13588
- "line": 189
13642
+ "line": 207
13589
13643
  },
13590
13644
  "parameters": [
13591
13645
  {
@@ -13604,7 +13658,7 @@
13604
13658
  "kind": "class",
13605
13659
  "locationInModule": {
13606
13660
  "filename": "src/package-tag/index.ts",
13607
- "line": 188
13661
+ "line": 206
13608
13662
  },
13609
13663
  "methods": [
13610
13664
  {
@@ -13614,7 +13668,7 @@
13614
13668
  },
13615
13669
  "locationInModule": {
13616
13670
  "filename": "src/package-tag/index.ts",
13617
- "line": 195
13671
+ "line": 213
13618
13672
  },
13619
13673
  "name": "eq",
13620
13674
  "parameters": [
@@ -13638,7 +13692,7 @@
13638
13692
  },
13639
13693
  "locationInModule": {
13640
13694
  "filename": "src/package-tag/index.ts",
13641
- "line": 208
13695
+ "line": 227
13642
13696
  },
13643
13697
  "name": "includes",
13644
13698
  "parameters": [
@@ -13647,6 +13701,13 @@
13647
13701
  "type": {
13648
13702
  "primitive": "any"
13649
13703
  }
13704
+ },
13705
+ {
13706
+ "name": "options",
13707
+ "optional": true,
13708
+ "type": {
13709
+ "fqn": "construct-hub.TagConditionIncludesOptions"
13710
+ }
13650
13711
  }
13651
13712
  ],
13652
13713
  "returns": {
@@ -13662,7 +13723,7 @@
13662
13723
  },
13663
13724
  "locationInModule": {
13664
13725
  "filename": "src/package-tag/index.ts",
13665
- "line": 221
13726
+ "line": 242
13666
13727
  },
13667
13728
  "name": "startsWith",
13668
13729
  "parameters": [
@@ -13683,6 +13744,61 @@
13683
13744
  "name": "TagConditionField",
13684
13745
  "symbolId": "src/package-tag/index:TagConditionField"
13685
13746
  },
13747
+ "construct-hub.TagConditionIncludesOptions": {
13748
+ "assembly": "construct-hub",
13749
+ "datatype": true,
13750
+ "docs": {
13751
+ "stability": "experimental",
13752
+ "summary": "Options for `includes` operator."
13753
+ },
13754
+ "fqn": "construct-hub.TagConditionIncludesOptions",
13755
+ "kind": "interface",
13756
+ "locationInModule": {
13757
+ "filename": "src/package-tag/index.ts",
13758
+ "line": 276
13759
+ },
13760
+ "name": "TagConditionIncludesOptions",
13761
+ "properties": [
13762
+ {
13763
+ "abstract": true,
13764
+ "docs": {
13765
+ "default": "1",
13766
+ "stability": "experimental",
13767
+ "summary": "The value must appear at least this many times."
13768
+ },
13769
+ "immutable": true,
13770
+ "locationInModule": {
13771
+ "filename": "src/package-tag/index.ts",
13772
+ "line": 281
13773
+ },
13774
+ "name": "atLeast",
13775
+ "optional": true,
13776
+ "type": {
13777
+ "primitive": "number"
13778
+ }
13779
+ },
13780
+ {
13781
+ "abstract": true,
13782
+ "docs": {
13783
+ "default": "false",
13784
+ "remarks": "This option\nis ignored if the value we are checking is an array.",
13785
+ "stability": "experimental",
13786
+ "summary": "String matches must match the casing of the original string."
13787
+ },
13788
+ "immutable": true,
13789
+ "locationInModule": {
13790
+ "filename": "src/package-tag/index.ts",
13791
+ "line": 288
13792
+ },
13793
+ "name": "caseSensitive",
13794
+ "optional": true,
13795
+ "type": {
13796
+ "primitive": "boolean"
13797
+ }
13798
+ }
13799
+ ],
13800
+ "symbolId": "src/package-tag/index:TagConditionIncludesOptions"
13801
+ },
13686
13802
  "construct-hub.TagConditionLogicType": {
13687
13803
  "assembly": "construct-hub",
13688
13804
  "docs": {
@@ -13693,7 +13809,7 @@
13693
13809
  "kind": "enum",
13694
13810
  "locationInModule": {
13695
13811
  "filename": "src/package-tag/index.ts",
13696
- "line": 140
13812
+ "line": 154
13697
13813
  },
13698
13814
  "members": [
13699
13815
  {
@@ -13736,6 +13852,91 @@
13736
13852
  "name": "TagConditionLogicType",
13737
13853
  "symbolId": "src/package-tag/index:TagConditionLogicType"
13738
13854
  },
13855
+ "construct-hub.TagConditionReadme": {
13856
+ "assembly": "construct-hub",
13857
+ "docs": {
13858
+ "stability": "experimental",
13859
+ "summary": "Target the README of the package to dictate whether a tag is relevant."
13860
+ },
13861
+ "fqn": "construct-hub.TagConditionReadme",
13862
+ "initializer": {
13863
+ "docs": {
13864
+ "stability": "experimental"
13865
+ },
13866
+ "locationInModule": {
13867
+ "filename": "src/package-tag/index.ts",
13868
+ "line": 256
13869
+ }
13870
+ },
13871
+ "kind": "class",
13872
+ "locationInModule": {
13873
+ "filename": "src/package-tag/index.ts",
13874
+ "line": 255
13875
+ },
13876
+ "methods": [
13877
+ {
13878
+ "docs": {
13879
+ "stability": "experimental",
13880
+ "summary": "Create a `readme.includes(value)` condition which applies if the README includes the specified string."
13881
+ },
13882
+ "locationInModule": {
13883
+ "filename": "src/package-tag/index.ts",
13884
+ "line": 262
13885
+ },
13886
+ "name": "includes",
13887
+ "parameters": [
13888
+ {
13889
+ "name": "value",
13890
+ "type": {
13891
+ "primitive": "string"
13892
+ }
13893
+ },
13894
+ {
13895
+ "name": "options",
13896
+ "optional": true,
13897
+ "type": {
13898
+ "fqn": "construct-hub.TagConditionIncludesOptions"
13899
+ }
13900
+ }
13901
+ ],
13902
+ "returns": {
13903
+ "type": {
13904
+ "fqn": "construct-hub.TagCondition"
13905
+ }
13906
+ }
13907
+ }
13908
+ ],
13909
+ "name": "TagConditionReadme",
13910
+ "symbolId": "src/package-tag/index:TagConditionReadme"
13911
+ },
13912
+ "construct-hub.TagConditionSource": {
13913
+ "assembly": "construct-hub",
13914
+ "docs": {
13915
+ "stability": "experimental"
13916
+ },
13917
+ "fqn": "construct-hub.TagConditionSource",
13918
+ "kind": "enum",
13919
+ "locationInModule": {
13920
+ "filename": "src/package-tag/index.ts",
13921
+ "line": 79
13922
+ },
13923
+ "members": [
13924
+ {
13925
+ "docs": {
13926
+ "stability": "experimental"
13927
+ },
13928
+ "name": "PACKAGE_JSON"
13929
+ },
13930
+ {
13931
+ "docs": {
13932
+ "stability": "experimental"
13933
+ },
13934
+ "name": "README"
13935
+ }
13936
+ ],
13937
+ "name": "TagConditionSource",
13938
+ "symbolId": "src/package-tag/index:TagConditionSource"
13939
+ },
13739
13940
  "construct-hub.sources.CodeArtifact": {
13740
13941
  "assembly": "construct-hub",
13741
13942
  "docs": {
@@ -14343,6 +14544,6 @@
14343
14544
  "symbolId": "src/package-sources/npmjs:NpmJsProps"
14344
14545
  }
14345
14546
  },
14346
- "version": "0.3.194",
14347
- "fingerprint": "Za55BQn8YFM0USRfSsRxP5ysCUMGTaNwbAL8ghIEEPo="
14547
+ "version": "0.3.195",
14548
+ "fingerprint": "RgDJMCAMgA0nSAsEUTxHMMiSHF69bNRDt0/b2jrtOzo="
14348
14549
  }