o1js-pack 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/.eslintrc.cjs +24 -0
  2. package/.gitattributes +3 -0
  3. package/.github/workflows/ci.yml +26 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.prettierignore +14 -0
  6. package/.prettierrc +6 -0
  7. package/LICENSE +199 -0
  8. package/README.md +59 -0
  9. package/babel.config.cjs +3 -0
  10. package/build/src/index.d.ts +5 -0
  11. package/build/src/index.js +6 -0
  12. package/build/src/index.js.map +1 -0
  13. package/build/src/lib/PackingPlant.d.ts +92 -0
  14. package/build/src/lib/PackingPlant.js +75 -0
  15. package/build/src/lib/PackingPlant.js.map +1 -0
  16. package/build/src/lib/packed-types/PackedBool.d.ts +77 -0
  17. package/build/src/lib/packed-types/PackedBool.js +48 -0
  18. package/build/src/lib/packed-types/PackedBool.js.map +1 -0
  19. package/build/src/lib/packed-types/PackedBool.test.d.ts +1 -0
  20. package/build/src/lib/packed-types/PackedBool.test.js +76 -0
  21. package/build/src/lib/packed-types/PackedBool.test.js.map +1 -0
  22. package/build/src/lib/packed-types/PackedCharacter.d.ts +51 -0
  23. package/build/src/lib/packed-types/PackedCharacter.js +34 -0
  24. package/build/src/lib/packed-types/PackedCharacter.js.map +1 -0
  25. package/build/src/lib/packed-types/PackedCharacter.test.d.ts +1 -0
  26. package/build/src/lib/packed-types/PackedCharacter.test.js +31 -0
  27. package/build/src/lib/packed-types/PackedCharacter.test.js.map +1 -0
  28. package/build/src/lib/packed-types/PackedString.d.ts +78 -0
  29. package/build/src/lib/packed-types/PackedString.js +83 -0
  30. package/build/src/lib/packed-types/PackedString.js.map +1 -0
  31. package/build/src/lib/packed-types/PackedString.test.d.ts +1 -0
  32. package/build/src/lib/packed-types/PackedString.test.js +100 -0
  33. package/build/src/lib/packed-types/PackedString.test.js.map +1 -0
  34. package/build/src/lib/packed-types/PackedUInt32.d.ts +77 -0
  35. package/build/src/lib/packed-types/PackedUInt32.js +48 -0
  36. package/build/src/lib/packed-types/PackedUInt32.js.map +1 -0
  37. package/build/src/lib/packed-types/PackedUInt32.test.d.ts +1 -0
  38. package/build/src/lib/packed-types/PackedUInt32.test.js +84 -0
  39. package/build/src/lib/packed-types/PackedUInt32.test.js.map +1 -0
  40. package/build/src/lib/scratch.d.ts +1 -0
  41. package/build/src/lib/scratch.js +16 -0
  42. package/build/src/lib/scratch.js.map +1 -0
  43. package/build/src/packed-types/PackedBool.d.ts +51 -0
  44. package/build/src/packed-types/PackedBool.js +34 -0
  45. package/build/src/packed-types/PackedBool.js.map +1 -0
  46. package/build/src/packed-types/PackedBool.test.d.ts +1 -0
  47. package/build/src/packed-types/PackedBool.test.js +101 -0
  48. package/build/src/packed-types/PackedBool.test.js.map +1 -0
  49. package/build/src/packed-types/PackedCharacter.d.ts +51 -0
  50. package/build/src/packed-types/PackedCharacter.js +34 -0
  51. package/build/src/packed-types/PackedCharacter.js.map +1 -0
  52. package/build/src/packed-types/PackedCharacter.test.d.ts +1 -0
  53. package/build/src/packed-types/PackedCharacter.test.js +31 -0
  54. package/build/src/packed-types/PackedCharacter.test.js.map +1 -0
  55. package/build/src/packed-types/PackedUInt32.d.ts +51 -0
  56. package/build/src/packed-types/PackedUInt32.js +34 -0
  57. package/build/src/packed-types/PackedUInt32.js.map +1 -0
  58. package/build/src/packed-types/PackedUInt32.test.d.ts +1 -0
  59. package/build/src/packed-types/PackedUInt32.test.js +68 -0
  60. package/build/src/packed-types/PackedUInt32.test.js.map +1 -0
  61. package/build/src/packed-types/PackingPlant.d.ts +54 -0
  62. package/build/src/packed-types/PackingPlant.js +45 -0
  63. package/build/src/packed-types/PackingPlant.js.map +1 -0
  64. package/build/src/packed-types/scratch.d.ts +1 -0
  65. package/build/src/packed-types/scratch.js +5 -0
  66. package/build/src/packed-types/scratch.js.map +1 -0
  67. package/config.json +4 -0
  68. package/coverage/clover.xml +166 -0
  69. package/coverage/coverage-final.json +5 -0
  70. package/coverage/lcov-report/PackedBool.ts.html +268 -0
  71. package/coverage/lcov-report/PackedUInt32.ts.html +313 -0
  72. package/coverage/lcov-report/base.css +224 -0
  73. package/coverage/lcov-report/block-navigation.js +87 -0
  74. package/coverage/lcov-report/favicon.png +0 -0
  75. package/coverage/lcov-report/index.html +131 -0
  76. package/coverage/lcov-report/lib/PackingPlant.ts.html +478 -0
  77. package/coverage/lcov-report/lib/index.html +116 -0
  78. package/coverage/lcov-report/lib/packed-types/PackedBool.ts.html +238 -0
  79. package/coverage/lcov-report/lib/packed-types/PackedString.ts.html +364 -0
  80. package/coverage/lcov-report/lib/packed-types/PackedUInt32.ts.html +238 -0
  81. package/coverage/lcov-report/lib/packed-types/index.html +146 -0
  82. package/coverage/lcov-report/prettify.css +1 -0
  83. package/coverage/lcov-report/prettify.js +2 -0
  84. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  85. package/coverage/lcov-report/sorter.js +196 -0
  86. package/coverage/lcov.info +282 -0
  87. package/jest-resolver.cjs +21 -0
  88. package/jest.config.js +24 -0
  89. package/package.json +50 -0
  90. package/tsconfig.json +23 -0
