import { Accordion, OrderedList, ListItem, Text, UnorderedList, } from "@chakra-ui/react"; import type { FunctionComponent } from "react"; import { FAQ, FAQHeading, FAQItem, FAQLink } from "../../components/FAQ"; import { Page } from "../../components/Page"; import { CONSTRUCT_HUB_REPO_URL } from "../../constants/links"; export const Contribute: FunctionComponent = () => ( Contributing to Construct Hub Constructs intended for Construct Hub must be published to the{" "} npm Registry under Apache, BSD, EPL, MPL-2.0, ISC and CDDL or MIT open source licenses and annotated with a keyword recognized by Construct Hub (awscdk, cdk8s, or cdktf). Additionally, since one of the main goals of Construct Hub is to enable an ecosystem of constructs that can be consumed by all CDK languages, your library must be compiled with{" "} JSII, a TypeScript-based tool for building multi-language libraries. Construct Hub leverages the type information produced by the JSII compiler to render a rich multi-language API reference for each construct. Construct Hub continuously monitors the npm Registry. Packages that meet the above requirements appear in Construct Hub in about 30 minutes. If your package does not appear in Construct Hub, but meets these requirements, please file an issue against our{" "} GitHub repository. The community has provided some great resources about publishing construct libraries that meet Construct Hub requirements. For example, see{" "} “A Beginner's Guide to Create AWS CDK ConstructLibrary with{" "} projen” {" "} by hayao-k. If you already have a library written in TypeScript and want to migrate it to JSII so it can be included in Construct Hub, see the{" "} JSII library author guide. To improve your construct library’s visibility on Construct Hub, follow these best practices: Helpful description. Publish your library with a description. Libraries without description have lower chances to be discovered by users. When you write your library’s description, think: Why would someone use it? What makes it unique? Make the description as accurate and differentiated as possible. Helpful keywords. Publish your library with helpful keywords, ones that can help potential users to find your package. Helpful keywords can be technologies that are being used by the library, use cases the library is useful for, service names that are being used by the library etc. For example: ‘Monitoring’, ‘Kubernetes’, ‘Cost Management’, ‘Websites’, ‘AI’, ‘Containers’ and more. Helpful README. Review your library’s README file. Is it developer-friendly? That is, can developers quickly understand the use case you’re trying to solve? Does your README make it easy to get started with your library? Does it explain how your library is different from other libraries? Is it easy to understand at first glance the value developers gain from the library? For more information see *“Q: What are the best practices for a developer-friendly README file?”.* API documentation. Document the library classes, methods, properties in the library’s code. Construct Hub will display this information when it automatically generates the API documentation. Maintain your library. Developers prefer libraries that are updated on a regular basis. Our experience shows that successful libraries are those where publishers engage and collaborate with the user community, respond to issues and pull requests, fix bugs, and add capabilities. To gain more developers trust, maintain the releases section on your code repository and make sure to describe the changes between different releases. You may consider to link the libraries you’ve published with your code repository. AWS Partner Network (APN) badge. If you’re an AWS partner and you are publishing a library for your offering, please reach out to us and we will be happy to add a badge to your libraries with your company’s name. Enable support for multiple programming languages. {" "} Make your library usable by a broader set of users and increase its value to the ecosystem. Starting with your library written in TypeScript, JSII will create packages in the other CDK programming languages. Construct Hub will then automatically generate API reference and transliterate code samples. All you need to do is to follow the instructions under *“Q: How can I add my construct to Construct Hub?”.* Developer-friendly READMEs help readers quickly understand your library’s relevance to their needs and its unique value in comparison to similar libraries on the Construct Hub. Below is a suggestion for a README file structure: State and maturity of the library. Start your READMEs with helpful badges like{" "} CDK pipelines badges . It will help users see the state of your package. Short description. What does this library do? Which use case does it solve? Which technologies and services does it use or support? What is unique about this library? Help readers quickly find the right library for their needs by stating its special advantages right up front. How does it compare to other libraries addressing the same need or that use the same technologies and services? You don’t need an explicit “us vs. them” feature checklist; just make sure you communicate your library’s unique value. Code samples. Include as many complete and working code samples as you can to help developers quickly understand how they can use your library. Some developers start reading code samples before anything else. Write your code samples in TypeScript, and Construct Hub will transliterate them to the other programming languages your library supports. A good practice is to include a minimal code sample of how to use your library in the first page of your README. Author information. Share information about you, other packages you’ve published, and additional helpful links that can improve your credibility with readers. License and support. Include a “License” and “Contributing” sections that invite users to contribute via links to your source code repository and issue tracker. (Construct Hub provides “License” and “Provide Feedback” in your library’s package page, but it’s convenient to have them in the README too.) Diagrams. Diagrams always help readers quickly understand what a library does. Consider adding diagrams for libraries that create multiple services that work together. Explanatory videos. Consider sharing links to videos that can help potential customers engage with your library. Absolute links vs. relative. Use absolute links (those that start with http:// or https://) and not relative links. Relative links are prone to breaking when the content is shared elsewhere. Construct Hub includes publicly-available constructs that are JSII-compatible and that were published to the npm Registry with a permissive open-source license and a CDK keyword: aws-cdk, cdk8s, or cdktf. If you believe your package qualifies, but it does not appear in Construct Hub, please check the following: You are using JSII to compile your project. When you successfully build your project with jsii, a .jsii file should get created in the root of your project. See the{" "} JSII Library Author Guide {" "} for more information about setting up JSII. Your packaged library includes the .jsii file. If you have a .npmignore file, make sure it does not ignore{" "} .jsii. (You can add "!.jsii " to specify it should be included in the packaged library.) If you are using the files field in{" "} package.json, make sure it includes " .jsii" (this list takes precedence over{" "} .npmignore). If your package still does not appear in Construct Hub, please raise an issue{" "} here . Yes, you can and should! After you publish a new valid version to the public npm Registry, it should appear on Construct Hub in about 30 minutes. Each package is owned by its publisher, so contributions, such as bug reports and pull requests, should be made via the repository link provided by the publisher. You may press the ‘Provide feedback’ link at the package page to open a new issue in at the package’s repository. Construct Hub is itself an open-source construct! Join the{" "} Construct Hub GitHub community . You are also welcome to join the #construct-hub-dev channel in the{" "} CDK community Slack workspace Please join the{" "} CDK Slack channel. This Slack channel is managed by the CDK community, for the CDK community. );