@greenlabs/ppx-spice 0.1.7-rc1 → 0.1.7-rc3

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.
@@ -4,48 +4,30 @@ on: [workflow_dispatch]
4
4
 
5
5
  jobs:
6
6
  build_linux:
7
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
7
+ name: ${{ matrix.os }}
8
8
  runs-on: ${{ matrix.os }}
9
9
  defaults:
10
10
  run:
11
11
  working-directory: src
12
12
  strategy:
13
13
  matrix:
14
- node-version: [12.x]
15
14
  os: [ubuntu-latest]
16
- container:
17
- image: alexfedoseev/alpine-node-yarn-esy:0.0.4
18
- steps:
19
- - name: Use Node.js ${{ matrix.node-version }}
20
- uses: actions/setup-node@v1
21
- with:
22
- node-version: ${{ matrix.node-version }}
15
+ ocaml-compiler:
16
+ - 4.12.1
23
17
 
18
+ steps:
24
19
  - uses: actions/checkout@v2
25
20
 
26
- - name: Add tar
27
- run: apk add --no-cache tar
28
-
29
- - name: Install
30
- run: esy install
31
-
32
- - name: Print esy cache
33
- id: print_esy_cache
34
- run: node ../.github/workflows/print_esy_cache.js
35
-
36
- - name: Try to restore dependencies cache
37
- uses: actions/cache@v2
38
- id: deps-cache
21
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
22
+ uses: ocaml/setup-ocaml@v2
39
23
  with:
40
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
41
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
42
- restore-keys: build-${{ matrix.os }}-
24
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
43
25
 
44
- - name: Build
45
- run: esy b
26
+ - name: Install deps
27
+ run: opam install . --deps-only --with-test
46
28
 
47
- - name: Build release-static
48
- run: esy release-static
29
+ - name: Build
30
+ run: opam exec -- dune build
49
31
 
50
32
  - name: Copy built PPX file
51
33
  run: |
@@ -4,50 +4,30 @@ on: [workflow_dispatch]
4
4
 
5
5
  jobs:
6
6
  build_macos:
7
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
7
+ name: ${{ matrix.os }}
8
8
  runs-on: ${{ matrix.os }}
9
9
  defaults:
10
10
  run:
11
11
  working-directory: src
12
12
  strategy:
13
13
  matrix:
14
- node-version: [12.x]
15
14
  os: [macOS-latest]
16
- steps:
17
- - name: Use Node.js ${{ matrix.node-version }}
18
- uses: actions/setup-node@v1
19
- with:
20
- node-version: ${{ matrix.node-version }}
15
+ ocaml-compiler:
16
+ - 4.12.1
21
17
 
18
+ steps:
22
19
  - uses: actions/checkout@v2
23
20
 
24
- - name: Install esy
25
- run: |
26
- npm install -g esy
27
-
28
- - name: Try to restore install cache
29
- uses: actions/cache@v1
21
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
22
+ uses: ocaml/setup-ocaml@v2
30
23
  with:
31
- path: ~/.esy/source
32
- key: source-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
33
-
34
- - name: Install
35
- run: esy install
24
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
36
25
 
37
- - name: Print esy cache
38
- id: print_esy_cache
39
- run: node ../.github/workflows/print_esy_cache.js
40
-
41
- - name: Try to restore dependencies cache
42
- id: deps-cache
43
- uses: actions/cache@v1
44
- with:
45
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
46
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
47
- restore-keys: build-${{ matrix.os }}-
26
+ - name: Install deps
27
+ run: opam install . --deps-only --with-test
48
28
 
49
29
  - name: Build
50
- run: esy b
30
+ run: opam exec -- dune build
51
31
 
52
32
  - name: Copy built PPX file
53
33
  run: |
@@ -3,45 +3,31 @@ name: ppx_spice build windows
3
3
  on: [workflow_dispatch]
4
4
 
5
5
  jobs:
6
- build_macos:
7
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
6
+ build_windows:
7
+ name: ${{ matrix.os }}
8
8
  runs-on: ${{ matrix.os }}
9
9
  defaults:
10
10
  run:
11
11
  working-directory: src
12
12
  strategy:
13
13
  matrix:
14
- node-version: [12.x]
15
14
  os: [windows-latest]
