Skip to content

Commit 72bac16

Browse files
authored
Add prettier and format everything (#1081)
* Add prettier and format everything * add extensions * use full defaults * add to ci * add pre-commit hook * remove lefthook
1 parent d630038 commit 72bac16

File tree

627 files changed

+11883
-8187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

627 files changed

+11883
-8187
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
name: 🚨 Documentation issue
33
about: Create an issue to help us improve the rescript-lang.org documentation website
4-
title: ''
5-
labels: ''
6-
assignees: ''
7-
4+
title: ""
5+
labels: ""
6+
assignees: ""
87
---
9-

.github/workflows/pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- run: npm ci
1313
- run: npx rescript
1414
- run: npm test
15+
- run: npm run ci:format
1516

1617
- name: Format check
1718
run: npx rescript format -check -all

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ _tempFile.cmt
2222
.bsb.lock
2323
.merlin
2424
lib/
25-
.vscode/
2625

2726
.vercel
2827

.prettierrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
plugins:
2+
- "@prettier/plugin-oxc"

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["esbenp.prettier-vscode", "chenglou92.rescript-vscode"]
3+
}

CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Changelog
22

3-
43
This changelog documents significant changes that caused a new version in the manual, or other related resources.
54

65
We don't create a version fork for every minor release, and try to make docs "append only" as much as possible. Usually when we introduce a new feature we add a `since 9.0` annotation to a specific section, and be done with it.
@@ -13,8 +12,7 @@ Here are the notes on major changes we did, and how the version corresponds to s
1312

1413
### latest
1514

16-
- 9.1 related
17-
-
15+
- ## 9.1 related
1816

1917
### v9.0 (v8.3 - v9.0)
2018

@@ -34,5 +32,3 @@ Here are the notes on major changes we did, and how the version corresponds to s
3432
### v8.0.0 (v6 - v8.3)
3533

3634
- Docs with Reason / OCaml syntax before the new syntax
37-
38-

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# rescript-lang.org
2+
23
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
34

45
This is the official documentation platform for the [ReScript](https://rescript-lang.org) programming language.

_blogposts/2020-08-10-bucklescript-is-rebranding.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ We're pleased to announce that BuckleScript is getting a brand new name: **ReScr
2121
## Community Situation
2222

2323
BuckleScript started with the idea that **JavaScript programmers deserved a great typed language with a fast and lean toolchain**. This idea took root and, over the years, we've gradually accomplished feats such as:
24+
2425
- a state of the art compiled JavaScript output that rivals hand-written JS,
2526
- a fast & reliable toolchain much needed in front-end and Node development,
2627
- various JS interop features that spawned an ecosystem of well typed libraries,
2728
- a production-ready standard library,
2829
- [and recently](/blog/bucklescript-8-1-new-syntax), a fresh syntax made by a major contributor of Reason's old syntax.
2930

3031
These developments have attracted many people into our community. But one bigger challenge persisted: newcomers dropped out at the sheer amount of extra incongruent tools and learning overhead from having to understand OCaml concepts, Reason concepts, and BuckleScript's concepts. Take, for example, what's required to make a React app using BuckleScript:
32+
3133
- Knowledge of React.
3234
- Knowledge of JS.
3335
- Knowledge of BuckleScript's specific bindings to React (that we've tried hard to keep to a minimum).
@@ -43,6 +45,7 @@ The adoption barrier is real, and it's about time we finally solve it.
4345
## The Rebranding
4446

4547
Today, we'll start to truly unify the various BuckleScript-related projects under the ReScript umbrella. This includes:
48+
4649
- The compiler, build system and the new syntax unified under a single installation.
4750
- Doubling down on editor tooling for ReScript usage.
4851
- A single documentation site (this one), which unifies all the docs and greatly trims down on redundant and stale info.

_blogposts/2020-08-28-new-rescript-logo.mdx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,44 @@ ReScript is the evolution and fusion of Reason and BuckleScript. As we're a desi
1515

1616
Here it is!
1717

18-
19-
<Image withShadow={false} src="/static/blog/rescript-launch/ReScript-1.jpg" caption="Comparison between the Reason, BuckleScript and ReScript logos"/>
20-
18+
<Image
19+
withShadow={false}
20+
src="/static/blog/rescript-launch/ReScript-1.jpg"
21+
caption="Comparison between the Reason, BuckleScript and ReScript logos"
22+
/>
2123

2224
The old Reason and BuckleScript logo had many limitations:
25+
2326
- The icons didn't really work well on round Social Media profile images (or round shapes at all).
2427
- There's no guideline on how the logo works inverted, or on colored background.
2528
- The large red rectangle makes it difficult to balance the logo with other elements.
2629
- The buckle and belt were a bit too literal and did not convey much.
2730

2831
The new logo addresses all these and more:
2932

30-
<Image withShadow={false} src="/static/blog/rescript-launch/ReScript-2.jpg" caption="Logo comparison on social media"/>
33+
<Image
34+
withShadow={false}
35+
src="/static/blog/rescript-launch/ReScript-2.jpg"
36+
caption="Logo comparison on social media"
37+
/>
3138

3239
## Creating Meaning Through Simple Shapes
3340

3441
A minimal logo design is achieved by putting aside all distractions while focusing on legibility, meaning and small details like clear lines, interesting perspective and depth.
3542

36-
37-
<Image withShadow={false} src="/static/blog/rescript-launch/ReScript-4.jpg" caption="ReScript logo variations and usage examples"/>
38-
43+
<Image
44+
withShadow={false}
45+
src="/static/blog/rescript-launch/ReScript-4.jpg"
46+
caption="ReScript logo variations and usage examples"
47+
/>
3948

4049
**The letter "r"**, composed of two shapes, is inspired by Albers, a german-born American Bauhaus artist and typographer. An object should be simple, beautiful, functional and accessible for everyone - a statement which applies to ReScript's principles perfectly.
4150

4251
**I/O**: The rectangle and circle represent the input / output, recalling the digital nature of a program.
4352

4453
**The red app-shaped background** references the vibrant, playful applications our developers are empowered to create with ReScript.
4554

46-
**The Logotype** ("rescript") complements the brand mark with its clean look and its embrace of technology while retaining a functional look.
55+
**The Logotype** ("rescript") complements the brand mark with its clean look and its embrace of technology while retaining a functional look.
4756

4857
We'd like to position ReScript to be a community of product-first developers who care about the fit & finish of their work, while keeping an eye on the quality of their engineering. This interplay of design and engineering is a hard-to-achieve but beautifully worthwhile sweet spot that's frequently been missing in the programmer community; our vibrant logo is our renewed symbolic step toward this mission. Come along with us on our journey!
4958

_blogposts/2020-09-25-release-8-3-2.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ To get the build output, instead of communicating through IPC, we adopted a simp
7474
This makes the editor integration build-system agnostic, it does not need talk to the build system directly.
7575

7676
It also makes our build tool work with other watchers including Facebook's [watchman](https://facebook.github.io/watchman/).
77-
Watchman is a more scalable watcher tool for some specific platforms and less memory hungry, however, we still need a watchman-client to get the output of triggered job.
77+
Watchman is a more scalable watcher tool for some specific platforms and less memory hungry, however, we still need a watchman-client to get the output of triggered job.
7878
We write the output to `.compiler.log` per each build, allowing clients to read compiler diagnostics when they want.
7979

8080
## A better algorithm for removing stale outputs
@@ -90,8 +90,8 @@ We scan `lib/bs` directory and check some dangling `cm{i,t,j,ti}` files, if it d
9090
the current build set, it is considered stale artifacts. If it is `cmt` file, it would trigger some hooks of `genType`, notably -cmt-rm.
9191

9292
- Based on previous build logs
93-
We store previous compilation stats. If a file is in the previous compiler output, but no longer in the output of the new build, it is considered stale and can be removed.
94-
it is considered stale output which can be removed.
93+
We store previous compilation stats. If a file is in the previous compiler output, but no longer in the output of the new build, it is considered stale and can be removed.
94+
it is considered stale output which can be removed.
9595

9696
In general, strategy two is more reliable and efficient.
9797

@@ -100,11 +100,9 @@ In general, strategy two is more reliable and efficient.
100100

101101
However, strategy one is easier for tooling like `genType`. Not every tool has knowledge of the build system.
102102

103-
104103
Sometimes a combination of both strategies is needed.
105-
- When removing .cm* files, we use the first strategy.
106-
- When removing generated javascript, we use strategy two,
107-
108104

105+
- When removing .cm\* files, we use the first strategy.
106+
- When removing generated javascript, we use strategy two,
109107

110108
Happy Hacking!

0 commit comments

Comments
 (0)