@softwarefactory-project/re-ansi 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -81,6 +81,11 @@ Make sure to read about [React][reason-react] and [Reason][rescript-lang] too.
81
81
 
82
82
  ## Changes
83
83
 
84
+ ### 0.7.2
85
+
86
+ - Use a bundle for the published JS library thanks to
87
+ https://github.com/rescript-lang/rescript-compiler/issues/6754#issuecomment-2153018168
88
+
84
89
  ### 0.7.1
85
90
 
86
91
  - Use @rescript/std instead of rescript.
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@softwarefactory-project/re-ansi",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "ANSI code to HTML",
5
5
  "files": [
6
6
  "README.md",
7
7
  "LICENSE",
8
8
  "rescript.json",
9
- "src"
9
+ "src/Ansi.res",
10
+ "src/Ansi.res.js"
10
11
  ],
11
12
  "main": "./src/Ansi.res.js",
13
+ "type": "module",
12
14
  "license": "Apache-2.0",
13
15
  "homepage": "https://github.com/softwarefactory-project/re-ansi",
14
16
  "repository": {
@@ -19,19 +21,18 @@
19
21
  "build": "rescript",
20
22
  "clean": "rescript clean",
21
23
  "dev": "rescript -w",
22
- "test": "npm run build && node tests/Spec.res.js"
24
+ "test": "npm run build && node tests/Spec.res.mjs",
25
+ "bundle": "npm run clean && npm run build && nanobundle build --clean --no-sourcemap --no-legal-comments --external=react"
23
26
  },
24
27
  "keywords": [
25
28
  "ansi",
26
29
  "rescript",
27
30
  "react"
28
31
  ],
29
- "dependencies": {
32
+ "devDependencies": {
33
+ "nanobundle": "^2.0.0",
30
34
  "@rescript/core": "^1.3.0",
31
35
  "@rescript/react": "^0.12.1",
32
- "@rescript/std": "^11.1.0"
33
- },
34
- "devDependencies": {
35
36
  "rescript": "^11.1.0"
36
37
  }
37
38
  }
package/rescript.json CHANGED
@@ -7,11 +7,10 @@
7
7
  "bsc-flags": ["-open RescriptCore"],
8
8
  "package-specs": [
9
9
  {
10
- "module": "commonjs",
10
+ "module": "esmodule",
11
11
  "in-source": true
12
12
  }
13
13
  ],
14
- "suffix": ".res.js",
15
- "bs-dependencies": ["@rescript/react", "@rescript/core"],
16
- "external-stdlib" : "@rescript/std"
14
+ "suffix": ".res.mjs",
15
+ "bs-dependencies": ["@rescript/react", "@rescript/core"]
17
16
  }
package/src/Ansi.res CHANGED
@@ -160,7 +160,7 @@ module AnsiCode = {
160
160
  ->RegExp.exec(txt)
161
161
  ->Option.flatMap(res => res->Array.get(0)
162
162
  ->Option.flatMap(url =>
163
- (url->Js.String.length, url->HRef->Some)->Some
163
+ (url->String.length, url->HRef->Some)->Some
164
164
  )
165
165
  )
166
166
  ->Option.getOr((1, None));
@@ -307,7 +307,7 @@ module Document = {
307
307
  // Convert a string to a document
308
308
  let parse = (txt: string): document => {
309
309
  let rec go = (txt: string, acc: list<document>) => {
310
- let length = txt->Js.String.length;
310
+ let length = txt->String.length;
311
311
  switch (txt->Document.parse(length, 0)) {
312
312
  | (pos, Some(doc)) when pos == length => acc->List.add(doc)
313
313
  | (pos, Some(doc)) =>
@@ -315,7 +315,7 @@ let parse = (txt: string): document => {
315
315
  | _ => acc
316
316
  };
317
317
  };
318
- txt->go(list{})->Belt.List.reverse->Belt.List.flatten;
318
+ txt->go(list{})->List.reverse->List.flat;
319
319
  };
320
320
 
321
321
  // Convert a document to a React.element