16
- steps:
17
- - name: Use Node.js ${{ matrix.node-version }}
18
- uses: actions/setup-node@v1
19
- with:
20
- node-version: ${{ matrix.node-version }}
15
+ ocaml-compiler:
16
+ - 4.12.1
21
17
 
18
+ steps:
22
19
  - uses: actions/checkout@v2
23
20
 
24
- - name: Install esy
25
- run: |
26
- npm install -g esy
27
-
28
- - name: Install
29
- run: esy install
30
-
31
- - name: Print esy cache
32
- id: print_esy_cache
33
- run: node ../.github/workflows/print_esy_cache.js
34
-
35
- - name: Try to restore dependencies cache
36
- id: deps-cache
37
- uses: actions/cache@v2
21
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
22
+ uses: ocaml/setup-ocaml@v2
38
23
  with:
39
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
40
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
41
- restore-keys: build-${{ matrix.os }}-
24
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
25
+
26
+ - name: Install deps
27
+ run: opam install . --deps-only --with-test
42
28
 
43
29
  - name: Build
44
- run: esy b
30
+ run: opam exec -- dune build
45
31
 
46
32
  - name: Copy built PPX file
47
33
  run: |
@@ -4,48 +4,30 @@ on: [workflow_dispatch]
4
4
 
5
5
  jobs:
6
6
  build_linux:
7
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
7
+ name: ${{ matrix.os }}
8
8
  runs-on: ${{ matrix.os }}
9
9
  defaults:
10
10
  run:
11
11
  working-directory: src
12
12
  strategy:
13
13
  matrix:
14
- node-version: [12.x]
15
14
  os: [ubuntu-latest]
16
- container:
17
- image: alexfedoseev/alpine-node-yarn-esy:0.0.4
18
- steps:
19
- - name: Use Node.js ${{ matrix.node-version }}
20
- uses: actions/setup-node@v1
21
- with:
22
- node-version: ${{ matrix.node-version }}
15
+ ocaml-compiler:
16
+ - 4.12.1
23
17
 
18
+ steps:
24
19
  - uses: actions/checkout@v2
25
20
 
26
- - name: Add tar
27
- run: apk add --no-cache tar
28
-
29
- - name: Install
30
- run: esy install
31
-
32
- - name: Print esy cache
33
- id: print_esy_cache
34
- run: node ../.github/workflows/print_esy_cache.js
35
-
36
- - name: Try to restore dependencies cache
37
- uses: actions/cache@v2
38
- id: deps-cache
21
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
22
+ uses: ocaml/setup-ocaml@v2
39
23
  with:
40
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
41
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
42
- restore-keys: build-${{ matrix.os }}-
24
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
43
25
 
44
- - name: Build
45
- run: esy b
26
+ - name: Install deps
27
+ run: opam install . --deps-only --with-test
46
28
 
47
- - name: Build release-static
48
- run: esy release-static
29
+ - name: Build
30
+ run: opam exec -- dune build
49
31
 
50
32
  - name: Copy built PPX file
51
33
  run: |
@@ -59,50 +41,67 @@ jobs:
59
41
  if-no-files-found: error
60
42
 
61
43
  build_macos:
62
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
44
+ name: ${{ matrix.os }}
63
45
  runs-on: ${{ matrix.os }}
64
46
  defaults:
65
47
  run:
66
48
  working-directory: src
67
49
  strategy:
68
50
  matrix:
69
- node-version: [12.x]
70
51
  os: [macOS-latest]
52
+ ocaml-compiler:
53
+ - 4.12.1
54
+
71
55
  steps:
72
- - name: Use Node.js ${{ matrix.node-version }}
73
- uses: actions/setup-node@v1
56
+ - uses: actions/checkout@v2
57
+
58
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
59
+ uses: ocaml/setup-ocaml@v2
74
60
  with:
75
- node-version: ${{ matrix.node-version }}
61
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
76
62
 
77
- - uses: actions/checkout@v2
63
+ - name: Install deps
64
+ run: opam install . --deps-only --with-test
65
+
66
+ - name: Build
67
+ run: opam exec -- dune build
78
68
 
79
- - name: Install esy
69
+ - name: Copy built PPX file
80
70
  run: |
81
- npm install -g esy
71
+ mv ./_build/default/bin/bin.exe ppx.exe
82
72
 
83
- - name: Try to restore install cache
84
- uses: actions/cache@v1
73
+ - name: (only on release) Upload artifacts ${{ matrix.os }}
74
+ uses: actions/upload-artifact@master
85
75
  with:
