giraffe

A template to quickly 📦 any typescript library/project using high industry standards!

Stars
0

Who is this for?

Standardizations

FAQ

Get Started

Create your repository

  • Initialize a new git repository
  • Commit & push to your new repository

Configure repository

  • Auto-publishing:
    • Provide a repository secret:  NPM_TOKEN,  for auto-publishing via github workflows
      https://github.com/<owner/repo>/settings/secrets/actions
    • Uncomment action at .github/workflows/publish.yml
  • Activate renovate and changesets for your repository
  • Change Pull Requests to only allow Squash: Default to pull request title
    https://github.com/<owner/repo>/settings#merge-button-settings
  • Create branch protection at https://github.com/<owner/repo>/settings/branch_protection_rules/newand enable:
    • Require a pull request before merging
      • Untick 'Require approvals'
    • Require status checks to pass before merging
      • Add test to the list of required status checks
    • Allow force pushes
      • Specify who can force push *will allow administrators automatically
  • Allow workflow Read and write permissionshttps://github.com/<owner/repo>/settings/actions
    • Below ^, tick on 'Allow GitHub Actions to create and approve pull requests'

Create branch

Let's set a good first example, and create a branch for configurating our project.

We will push changes one by one into our new branch.

Create a branch following Semantic Changes:  chore-configurating-initial-project

Configure your library

  • Find & Replace <repo> with your repository
    • Example: <repo> -> x-classes
  • Find & Replace <owner/repo> with your owner/repository
    • Example: <owner/repo> -> refzlund/x-classes
  • Rename packages/template to <repo>, ex. -> packages/x-classes
  • Configure your packages/<repo>/package.json
  • Define your monorepo README
  • Define your library package README

Changelog!

Great! We've configured our project. Let's create our first patch release using changeset.

pnpm i

  • Create changeset: 
    1. npx changeset
    2. Select your package using space, enter to continue
    3. No major changes
    4. No minor changes
    5. Patch — chore: configurating initial project
  • Push your changes
  • Create pull request on the main branch for chore-configurating-initial-project
    • Title: chore: configurating initial project
  • Squash & Merge changes

When you're ready to publish a new release, merge the incoming "Version Packages"-pull request by changesets.

Congratsulations! You're a natural🚀🎉

Development

See Development

Community tips & tricks

[!NOTE] Pull requests and issues to this repository are more than welcome🦒

VSCode Extensions

  • Toggle Excluded Files: Hide unnecessary config files
  • ESLint: Integrates ESLint into VS Code
  • Vitest Runner: Run your Vitests with a single click
    • It launches the terminal.
      After — press arrow up — replace vitest run ... with vitest watch ..., and it will run the tests when the files change.
  • Console Ninja: Outputs console logs in your IDE — immensly helpful debugging tool

Get Inspired

Here are some repositories that follow similar structure: