-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ts
49 lines (44 loc) · 1.25 KB
/
build.ts
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
47
48
49
import { execSync } from 'node:child_process'
const pkg = JSON.parse(Deno.readTextFileSync('./deno.json'))
try {
Deno.removeSync('./package.json')
console.log('Previous package.json removed.')
} catch { // NOOP
}
const packageJson = {
name: pkg.name,
version: pkg.version,
type: 'module',
exports: {
'.': {
import: './dist/index.mjs',
require: './dist/index.cjs',
},
},
main: './dist/index.cjs',
types: './dist/index.d.ts',
files: ['dist'],
author: 'YieldRay',
description: 'A strictly typed json-rpc(2.0) implementation',
keywords: [
'jsonrpc',
'json-rpc',
'rpc',
'json',
'jsonrpc-2.0',
],
license: 'MIT',
repository: {
type: 'git',
url: 'git+https://github.com/YieldRay/json-rpc-ts.git',
},
bugs: {
url: 'https://github.com/YieldRay/json-rpc-ts/issues',
},
homepage: 'https://github.com/YieldRay/json-rpc-ts#readme',
}
Deno.writeTextFileSync('./package.json', JSON.stringify(packageJson, null, 4))
console.log('New package.json created.')
console.log(packageJson)
console.log('Building package using unbuild...')
execSync('npx -y [email protected]', { stdio: ['ignore', 'inherit', 'inherit'] })