adds initial rescript structure

This commit is contained in:
Andre 2023-09-06 19:02:59 +09:30
parent 976caf4262
commit ecf9996d48
11 changed files with 5390 additions and 0 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "disable"
}

27
rescript/.gitignore vendored Normal file
View File

@ -0,0 +1,27 @@
*.exe
*.obj
*.out
*.compile
*.native
*.byte
*.cmo
*.annot
*.cmi
*.cmx
*.cmt
*.cmti
*.cma
*.a
*.cmxa
*.obj
*~
*.annot
*.cmj
*.bak
lib/bs
*.mlast
*.mliast
.vscode
.merlin
.bsb.lock
/node_modules/

13
rescript/README.md Normal file
View File

@ -0,0 +1,13 @@
# Build
```
npm run build
```
# Watch
```
npm run watch
```

14
rescript/bsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "rescript",
"version": "0.1.0",
"sources": {
"dir" : "src",
"subdirs" : true
},
"package-specs": {
"module": "es6",
"in-source": true
},
"suffix": ".bs.js",
"bs-dependencies": ["@glennsl/rescript-jest"]
}

14
rescript/jest.config.js Normal file
View File

@ -0,0 +1,14 @@
module.exports = {
moduleFileExtensions: [
"js",
"mjs",
],
testMatch: [
"**/src/**/*_test.mjs",
"**/src/**/*_test.bs.js",
],
transform: {
"^.+\\.jsx?$": "esbuild-jest"
},
"transformIgnorePatterns": ["<rootDir>/node_modules/(?!(rescript|@glennsl/rescript-jest)/)"]
}

22
rescript/package.json Normal file
View File

@ -0,0 +1,22 @@
{
"devDependencies": {
"@babel/core": "^7.22.15",
"@babel/preset-env": "^7.22.15",
"@glennsl/rescript-jest": "^0.10.0",
"babel-jest": "^29.6.4",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"esbuild": "^0.19.2",
"esbuild-jest": "^0.5.0",
"jest": "^29.6.4",
"rescript": "^10.1.4"
},
"scripts": {
"test": "jest",
"test:watch": "jest --watchAll",
"dev:rescript": "rescript build -w",
"start": "node src/Main.bs.js"
},
"name": "rescript",
"version": "1.0.0",
"license": "MIT"
}

9
rescript/src/Demo.bs.js Normal file
View File

@ -0,0 +1,9 @@
// Generated by ReScript, PLEASE EDIT WITH CARE
console.log("Hello, ReScript");
export {
}
/* Not a pure module */

2
rescript/src/Demo.res Normal file
View File

@ -0,0 +1,2 @@
Js.log("Hello, ReScript")

View File

@ -0,0 +1,12 @@
// Generated by ReScript, PLEASE EDIT WITH CARE
import * as Jest from "@glennsl/rescript-jest/src/jest.bs.js";
Jest.test("hey", (function (param) {
return Jest.Expect.toBe(Jest.Expect.expect(1), 1);
}));
export {
}
/* Not a pure module */

View File

@ -0,0 +1,6 @@
open Jest
open Expect
test("hey", () => {
1->expect->toBe(1)
})

5268
rescript/yarn.lock Normal file

File diff suppressed because it is too large Load Diff