Skip to content

Commit 2a14cd4

Browse files
authored
Merge pull request #2282 from o1-labs/feature/markdown-formatting-80-chars
Add markdown formatting with 80-character line wrapping
2 parents 045b1ab + 5f9a1e5 commit 2a14cd4

File tree

8 files changed

+1636
-696
lines changed

8 files changed

+1636
-696
lines changed

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ jobs:
9696
if: steps.get_changed_files.outputs.files_changed == 'true'
9797
run: xargs npm run lint:strict < changed_files.txt
9898

99+
- name: Run Markdown Format Check
100+
run: npm run format:md:check
101+
99102
- name: Run codespell
100103
if: steps.get_changed_files.outputs.files_changed == 'true' && github.event.pull_request.labels.*.name != 'no-typo-check'
101104
uses: codespell-project/actions-codespell@master

.prettierrc.md.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
trailingComma: 'es5',
3+
tabWidth: 2,
4+
semi: true,
5+
singleQuote: true,
6+
printWidth: 80,
7+
proseWrap: 'always',
8+
overrides: [
9+
{
10+
files: '*.md',
11+
options: {
12+
printWidth: 80,
13+
proseWrap: 'always',
14+
},
15+
},
16+
],
17+
};

CHANGELOG.md

Lines changed: 1255 additions & 535 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,84 @@
22

33
Thank you for investing your time in contributing to our project.
44