@@ -0,0 +1,282 @@
1
+ TN:
2
+ SF:src/lib/PackingPlant.ts
3
+ FN:12,PackingPlant
4
+ FN:31,(anonymous_1)
5
+ FN:41,(anonymous_2)
6
+ FN:46,(anonymous_3)
7
+ FN:52,(anonymous_4)
8
+ FN:56,(anonymous_5)
9
+ FN:63,(anonymous_6)
10
+ FN:72,MultiPackingPlant
11
+ FN:92,(anonymous_8)
12
+ FN:100,(anonymous_9)
13
+ FN:105,(anonymous_10)
14
+ FN:111,(anonymous_11)
15
+ FN:115,(anonymous_12)
16
+ FN:122,(anonymous_13)
17
+ FNF:14
18
+ FNH:10
19
+ FNDA:10,PackingPlant
20
+ FNDA:12,(anonymous_1)
21
+ FNDA:0,(anonymous_2)
22
+ FNDA:0,(anonymous_3)
23
+ FNDA:4,(anonymous_4)
24
+ FNDA:4,(anonymous_5)
25
+ FNDA:2,(anonymous_6)
26
+ FNDA:8,MultiPackingPlant
27
+ FNDA:10,(anonymous_8)
28
+ FNDA:0,(anonymous_9)
29
+ FNDA:0,(anonymous_10)
30
+ FNDA:5,(anonymous_11)
31
+ FNDA:2,(anonymous_12)
32
+ FNDA:1,(anonymous_13)
33
+ DA:10,3
34
+ DA:17,10
35
+ DA:18,2
36
+ DA:25,8
37
+ DA:26,8
38
+ DA:29,10
39
+ DA:32,12
40
+ DA:33,2
41
+ DA:37,10
42
+ DA:38,10
43
+ DA:42,0
44
+ DA:43,0
45
+ DA:47,0
46
+ DA:48,0
47
+ DA:49,0
48
+ DA:53,4
49
+ DA:57,4
50
+ DA:64,2
51
+ DA:65,2
52
+ DA:66,2
53
+ DA:69,8
54
+ DA:76,8
55
+ DA:77,0
56
+ DA:81,8
57
+ DA:85,8
58
+ DA:86,8
59
+ DA:87,8
60
+ DA:90,8
61
+ DA:93,10
62
+ DA:94,2
63
+ DA:96,8
64
+ DA:97,8
65
+ DA:101,0
66
+ DA:102,0
67
+ DA:106,0
68
+ DA:107,0
69
+ DA:108,0
70
+ DA:112,5
71
+ DA:116,2
72
+ DA:123,1
73
+ DA:124,1
74
+ DA:125,1
75
+ DA:126,3
76
+ DA:130,8
77
+ LF:44
78
+ LH:33
79
+ BRDA:17,0,0,2
80
+ BRDA:32,1,0,2
81
+ BRDA:76,2,0,0
82
+ BRDA:93,3,0,2
83
+ BRF:4
84
+ BRH:3
85
+ end_of_record
86
+ TN:
87
+ SF:src/lib/packed-types/PackedBool.ts
88
+ FN:6,PackedBoolFactory
89
+ FN:8,(anonymous_1)
90
+ FN:9,(anonymous_2)
91
+ FN:22,(anonymous_3)
92
+ FN:27,(anonymous_4)
93
+ FN:36,(anonymous_5)
94
+ FN:41,(anonymous_6)
95
+ FN:42,(anonymous_7)
96
+ FN:46,(anonymous_8)
97
+ FN:47,(anonymous_9)
98
+ FNF:10
99
+ FNH:10
100
+ FNDA:5,PackedBoolFactory
101
+ FNDA:3,(anonymous_1)
102
+ FNDA:3,(anonymous_2)
103
+ FNDA:762,(anonymous_3)
104
+ FNDA:5,(anonymous_4)
105
+ FNDA:3,(anonymous_5)
106
+ FNDA:3,(anonymous_6)
107
+ FNDA:763,(anonymous_7)
108
+ FNDA:1,(anonymous_8)
109
+ FNDA:254,(anonymous_9)
110
+ DA:4,1
111
+ DA:9,3
112
+ DA:10,3
113
+ DA:11,3
114
+ DA:13,3
115
+ DA:14,3
116
+ DA:16,0
117
+ DA:18,3
118
+ DA:19,762
119
+ DA:20,762
120
+ DA:22,762
121
+ DA:24,3
122
+ DA:28,5
123
+ DA:29,5
124
+ DA:30,1265
125
+ DA:31,1265
126
+ DA:33,5
127
+ DA:37,3
128
+ DA:38,3
129
+ DA:42,763
130
+ DA:43,3
131
+ DA:47,254
132
+ DA:50,4
133
+ LF:23
134
+ LH:22
135
+ BRDA:13,0,0,3
136
+ BRDA:13,0,1,0
137
+ BRDA:13,1,0,3
138
+ BRDA:13,1,1,3
139
+ BRF:4
140
+ BRH:3
141
+ end_of_record
142
+ TN:
143
+ SF:src/lib/packed-types/PackedString.ts
144
+ FN:7,PackedStringFactory
145
+ FN:9,(anonymous_1)
146
+ FN:12,(anonymous_2)
147
+ FN:38,(anonymous_3)
148
+ FN:45,(anonymous_4)
149
+ FN:71,(anonymous_5)
150
+ FN:80,(anonymous_6)
151
+ FN:85,(anonymous_7)
152
+ FN:88,(anonymous_8)
153
+ FNF:9
154
+ FNH:9
155
+ FNDA:8,PackedStringFactory
156
+ FNDA:6,(anonymous_1)
157
+ FNDA:6,(anonymous_2)
158
+ FNDA:210,(anonymous_3)
159
+ FNDA:10,(anonymous_4)
160
+ FNDA:6,(anonymous_5)
161
+ FNDA:7,(anonymous_6)
162
+ FNDA:4,(anonymous_7)
163
+ FNDA:104,(anonymous_8)
164
+ DA:4,1
165
+ DA:5,1
166
+ DA:12,6
167
+ DA:13,6
168
+ DA:14,6
169
+ DA:15,6
170
+ DA:16,6
171
+ DA:17,6
172
+ DA:18,6
173
+ DA:19,6
174
+ DA:20,14
175
+ DA:21,13
176
+ DA:24,6
177
+ DA:25,0
178
+ DA:27,6
179
+ DA:28,14
180
+ DA:30,6
181
+ DA:31,14
182
+ DA:32,14
183
+ DA:33,210
184
+ DA:34,210
185
+ DA:35,210
186
+ DA:38,6
187
+ DA:39,210
188
+ DA:42,6
189
+ DA:46,10
190
+ DA:47,10
191
+ DA:48,10
192
+ DA:49,29
193
+ DA:50,29
194
+ DA:51,0
195
+ DA:55,29
196
+ DA:56,29
197
+ DA:57,29
198
+ DA:58,374
199
+ DA:59,374
200
+ DA:60,0
201
+ DA:62,374
202
+ DA:63,374
203
+ DA:64,374
204
+ DA:66,29
205
+ DA:68,10
206
+ DA:72,6
207
+ DA:73,6
208
+ DA:74,277
209
+ DA:77,6
210
+ DA:81,7
211
+ DA:82,7
212
+ DA:86,4
213
+ DA:87,4
214
+ DA:88,104
215
+ DA:92,8
216
+ LF:52
217
+ LH:49
218
+ BRDA:20,0,0,13
219
+ BRDA:24,1,0,0
220
+ BRDA:50,2,0,0
221
+ BRDA:59,3,0,0
222
+ BRDA:62,4,0,374
223
+ BRDA:62,4,1,0
224
+ BRF:6
225
+ BRH:2
226
+ end_of_record
227
+ TN:
228
+ SF:src/lib/packed-types/PackedUInt32.ts
229
+ FN:6,PackedUInt32Factory
230
+ FN:8,(anonymous_1)
231
+ FN:9,(anonymous_2)
232
+ FN:22,(anonymous_3)
233
+ FN:27,(anonymous_4)
234
+ FN:36,(anonymous_5)
235
+ FN:41,(anonymous_6)
236
+ FN:42,(anonymous_7)
237
+ FN:46,(anonymous_8)
238
+ FN:47,(anonymous_9)
239
+ FNF:10
240
+ FNH:10
241
+ FNDA:5,PackedUInt32Factory
242
+ FNDA:3,(anonymous_1)
243
+ FNDA:3,(anonymous_2)
244
+ FNDA:21,(anonymous_3)
245
+ FNDA:5,(anonymous_4)
246
+ FNDA:3,(anonymous_5)
247
+ FNDA:3,(anonymous_6)
248
+ FNDA:22,(anonymous_7)
249
+ FNDA:1,(anonymous_8)
250
+ FNDA:7,(anonymous_9)
251
+ DA:4,1
252
+ DA:9,3
253
+ DA:10,3
254
+ DA:11,3
255
+ DA:13,3
256
+ DA:14,3
257
+ DA:16,0
258
+ DA:18,3
259
+ DA:19,21
260
+ DA:20,21
261
+ DA:22,21
262
+ DA:24,3
263
+ DA:28,5
264
+ DA:29,5
265
+ DA:30,30
266
+ DA:31,30
267
+ DA:33,5
268
+ DA:37,3
269
+ DA:38,3
270
+ DA:42,22
271
+ DA:43,3
272
+ DA:47,7
273
+ DA:50,4
274
+ LF:23
275
+ LH:22
276
+ BRDA:13,0,0,3
277
+ BRDA:13,0,1,0
278
+ BRDA:13,1,0,3
279
+ BRDA:13,1,1,3
280
+ BRF:4
281
+ BRH:3
282
+ end_of_record
@@ -0,0 +1,21 @@
1
+ module.exports = (request, options) => {
2
+ return options.defaultResolver(request, {
3
+ ...options,
4
+ packageFilter: (pkg) => {
5
+ // When importing o1js, we specify the Node ESM import as Jest by default imports the web version
6
+ if (pkg.name === 'o1js') {
7
+ return {
8
+ ...pkg,
9
+ main: pkg.exports.node.import,
10
+ };
11
+ }
12
+ if (pkg.name === 'node-fetch') {
13
+ return { ...pkg, main: pkg.main };
14
+ }
15
+ return {
16
+ ...pkg,
17
+ main: pkg.module || pkg.main,
18
+ };
19
+ },
20
+ });
21
+ };
package/jest.config.js ADDED
@@ -0,0 +1,24 @@
1
+ /** @type {import('@ts-jest/dist/types').InitialOptionsTsJest} */
2
+ export default {
3
+ verbose: true,
4
+ preset: 'ts-jest/presets/default-esm',
5
+ testEnvironment: 'node',
6
+ globals: {
7
+ 'ts-jest': {
8
+ useESM: true,
9
+ },
10
+ },
11
+ testTimeout: 1_000_000,
12
+ transform: {
13
+ '^.+\\.(t)s$': 'ts-jest',
14
+ '^.+\\.(j)s$': 'babel-jest',
15
+ },
16
+ resolver: '<rootDir>/jest-resolver.cjs',
17
+ transformIgnorePatterns: [
18
+ '<rootDir>/node_modules/(?!(tslib|o1js/node_modules/tslib))',
19
+ ],
20
+ modulePathIgnorePatterns: ['<rootDir>/build/'],
21
+ moduleNameMapper: {
22
+ '^(\\.{1,2}/.+)\\.js$': '$1',
23
+ },
24
+ };
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "o1js-pack",
3
+ "version": "0.3.1",
4
+ "description": "",
5
+ "author": "45930",
6
+ "license": "Apache-2.0",
7
+ "keywords": [
8
+ "mina-zkapp",
9
+ "mina-zk-app",
10
+ "mina-dapp",
11
+ "zkapp"
12
+ ],
13
+ "type": "module",
14
+ "main": "build/src/index.js",
15
+ "types": "build/src/index.d.ts",
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "buildw": "tsc --watch",
19
+ "coverage": "node --experimental-vm-modules --experimental-wasm-threads node_modules/jest/bin/jest.js --coverage",
20
+ "format": "prettier --write --ignore-unknown **/*",
21
+ "prepare": "husky install",
22
+ "test": "node --experimental-vm-modules --experimental-wasm-threads node_modules/jest/bin/jest.js",
23
+ "testw": "node --experimental-vm-modules --experimental-wasm-threads node_modules/jest/bin/jest.js --watch",
24
+ "lint": "npx eslint src/* --fix"
25
+ },
26
+ "lint-staged": {
27
+ "**/*": [
28
+ "eslint src/* --fix",
29
+ "prettier --write --ignore-unknown"
30
+ ]
31
+ },
32
+ "devDependencies": {
33
+ "@babel/preset-env": "^7.16.4",
34
+ "@babel/preset-typescript": "^7.16.0",
35
+ "@types/jest": "^27.0.3",
36
+ "@typescript-eslint/eslint-plugin": "^5.5.0",
37
+ "@typescript-eslint/parser": "^5.5.0",
38
+ "eslint": "^8.7.0",
39
+ "eslint-plugin-o1js": "^0.4.0",
40
+ "husky": "^7.0.1",
41
+ "jest": "^27.3.1",
42
+ "lint-staged": "^11.0.1",
43
+ "prettier": "^2.3.2",
44
+ "ts-jest": "^27.0.7",
45
+ "typescript": "^4.7.2"
46
+ },
47
+ "peerDependencies": {
48
+ "o1js": "^0.13.*"
49
+ }
50
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2020",
4
+ "module": "es2022",
5
+ "lib": ["dom", "esnext"],
6
+ "outDir": "./build",
7
+ "rootDir": ".",
8
+ "strict": true,
9
+ "strictPropertyInitialization": false, // to enable generic constructors, e.g. on CircuitValue
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "esModuleInterop": true,
13
+ "moduleResolution": "node",
14
+ "experimentalDecorators": true,
15
+ "emitDecoratorMetadata": true,
16
+ "allowJs": true,
17
+ "declaration": true,
18
+ "sourceMap": true,
19
+ "noFallthroughCasesInSwitch": true,
20
+ "allowSyntheticDefaultImports": true
21
+ },
22
+ "include": ["./src"]
23
+ }