From f29c0d3ea665d207d2f66b8f03c7c60b0fac0671 Mon Sep 17 00:00:00 2001 From: Steven Slack Date: Wed, 27 Mar 2024 11:13:26 -0400 Subject: [PATCH 1/5] WIP: issue-21 From fd83e757addfdd626e153c33a2b0c16e8f2b646c Mon Sep 17 00:00:00 2001 From: Steven Slack Date: Tue, 16 Apr 2024 12:58:15 -0400 Subject: [PATCH 2/5] Add documentation for adding and managing packages, versioning and publishing packages in root readme --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5fb5ec93..9b89ea23 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,16 @@ # Alley Scripts -A collection of scripts and utilities for [Alley Interactive](https://alley.com) -projects where we can iteratively build and publish functionality as discrete -`npm` packages that can be used in projects to speed up development. +A collection of scripts and utilities built by [Alley Interactive](https://alley.com) +for projects to speed up development. + +## Table of Contents + +- [Packages](#packages) +- [Adding and Managing Packages](#adding-and-managing-packages) +- [Releasing a New Version](#releasing-a-new-version) +- [Changelog](#changelog) +- [Credits](#credits) +- [License](#license) ## Packages @@ -18,9 +26,57 @@ This monorepo contains the following packages: - [`@alleyinteractive/stylelint-config`](./packages/stylelint-config/README.md) - [`@alleyinteractive/tsconfig`](./packages/tsconfig/README.md) +## Adding and Managing Packages + +This project uses Turborepo with NPM to add and manage packages in this monorepo. To add a new package, you can add the package manually or run a command. + +**NOTE**: _If the workspace is to be created in a location other than the default `packages` directory, the path to the directory needs to be provided in the root `package.json` workspaces configuration._ + +### Scaffold a new package + +```sh +npx turbo gen workspace --type package +``` + +The command above will walk through some prompts and create a new package in the `packages` directory with a basic `package.json` and `README.md` file. + +**NOTE**: _The `package.json` file will be scaffolded with the `private` configuration set to `true`. When the package is ready to be published to the public registry, this configuration should be removed._ + +For more information on the `Turborepo` code generation, see the [Turborepo Code Generation documentation](https://turbo.build/repo/docs/core-concepts/monorepos/code-generation). + +### Add a package manually + +To add a package manually you can create a new directory with the same name as the package in the `packages` directory and add a `package.json` file with the following content: + +```json +{ + "name": "@alleyinteractive/package-name", + "version": "0.0.0", + "license": "GPL-2.0-or-later", +} +``` + +## Versioning and Publishing Packages in this Monorepo + +This project uses the [Changesets CLI](https://github.com/changesets/changesets) to manage versioning and publishing of packages in this monorepo. To release a new version of a package that you are working on, you can run the following command: + +```sh +npx changeset +``` + +The command above will walk through some prompts and create a new changeset file in the `.changeset` directory. Commit this file to version control in your feature branch and open a pull request. + +Once the pull request is approved, merge the branch into the `main` branch. The changeset Github actions will automatically create a new branch, e.g. `changeset-release/main` and pull request titled "Version Packages". Once you are ready to release the package merge the pull request. You may need to check with other developers releasing versions for other packages as the changeset release will add all changes to that pull request. Once the `changeset-release/main` branch is merged it will publish the new version of the package to the NPM registry. + +**You do not need to manually bump the version of the package in the `package.json` file. The changeset Github actions will handle this for you.** + ## Changelog -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. +Each package/workspace contains a changelog file that documents the changes for each version of the package. The changelog file is located in the root of the package directory and is named `CHANGELOG.md`. + +## Contributing + +Feel free to dive in! [Open an issue](https://github.com/alleyinteractive/alley-scripts/issues/new/choose) or [submit PRs](https://github.com/alleyinteractive/alley-scripts/compare). Standard Readme follows the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/1/3/0/code-of-conduct/). ## Credits From 107a693fe71d77208a946d914f5e6712eae06a11 Mon Sep 17 00:00:00 2001 From: Steven Slack Date: Tue, 16 Apr 2024 13:24:40 -0400 Subject: [PATCH 3/5] add Alley logo --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b89ea23..520f8d62 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Each package/workspace contains a changelog file that documents the changes for Feel free to dive in! [Open an issue](https://github.com/alleyinteractive/alley-scripts/issues/new/choose) or [submit PRs](https://github.com/alleyinteractive/alley-scripts/compare). Standard Readme follows the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/1/3/0/code-of-conduct/). -## Credits +## Maintainers This project is actively maintained by [Alley Interactive](https://github.com/alleyinteractive). Like what you see? [Come work @@ -86,6 +86,8 @@ with us](https://alley.com/careers/). - [All Contributors](../../contributors) +![Alley logo](https://avatars.githubusercontent.com/u/1733454?s=200&v=4) + ## License The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information. From 9c3de47d6f1d694960104ec20157d1b26da03bff Mon Sep 17 00:00:00 2001 From: Steven Slack Date: Tue, 16 Apr 2024 14:57:02 -0400 Subject: [PATCH 4/5] update TOC --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 520f8d62..b19f42ea 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ for projects to speed up development. - [Packages](#packages) - [Adding and Managing Packages](#adding-and-managing-packages) -- [Releasing a New Version](#releasing-a-new-version) +- [Versioning and Publishing Packages in this Monorepo](##versioning-and-publishing-packages-in-this-monorepo) - [Changelog](#changelog) -- [Credits](#credits) +- [Contributing](#contributing) +- [Maintainers](#maintainers) - [License](#license) ## Packages From 0d581b98968718492c4ffe808e0c2c3cfa3753c0 Mon Sep 17 00:00:00 2001 From: Steven Slack Date: Tue, 16 Apr 2024 14:59:19 -0400 Subject: [PATCH 5/5] add link to Turborepo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b19f42ea..903ae8f5 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This monorepo contains the following packages: ## Adding and Managing Packages -This project uses Turborepo with NPM to add and manage packages in this monorepo. To add a new package, you can add the package manually or run a command. +This project uses [Turborepo](https://turbo.build/repo/docs) with NPM to add and manage packages in this monorepo. To add a new package, you can add the package manually or run a command. **NOTE**: _If the workspace is to be created in a location other than the default `packages` directory, the path to the directory needs to be provided in the root `package.json` workspaces configuration._