Purplet is open source under the Apache 2.0 License, and we welcome contributions. Before doing anything, please open an issue or talk about your ideas in #purplet-dev on Discord.
We believe the following principals when building Purplet:
- Speed is important to us, but it isn't the top priority; typedefs and developer experience are. This does not mean we can forget about performance for the means of DX.
- A handful of less lines for the developer is worth a hundred more of framework code.
- Developers should be given multiple ways to implement a given idea, but not infinite.
- Our APIs should be simple and composable. Any complex behavior should build off a simpler function (ex:
$slashCommand
is based off of$command
, an internal hook that defines and provides a handler for a generic command). - There should not be one centeral package, but instead split into smaller, reusable APIs, such as
@purplet/rest
.
Our code style is as follows:
- Use
pnpm
instead ofyarn
ornpm
(Our own code and examples. Developers may use whatever they want) - I follow Conventional Commits when naming commits. You don't have to, but it is a very nice system.
- Functions that return Purplet
Feature
s must be named with a leading$
. - No more than two parameters + an "options" object per function.
- Files are named either as the exact name of a Class definition (ex:
GatewayClient.ts
), or a description of what the file contains in kebab-case (ex:errors.ts
). In some situations, the kebab-case name is written backwards to sort them with similar files (ex: the fourhook-*.ts
files). - All files should be formatted with our Prettier config, which you can run with our
pnpm format
- All changes should be documented with Changesets
examples/
contains our example projects. If an example has a.template.json
file, it will show up in thecreate-purplet
CLI.packages/
contains our packages.- each package has a
CONTRIBUTING.md
with package-specific information.
- each package has a
sites
contains our websites, currently justpurplet.js.org
.sites/purplet.js.org/docs
contains Purplet's documentation.
For Developers:
pnpm i
to install all workspace dependenciespnpm dev
to start development mode for all packages and the documentation (port 3000)pnpm changeset
to create a changesetpnpm build
to build all packagespnpm format
to run prettier across the entire monorepopnpm lint
to run eslint across the entire monorepo
For Maintainers:
pnpm bump
to apply changesets and bump packagespnpm pub
to publish all packages