-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_npm.ts
47 lines (43 loc) · 1.21 KB
/
build_npm.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
import { build, emptyDir } from "https://deno.land/x/dnt@0.21.2/mod.ts";
import * as semver from "https://deno.land/x/semver@v1.4.0/mod.ts";
const version = semver.clean(Deno.args[0]);
if (!semver.valid(version)) {
throw new Error("Wrong version number: " + version);
}
await emptyDir("./npm");
await build({
typeCheck: true,
test: false,
declaration: true,
scriptModule: false,
shims: {
deno: false,
},
entryPoints: ["./src/lite-sdk.ts"],
outDir: "./npm",
package: {
name: "directus-lite-sdk",
version: version as string,
description: "Alternative <1Kb Directus SDK (TypeScript)",
main: "esm/directus-lite-sdk.js",
license: "MIT",
author: "Jacobo Tabernero Rey - https://jacobo.codes",
homepage: "https://github.com/jacoborus/directus-lite-sdk",
keywords: [
"directus",
"sdk",
"lite",
"typescript",
],
repository: {
"type": "git",
"url": "git@github.com:jacoborus/directus-lite-sdk.git",
},
bugs: {
"url": "https://github.com/jacoborus/directus-lite-sdk/issues",
},
},
});
await Deno.mkdir("./npm", { recursive: true });
Deno.copyFileSync("LICENSE", "./npm/LICENSE");
Deno.copyFileSync("README.md", "./npm/README.md");