A collection of cool projen components
npm install @mountainpass/cool-bits-for-projenA collection of cool projen components
  

  
 
  
1. If you don't have projen installed and configured, you'll need to go do that first.
2. Add @mountainpass/cool-bits-for-projen to you development dependencies. e.g., in your .projenrc.ts
``ts`
const project = new TypeScriptProject({
//...
devDeps: [
//...
"@mountainpass/cool-bits-for-projen"
],
//...
});
or
`ts`
const project = new TypeScriptProject({
//...
});
project.addDevDeps("@mountainpass/cool-bits-for-projen");
3. Run npx projen to regenerate the project files.projenrc.ts
4. Add the components to you project in your file. ForRecommended
example, to add all the recommended components, add
`ts
import { Recommended } from "@mountainpass/cool-bits-for-projen";
//...
const project = new TypeScriptProject({
...Recommended.defaultProjectOptions,
//...
});
new Recommended(project);
//...
project.synth();
`
or you can add individual components
`ts
import { Husky, EslintUnicorn } from "@mountainpass/cool-bits-for-projen";
//...
const project = new TypeScriptProject({
...EslintUnicorn.defaultProjectOptions,
//...
});
new Husky(project);
new EslintUnicorn(project);
//...
project.synth();
`
5. Run npx projen to generate the project files
| Component | Functionality | Uses | Base Project Type Required | Included in Recommended |
| ----------- | ----------- | ----------- | ----------- | ----------- |
| CodeOfConduct | Add a Contributor Covenant v2.1 CODE_OF_CONDUCT.md to your project.CodeOfConduct
NOTE: 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 | |Commitlint
| | Checks if your commit messages meet the conventional commit format. | commitlint | NodeProject | ✅ |Contributors
| | Adds github authors to the project's contributors list | shelljs-plugin-authors | NodeProject | ✅ |CSpell
| | Provides spell checking for your code and your commit messages | cspell | NodeProject | ✅ |EslintIgnore
| | Creates an ESLint ignore file containing the projen generated files | | TypeScriptProject | ✅ |EslintJsdoc
| | Provides JSDoc specific linting rules for ESLint | eslint-plugin-jsdoc | TypeScriptProject | ✅ |EslintJsonC
| | Provides linting of JSON files | eslint-plugin-jsonc | TypeScriptProject | ✅ |EslintNoSecrets
| | Adds an eslint plugin to find strings that might be secrets/credentials | eslint-plugin-no-secrets | TypeScriptProject | ✅ |EslintPrettierFixer
| | Ensures prettier is the last entry in your eslint extends section, which is needed for prettier to work correctly with eslint | | TypeScriptProject | ✅ |EslintUnicorn
| | Provides more than 100 powerful ESLint rules | eslint-plugin-unicorn | TypeScriptProject | ✅ |Husky
| | Git hooks made easy 🐶 woof! | husky | NodeProject | ✅ |Recommended
| | Includes all the "included in recommended" components in this table | | TypeScriptProject | |VscodeExtensionRecommendations
| | Manages vscode extension recommendations for your project | | Project | ✅ |
Pseudo-Components behave like components but are created before the project. This is needed in situations where the project options are being generated.
| Pseudo-Component | Functionality | Base Project Type Required |
| ----------- | ----------- | ----------- |
| GitHubber | The GitHubber pseudo-component add github repo, issues and homepage URLs to your project | NodeProject |NpmReleaser
| | The NpmReleaser pseudo-component add npm release data to the project | NodeProject |Organisational
| | The Organisational pseudo-component add organisation based author data to the project | NodeProject |
Pseudo-Components are constructed and then added to the project using the addToProject() method
`tspreSynthesize()
import { Organisational } from "@mountainpass/cool-bits-for-projen";
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 , synthesize(), and postSynthesize() ``
// methods will not be called
organisational.addToProject(project);