5-
We also welcome contributions to [zkApps Developer](https://docs.minaprotocol.com/zkapps) documentation.
5+
We also welcome contributions to
6+
[zkApps Developer](https://docs.minaprotocol.com/zkapps) documentation.
67

78
There are two ways to contribute:
89

9-
1. Preferred: Maintain your own package that can be installed from [npm](https://www.npmjs.com/) and used alongside o1js. See [Creating high-quality community packages](#creating-high-quality-community-packages).
10-
2. Directly contribute to this repo. See [Contributing to o1js](#contributing-to-o1js).
10+
1. Preferred: Maintain your own package that can be installed from
11+
[npm](https://www.npmjs.com/) and used alongside o1js. See
12+
[Creating high-quality community packages](#creating-high-quality-community-packages).
13+
2. Directly contribute to this repo. See
14+
[Contributing to o1js](#contributing-to-o1js).
1115

12-
If you maintain your own package, we strongly encourage you to add it to our official list of [community packages](./README.md#community-packages).
16+
If you maintain your own package, we strongly encourage you to add it to our
17+
official list of [community packages](./README.md#community-packages).
1318

14-
For information that is helpful for o1js core contributors, see [README-dev](README-dev.md).
19+
For information that is helpful for o1js core contributors, see
20+
[README-dev](README-dev.md).
1521

1622
### Creating high-quality community packages
1723

18-
To ensure consistency within the o1js ecosystem and ease review and use by our team and other o1js devs, we encourage community packages to follow these standards:
24+
To ensure consistency within the o1js ecosystem and ease review and use by our
25+
team and other o1js devs, we encourage community packages to follow these
26+
standards:
1927

2028
- The package is published to [npm](https://www.npmjs.com/).
21-
- `npm install <your-package>` works and is all that is needed to use the package.
22-
- o1js must be listed as a [peer dependency](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies).
29+
- `npm install <your-package>` works and is all that is needed to use the
30+
package.
31+
- o1js must be listed as a
32+
[peer dependency](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#peerdependencies).
2333
- If applicable, the package must work both on the web and in NodeJS.
24-
- The package is created using the [zkApp CLI](https://www.npmjs.com/package/zkapp-cli) (recommended).
25-
If you did not create the package using the zkApp CLI, follow these guidelines for code consistency:
26-
- Use TypeScript, and export types from `d.ts` files. We suggest that you base your tsconfig on the [tsconfig.json](./tsconfig.json) that o1js uses.
27-
- Code must be auto-formatted with [prettier](https://prettier.io/). We encourage you to use [.prettierrc.cjs](./.prettierrc.cjs), the same prettier config as o1js.
34+
- The package is created using the
35+
[zkApp CLI](https://www.npmjs.com/package/zkapp-cli) (recommended). If you did
36+
not create the package using the zkApp CLI, follow these guidelines for code
37+
consistency:
38+
- Use TypeScript, and export types from `d.ts` files. We suggest that you base
39+
your tsconfig on the [tsconfig.json](./tsconfig.json) that o1js uses.
40+
- Code must be auto-formatted with [prettier](https://prettier.io/). We
41+
encourage you to use [.prettierrc.cjs](./.prettierrc.cjs), the same prettier
42+
config as o1js.
2843
- The package includes tests.
29-
- If applicable, tests must demonstrate that the package's methods can successfully run as provable code. For example, when the package is used in a SmartContract or ZkProgram that is compiled and proven.
30-
- Ideally, your tests are easy to use, modify, and port to other projects by developers in the ecosystem. This is achieved by using Jest (see [jest.config.js](./jest.config.js) for an example config) or by structuring your tests as plain node scripts, like [this example](./src/lib/circuit_value.unit-test.ts).
31-
- Public API must be documented and [JSDoc](https://jsdoc.app/) comments must be present on exported methods and globals.
44+
- If applicable, tests must demonstrate that the package's methods can
45+
successfully run as provable code. For example, when the package is used in
46+
a SmartContract or ZkProgram that is compiled and proven.
47+
- Ideally, your tests are easy to use, modify, and port to other projects by
48+
developers in the ecosystem. This is achieved by using Jest (see
49+
[jest.config.js](./jest.config.js) for an example config) or by structuring
50+
your tests as plain node scripts, like
51+
[this example](./src/lib/circuit_value.unit-test.ts).
52+
- Public API must be documented and [JSDoc](https://jsdoc.app/) comments must be
53+
present on exported methods and globals.
3254
- Include README and LICENSE files.
3355
- Comments and README must be in English and preferably use American spelling.
3456

3557
### Contributing to o1js
3658

3759
The `main` branch contains the development version of the code.
3860

39-
To contribute directly to this project repo, follow these steps to get your changes in the `main` branch as quickly as possible.
61+
To contribute directly to this project repo, follow these steps to get your
62+
changes in the `main` branch as quickly as possible.
4063

41-
1. Create a new issue for your proposed changes or use an existing issue if a relevant one exists.
42-
1. Write a request for comment (RFC) to outline your proposed changes and motivation, like this [example RFC](https://github.com/o1-labs/o1js/issues/233). Describe your objective and why the change is useful, how it works, and so on.
64+
1. Create a new issue for your proposed changes or use an existing issue if a
65+
relevant one exists.
66+
1. Write a request for comment (RFC) to outline your proposed changes and
67+
motivation, like this
68+
[example RFC](https://github.com/o1-labs/o1js/issues/233). Describe your
69+
objective and why the change is useful, how it works, and so on.
4370

44-
Note: If you are proposing a smaller change your RFC will be smaller, and that's ok! :)
71+
Note: If you are proposing a smaller change your RFC will be smaller, and
72+
that's ok! :)
4573

46-
1. One of the codebase maintainers reviews your RFC and works with you until it is approved.
47-
1. After your RFC proposal is approved, fork the repository and implement your changes.
74+
1. One of the codebase maintainers reviews your RFC and works with you until it
75+
is approved.
76+
1. After your RFC proposal is approved, fork the repository and implement your
77+
changes.
4878
1. Submit a pull request and wait for code review. :)
4979

50-
Our goal is to include functionality within o1js when the change is likely to be widely useful for developers. For more esoteric functionality, it makes more sense to provide high-quality community packages that can be used alongside o1js.
80+
Our goal is to include functionality within o1js when the change is likely to be
81+
widely useful for developers. For more esoteric functionality, it makes more
82+
sense to provide high-quality community packages that can be used alongside
83+
o1js.
5184

5285
We appreciate your contribution!

0 commit comments

Comments
 (0)