-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
46 lines (46 loc) · 2.6 KB
/
Copy pathpackage.json
File metadata and controls
46 lines (46 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"name": "contract-kernel",
"version": "1.0.0",
"description": "",
"main": "./dist/kernel/index.js",
"types": "./dist/kernel/index.d.ts",
"exports": {
".": {
"types": "./dist/kernel/index.d.ts",
"import": "./dist/kernel/index.js"
}
},
"files": [
"dist/"
],
"directories": {
"doc": "docs"
},
"scripts": {
"test": "vitest run",
"test:package": "node --input-type=module --eval=\"import { spawnSync } from 'node:child_process'; import { mkdtemp, readFile, rm, stat } from 'node:fs/promises'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; import { pathToFileURL } from 'node:url'; const temp = await mkdtemp(join(tmpdir(), 'contract-kernel-pack-')); try { const packed = spawnSync('npm', ['pack', '--json', '--pack-destination', temp], { encoding: 'utf8', env: { ...process.env, npm_config_cache: join(temp, 'cache') } }); if (packed.status !== 0) { process.stderr.write(packed.stderr); process.exit(packed.status ?? 1); } const [{ filename }] = JSON.parse(packed.stdout); const extracted = spawnSync('tar', ['-xzf', join(temp, filename), '-C', temp], { encoding: 'utf8' }); if (extracted.status !== 0) { process.stderr.write(extracted.stderr); process.exit(extracted.status ?? 1); } const packageDir = join(temp, 'package'); const installed = spawnSync('npm', ['install', '--omit=dev'], { cwd: packageDir, encoding: 'utf8', env: { ...process.env, npm_config_cache: join(temp, 'cache') } }); if (installed.status !== 0) { process.stderr.write(installed.stderr); process.exit(installed.status ?? 1); } const manifest = JSON.parse(await readFile(join(packageDir, 'package.json'), 'utf8')); const entry = manifest.exports['.'].import; const types = manifest.exports['.'].types; await stat(join(packageDir, types)); const { KERNEL_API_VERSION } = await import(pathToFileURL(join(packageDir, entry)).href); if (KERNEL_API_VERSION !== 'loop.dev/v1') throw new Error('Packed kernel API version mismatch'); } finally { await rm(temp, { recursive: true, force: true }); }\"",
"build": "tsc -p tsconfig.build.json",
"typecheck": "tsc -p tsconfig.json --noEmit",
"schemas": "tsx scripts/generate-schemas.ts",
"verify": "npm run schemas && npm run typecheck && npm test && npm run build && npm run test:package"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "module",
"dependencies": {
"ajv": "^8.20.0",
"ajv-formats": "^3.0.1",
"yaml": "^2.9.0"
},
"devDependencies": {
"@types/node": "^22.19.21",
"tsx": "^4.22.4",
"typescript": "^5.9.3",
"vitest": "^3.2.6"
},
"engines": {
"node": ">=22"
},
"private": true
}