-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdnt.ts
42 lines (37 loc) · 868 Bytes
/
dnt.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
import {
build,
emptyDir,
} from 'https://deno.land/x/dnt@0.33.1/mod.ts';
const version = Deno.args[0] ?? null;
if (!version) {
throw 'Version not passed to script invocation';
}
await emptyDir('./npm');
await build({
entryPoints: ['./mod.ts'],
outDir: './npm',
packageManager: 'pnpm',
shims: {
// see JS docs for overview and more options
deno: true,
},
package: {
// package.json properties
name: 'result_rs',
version,
description:
'Rust\'s Result struct ported to Typescript/Javascript',
license: 'MIT',
repository: {
type: 'git',
url: 'git+https://github.com/Yakiyo/result_rs.git',
},
bugs: {
url: 'https://github.com/Yakiyo/result_rs/issues',
},
keywords: ['deno', 'dnt', 'result', 'rust'],
},
});
// post build steps
Deno.copyFileSync('LICENSE', 'npm/LICENSE');
Deno.copyFileSync('README.md', 'npm/README.md');