Skip to content

Commit

Permalink
update grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-chernicki committed Jan 2, 2024
1 parent a1af30e commit be92a17
Show file tree
Hide file tree
Showing 10 changed files with 525 additions and 215 deletions.
7 changes: 7 additions & 0 deletions apps/documentation/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["plugin:mdx/recommended"],
"settings": {
"mdx/code-blocks": true
},
"root": true
}
5 changes: 5 additions & 0 deletions apps/documentation/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [
"bento",
"buildable",
"checkcontext",
"checkoptions",
"Codeowner",
"CODEOWNERS",
"commonalityco",
"corepack",
"createtestcheck",
"falsey",
"myteam",
"nextra"
],
Expand Down
4 changes: 3 additions & 1 deletion apps/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"private": true,
"scripts": {
"dev": "next dev",
"lint": "eslint . --ext md,mdx",
"build": "next build",
"start": "next start",
"spellcheck": "cspell pages/**/*.mdx"
"spellcheck": "cspell **/*.mdx"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -40,6 +41,7 @@
"@types/node": "18.11.10",
"autoprefixer": "^10.4.16",
"cspell": "^8.3.2",
"eslint-plugin-mdx": "^2.3.1",
"postcss": "^8.4.30",
"tailwindcss": "^3.4.0",
"typescript": "^4.9.3"
Expand Down
10 changes: 5 additions & 5 deletions apps/documentation/pages/docs/api/checks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ensureCodeowner = defineCheck(() => {
`"string" | (options: CheckContext) => Message | Promise<Message>{:ts}`
</Subtext>

You can pass a static string for simple checks or dynamically return a Message with a function that is passed [CheckContext](#checkoptions).
You can pass a static string for simple checks or dynamically return a Message with a function that is passed [CheckContext](#checkcontext).

#### Simple message

Expand Down Expand Up @@ -241,7 +241,7 @@ const ensureCodeowner = defineCheck(() => {

`(check: Check, context?: TestCheckContext) => Check{:ts}`

`createTestCheck` wraps your checks and decorates these functions with sensible defaults for [CheckContext](/docs/api/checks#checkcontext) that you can override.
`createTestCheck` wraps your checks and decorates these functions with sensible defaults for [CheckContext](/docs/api/checks#checkcontext) that you can override.
This cuts down on repetitive boilerplate when writing tests for your checks.


Expand All @@ -257,7 +257,7 @@ A valid [check](/api/checks#check-properties) object
<Subtext>
`TestCheckContext{:ts}`
</Subtext>
Pass options that will be used as the check's [`CheckContext`](/docs/api/checks#checkcontext).
Pass options that will be used as the check's [`CheckContext`](/docs/api/checks#checkcontext).
If a property is not explicitly passed, the check will be passed a default from the table below.

| Name | Default |
Expand All @@ -269,7 +269,7 @@ If a property is not explicitly passed, the check will be passed a default from
| `context.allWorkspaces` | `[{relativePath: './', path: './'}]{:ts}` |

**Returns**
Returns the original check function, however the `validate`, `fix`, and `message` functions
Returns the original check function, however the `validate`, `fix`, and `message` functions
will be passed the `TestCheckContext` rather than requiring that `CheckContext` be passed.

**Example**
Expand Down Expand Up @@ -313,7 +313,7 @@ test('validate - returns true when valid', () => {

const check = createTestCheck(myCheck());
const result = myCheck.validate();

expect(result).toEqual(true);
})
```
Expand Down
6 changes: 3 additions & 3 deletions apps/documentation/pages/docs/api/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Subtext } from '../../../components/subtext.tsx';

**`commonality.config.ts`** **`commonality.config.js`**

Your project's configuration should located be at the root of your project.
Your project's configuration should be located at the root of your project.

<Callout type="info">
Use the `defineConfig` helper function to get type checking and intellisense
Expand Down Expand Up @@ -62,10 +62,10 @@ import { defineConfig } from 'commonality';
export default defineConfig({
constraints: {
'*': [
disallow: ['deployable'],
{ disallow: ['deployable'] },
],
config: [
allow: ['config']
{ allow: ['config'] }
],
},
});
Expand Down
2 changes: 1 addition & 1 deletion apps/documentation/pages/docs/api/constraints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Commonality will allow all direct dependencies

#### Allow specific direct dependencies

Commonality will only allow direct dependencies that have the `api` or `internal` tag in it's [package configuration](/reference/configuration#package-configuration).
Commonality will only allow direct dependencies that have the `api` or `internal` tag in its [package configuration](/reference/configuration#package-configuration).

```json
{
Expand Down
6 changes: 3 additions & 3 deletions apps/documentation/pages/docs/checks/testing-checks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ensureLicense = defineCheck((license: string = 'MIT') => {
path.join(workspace.path, 'package.json'),
).get();

// This check should fail if the package's license does not match the one we specified
// This check will fail if the package's license does not match the one specified
return packageJson.license === license;
},
fix: async ({ workspace }) => {
Expand All @@ -35,7 +35,7 @@ const ensureLicense = defineCheck((license: string = 'MIT') => {
path.join(workspace.path, 'package.json'),
).get();

// Since we return multiple messsages we should test for each scenario
// Since we return multiple messages we should test for each scenario
if (!packageJson || !packageJson.license) {
return {
title: 'Package.json must have a license',
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('ensureLicense', () => {

expect(message.title).toEqual('Package.json license must be MIT');
expect(message.filePath).toEqual('package.json');
// We recommend snapshot testing suggestions as the formatting can be tricky to hardode
// We recommend snapshot testing suggestions as the formatting can be tricky to hardcode
expect(message.suggestion).toMatchInlineSnapshot();
});
});
Expand Down
Loading

0 comments on commit be92a17

Please sign in to comment.