Skip to content

Commit 9bda350

Browse files
Merge pull request #136 from rajinwonderland/release-0.1.5
chore(docs, package resolutions, and script aliases.): 📝 Implement n…
2 parents 34adc00 + 5437f1a commit 9bda350

File tree

6 files changed

+854
-588
lines changed

6 files changed

+854
-588
lines changed

CONTRIBUTING.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,81 @@
1-
# WIP
1+
# Contributing to React Code Blocks
22

3+
First off, thank you for considering contributing to React Code Blocks. It's people like you that make React Code Blocks such a great tool.
4+
5+
### Where do I go from here?
6+
7+
If you've noticed a bug or have a question, [search the issue tracker](https://github.com/rajinwonderland/react-code-blocks/issues) to see if someone else in the community has already created a ticket. If not, go ahead and make one!
8+
9+
### Fork & create a branch
10+
11+
If this is something you think you can fix, then [fork React Code Blocks](https://github.com/rajinwonderland/react-code-blocks/fork) and create a branch with a descriptive name.
12+
13+
A good branch name would be (where issue #325 is the ticket you're working on):
14+
15+
```bash
16+
git checkout -b 325-add-language-support
17+
```
18+
19+
### Working on the code
20+
21+
We use `pnpm workspaces` to house all of our demos and packages.
22+
23+
The `react-code-blocks` package is located under [`packages/react-code-blocks`](packages/react-code-blocks).
24+
25+
You can run the following command from the root of the project to start storybook:
26+
27+
```bash
28+
pnpm rcb run storybook
29+
```
30+
31+
### Implement your fix or feature
32+
33+
At this point, you're ready to make your changes! Feel free to ask for help; everyone is a beginner at first 😸
34+
35+
### Committing Your Changes
36+
37+
We follow a set of conventions for commit messages to make the history easier to understand and to facilitate the creation of changelogs. To help with this process, we use `gacp` (Git Automated Commit and Push), which is a tool that helps to format commit messages according to the conventional commit format.
38+
39+
Before committing, make sure to stage your changes. You can do this with:
40+
41+
```bash
42+
git add .
43+
```
44+
45+
Instead of using git commit, we use an automated process via the command:
46+
47+
```bash
48+
pnpm commit
49+
```
50+
51+
This command will prompt you to fill out any required commit fields at commit time. No need to worry about the commit message format as gacp will guide you through the process.
52+
53+
### Make a Pull Request
54+
55+
At this point, you should switch back to your master branch and make sure it's up to date with React Code Blocks's master branch:
56+
57+
```bash
58+
git remote add upstream https://github.com/rajinwonderland/react-code-blocks.git
59+
git checkout master
60+
git pull upstream master
61+
```
62+
63+
Then update your feature branch from your local copy of master, and push it!
64+
65+
```bash
66+
git checkout 325-add-language-support
67+
git rebase master
68+
git push --set-upstream origin 325-add-language-support
69+
```
70+
71+
Finally, go to GitHub and [make a Pull Request](https://github.com/rajinwonderland/react-code-blocks/compare) 🎉
72+
73+
### Keeping your Pull Request updated
74+
75+
If a maintainer asks you to "rebase" your Pull Request, they're saying that a lot of code has changed, and that you need to update your branch so it's easier to merge.
76+
77+
Here's a great article on rebasing, which basically just means getting the latest version of master and then putting your branch on top of it.
78+
79+
### Questions?
80+
81+
Feel free to contact either [@rajinwonderland](https://github.com/rajinwonderland) or [@thomasmost](https://github.com/thomasmost) if you have any questions about contributing.

package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
"author": "",
66
"private": true,
77
"scripts": {
8-
"start:demo": "pnpm start demo",
8+
"rcb": "pnpm -r --filter react-code-blocks",
9+
"demo": "pnpm -r --filter demo",
10+
"start:demo": "pnpm demo run start",
911
"test": "pnpm test",
10-
"nuke": "rm -rf node_modules rm -rf pnpm-lock.yaml"
12+
"nuke": "rm -rf node_modules rm -rf pnpm-lock.yaml",
13+
"commit": "gacp"
1114
},
1215
"workspaces": [
1316
"packages/*",
@@ -20,7 +23,7 @@
2023
"resolutions": {
2124
"react": "^16.11.0",
2225
"react-dom": "^16.11.0",
23-
"refractor": "^4.8.1",
26+
"refractor": "^3.6.0",
2427
"react-syntax-highlighter": "^15.5.0"
2528
},
2629
"homepage": "https://react-code-blocks.rajinwonderland.vercel.app",
@@ -83,5 +86,14 @@
8386
"postcss@<8.4.31": ">=8.4.31",
8487
"@babel/traverse@<7.23.2": ">=7.23.2"
8588
}
89+
},
90+
"gacp": {
91+
"add": false,
92+
"push": true,
93+
"emoji": "emoji",
94+
"editor": true
95+
},
96+
"devDependencies": {
97+
"gacp": "^3.0.3"
8698
}
8799
}

packages/react-code-blocks/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ npm i react-code-blocks
6868
> Updated usage instructions can be found [here](https://react-code-blocks.rajinwonderland.vercel.app/)
6969
7070
```js
71-
import { CopyBlock } from "react-code-blocks";
71+
import { CopyBlock } from 'react-code-blocks';
7272
```
7373

7474
```js
@@ -91,7 +91,7 @@ function MyCodeComponent(props) {
9191
A simple code block component
9292

9393
```js
94-
import { CodeBlock, dracula } from "react-code-blocks";
94+
import { CodeBlock, dracula } from 'react-code-blocks';
9595

9696
function MyCoolCodeBlock({ code, language, showLineNumbers }) {
9797
return (
@@ -126,7 +126,7 @@ function MyCoolCodeBlock({ code, language, showLineNumbers }) {
126126
A code block component with a little copy button for copying a snippet.
127127

128128
```jsx
129-
import { CopyBlock, dracula } from "react-code-blocks";
129+
import { CopyBlock, dracula } from 'react-code-blocks';
130130

131131
function MyCoolCodeBlock({ code, language, showLineNumbers }) {
132132
<CopyBlock
@@ -203,6 +203,5 @@ _This README was generated with ❤️ by [readme-md-generator](https://github.c
203203
<img src="packages/assets/rajinwonderland.png" height="175px" />
204204
</div>
205205

206-
- Website: https://novvum.io
207206
- Twitter: [@rajinwonderland](https://twitter.com/rajinwonderland)
208207
- Github: [@rajinwonderland](https://github.com/rajinwonderland)

packages/react-code-blocks/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-code-blocks",
3-
"description": "Modified Atlaskit's Code Block to support more languages (i.e graphql, reasonml, etc) and theme (i.e railscast, darcula, monokai, etc) code snippets!",
3+
"description": "Modified Atlaskit's Code Block to support more languages (i.e graphql, reasonml, etc) and theme (i.e railscast, dracula, monokai, etc) code snippets!",
44
"keywords": [
55
"code-snippets",
66
"code-blocks",
@@ -81,9 +81,8 @@
8181
},
8282
"dependencies": {
8383
"@babel/runtime": "^7.10.4",
84-
"@types/react-syntax-highlighter": "^15.5.7",
8584
"react-syntax-highlighter": "^15.5.0",
86-
"styled-components": "^6.1.0",
85+
"styled-components": "^6.1.0",
8786
"tslib": "^2.6.0"
8887
}
8988
}

0 commit comments

Comments
 (0)