Skip to content

Commit bf2e236

Browse files
committed
ReScript
1 parent 0c43b55 commit bf2e236

File tree

10 files changed

+75
-85
lines changed

10 files changed

+75
-85
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ node_modules
99
# npm unused lock file (we use yarn.lock)
1010
package-lock.json
1111

12-
# ReScript / Reason / Ocaml artifacts
13-
#*.bs.js # we do want this files to ensure zero-cost
12+
# ReScript artifacts
13+
# *.bs.js # we do want this files to ensure zero-cost
1414
.bsb.lock
1515
**/lib/bs
1616
**/lib/ocaml

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog of `@reason-react-native/image-editor`
1+
# Changelog of `@rescript-react-native/image-editor`
22

33
## 2.3.2 - 2020-11-17
44

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @reason-react-native contributors
3+
Copyright (c) 2019 @rescript-react-native contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# `@reason-react-native/image-editor`
1+
# `@rescript-react-native/image-editor`
22

3-
[![Build Status](https://github.com/reason-react-native/image-editor/workflows/Build/badge.svg)](https://github.com/reason-react-native/image-editor/actions)
4-
[![Version](https://img.shields.io/npm/v/@reason-react-native/image-editor.svg)](https://www.npmjs.com/@reason-react-native/image-editor)
5-
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reason-react-native.github.io/discord/)
3+
[![Build Status](https://github.com/rescript-react-native/image-editor/workflows/Build/badge.svg)](https://github.com/rescript-react-native/image-editor/actions)
4+
[![Version](https://img.shields.io/npm/v/@rescript-react-native/image-editor.svg)](https://www.npmjs.com/@rescript-react-native/image-editor)
5+
[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)
66

7-
[ReScript](https://rescript-lang.org) / [Reason](https://reasonml.github.io) bindings for
7+
[ReScript](https://rescript-lang.org) bindings for
88
[`@react-native-community/image-editor`](https://github.com/react-native-image-editor/react-native-image-editor).
99

1010
Exposed as `ReactNativeImageEditor` module.
1111

12-
`@reason-react-native/image-editor` X.y.\* means it's compatible with
12+
`@rescript-react-native/image-editor` X.y.\* means it's compatible with
1313
`@react-native-community/image-editor` X.y.\*
1414

1515
## Installation
@@ -20,22 +20,22 @@ is properly installed & configured by following their installation instructions,
2020
you can install the bindings:
2121

2222
```console
23-
npm install @reason-react-native/image-editor
23+
npm install @rescript-react-native/image-editor
2424
# or
25-
yarn add @reason-react-native/image-editor
25+
yarn add @rescript-react-native/image-editor
2626
```
2727

28-
`@reason-react-native/image-editor` should be added to `bs-dependencies` in your
28+
`@rescript-react-native/image-editor` should be added to `bs-dependencies` in your
2929
`bsconfig.json`:
3030

3131
```diff
3232
{
3333
//...
3434
"bs-dependencies": [
35-
"reason-react",
36-
"reason-react-native",
35+
"@rescript/react",
36+
"rescript-react-native",
3737
// ...
38-
+ "@reason-react-native/image-editor"
38+
+ "@rescript-react-native/image-editor"
3939
],
4040
//...
4141
}
@@ -50,23 +50,23 @@ successfully cropped, returns path of the resulting image as a `string`, wrapped
5050
in a Promise. If a remote image cannot be downloaded or an image cannot be
5151
cropped, the Promise will be rejected.
5252

53-
```reason
53+
```rescript
5454
cropImage: (source, cropData) => Js.Promise.t(string)
5555
```
5656

5757
### `fromRequired`
5858

5959
To convert a `ReactNative.Packager.required` object into [`source`](#source).
6060

61-
```reason
61+
```rescript
6262
fromRequired: ReactNative.Packager.required => source
6363
```
6464

6565
### `fromUriSource`
6666

6767
To convert a URI given as a `string` into [`source`](#source).
6868

69-
```reason
69+
```rescript
7070
fromUriSource: string => source
7171
```
7272

@@ -82,7 +82,7 @@ An abstract type created using the [`fromRequired`](#fromrequired) and
8282
An abstract type created using the constructor of the same name which takes
8383
named arguments `x` and `y` of type `int`.
8484

85-
```reason
85+
```rescript
8686
offset: (~x: int, ~y: int) => offset
8787
```
8888

@@ -91,7 +91,7 @@ offset: (~x: int, ~y: int) => offset
9191
An abstract type created using the constructor of the same name which takes
9292
named arguments `width` and `height` of type `int`.
9393

94-
```reason
94+
```rescript
9595
size: (~width: int, ~height: int) => size
9696
```
9797

@@ -102,7 +102,7 @@ named arguments `offset` (of type `offset`) and `size` (of type `size`) and
102102
optional arguments `displaySize` (of type `size`) and `resizeMode` (one of
103103
polymorphic variants `` `contain ``, `` `cover ``, `` `stretch ``).
104104

105-
```reason
105+
```rescript
106106
cropData: (
107107
~offset: offset,
108108
~size: size,
@@ -114,7 +114,7 @@ cropData: (
114114

115115
## Example
116116

117-
```reason
117+
```rescript
118118
open ReactNative;
119119
120120
// hardcoding actual image dimensions
@@ -262,11 +262,11 @@ releases.
262262
## Contribute
263263

264264
Read the
265-
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
265+
[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)
266266
before contributing.
267267

268268
## Code of Conduct
269269

270270
We want this community to be friendly and respectful to each other. Please read
271-
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
271+
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
272272
so that you can understand what actions will and will not be tolerated.

bsconfig.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"name": "@reason-react-native/image-editor",
3-
"refmt": 3,
4-
"reason": {
5-
"react-jsx": 3
6-
},
2+
"name": "@rescript-react-native/image-editor",
3+
"reason": { "react-jsx": 3 },
74
"package-specs": {
85
"module": "commonjs",
96
"in-source": true
@@ -19,5 +16,5 @@
1916
"warnings": {
2017
"error": true
2118
},
22-
"bs-dependencies": ["reason-react-native"]
19+
"bs-dependencies": ["rescript-react-native"]
2320
}

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@reason-react-native/image-editor",
2+
"name": "@rescript-react-native/image-editor",
33
"description": "ReScript bindings for @react-native-community/image-editor.",
44
"version": "2.3.2",
55
"publishConfig": {
@@ -8,21 +8,19 @@
88
"peerDependencies": {
99
"@react-native-community/image-editor": "^2.3.0"
1010
},
11-
"repository": "https://github.com/reason-react-native/image-editor.git",
11+
"repository": "https://github.com/rescript-react-native/image-editor.git",
1212
"author": "sgny (https://github.com/sgny)",
1313
"license": "MIT",
1414
"keywords": [
1515
"rescript",
16-
"reason",
17-
"reasonml",
18-
"bucklescript",
1916
"react-native",
2017
"image-editor"
2118
],
2219
"files": [
2320
"*.md",
2421
"bsconfig.json",
25-
"src/**/*.re",
22+
"src/**/*.res",
23+
"src/**/*.resi",
2624
"src/**/*.js",
2725
"!src/**/*.bs.js"
2826
],
@@ -39,13 +37,13 @@
3937
"release": "npmpub"
4038
},
4139
"devDependencies": {
42-
"bs-platform": "^8.2.0",
40+
"bs-platform": "^9.0.0",
4341
"husky": "^4.0.0",
4442
"lint-staged": "^10.0.0",
4543
"npmpub": "^5.0.0",
4644
"prettier": "^2.0.0",
47-
"reason-react": "^0.9.0",
48-
"reason-react-native": "^0.63.0"
45+
"@rescript/react": "^0.10.0",
46+
"rescript-react-native": "^0.64.3"
4947
},
5048
"prettier": {
5149
"trailingComma": "all"

src/ReactNativeImageEditor.re

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/ReactNativeImageEditor.res

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
type source
2+
3+
external fromRequired: ReactNative.Packager.required => source = "%identity"
4+
external fromUriSource: string => source = "%identity"
5+
6+
type offset
7+
8+
@obj external offset: (~x: int, ~y: int) => offset = ""
9+
10+
type size
11+
12+
@obj external size: (~width: int, ~height: int) => size = ""
13+
14+
type cropData
15+
16+
@obj
17+
external cropData: (
18+
~offset: offset,
19+
~size: size,
20+
~displaySize: size=?,
21+
~resizeMode: [#contain | #cover | #stretch]=?,
22+
unit,
23+
) => cropData = ""
24+
25+
@module("@react-native-community/image-editor") @scope("default")
26+
external cropImage: (source, cropData) => Js.Promise.t<string> = "cropImage"

yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@
127127
dependencies:
128128
"@types/node" ">= 8"
129129

130+
"@rescript/react@^0.10.0":
131+
version "0.10.2"
132+
resolved "https://registry.yarnpkg.com/@rescript/react/-/react-0.10.2.tgz#170d2a5ff34ad09cd614d92467d5efad95202794"
133+
integrity sha512-Qe21P4WnrmrbhbEMQ4dpaXC1/iMMc7JmqjuSpZouSP+s41K5dCXUGY9sds30gajU74lSfJdG2PzSDYcNAcDyVA==
134+
130135
"@sindresorhus/df@^1.0.1":
131136
version "1.0.1"
132137
resolved "https://registry.yarnpkg.com/@sindresorhus/df/-/df-1.0.1.tgz#c69b66f52f6fcdd287c807df210305dbaf78500d"
@@ -251,10 +256,10 @@ braces@^3.0.1:
251256
dependencies:
252257
fill-range "^7.0.1"
253258

254-
bs-platform@^8.2.0:
255-
version "8.3.2"
256-
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.3.2.tgz#c307f1cc2d2397c3d088c7f3b62e9f493283cdcf"
257-
integrity sha512-iOTi5JIlNPoCPq31NS9ET79FLyCpwTL2JZbgHz35LzY9Bch1iDtbBR3FVGhRbjphxelAP4fLlFONfUNp5Y3a5g==
259+
bs-platform@^9.0.0:
260+
version "9.0.2"
261+
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-9.0.2.tgz#a6eac70eb8924a322556dacaccbfbc9b2a0d3a37"
262+
integrity sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==
258263

259264
callsites@^3.0.0:
260265
version "3.1.0"
@@ -1104,21 +1109,16 @@ readjson@^2.0.1:
11041109
dependencies:
11051110
try-catch "^3.0.0"
11061111

1107-
reason-react-native@^0.63.0:
1108-
version "0.63.0"
1109-
resolved "https://registry.yarnpkg.com/reason-react-native/-/reason-react-native-0.63.0.tgz#08de85136a41809b9a66cac066d4ea6975406000"
1110-
integrity sha512-rE1OOph5Jxceost2ahdvX+VXJ2RPNyefX9FMXa/OXgqmLKjFeZuyVOySUj41UoohOYyKmZWbgansDGccwYrdUQ==
1111-
1112-
reason-react@^0.9.0:
1113-
version "0.9.1"
1114-
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.9.1.tgz#30a887158200b659aa03e2d75ff4cc54dc462bb0"
1115-
integrity sha512-nlH0O2TDy9KzOLOW+vlEQk4ExHOeciyzFdoLcsmmiit6hx6H5+CVDrwJ+8aiaLT/kqK5xFOjy4PS7PftWz4plA==
1116-
11171112
regenerator-runtime@^0.13.4:
11181113
version "0.13.5"
11191114
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
11201115
integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==
11211116

1117+
rescript-react-native@^0.64.3:
1118+
version "0.64.3"
1119+
resolved "https://registry.yarnpkg.com/rescript-react-native/-/rescript-react-native-0.64.3.tgz#8fd11a2681cfdd65c02f0ff620186e5adf0c6854"
1120+
integrity sha512-PjGDkV3RYiCTk4hCZyaKtZJV69By0AmJuzWyuHZONdeCB0q3DwjVJtA73gu6+jBrdl0OWon6UdXaVRXhhR47cQ==
1121+
11221122
resolve-from@^4.0.0:
11231123
version "4.0.0"
11241124
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"

0 commit comments

Comments
 (0)