forked from wvbe/docxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnt.ts
70 lines (64 loc) · 1.6 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Running this script rebuilds it as a NodeJS compatible npm package.
*/
import { build, emptyDir } from 'https://deno.land/x/dnt@0.25.2/mod.ts';
const VERSION = Deno.args[0];
if (!VERSION) {
throw new Error('Please specify a version, eg. "deno task dnt 1.0.0".');
}
const msg = ` Creating npm package for version ${VERSION} `;
console.log('-'.repeat(msg.length) + '\n' + msg + '\n' + '-'.repeat(msg.length));
await emptyDir('./npm');
await build({
entryPoints: ['./mod.ts'],
outDir: './npm',
typeCheck: true,
test: false,
declaration: true,
skipSourceOutput: true,
shims: {
deno: true,
custom: [
{
package: { name: 'crypto' },
globalNames: [{ name: 'crypto', exportName: 'default' }],
},
],
},
package: {
name: 'docxml',
version: VERSION,
description: 'TypeScript (component) library for building and parsing a DOCX file',
author: {
name: 'Wybe Minnebo',
email: 'wybe@x-54.com',
url: 'https://github.com/wvbe',
},
contributors: [],
homepage: 'https://github.com/wvbe/docxml',
repository: {
type: 'git',
url: 'git+https://github.com/wvbe/docxml.git',
},
bugs: {
url: 'https://github.com/wvbe/docxml/issues',
},
license: 'none',
keywords: ['ooxml', 'docx', 'components', 'deno', 'node', 'jsx'],
type: 'module',
main: 'script/mod.js',
module: 'esm/mod.js',
typings: 'types/mod.d.ts',
},
mappings: {
'https://esm.sh/fontoxpath@3.28.2?pin=v121': {
name: 'fontoxpath',
version: '3.28.2',
},
'https://esm.sh/slimdom@4.0.2?pin=v121': {
name: 'slimdom',
version: '4.0.2',
},
},
});
await Deno.copyFile('README.md', 'npm/README.md');