86
- path: ~/.esy/source
87
- key: source-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
76
+ name: ${{ matrix.os }}
77
+ path: src/ppx.exe
78
+ if-no-files-found: error
88
79
 
89
- - name: Install
90
- run: esy install
80
+ build_windows:
81
+ name: ${{ matrix.os }}
82
+ runs-on: ${{ matrix.os }}
83
+ defaults:
84
+ run:
85
+ working-directory: src
86
+ strategy:
87
+ matrix:
88
+ os: [windows-latest]
89
+ ocaml-compiler:
90
+ - 4.12.1
91
91
 
92
- - name: Print esy cache
93
- id: print_esy_cache
94
- run: node ../.github/workflows/print_esy_cache.js
92
+ steps:
93
+ - uses: actions/checkout@v2
95
94
 
96
- - name: Try to restore dependencies cache
97
- id: deps-cache
98
- uses: actions/cache@v1
95
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
96
+ uses: ocaml/setup-ocaml@v2
99
97
  with:
100
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
101
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
102
- restore-keys: build-${{ matrix.os }}-
98
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
99
+
100
+ - name: Install deps
101
+ run: opam install . --deps-only --with-test
103
102
 
104
103
  - name: Build
105
- run: esy b
104
+ run: opam exec -- dune build
106
105
 
107
106
  - name: Copy built PPX file
108
107
  run: |
@@ -116,14 +115,14 @@ jobs:
116
115
  if-no-files-found: error
117
116
 
118
117
  publish:
119
- needs: [build_linux, build_macos]
118
+ needs: [build_linux, build_macos, build_windows]
120
119
  name: (only on release) Publish
121
120
  runs-on: ubuntu-latest
122
121
  steps:
123
122
  - uses: actions/checkout@v1
124
- - uses: actions/setup-node@v1
123
+ - uses: actions/setup-node@v3
125
124
  with:
126
- node-version: "12.x"
125
+ node-version: 16
127
126
  registry-url: "https://registry.npmjs.org"
128
127
 
129
128
  - name: Download linux artifacts
@@ -140,12 +139,20 @@ jobs:
140
139
  name: macOS-latest
141
140
  path: binaries/darwin
142
141
 
142
+ - name: Download windows artifacts
143
+ if: success()
144
+ uses: actions/download-artifact@master
145
+ with:
146
+ name: windows-latest
147
+ path: binaries/windows
148
+
143
149
  - name: Move artifacts
144
150
  if: success()
145
151
  run: |
146
152
  mkdir -p bin
147
153
  mv binaries/linux/ppx.exe ppx-linux.exe
148
154
  mv binaries/darwin/ppx.exe ppx-osx.exe
155
+ mv binaries/windows/ppx.exe ppx-windows.exe
149
156
 
150
157
  - name: Publish
151
158
  if: success()
@@ -4,54 +4,36 @@ on:
4
4
  workflow_dispatch:
5
5
  inputs:
6
6
  release_version:
7
- description: 'change npm release version'
8
- required: true
9
- default: ''
7
+ description: "change npm release version"
8
+ required: true
9
+ default: ""
10
10
 
11
11
  jobs:
12
12
  build_linux:
13
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
13
+ name: ${{ matrix.os }}
14
14
  runs-on: ${{ matrix.os }}
15
15
  defaults:
16
16
  run:
17
17
  working-directory: src
18
18
  strategy:
19
19
  matrix:
20
- node-version: [12.x]
21
20
  os: [ubuntu-latest]
22
- container:
23
- image: alexfedoseev/alpine-node-yarn-esy:0.0.4
24
- steps:
25
- - name: Use Node.js ${{ matrix.node-version }}
26
- uses: actions/setup-node@v1
27
- with:
28
- node-version: ${{ matrix.node-version }}
21
+ ocaml-compiler:
22
+ - 4.12.1
29
23
 
24
+ steps:
30
25
  - uses: actions/checkout@v2
31
26
 
32
- - name: Add tar
33
- run: apk add --no-cache tar
34
-
35
- - name: Install
36
- run: esy install
37
-
38
- - name: Print esy cache
39
- id: print_esy_cache
40
- run: node ../.github/workflows/print_esy_cache.js
41
-
42
- - name: Try to restore dependencies cache
43
- uses: actions/cache@v2
44
- id: deps-cache
27
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
28
+ uses: ocaml/setup-ocaml@v2
45
29
  with:
46
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
47
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
48
- restore-keys: build-${{ matrix.os }}-
30
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
49
31
 
50
- - name: Build
51
- run: esy b
32
+ - name: Install deps
33
+ run: opam install . --deps-only --with-test
52
34
 
53
- - name: Build release-static
54
- run: esy release-static
35
+ - name: Build
36
+ run: opam exec -- dune build
55
37
 
56
38
  - name: Copy built PPX file
57
39
  run: |
@@ -65,50 +47,67 @@ jobs:
65
47
  if-no-files-found: error
66
48
 
67
49
  build_macos:
68
- name: ${{ matrix.os }}/node-${{ matrix.node-version }}
50
+ name: ${{ matrix.os }}
69
51
  runs-on: ${{ matrix.os }}
70
52
  defaults:
71
53
  run:
72
54
  working-directory: src
73
55
  strategy:
74
56
  matrix:
75
- node-version: [12.x]
76
57
  os: [macOS-latest]
58
+ ocaml-compiler:
59
+ - 4.12.1
60
+
77
61
  steps:
78
- - name: Use Node.js ${{ matrix.node-version }}
79
- uses: actions/setup-node@v1
62
+ - uses: actions/checkout@v2
63
+
64
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
65
+ uses: ocaml/setup-ocaml@v2
80
66
  with:
81
- node-version: ${{ matrix.node-version }}
67
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
82
68
 
83
- - uses: actions/checkout@v2
69
+ - name: Install deps
70
+ run: opam install . --deps-only --with-test
71
+
72
+ - name: Build
73
+ run: opam exec -- dune build
84
74
 
85
- - name: Install esy
75
+ - name: Copy built PPX file
86
76
  run: |
87
- npm install -g esy
77
+ mv ./_build/default/bin/bin.exe ppx.exe
88
78
 
89
- - name: Try to restore install cache
90
- uses: actions/cache@v1
79
+ - name: (only on release) Upload artifacts ${{ matrix.os }}
80
+ uses: actions/upload-artifact@master
91
81
  with:
92
- path: ~/.esy/source
93
- key: source-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
82
+ name: ${{ matrix.os }}
83
+ path: src/ppx.exe
84
+ if-no-files-found: error
94
85
 
95
- - name: Install
96
- run: esy install
86
+ build_windows:
87
+ name: ${{ matrix.os }}
88
+ runs-on: ${{ matrix.os }}
89
+ defaults:
90
+ run:
91
+ working-directory: src
92
+ strategy:
93
+ matrix:
94
+ os: [windows-latest]
95
+ ocaml-compiler:
96
+ - 4.12.1
97
97
 
98
- - name: Print esy cache
99
- id: print_esy_cache
100
- run: node ../.github/workflows/print_esy_cache.js
98
+ steps:
99
+ - uses: actions/checkout@v2
101
100
 
102
- - name: Try to restore dependencies cache
103
- id: deps-cache
104
- uses: actions/cache@v1
101
+ - name: Use OCaml ${{ matrix.ocaml-compiler}}
102
+ uses: ocaml/setup-ocaml@v2
105
103
  with:
106
- path: ${{ steps.print_esy_cache.outputs.esy_cache }}
107
- key: build-${{ matrix.os }}-${{ hashFiles('**/index.json') }}
108
- restore-keys: build-${{ matrix.os }}-
104
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
105
+
106
+ - name: Install deps
107
+ run: opam install . --deps-only --with-test
109
108
 
110
109
  - name: Build
111
- run: esy b
110
+ run: opam exec -- dune build
112
111
 
113
112
  - name: Copy built PPX file
114
113
  run: |
@@ -122,14 +121,14 @@ jobs:
122
121
  if-no-files-found: error
123
122
 
124
123
  publish:
125
- needs: [build_linux, build_macos]
124
+ needs: [build_linux, build_macos, build_windows]
126
125
  name: (only on release) Publish
127
126
  runs-on: ubuntu-latest
128
127
  steps:
129
128
  - uses: actions/checkout@v1
130
- - uses: actions/setup-node@v1
129
+ - uses: actions/setup-node@v3
131
130
  with:
132
- node-version: "12.x"
131
+ node-version: 16
133
132
  registry-url: "https://registry.npmjs.org"
134
133
 
135
134
  - name: Download linux artifacts
@@ -146,12 +145,20 @@ jobs:
146
145
  name: macOS-latest
147
146
  path: binaries/darwin
148
147
 
148
+ - name: Download windows artifacts
149
+ if: success()
150
+ uses: actions/download-artifact@master
151
+ with:
152
+ name: windows-latest
153
+ path: binaries/windows
154
+
149
155
  - name: Move artifacts
150
156
  if: success()
151
157
  run: |
152
158
  mkdir -p bin
153
159
  mv binaries/linux/ppx.exe ppx-linux.exe
154
160
  mv binaries/darwin/ppx.exe ppx-osx.exe
161
+ mv binaries/windows/ppx.exe ppx-windows.exe
155
162
 
156
163
  - name: Change npm release version
157
164
  if: success()
package/README.md CHANGED
@@ -138,39 +138,10 @@ yarn add -D @greenlabs/ppx-spice
138
138
 
139
139
  ## Development
140
140
 
141
- ### With Esy
142
-
143
- 1. Install dependencies
144
-
145
- ```
146
- cd src
147
- esy install
148
- ```
149
-
150
- 2. Build
151
-
152
- ```
153
- (make sure in /src directory)
154
- esy build
155
- ```
156
-
157
- 3. Test
158
-
159
- ```
160
- cd test
161
-
162
- (install dependencies)
163
- yarn
164
-
165
- (build --watch)
166
- yarn res:clean && yarn res:watch
167
-
168
- (run test --watch)
169
- yarn test:watch
170
- ```
171
-
172
141
  ### With Dune
173
142
 
143
+ Make sure running the below commands in `/src`.
144
+
174
145
  1. Create a sandbox with opam
175
146
 
176
147
  ```
@@ -180,7 +151,7 @@ opam switch create spice 4.12.1
180
151
  2. Install dependencies
181
152
 
182
153
  ```
183
- opam install dune ppxlib ocaml-lsp-server ocamlformat ocp-indent
154
+ opam install . --deps-only
184
155
  ```
185
156
 
186
157
  3. Build
@@ -191,6 +162,8 @@ dune build
191
162
 
192
163
  4. Test
193
164
 
165
+ Make sure running tests in `/test`
166
+
194
167
  ```
195
168
  cd test
196
169
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greenlabs/ppx-spice",
3
- "version": "0.1.7-rc1",
3
+ "version": "0.1.7-rc3",
4
4
  "description": "ReScript PPX which generate JSON (de)serializer",
5
5
  "license": "MIT",
6
6
  "author": "Greenlabs Dev <developer@greenlabs.co.kr>",
package/ppx-linux.exe CHANGED
Binary file
package/ppx-osx.exe CHANGED
Binary file
Binary file
@@ -12,9 +12,9 @@ homepage: "https://github.com/green-labs/ppx_spice"
12
12
  bug-reports: "https://github.com/green-labs/ppx_spice/issues"
13
13
  dev-repo: "git+https://github.com/green-labs/ppx_spice.git"
14
14
  depends: [
15
- "ocaml" {"4.12.1"}
15
+ "ocaml" { = "4.12.1"}
16
16
  "dune" { >= "2.7"}
17
- "ppxlib" {"0.23.0"}
17
+ "ppxlib" { = "0.23.0"}
18
18
  ]
19
19
  build: [
20
20
  ["dune" "build" "-p" name "-j" jobs]
package/src/esy.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "name": "ppx_spice",
3
- "description": "OCaml/ReasonML ppx that generate parse/stringify function",
4
- "scripts": {
5
- "format": "dune build @fmt --auto-promote",
6
- "release-static": "dune build --root . --only-packages '#{self.name}' --ignore-promoted-rules --no-config --profile release-static"
7
- },
8
- "esy": {
9
- "build": "dune build -p #{self.name}",
10
- "buildsInSource": "_build"
11
- },
12
- "dependencies": {
13
- "@opam/dune": "*",
14
- "@opam/ppxlib": "0.23.0",
15
- "ocaml": "4.12.x"
16
- },
17
- "devDependencies": {
18
- "@opam/ocaml-lsp-server": "1.8.3",
19
- "@opam/ocamlformat": "0.19.0"
20
- }
21
- }