@clarigen/test 1.0.0-next.9 → 1.0.0
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/dist/index.d.ts +94 -31
- package/dist/index.js +440 -5
- package/dist/index.mjs +443 -0
- package/package.json +22 -19
- package/dist/test.cjs.development.js +0 -1827
- package/dist/test.cjs.development.js.map +0 -1
- package/dist/test.cjs.production.min.js +0 -2
- package/dist/test.cjs.production.min.js.map +0 -1
- package/dist/test.esm.js +0 -1816
- package/dist/test.esm.js.map +0 -1
- package/dist/utils/clarity-cli-adapter.d.ts +0 -79
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/pure.d.ts +0 -44
- package/dist/utils/util-contract.d.ts +0 -12
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
import {
|
|
23
|
+
deployContract as deployContract2,
|
|
24
|
+
createClarityBin
|
|
25
|
+
} from "@clarigen/native-bin";
|
|
26
|
+
import {
|
|
27
|
+
getContractIdentifier,
|
|
28
|
+
expectOk,
|
|
29
|
+
expectErr
|
|
30
|
+
} from "@clarigen/core";
|
|
31
|
+
|
|
32
|
+
// src/utils/index.ts
|
|
33
|
+
import { publicKeyToStxAddress, StacksNetworkVersion } from "micro-stacks/crypto";
|
|
34
|
+
import { getPublicKeyFromStacksPrivateKey, makeRandomPrivKey } from "micro-stacks/transactions";
|
|
35
|
+
|
|
36
|
+
// src/utils/util-contract.ts
|
|
37
|
+
import { hexToCV } from "micro-stacks/clarity";
|
|
38
|
+
import { join } from "path";
|
|
39
|
+
import { cvToValue } from "@clarigen/core";
|
|
40
|
+
import { deployContract, evalJson, executeJson } from "@clarigen/native-bin";
|
|
41
|
+
import { intToBigInt } from "micro-stacks/common";
|
|
42
|
+
var UTIL_CONTRACT_ID = "ST000000000000000000002AMW42H.clarigen-test-utils";
|
|
43
|
+
async function deployUtilContract(clarityBin) {
|
|
44
|
+
let contractFilePath = join(__dirname, "..", "..", "contracts", "test-utils.clar");
|
|
45
|
+
if (__dirname.includes("dist")) {
|
|
46
|
+
contractFilePath = join(__dirname, "..", "contracts", "test-utils.clar");
|
|
47
|
+
}
|
|
48
|
+
await deployContract({
|
|
49
|
+
contractIdentifier: UTIL_CONTRACT_ID,
|
|
50
|
+
provider: clarityBin,
|
|
51
|
+
contractFilePath
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function getBin(provider) {
|
|
55
|
+
return "clarityBin" in provider ? provider.clarityBin : provider;
|
|
56
|
+
}
|
|
57
|
+
async function getBlockHeight(provider) {
|
|
58
|
+
const bin = getBin(provider);
|
|
59
|
+
const { output_serialized } = await evalJson({
|
|
60
|
+
contractAddress: UTIL_CONTRACT_ID,
|
|
61
|
+
functionName: "get-block-height",
|
|
62
|
+
args: [],
|
|
63
|
+
provider: bin
|
|
64
|
+
});
|
|
65
|
+
const outputCV = hexToCV(output_serialized);
|
|
66
|
+
const blockHeight = cvToValue(outputCV);
|
|
67
|
+
return blockHeight;
|
|
68
|
+
}
|
|
69
|
+
async function mineBlock(provider) {
|
|
70
|
+
const bin = getBin(provider);
|
|
71
|
+
await executeJson({
|
|
72
|
+
contractAddress: UTIL_CONTRACT_ID,
|
|
73
|
+
functionName: "mine-block",
|
|
74
|
+
args: [],
|
|
75
|
+
provider: bin,
|
|
76
|
+
senderAddress: "ST000000000000000000002AMW42H"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async function mineBlocks(_blocks, provider) {
|
|
80
|
+
const blocks = intToBigInt(_blocks);
|
|
81
|
+
for (let index = 0; index < blocks; index++) {
|
|
82
|
+
await mineBlock(provider);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function getStxBalance(provider, account) {
|
|
86
|
+
const bin = getBin(provider);
|
|
87
|
+
const { output_serialized } = await evalJson({
|
|
88
|
+
contractAddress: UTIL_CONTRACT_ID,
|
|
89
|
+
functionName: "get-stx-balance",
|
|
90
|
+
args: [`'${account}`],
|
|
91
|
+
provider: bin
|
|
92
|
+
});
|
|
93
|
+
const outputCV = hexToCV(output_serialized);
|
|
94
|
+
const balance = cvToValue(outputCV);
|
|
95
|
+
return balance;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/utils/coverage.ts
|
|
99
|
+
import { mkdir, readdir, unlink } from "fs/promises";
|
|
100
|
+
import { join as join2, resolve } from "path";
|
|
101
|
+
async function setupCoverage(dir) {
|
|
102
|
+
const dirName = resolve(process.cwd(), "coverage");
|
|
103
|
+
try {
|
|
104
|
+
await mkdir(dirName);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
}
|
|
107
|
+
const files = await readdir(dirName);
|
|
108
|
+
const removals = files.map((file) => {
|
|
109
|
+
return unlink(join2(dirName, file));
|
|
110
|
+
});
|
|
111
|
+
await Promise.all(removals);
|
|
112
|
+
return dirName;
|
|
113
|
+
}
|
|
114
|
+
async function finishCoverage(provider, dir) {
|
|
115
|
+
const lcovFile = join2(dir, "clarigen.lcov");
|
|
116
|
+
await provider.runCommand(["make_lcov", dir, lcovFile]);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// src/utils/index.ts
|
|
120
|
+
function makeRandomAddress(version = StacksNetworkVersion.testnetP2PKH) {
|
|
121
|
+
const privateKey = makeRandomPrivKey();
|
|
122
|
+
const publicKey = getPublicKeyFromStacksPrivateKey(privateKey);
|
|
123
|
+
const address = publicKeyToStxAddress(publicKey.data, version);
|
|
124
|
+
return address;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/utils/pure.ts
|
|
128
|
+
import {
|
|
129
|
+
cvToString,
|
|
130
|
+
cvToValue as cvToValue2,
|
|
131
|
+
filterEvents,
|
|
132
|
+
CoreNodeEventType,
|
|
133
|
+
ok,
|
|
134
|
+
err
|
|
135
|
+
} from "@clarigen/core";
|
|
136
|
+
import {
|
|
137
|
+
evalRaw,
|
|
138
|
+
evalJson as evalJson2,
|
|
139
|
+
executeJson as executeJson2
|
|
140
|
+
} from "@clarigen/native-bin";
|
|
141
|
+
import {
|
|
142
|
+
hexToCV as hexToCV2,
|
|
143
|
+
responseErrorCV,
|
|
144
|
+
responseOkCV
|
|
145
|
+
} from "micro-stacks/clarity";
|
|
146
|
+
function getPrints(events) {
|
|
147
|
+
return filterEvents(events, CoreNodeEventType.ContractEvent).map((e) => {
|
|
148
|
+
const hex = e.contract_event.raw_value;
|
|
149
|
+
const cv = hexToCV2(hex);
|
|
150
|
+
return cvToValue2(cv);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function formatArguments(args) {
|
|
154
|
+
return args.map((arg) => cvToString(arg));
|
|
155
|
+
}
|
|
156
|
+
function getIdentifier(tx2) {
|
|
157
|
+
return `${tx2.contractAddress}.${tx2.contractName}`;
|
|
158
|
+
}
|
|
159
|
+
function getLogs(stderr) {
|
|
160
|
+
if (stderr === "")
|
|
161
|
+
return [];
|
|
162
|
+
return stderr.split("\n").map((line) => line.slice(62));
|
|
163
|
+
}
|
|
164
|
+
function makeEvalResult(result) {
|
|
165
|
+
const resultCV = hexToCV2(result.output_serialized);
|
|
166
|
+
const value = cvToValue2(resultCV, true);
|
|
167
|
+
return {
|
|
168
|
+
value,
|
|
169
|
+
clarityValue: resultCV,
|
|
170
|
+
logs: getLogs(result.stderr),
|
|
171
|
+
costs: result.costs
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
async function ro({
|
|
175
|
+
tx: tx2,
|
|
176
|
+
bin,
|
|
177
|
+
coverageFolder
|
|
178
|
+
}) {
|
|
179
|
+
const result = await evalJson2({
|
|
180
|
+
functionName: tx2.function.name,
|
|
181
|
+
args: formatArguments(tx2.functionArgs),
|
|
182
|
+
contractAddress: getIdentifier(tx2),
|
|
183
|
+
provider: bin,
|
|
184
|
+
coverageFolder
|
|
185
|
+
});
|
|
186
|
+
return makeEvalResult(result);
|
|
187
|
+
}
|
|
188
|
+
async function evalCode({
|
|
189
|
+
contractAddress,
|
|
190
|
+
code,
|
|
191
|
+
bin,
|
|
192
|
+
coverageFolder
|
|
193
|
+
}) {
|
|
194
|
+
const result = await evalRaw({
|
|
195
|
+
contractAddress,
|
|
196
|
+
code,
|
|
197
|
+
provider: bin,
|
|
198
|
+
coverageFolder
|
|
199
|
+
});
|
|
200
|
+
return makeEvalResult(result);
|
|
201
|
+
}
|
|
202
|
+
async function tx({
|
|
203
|
+
tx: tx2,
|
|
204
|
+
senderAddress,
|
|
205
|
+
bin,
|
|
206
|
+
coverageFolder
|
|
207
|
+
}) {
|
|
208
|
+
const result = await executeJson2({
|
|
209
|
+
contractAddress: getIdentifier(tx2),
|
|
210
|
+
senderAddress,
|
|
211
|
+
provider: bin,
|
|
212
|
+
functionName: tx2.function.name,
|
|
213
|
+
args: formatArguments(tx2.functionArgs),
|
|
214
|
+
coverageFolder
|
|
215
|
+
});
|
|
216
|
+
const resultCV = hexToCV2(result.output_serialized);
|
|
217
|
+
const value = cvToValue2(resultCV);
|
|
218
|
+
const resp = result.success ? ok(value) : err(value);
|
|
219
|
+
const baseReturn = {
|
|
220
|
+
logs: getLogs(result.stderr),
|
|
221
|
+
costs: result.costs,
|
|
222
|
+
value: resp
|
|
223
|
+
};
|
|
224
|
+
if (result.success) {
|
|
225
|
+
return __spreadProps(__spreadValues({}, baseReturn), {
|
|
226
|
+
isOk: true,
|
|
227
|
+
response: responseOkCV(resultCV),
|
|
228
|
+
assets: result.assets,
|
|
229
|
+
events: result.events,
|
|
230
|
+
prints: getPrints(result.events)
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return __spreadProps(__spreadValues({}, baseReturn), {
|
|
234
|
+
isOk: false,
|
|
235
|
+
response: responseErrorCV(resultCV)
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
async function mapGet({
|
|
239
|
+
map,
|
|
240
|
+
bin
|
|
241
|
+
}) {
|
|
242
|
+
const code = `(map-get? ${map.map.name} ${cvToString(map.key)})`;
|
|
243
|
+
const result = await evalCode({
|
|
244
|
+
contractAddress: getIdentifier(map),
|
|
245
|
+
code,
|
|
246
|
+
bin
|
|
247
|
+
});
|
|
248
|
+
return result.value;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// src/index.ts
|
|
252
|
+
import { resolve as resolve2 } from "path";
|
|
253
|
+
|
|
254
|
+
// src/utils/test-factory.ts
|
|
255
|
+
import {
|
|
256
|
+
projectFactory
|
|
257
|
+
} from "@clarigen/core";
|
|
258
|
+
function testFactory(project) {
|
|
259
|
+
return projectFactory(project, "simnet");
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// src/index.ts
|
|
263
|
+
import { Allocation, createClarityBin as createClarityBin2, executeJson as executeJson3, evalJson as evalJson3 } from "@clarigen/native-bin";
|
|
264
|
+
var TestProvider = class {
|
|
265
|
+
constructor(clarityBin) {
|
|
266
|
+
this.clarityBin = clarityBin;
|
|
267
|
+
}
|
|
268
|
+
static async fromContracts(contracts, options = {}) {
|
|
269
|
+
const clarityBin = options.clarityBin || await createClarityBin({
|
|
270
|
+
allocations: options.accounts
|
|
271
|
+
});
|
|
272
|
+
const instances = {};
|
|
273
|
+
let coverageFolder = options.coverageFolder;
|
|
274
|
+
if (process.env.CLARIGEN_COVERAGE) {
|
|
275
|
+
coverageFolder = resolve2(process.cwd(), "coverage");
|
|
276
|
+
}
|
|
277
|
+
await deployUtilContract(clarityBin);
|
|
278
|
+
for (const k in contracts) {
|
|
279
|
+
if (Object.prototype.hasOwnProperty.call(contracts, k)) {
|
|
280
|
+
const contract = contracts[k];
|
|
281
|
+
const identifier = getContractIdentifier(contract);
|
|
282
|
+
await deployContract2({
|
|
283
|
+
contractIdentifier: identifier,
|
|
284
|
+
contractFilePath: contract.contractFile,
|
|
285
|
+
provider: clarityBin,
|
|
286
|
+
coverageFolder
|
|
287
|
+
});
|
|
288
|
+
const instance = contract.contract(contract.address, contract.name);
|
|
289
|
+
instances[k] = {
|
|
290
|
+
identifier: getContractIdentifier(contract),
|
|
291
|
+
contract: instance
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const provider = new this(clarityBin);
|
|
296
|
+
provider.coverageFolder = coverageFolder;
|
|
297
|
+
return {
|
|
298
|
+
deployed: instances,
|
|
299
|
+
provider
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
static async fromProject(simnet, options = {}) {
|
|
303
|
+
const allocations = Object.fromEntries(Object.entries(simnet.accounts).map(([name, account]) => {
|
|
304
|
+
return [name, __spreadProps(__spreadValues({}, account), { balance: BigInt(account.balance) })];
|
|
305
|
+
}));
|
|
306
|
+
const clarityBin = options.clarityBin || await createClarityBin({
|
|
307
|
+
allocations
|
|
308
|
+
});
|
|
309
|
+
let coverageFolder = options.coverageFolder;
|
|
310
|
+
if (process.env.CLARIGEN_COVERAGE) {
|
|
311
|
+
coverageFolder = resolve2(process.cwd(), "coverage");
|
|
312
|
+
}
|
|
313
|
+
await deployUtilContract(clarityBin);
|
|
314
|
+
for (const contract of simnet.deployment) {
|
|
315
|
+
let contractFilePath = contract.file;
|
|
316
|
+
if (options.clarinetPath) {
|
|
317
|
+
contractFilePath = resolve2(process.cwd(), options.clarinetPath, contractFilePath);
|
|
318
|
+
}
|
|
319
|
+
await deployContract2({
|
|
320
|
+
contractIdentifier: contract.identifier,
|
|
321
|
+
contractFilePath,
|
|
322
|
+
provider: clarityBin,
|
|
323
|
+
coverageFolder
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
const provider = new this(clarityBin);
|
|
327
|
+
provider.coverageFolder = coverageFolder;
|
|
328
|
+
return provider;
|
|
329
|
+
}
|
|
330
|
+
static async fromFactory(contracts, options = {}) {
|
|
331
|
+
const clarityBin = options.clarityBin || await createClarityBin({
|
|
332
|
+
allocations: options.accounts
|
|
333
|
+
});
|
|
334
|
+
let coverageFolder = options.coverageFolder;
|
|
335
|
+
if (process.env.CLARIGEN_COVERAGE) {
|
|
336
|
+
coverageFolder = resolve2(process.cwd(), "coverage");
|
|
337
|
+
}
|
|
338
|
+
await deployUtilContract(clarityBin);
|
|
339
|
+
for (const k in contracts) {
|
|
340
|
+
if (Object.prototype.hasOwnProperty.call(contracts, k)) {
|
|
341
|
+
const contract = contracts[k];
|
|
342
|
+
let contractFilePath = contract.contractFile;
|
|
343
|
+
if (options.clarinetPath) {
|
|
344
|
+
contractFilePath = resolve2(process.cwd(), options.clarinetPath, contractFilePath);
|
|
345
|
+
}
|
|
346
|
+
if (typeof contractFilePath === "undefined") {
|
|
347
|
+
throw new Error("Cannot setup @clarigen/test - missing contract file.");
|
|
348
|
+
}
|
|
349
|
+
await deployContract2({
|
|
350
|
+
contractIdentifier: contract.identifier,
|
|
351
|
+
contractFilePath,
|
|
352
|
+
provider: clarityBin,
|
|
353
|
+
coverageFolder
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const provider = new this(clarityBin);
|
|
358
|
+
provider.coverageFolder = coverageFolder;
|
|
359
|
+
return provider;
|
|
360
|
+
}
|
|
361
|
+
ro(tx2) {
|
|
362
|
+
return ro({ tx: tx2, bin: this.clarityBin, coverageFolder: this.coverageFolder });
|
|
363
|
+
}
|
|
364
|
+
async rov(tx2) {
|
|
365
|
+
const result = await this.ro(tx2);
|
|
366
|
+
return result.value;
|
|
367
|
+
}
|
|
368
|
+
async roOk(tx2) {
|
|
369
|
+
const result = await this.ro(tx2);
|
|
370
|
+
const value = expectOk(result.value);
|
|
371
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
372
|
+
value
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
async roErr(tx2) {
|
|
376
|
+
const result = await this.ro(tx2);
|
|
377
|
+
const value = expectErr(result.value);
|
|
378
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
379
|
+
value
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
async rovOk(tx2) {
|
|
383
|
+
return (await this.roOk(tx2)).value;
|
|
384
|
+
}
|
|
385
|
+
async rovErr(tx2) {
|
|
386
|
+
return (await this.roErr(tx2)).value;
|
|
387
|
+
}
|
|
388
|
+
tx(tx2, senderAddress) {
|
|
389
|
+
return tx({
|
|
390
|
+
tx: tx2,
|
|
391
|
+
senderAddress,
|
|
392
|
+
bin: this.clarityBin,
|
|
393
|
+
coverageFolder: this.coverageFolder
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
async txOk(tx2, senderAddress) {
|
|
397
|
+
const result = await this.tx(tx2, senderAddress);
|
|
398
|
+
const value = expectOk(result.value);
|
|
399
|
+
if (!result.isOk)
|
|
400
|
+
throw new Error(`Expected OK, received error: ${String(result.value)}`);
|
|
401
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
402
|
+
value
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
async txErr(tx2, senderAddress) {
|
|
406
|
+
const result = await this.tx(tx2, senderAddress);
|
|
407
|
+
const value = expectErr(result.value);
|
|
408
|
+
if (result.isOk)
|
|
409
|
+
throw new Error(`Expected Err, received ok: ${String(result.value)}`);
|
|
410
|
+
return __spreadProps(__spreadValues({}, result), {
|
|
411
|
+
value
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
evalCode(code, contractAddress = UTIL_CONTRACT_ID) {
|
|
415
|
+
return evalCode({
|
|
416
|
+
contractAddress,
|
|
417
|
+
code,
|
|
418
|
+
bin: this.clarityBin,
|
|
419
|
+
coverageFolder: this.coverageFolder
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
async eval(code, contractAddress = UTIL_CONTRACT_ID) {
|
|
423
|
+
const result = await this.evalCode(code, contractAddress);
|
|
424
|
+
return result.value;
|
|
425
|
+
}
|
|
426
|
+
mapGet(map) {
|
|
427
|
+
return mapGet({ map, bin: this.clarityBin });
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
export {
|
|
431
|
+
Allocation,
|
|
432
|
+
TestProvider,
|
|
433
|
+
createClarityBin2 as createClarityBin,
|
|
434
|
+
evalJson3 as evalJson,
|
|
435
|
+
executeJson3 as executeJson,
|
|
436
|
+
finishCoverage,
|
|
437
|
+
getBlockHeight,
|
|
438
|
+
getStxBalance,
|
|
439
|
+
makeRandomAddress,
|
|
440
|
+
mineBlocks,
|
|
441
|
+
setupCoverage,
|
|
442
|
+
testFactory
|
|
443
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.0
|
|
2
|
+
"version": "1.0.0",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"import": "./dist/index.mjs",
|
|
6
8
|
"files": [
|
|
7
9
|
"dist",
|
|
8
10
|
"contracts"
|
|
@@ -10,27 +12,28 @@
|
|
|
10
12
|
"engines": {
|
|
11
13
|
"node": ">=10"
|
|
12
14
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"start": "tsdx watch",
|
|
15
|
-
"dev": "tsdx watch",
|
|
16
|
-
"build": "tsdx build",
|
|
17
|
-
"test": "yarn build-test-types && jest",
|
|
18
|
-
"lint": "tsdx lint",
|
|
19
|
-
"prepublishOnly": "tsdx build",
|
|
20
|
-
"typecheck": "tsc --noEmit",
|
|
21
|
-
"build-test-types": "cd test && yarn clarigen && cd .."
|
|
22
|
-
},
|
|
23
15
|
"prettier": "@stacks/prettier-config",
|
|
24
16
|
"name": "@clarigen/test",
|
|
25
17
|
"author": "Hank Stoever",
|
|
26
|
-
"
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"jest-environment-node": "28.1.1"
|
|
20
|
+
},
|
|
27
21
|
"dependencies": {
|
|
28
|
-
"@clarigen/core": "1.0.0
|
|
29
|
-
"@clarigen/native-bin": "1.0.0
|
|
30
|
-
"micro-stacks": "^
|
|
22
|
+
"@clarigen/core": "1.0.0",
|
|
23
|
+
"@clarigen/native-bin": "1.0.0",
|
|
24
|
+
"micro-stacks": "^1.1.4"
|
|
31
25
|
},
|
|
32
26
|
"publishConfig": {
|
|
33
27
|
"access": "public"
|
|
34
28
|
},
|
|
35
|
-
"
|
|
36
|
-
|
|
29
|
+
"scripts": {
|
|
30
|
+
"start": "tsup-node --watch",
|
|
31
|
+
"dev": "tsup-node --watch",
|
|
32
|
+
"build": "shx rm -rf ./dist && tsup-node",
|
|
33
|
+
"test": "pnpm build-test-types && jest",
|
|
34
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\" && prettier --check src/**/*.ts",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"build-test-types": "sh build-types.sh",
|
|
37
|
+
"publish:dev": "pnpm build && yalc publish --push"
|
|
38
|
+
}
|
|
39
|
+
}
|