sendscript 0.0.1 → 0.0.3

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.
@@ -0,0 +1,15 @@
1
+ TAP version 14
2
+ # Subtest: return a constant value
3
+ 1..1
4
+ ok 1 - should be equal
5
+ ok 1 - return a constant value # time=5.997ms
6
+
7
+ # Subtest: use function calls as arguments
8
+ 1..4
9
+ ok 1 - should be equal
10
+ ok 2 - should be equal
11
+ ok 3 - should be equal
12
+ ok 4 - should be equal
13
+ ok 2 - use function calls as arguments # time=1.417ms
14
+
15
+ 1..2
@@ -0,0 +1,26 @@
1
+ TAP version 14
2
+ # Subtest: curry function
3
+ # Subtest: curry function returns a function
4
+ ok 1 - returns a function
5
+ 1..1
6
+ ok 1 - curry function returns a function # time=4.318ms
7
+
8
+ # Subtest: curried function returns correct result
9
+ ok 1 - returns correct result
10
+ 1..1
11
+ ok 2 - curried function returns correct result # time=0.913ms
12
+
13
+ # Subtest: curried function handles partial application
14
+ ok 1 - handles partial application
15
+ 1..1
16
+ ok 3 - curried function handles partial application # time=0.785ms
17
+
18
+ # Subtest: curried function handles multiple arguments
19
+ ok 1 - handles multiple arguments
20
+ 1..1
21
+ ok 4 - curried function handles multiple arguments # time=0.71ms
22
+
23
+ 1..4
24
+ ok 1 - curry function # time=15.786ms
25
+
26
+ 1..1
@@ -0,0 +1,58 @@
1
+ TAP version 14
2
+ # Subtest: should evaluate basic expressions correctly
3
+ 1..4
4
+ ok 1 - 1 + 2 = 3
5
+ ok 2 - 5 - 3 = 2
6
+ ok 3 - 4 * 3 = 12
7
+ ok 4 - 10 / 2 = 5
8
+ ok 1 - should evaluate basic expressions correctly # time=8.016ms
9
+
10
+ # Subtest: should be able to call a partially applied function
11
+ ok 1 - should be equal
12
+ ok 2 - should be equal
13
+ 1..2
14
+ ok 2 - should be able to call a partially applied function # time=1.168ms
15
+
16
+ # Subtest: should handle let expressions
17
+ 1..1
18
+ ok 1 - x + y = 5
19
+ ok 3 - should handle let expressions # time=1.027ms
20
+
21
+ # Subtest: should handle fn expressions
22
+ 1..2
23
+ ok 1 - should return a function
24
+ ok 2 - 1 + 2 = 3
25
+ ok 4 - should handle fn expressions # time=1.4ms
26
+
27
+ # Subtest: should throw an error for unknown expressions
28
+ 1..1
29
+ ok 1 - should throw an error for unknown expressions
30
+ ok 5 - should throw an error for unknown expressions # time=0.932ms
31
+
32
+ # Subtest: should evaluate nested expressions correctly
33
+ 1..1
34
+ ok 1 - 2 * (1 + 2) = 6
35
+ ok 6 - should evaluate nested expressions correctly # time=0.746ms
36
+
37
+ # Subtest: should concatenate two arrays
38
+ 1..1
39
+ ok 1 - should be equivalent
40
+ ok 7 - should concatenate two arrays # time=2.254ms
41
+
42
+ # Subtest: should fetch the reference to the item on the env
43
+ ok 1 - should be equivalent
44
+ ok 2 - should be equivalent
45
+ 1..2
46
+ ok 8 - should fetch the reference to the item on the env # time=0.536ms
47
+
48
+ # Subtest: should reject with the error of the called function
49
+ ok 1 - expected to reject
50
+ 1..1
51
+ ok 9 - should reject with the error of the called function # time=1.386ms
52
+
53
+ # Subtest: should not exec expressions in an object
54
+ ok 1 - should be equivalent
55
+ 1..1
56
+ ok 10 - should not exec expressions in an object # time=1.079ms
57
+
58
+ 1..10
package/CHANGELOG.md CHANGED
@@ -4,8 +4,20 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.0.3](https://github.com/bas080/sendscript/compare/v0.0.2...v0.0.3)
8
+
9
+ - Update tap from version 16 to 18 [`465c933`](https://github.com/bas080/sendscript/commit/465c93391097018ee010b51a64ca51d6872b49f1)
10
+
11
+ #### [v0.0.2](https://github.com/bas080/sendscript/compare/v0.0.1...v0.0.2)
12
+
13
+ > 6 October 2023
14
+
15
+ - Add table of content to readme [`a14f2d8`](https://github.com/bas080/sendscript/commit/a14f2d86f602a01721812d1c5be94b299e515397)
16
+
7
17
  #### [v0.0.1](https://github.com/bas080/sendscript/compare/v0.0.0...v0.0.1)
8
18
 
19
+ > 26 September 2023
20
+
9
21
  - Add square fn to the socket.io example [`8d7cfbd`](https://github.com/bas080/sendscript/commit/8d7cfbddd7933804e7168825cf1e17e792c91fe9)
10
22
  - Rename dsl to api [`4a67324`](https://github.com/bas080/sendscript/commit/4a6732456656db743d02c5c35444f93a866d27ec)
11
23
  - Move promise only concept to own module [`50adde6`](https://github.com/bas080/sendscript/commit/50adde694b3d23fb025a4ad20dcc83d7bb72b852)
package/README.md CHANGED
@@ -11,6 +11,23 @@ Write JS code that you can run on servers, browsers or other clients.
11
11
  > method of communication between servers and clients that best fits your
12
12
  > needs.
13
13
 
14
+ <!-- toc -->
15
+
16
+ - [Socket example](#socket-example)
17
+ * [Module](#module)
18
+ * [Server](#server)
19
+ * [Client](#client)
20
+ - [Reference](#reference)
21
+ * [`sendscript/api.mjs`](#sendscriptapimjs)
22
+ * [`sendscript/exec.mjs`](#sendscriptexecmjs)
23
+ - [Tests](#tests)
24
+ - [Formatting](#formatting)
25
+ - [Changelog](#changelog)
26
+ - [Dependencies](#dependencies)
27
+ - [License](#license)
28
+
29
+ <!-- tocstop -->
30
+
14
31
  ## Socket example
15
32
 
16
33
  For this example we'll use [socket.io][socket.io].
@@ -172,32 +189,25 @@ is an implementation detail and might change over time.
172
189
  Tests with 100% code coverage.
173
190
 
174
191
  ```bash
175
- npx c8 --100 npm t -- -R classic
192
+ npm t -- -R silent
193
+ npm t -- report text-summary
176
194
  ```
177
195
  ```
178
196
 
179
- > sendscript@0.0.1 test
180
- > tap *.test.mjs --no-cov -R classic
197
+ > sendscript@0.0.3 test
198
+ > tap -R silent
199
+
181
200
 
182
- api.test.mjs .......................................... 5/5
183
- curry.test.mjs ........................................ 4/4
184
- exec.test.mjs ....................................... 16/16
185
- total ............................................... 25/25
201
+ > sendscript@0.0.3 test
202
+ > tap report text-summary
186
203
 
187
- 25 passing (406.01ms)
188
204
 
189
- ok
190
- ------------------|---------|----------|---------|---------|-------------------
191
- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
192
- ------------------|---------|----------|---------|---------|-------------------
193
- All files | 100 | 100 | 100 | 100 |
194
- api.mjs | 100 | 100 | 100 | 100 |
195
- curry.mjs | 100 | 100 | 100 | 100 |
196
- debug.mjs | 100 | 100 | 100 | 100 |
197
- error.mjs | 100 | 100 | 100 | 100 |
198
- exec.mjs | 100 | 100 | 100 | 100 |
199
- promise-only.mjs | 100 | 100 | 100 | 100 |
200
- ------------------|---------|----------|---------|---------|-------------------
205
+ =============================== Coverage summary ===============================
206
+ Statements : 100% ( 139/139 )
207
+ Branches : 100% ( 47/47 )
208
+ Functions : 100% ( 12/12 )
209
+ Lines : 100% ( 139/139 )
210
+ ================================================================================
201
211
  ```
202
212
 
203
213
  ## Formatting
@@ -217,6 +227,17 @@ The [changelog][changelog] is generated using the useful
217
227
  npx auto-changelog -p
218
228
  ```
219
229
 
230
+ ## Dependencies
231
+
232
+ Check if packages are up to date on release.
233
+
234
+ ```bash
235
+ npm outdated && echo 'No outdated packages found'
236
+ ```
237
+ ```
238
+ No outdated packages found
239
+ ```
240
+
220
241
  ## License
221
242
 
222
243
  See the [LICENSE.txt][license] file for details.
package/README.mz CHANGED
@@ -11,6 +11,8 @@ Write JS code that you can run on servers, browsers or other clients.
11
11
  > method of communication between servers and clients that best fits your
12
12
  > needs.
13
13
 
14
+ <!-- toc -->
15
+
14
16
  ## Socket example
15
17
 
16
18
  For this example we'll use [socket.io][socket.io].
@@ -169,7 +171,8 @@ is an implementation detail and might change over time.
169
171
  Tests with 100% code coverage.
170
172
 
171
173
  ```bash bash
172
- npx c8 --100 npm t -- -R classic
174
+ npm t -- -R silent
175
+ npm t -- report text-summary
173
176
  ```
174
177
 
175
178
  ## Formatting
@@ -189,6 +192,14 @@ The [changelog][changelog] is generated using the useful
189
192
  npx auto-changelog -p
190
193
  ```
191
194
 
195
+ ## Dependencies
196
+
197
+ Check if packages are up to date on release.
198
+
199
+ ```bash bash
200
+ npm outdated && echo 'No outdated packages found'
201
+ ```
202
+
192
203
  ## License
193
204
 
194
205
  See the [LICENSE.txt][license] file for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sendscript",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Blur the line between server and client code.",
5
5
  "module": true,
6
6
  "main": "index.mjs",
@@ -9,14 +9,14 @@
9
9
  "url": "git@github.com:bas080/sendscript.git"
10
10
  },
11
11
  "scripts": {
12
- "test": "tap *.test.mjs --no-cov",
12
+ "test": "tap",
13
13
  "version": "npm run docs && git add *.md",
14
- "docs": "markatzea README.mz | tee README.md"
14
+ "docs": "markatzea README.mz | tee README.md && npx markdown-toc -i README.md"
15
15
  },
16
16
  "author": "Bas Huis",
17
17
  "license": "MIT",
18
18
  "devDependencies": {
19
- "tap": "^16.3.4"
19
+ "tap": "^18.4.3"
20
20
  },
21
21
  "dependencies": {
22
22
  "debug": "^4.3.4"