|
1 | | -############################################################################### |
2 | | -# Bazel now uses Bzlmod by default to manage external dependencies. |
3 | | -# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. |
4 | | -# |
5 | | -# For more details, please check https://github.com/bazelbuild/bazel/issues/18958 |
6 | | -############################################################################### |
| 1 | +"""Rules/toolchains for vscode-ng-language-service with Bazel.""" |
| 2 | + |
| 3 | +module( |
| 4 | + name = "vscode", |
| 5 | +) |
| 6 | + |
| 7 | +bazel_dep(name = "tar.bzl", version = "0.5.5") |
| 8 | +bazel_dep(name = "rules_nodejs", version = "6.5.0") |
| 9 | +bazel_dep(name = "bazel_skylib", version = "1.8.1") |
| 10 | +bazel_dep(name = "aspect_bazel_lib", version = "2.21.1") |
| 11 | +bazel_dep(name = "aspect_rules_esbuild", version = "0.22.1") |
| 12 | +bazel_dep(name = "aspect_rules_jasmine", version = "2.0.0") |
| 13 | +bazel_dep(name = "aspect_rules_js", version = "2.5.0") |
| 14 | +bazel_dep(name = "aspect_rules_ts", version = "3.7.0") |
| 15 | + |
| 16 | +rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext") |
| 17 | +rules_ts_ext.deps( |
| 18 | + name = "angular_npm_typescript", |
| 19 | + # Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity' |
| 20 | + ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", |
| 21 | + ts_version = "5.9.2", |
| 22 | +) |
| 23 | +use_repo(rules_ts_ext, **{"npm_typescript": "angular_npm_typescript"}) |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") |
| 28 | +use_repo(pnpm, "pnpm") |
| 29 | + |
| 30 | +npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm") |
| 31 | +npm.npm_translate_lock( |
| 32 | + name = "npm", |
| 33 | + data = [ |
| 34 | + "//:package.json", |
| 35 | + "//:pnpm-workspace.yaml", |
| 36 | + ], |
| 37 | + npmrc = "//:.npmrc", |
| 38 | + pnpm_lock = "//:pnpm-lock.yaml", |
| 39 | + public_hoist_packages = { |
| 40 | + # Hoist transitive closure of npm deps needed for vsce; this set was determined manually by |
| 41 | + # running `bazel build //:vsix` and burning down missing packages. We do this so that we |
| 42 | + # don't have to run an additional `npm install` action to create a node_modules within the |
| 43 | + # //:npm npm_package where the vsce build takes place. |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + }, |
| 54 | + verify_node_modules_ignored = "//:.bazelignore", |
| 55 | + yarn_lock = "//:yarn.lock", |
| 56 | +) |
| 57 | + |
| 58 | +npm.npm_translate_lock( |
| 59 | + name = "npm_integration_pre_standalone_project", |
| 60 | + data = [ |
| 61 | + "//integration/pre_standalone_project:package.json", |
| 62 | + "//integration/pre_standalone_project:pnpm-workspace.yaml", |
| 63 | + ], |
| 64 | + npmrc = "//:.npmrc", |
| 65 | + pnpm_lock = "//integration/pre_standalone_project:pnpm-lock.yaml", |
| 66 | + verify_node_modules_ignored = "//:.bazelignore", |
| 67 | +) |
| 68 | + |
| 69 | +npm.npm_translate_lock( |
| 70 | + name = "npm_integration_workspace", |
| 71 | + data = [ |
| 72 | + "//integration/workspace:package.json", |
| 73 | + "//integration/workspace:pnpm-workspace.yaml", |
| 74 | + ], |
| 75 | + npmrc = "//:.npmrc", |
| 76 | + pnpm_lock = "//integration/workspace:pnpm-lock.yaml", |
| 77 | + verify_node_modules_ignored = "//:.bazelignore", |
| 78 | + yarn_lock = "//integration/workspace:yarn.lock", |
| 79 | +) |
| 80 | + |
| 81 | +npm.npm_translate_lock( |
| 82 | + name = "npm_integration_pre_apf_project", |
| 83 | + data = [ |
| 84 | + "//integration/pre_apf_project:package.json", |
| 85 | + "//integration/pre_apf_project:pnpm-workspace.yaml", |
| 86 | + ], |
| 87 | + npmrc = "//:.npmrc", |
| 88 | + pnpm_lock = "//integration/pre_apf_project:pnpm-lock.yaml", |
| 89 | + verify_node_modules_ignored = "//:.bazelignore", |
| 90 | + yarn_lock = "//integration/pre_apf_project:yarn.lock", |
| 91 | +) |
| 92 | + |
| 93 | + |
| 94 | +npm.npm_translate_lock( |
| 95 | + name = "npm_integration_project", |
| 96 | + data = [ |
| 97 | + "//integration/project:package.json", |
| 98 | + "//integration/project:pnpm-workspace.yaml", |
| 99 | + ], |
| 100 | + npmrc = "//:.npmrc", |
| 101 | + pnpm_lock = "//integration/project:pnpm-lock.yaml", |
| 102 | + verify_node_modules_ignored = "//:.bazelignore", |
| 103 | + yarn_lock = "//integration/project:yarn.lock", |
| 104 | +) |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +use_repo(npm, "npm", "npm_integration_pre_standalone_project", "npm_integration_workspace", "npm_integration_pre_apf_project", "npm_integration_project") |
| 111 | + |
| 112 | +node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") |
| 113 | +node.toolchain(node_version = "22.11.0") |
| 114 | +use_repo(node, "nodejs_toolchains") |
| 115 | +use_repo(node, "nodejs_darwin_amd64") |
| 116 | +use_repo(node, "nodejs_darwin_arm64") |
| 117 | +use_repo(node, "nodejs_linux_amd64") |
| 118 | +use_repo(node, "nodejs_linux_arm64") |
| 119 | +use_repo(node, "nodejs_linux_ppc64le") |
| 120 | +use_repo(node, "nodejs_linux_s390x") |
| 121 | +use_repo(node, "nodejs_windows_amd64") |
0 commit comments