1.0.0 • Published 5 months ago

@floydspace/projen-components v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

@floydspace/projen-components

A collection of cool projen components

License npm npm downloads FOSSA Status

GitHub Actions Workflow Status GitHub issues GitHub pull requests codecov

Conventional Commits code style: prettier Contributor Covenant

I love badges

Installation & Usage

  1. If you don't have projen installed and configured, you'll need to go do that first.

  2. Add @floydspace/projen-components to you development dependencies. e.g., in your .projenrc.ts

const project = new TypeScriptProject({
  //...
  devDeps: [
    //...
    "@floydspace/projen-components",
  ],
  //...
});

or

const project = new TypeScriptProject({
  //...
});
project.addDevDeps("@floydspace/projen-components");
  1. Run npx projen to regenerate the project files

  2. Add the components to you project in your .projenrc.ts file. For example, to add all the recommended components, add Recommended

import { Recommended } from "@floydspace/projen-components";

//...

const project = new TypeScriptProject({
  ...Recommended.defaultProjectOptions,
  //...
});

new Recommended(project);

//...

project.synth();

or you can add individual components

import { Husky, EslintUnicorn } from "@floydspace/projen-components";

//...

const project = new TypeScriptProject({
  ...EslintUnicorn.defaultProjectOptions,
  //...
});

new Husky(project);
new EslintUnicorn(project);

//...

project.synth();
  1. Run npx projen to generate the project files

Components

ComponentFunctionalityUsesBase Project Type RequiredIncluded in Recommended
ChangesetsAdds Changesets to your projectchangesetsNodeProject
CodeOfConductAdd a Contributor Covenant v2.1 CODE_OF_CONDUCT.md to your project.*NOTE: CodeOfConduct is not automatically included in the Recommended component because we believe adopting the Contributor Covenant should be a conscious deliberate decision and not something done inadvertently. We actively recommend its adoption*Project
CommitlintChecks if your commit messages meet the conventional commit format.commitlintNodeProject
ContributorsAdds github authors to the project's contributors listshelljs-plugin-authorsNodeProject
CSpellProvides spell checking for your code and your commit messagescspellNodeProject
EslintIgnoreCreates an ESLint ignore file containing the projen generated filesTypeScriptProject
EslintJsdocProvides JSDoc specific linting rules for ESLinteslint-plugin-jsdocTypeScriptProject
EslintJsonCProvides linting of JSON fileseslint-plugin-jsoncTypeScriptProject
EslintNoSecretsAdds an eslint plugin to find strings that might be secrets/credentialseslint-plugin-no-secretsTypeScriptProject
EslintPrettierFixerEnsures prettier is the last entry in your eslint extends section, which is needed for prettier to work correctly with eslintTypeScriptProject
EslintUnicornProvides more than 100 powerful ESLint ruleseslint-plugin-unicornTypeScriptProject
HuskyGit hooks made easy 🐶 woof!huskyNodeProject
OnlyAllowOnly allow project package manager to be usedonly-allowNodeProject
RecommendedIncludes all the "included in recommended" components in this tableTypeScriptProject
VscodeExtensionRecommendationsManages vscode extension recommendations for your projectProject

Pseudo-Components

Pseudo-Components behave like components but are created before the project. This is needed in situations where the project options are being generated.

Pseudo-ComponentFunctionalityBase Project Type Required
GitHubberThe GitHubber pseudo-component add github repo, issues and homepage URLs to your projectNodeProject
NpmReleaserThe NpmReleaser pseudo-component add npm release data to the projectNodeProject
OrganisationalThe Organisational pseudo-component add organisation based author data to the projectNodeProject

Pseudo-Component Usage

Pseudo-Components are constructed and then added to the project using the addToProject() method

import { Organisational } from "@floydspace/projen-components";
const organisational = new Organisational({
  organisation: {
    name: "Mountain Pass",
    email: "info@mountain-pass.com.au",
    url: "https://mountain-pass.com.au",
  },
});
const project = new TypeScriptProject(
  ...organisational.nodeProjectOptions()
  //...
);
// NOTE: The follow step is needed for Pseudo-Components, otherwise
// their `preSynthesize()`, `synthesize()`, and `postSynthesize()`
// methods will not be called
organisational.addToProject(project);