|
1 | | -import { build, emptyDir } from "@deno/dnt"; |
| 1 | +const version = Deno.args[0] ?? "0.0.0"; |
| 2 | +const outputPath = "npm/fetchclient.tgz"; |
2 | 3 |
|
3 | | -await emptyDir("./npm"); |
| 4 | +await Deno.mkdir("npm", { recursive: true }); |
4 | 5 |
|
5 | | -await build({ |
6 | | - entryPoints: [ |
7 | | - "./mod.ts", |
8 | | - { |
9 | | - name: "./mocks", |
10 | | - path: "./src/mocks/mod.ts", |
11 | | - }, |
| 6 | +const command = new Deno.Command(Deno.execPath(), { |
| 7 | + args: [ |
| 8 | + "pack", |
| 9 | + "--allow-dirty", |
| 10 | + "--set-version", |
| 11 | + version, |
| 12 | + "--output", |
| 13 | + outputPath, |
12 | 14 | ], |
13 | | - outDir: "./npm", |
14 | | - filterDiagnostic(diagnostic) { |
15 | | - // Ignore diagnostics from docs folder |
16 | | - if (diagnostic.file?.fileName.includes("/docs/")) { |
17 | | - return false; |
18 | | - } |
19 | | - return true; |
20 | | - }, |
21 | | - shims: { |
22 | | - deno: true, |
23 | | - }, |
24 | | - |
25 | | - declaration: "separate", |
26 | | - scriptModule: "cjs", |
27 | | - typeCheck: false, |
28 | | - test: true, |
29 | | - rootTestDir: "./src", |
30 | | - testPattern: "**/*.test.ts", |
31 | | - |
32 | | - importMap: "deno.json", |
33 | | - |
34 | | - package: { |
35 | | - name: "@foundatiofx/fetchclient", |
36 | | - version: Deno.args[0], |
37 | | - repository: { |
38 | | - type: "git", |
39 | | - url: "git+https://github.com/FoundatioFx/FetchClient.git", |
40 | | - }, |
41 | | - homepage: "https://github.com/FoundatioFx/FetchClient#readme", |
42 | | - bugs: { |
43 | | - url: "https://github.com/FoundatioFx/FetchClient/issues", |
44 | | - }, |
45 | | - license: "Apache-2.0", |
46 | | - description: |
47 | | - "A typed JSON fetch client with middleware support for Deno, Node and the browser.", |
48 | | - author: { |
49 | | - name: "Eric J. Smith", |
50 | | - email: "eric@exceptionless.com", |
51 | | - url: "https://exceptionless.com", |
52 | | - }, |
53 | | - keywords: [ |
54 | | - "Fetch", |
55 | | - "Middleware", |
56 | | - "ProblemDetails", |
57 | | - "Problem", |
58 | | - ], |
59 | | - }, |
60 | | - |
61 | | - compilerOptions: { |
62 | | - target: "ES2022", |
63 | | - lib: ["ES2022", "WebWorker"], |
64 | | - }, |
65 | | - |
66 | | - async postBuild() { |
67 | | - await Deno.copyFile("license", "npm/license"); |
68 | | - await Deno.copyFile("readme.md", "npm/readme.md"); |
69 | | - }, |
| 15 | + stdout: "inherit", |
| 16 | + stderr: "inherit", |
70 | 17 | }); |
| 18 | + |
| 19 | +const status = await command.spawn().status; |
| 20 | +if (!status.success) { |
| 21 | + Deno.exit(status.code); |
| 22 | +} |
0 commit comments