generated from hamlim/template-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
137 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
# Template monorepo | ||
# One Version Monorepo | ||
|
||
This is a template repo in GitHub for creating a fresh monorepo for managing code and documentation. | ||
This repo contains the [`one-version`](./packages/one-version/README.md) library, a strict dependency conformance tool for monorepos. | ||
|
||
For more details on this setup, refer to my blog post here: https://matthamlin.me/2024/february/library-docs-monorepo-template | ||
<!-- | ||
<a href="https://hohoro.vercel.app/">Docs</a> | <a href="https://npm.im/hohoro">NPM</a> | | ||
--> | ||
|
||
## Getting Started: | ||
|
||
- Use this template (see `Use this Template` button near the top right corner of the page) | ||
- Clone the newly created repo | ||
- Run `bun install` (if you don't have bun installed locally, refer to their [docs](https://bun.sh)) | ||
- Start writing some code! | ||
<p align="center"> | ||
<a href="./packages/one-version/README.md">Source</a> | ||
</p> | ||
|
||
--- | ||
|
||
Check out the [Guidebook](./GUIDEBOOK.md) for more details on how to use this repo setup! | ||
_Refer to the [Monorepo GUIDEBOOK.md](./GUIDEBOOK.md) for details about the repo setup and structure!_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Unreleased: | ||
|
||
### [0.0.1] - May 14th, 2024 | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# `one-version` | ||
|
||
## Getting Started: | ||
|
||
Install `one-version` from the root of your repo (even for monorepos!): | ||
|
||
```bash | ||
bun add one-version | ||
``` | ||
|
||
Add a `one-version:check` script to your root `package.json`: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"one-version:check": "one-version check" | ||
} | ||
} | ||
``` | ||
|
||
## Configuration: | ||
|
||
`one-version` can be configured using a `one-version.config.(jsonc|json)` file in the root of your repo. Here's an example: | ||
|
||
```jsonc | ||
{ | ||
// one of: "bun", "yarn-berry", "yarn", "pnpm", "npm" | ||
// by default it will try to detect the package manager based on the presence of a lockfile | ||
"packageManager": "bun", | ||
} | ||
``` | ||
|
||
## Inspiration: | ||
|
||
This is effectively a fork of the [wayfair/one-version](https://github.com/wayfair/one-version) project, which I had partially contributed to while I was at Wayfair. This fork is intended to be a slimmer re-write of the original project, aiming to support the same functionality (eventually), with also supporting `bun`! | ||
|
||
This tool should be a drop-in replacement for `@wayfair/one-version`, if you run into any issues or collisions, please open an issue! | ||
|
||
## Contributing: | ||
|
||
This library does not have a build step currently. | ||
|
||
### Code Quality: | ||
|
||
#### Type Checking: | ||
|
||
This library uses TypeScript to perform type checks, run `bun run type-check` from the root or from this workspace! | ||
|
||
#### Linting | ||
|
||
This library uses [BiomeJS](https://biomejs.dev/) for linting, run `bun run lint` from the root or from this workspace! | ||
|
||
#### Tests | ||
|
||
This library uses Node.js for running unit tests, run `bun run test` from the root or from this workspace! | ||
|
||
### Publishing: | ||
|
||
To publish the library, run `bun run pub` from the workspace root. This will prompt you to login to npm and publish the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import assert from "node:assert"; | ||
import { after, before, test } from "node:test"; | ||
|
||
test("stub", () => { | ||
assert.ok(true); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env node | ||
import { start } from "../one-version.mjs"; | ||
|
||
start({ rootDirectory: process.cwd(), logger: console }).catch((e) => { | ||
console.error("Error running one-version:"); | ||
console.error(e); | ||
process.exit(1); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export async function start({ rootDirectory, logger }) { | ||
logger.log(`Running one-version in ${rootDirectory}`); | ||
return Promise.resolve(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.