-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathBUILD.bazel
80 lines (72 loc) · 1.93 KB
/
BUILD.bazel
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
71
72
73
74
75
76
77
78
79
80
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_image_layer", "js_test")
load("@aspect_rules_ts//ts:defs.bzl", "ts_config", "ts_project")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
# Link all packages from the /WORKSPACE npm_translate_lock(name = "npm") and also packages from
# manual /WORKSPACE npm_import rules to bazel-bin/node_modules as well as the virtual store
# bazel-bin/node_modules/.aspect_rules_js since /pnpm-lock.yaml is the root of the pnpm workspace
npm_link_all_packages(
name = "node_modules",
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
)
ts_project(
name = "linear-jira-ts",
srcs = [
"main.ts",
"test.ts",
],
tsconfig = "@//:tsconfig",
deps = [
":node_modules/@atlaskit/adf-schema",
":node_modules/@atlaskit/editor-json-transformer",
":node_modules/@atlaskit/editor-markdown-transformer",
":node_modules/@linear/sdk",
":node_modules/@types/lodash",
":node_modules/adf-to-md",
":node_modules/jira.js",
":node_modules/lodash",
":node_modules/@types/react",
# Dev dependencies
":node_modules/@types/node",
":node_modules/ts-node",
":node_modules/typescript",
],
)
js_binary(
name = "linear-jira",
node_options = [
"--unhandled-rejections=strict",
],
data = [
":linear-jira-ts",
":package.json",
],
entry_point = "main.js",
)
# Image
js_image_layer(
name = "layers",
binary = ":linear-jira",
root = "/app",
)
oci_image(
name = "linear-jira-image",
base = "@debian",
cmd = ["/app/linear-jira"],
entrypoint = ["bash"],
tars = [
":layers",
],
)
oci_push(
name = "push_image",
image = ":linear-jira-image",
repository = "ghcr.io/dfinity/dre/linear-jira",
)
js_test(
name = "test",
entry_point = "test.js",
)