Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ build:test --crdb_test

# Basic settings.
common --noenable_bzlmod
# rules_ts 3.x requires explicit skipLibCheck configuration
# honor_tsconfig means respect the tsconfig.json setting
common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
# rules_ts 3.x requires explicit transpiler selection
# tsc means use TypeScript compiler for transpilation
common --@aspect_rules_ts//ts:default_to_tsc_transpiler
build --enable_platform_specific_config
build --define gotags=bazel,gss
build --experimental_proto_descriptor_sets_include_source_info
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ help:
.PHONY: build build%
build:
./dev build $(TARGET)
# Alias: buildshort -> build short; buildoss -> build oss; buildtests -> build tests etc.
# Alias: buildshort -> build short; buildtests -> build tests etc.
build%:
./dev build $(@:build%=%)

Expand Down
51 changes: 32 additions & 19 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,23 @@ http_archive(
# Like the above, but for JS.
http_archive(
name = "aspect_rules_js",
sha256 = "2cfb3875e1231cefd3fada6774f2c0c5a99db0070e0e48ea398acbff7c6c765b",
strip_prefix = "rules_js-1.42.3",
url = "https://storage.googleapis.com/public-bazel-artifacts/js/rules_js-v1.42.3.tar.gz",
sha256 = "83e5af4d17385d1c3268c31ae217dbfc8525aa7bcf52508dc6864baffc8b9501",
strip_prefix = "rules_js-2.3.7",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.3.7/rules_js-v2.3.7.tar.gz",
)

http_archive(
name = "aspect_rules_ts",
sha256 = "ace5b609603d9b5b875d56c9c07182357c4ee495030f40dcefb10d443ba8c208",
strip_prefix = "rules_ts-1.4.0",
url = "https://storage.googleapis.com/public-bazel-artifacts/js/rules_ts-v1.4.0.tar.gz",
sha256 = "013a10b2b457add73b081780e604778eb50a141709f9194298f97761acdcc169",
strip_prefix = "rules_ts-3.4.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.4.0/rules_ts-v3.4.0.tar.gz",
)

# NOTE: aspect_rules_webpack exists for webpack, but it's incompatible with webpack v4.
http_archive(
name = "aspect_rules_jest",
sha256 = "d3bb833f74b8ad054e6bff5e41606ff10a62880cc99e4d480f4bdfa70add1ba7",
strip_prefix = "rules_jest-0.18.4",
url = "https://storage.googleapis.com/public-bazel-artifacts/js/rules_jest-v0.18.4.tar.gz",
sha256 = "7fc6798dc566f8ec83867f636739716d81097bd3cead9c0fedb098c58fae6567",
strip_prefix = "rules_jest-0.22.0",
url = "https://github.com/aspect-build/rules_jest/releases/download/v0.22.0/rules_jest-v0.22.0.tar.gz",
)

# Load gazelle. This lets us auto-generate BUILD.bazel files throughout the
Expand Down Expand Up @@ -122,11 +121,15 @@ http_archive(

http_archive(
name = "bazel_features",
sha256 = "1aabce613b3ed83847b47efa69eb5dc9aa3ae02539309792a60e705ca4ab92a5",
strip_prefix = "bazel_features-0.2.0",
url = "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel_features-v0.2.0.tar.gz",
sha256 = "8b1c9b7558498000f5adebbc584b7bf15b6b2bf181448a66f6b2fc5b4c84231c",
strip_prefix = "bazel_features-1.23.0",
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.23.0/bazel_features-v1.23.0.tar.gz",
)

load("@bazel_features//:deps.bzl", "bazel_features_deps")

bazel_features_deps()

# com_github_golang_protobuf handled in DEPS.bzl.
# com_github_mwitkow_go_proto_validators handled in DEPS.bzl.
# com_github_gogo_protobuf handled in DEPS.bzl.
Expand Down Expand Up @@ -231,8 +234,9 @@ go_register_nogo(nogo = "@com_github_cockroachdb_cockroach//:crdb_nogo")
# The rules_nodejs "core" module.
http_archive(
name = "rules_nodejs",
sha256 = "764a3b3757bb8c3c6a02ba3344731a3d71e558220adcb0cf7e43c9bba2c37ba8",
urls = ["https://storage.googleapis.com/public-bazel-artifacts/js/rules_nodejs-core-5.8.2.tar.gz"],
sha256 = "158619723f1d8bd535dd6b93521f4e03cf24a5e107126d05685fbd9540ccad10",
strip_prefix = "rules_nodejs-6.3.2",
urls = ["https://github.com/bazel-contrib/rules_nodejs/releases/download/v6.3.2/rules_nodejs-v6.3.2.tar.gz"],
)

# NOTE: After upgrading this library, run `build/scripts/build-bazel-lib-helpers.sh`.
Expand All @@ -243,9 +247,9 @@ http_archive(
# Do this AFTER, not BEFORE, upgrading the library.
http_archive(
name = "aspect_bazel_lib",
sha256 = "d0529773764ac61184eb3ad3c687fb835df5bee01afedf07f0cf1a45515c96bc",
strip_prefix = "bazel-lib-1.42.3",
url = "https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-lib-v1.42.3.tar.gz",
sha256 = "349aabd3c2b96caeda6181eb0ae1f14f2a1d9f3cd3c8b05d57f709ceb12e9fb3",
strip_prefix = "bazel-lib-2.9.4",
url = "https://github.com/bazel-contrib/bazel-lib/releases/download/v2.9.4/bazel-lib-v2.9.4.tar.gz",
)

# Load custom toolchains.
Expand All @@ -258,6 +262,16 @@ load("//build:nodejs.bzl", "declare_nodejs_repos")

declare_nodejs_repos()

# Required by rules_js 2.x
load(
"@aspect_bazel_lib//lib:repositories.bzl",
"register_tar_toolchains",
"register_yq_toolchains",
)

register_tar_toolchains()
register_yq_toolchains()

# NOTE: The version is expected to match up to what version of typescript we
# use for all packages in pkg/ui.
# TODO(ricky): We should add a lint check to ensure it does match.
Expand All @@ -266,7 +280,6 @@ load("@aspect_rules_ts//ts/private:npm_repositories.bzl", ts_http_archive = "htt
ts_http_archive(
name = "npm_typescript",
build_file = "@aspect_rules_ts//ts:BUILD.typescript",
# v5.1.6 isn't known to rules_ts 1.4.0 (nor to any published rules_ts version as-of 7 Aug 2023).
integrity = "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==",
urls = ["https://storage.googleapis.com/cockroach-npm-deps/typescript/-/typescript-{}.tgz"],
version = "5.1.6",
Expand Down
12 changes: 6 additions & 6 deletions build/bazelutil/distdir_files.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Code generated by generate-distdir. DO NOT EDIT.

DISTDIR_FILES = {
"https://github.com/aspect-build/rules_jest/releases/download/v0.22.0/rules_jest-v0.22.0.tar.gz": "7fc6798dc566f8ec83867f636739716d81097bd3cead9c0fedb098c58fae6567",
"https://github.com/aspect-build/rules_js/releases/download/v2.3.7/rules_js-v2.3.7.tar.gz": "83e5af4d17385d1c3268c31ae217dbfc8525aa7bcf52508dc6864baffc8b9501",
"https://github.com/aspect-build/rules_ts/releases/download/v3.4.0/rules_ts-v3.4.0.tar.gz": "013a10b2b457add73b081780e604778eb50a141709f9194298f97761acdcc169",
"https://github.com/bazel-contrib/bazel-lib/releases/download/v2.9.4/bazel-lib-v2.9.4.tar.gz": "349aabd3c2b96caeda6181eb0ae1f14f2a1d9f3cd3c8b05d57f709ceb12e9fb3",
"https://github.com/bazel-contrib/bazel_features/releases/download/v1.23.0/bazel_features-v1.23.0.tar.gz": "8b1c9b7558498000f5adebbc584b7bf15b6b2bf181448a66f6b2fc5b4c84231c",
"https://github.com/bazel-contrib/rules_nodejs/releases/download/v6.3.2/rules_nodejs-v6.3.2.tar.gz": "158619723f1d8bd535dd6b93521f4e03cf24a5e107126d05685fbd9540ccad10",
"https://storage.googleapis.com/cockroach-godeps/gomod/bazil.org/fuse/org_bazil_fuse-v0.0.0-20160811212531-371fbbdaa898.zip": "c4f8d08b812e14a7689471372b43e43a0d6c984cdf3d9e541750d69398442e5a",
"https://storage.googleapis.com/cockroach-godeps/gomod/cloud.google.com/go/accessapproval/com_google_cloud_go_accessapproval-v1.6.0.zip": "4fd31c02273e95e4032c7652822e740dbf074d77d66002df0fb96c1222fd0d1e",
"https://storage.googleapis.com/cockroach-godeps/gomod/cloud.google.com/go/accesscontextmanager/com_google_cloud_go_accesscontextmanager-v1.7.0.zip": "90230ccc20b02821de0ef578914c7c32ac3189ebcce539da521228df768fa4f1",
Expand Down Expand Up @@ -1151,8 +1157,6 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/cockroach-godeps/gomod/sourcegraph.com/sourcegraph/appdash/com_sourcegraph_sourcegraph_appdash-v0.0.0-20190731080439-ebfcffb1b5c0.zip": "bd2492d9db05362c2fecd0b3d0f6002c89a6d90d678fb93b4158298ab883736f",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/88ef31b429631b787ceb5e4556d773b20ad797c8.zip": "92a89a2bbe6c6db2a8b87da4ce723aff6253656e8417f37e50d362817c39b98b",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-gazelle-v0.39.1.tar.gz": "b760f7fe75173886007f7c2e616a21241208f3d90e8657dc65d36a771e916b6a",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel-lib-v1.42.3.tar.gz": "d0529773764ac61184eb3ad3c687fb835df5bee01afedf07f0cf1a45515c96bc",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazel_features-v0.2.0.tar.gz": "1aabce613b3ed83847b47efa69eb5dc9aa3ae02539309792a60e705ca4ab92a5",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazelbuild-bazel-skylib-1.3.0-0-g6a17363.tar.gz": "4ede85dfaa97c5662c3fb2042a7ac322d5f029fdc7a6b9daa9423b746e8e8fc0",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bazelbuild-buildtools-v6.3.3-0-gb163fcf.tar.gz": "7929c8fc174f8ab03361796f1417eb0eb5ae4b2a12707238694bec2954145ce4",
"https://storage.googleapis.com/public-bazel-artifacts/bazel/bmatcuk-doublestar-v4.0.1-0-gf7a8118.tar.gz": "d11c3b3a45574f89d6a6b2f50e53feea50df60407b35f36193bf5815d32c79d1",
Expand Down Expand Up @@ -1192,10 +1196,6 @@ DISTDIR_FILES = {
"https://storage.googleapis.com/public-bazel-artifacts/go/20251028-171726/go1.25.3.linux-s390x.tar.gz": "6d080fdd7333c8c84d679119613b7dc6b8703dc45f7231be78ba13e0523ffd50",
"https://storage.googleapis.com/public-bazel-artifacts/go/20251028-171726/go1.25.3.windows-amd64.tar.gz": "2f108bdf9956d0e1620d6277ecf761438f4562f7d551ca6258e8579875cf1ce5",
"https://storage.googleapis.com/public-bazel-artifacts/java/railroad/rr-1.63-java8.zip": "d2791cd7a44ea5be862f33f5a9b3d40aaad9858455828ebade7007ad7113fb41",
"https://storage.googleapis.com/public-bazel-artifacts/js/rules_jest-v0.18.4.tar.gz": "d3bb833f74b8ad054e6bff5e41606ff10a62880cc99e4d480f4bdfa70add1ba7",
"https://storage.googleapis.com/public-bazel-artifacts/js/rules_js-v1.42.3.tar.gz": "2cfb3875e1231cefd3fada6774f2c0c5a99db0070e0e48ea398acbff7c6c765b",
"https://storage.googleapis.com/public-bazel-artifacts/js/rules_nodejs-core-5.8.2.tar.gz": "764a3b3757bb8c3c6a02ba3344731a3d71e558220adcb0cf7e43c9bba2c37ba8",
"https://storage.googleapis.com/public-bazel-artifacts/js/rules_ts-v1.4.0.tar.gz": "ace5b609603d9b5b875d56c9c07182357c4ee495030f40dcefb10d443ba8c208",
"https://storage.googleapis.com/public-bazel-artifacts/python/six-1.10.0.tar.gz": "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
"https://storage.googleapis.com/public-bazel-artifacts/zlib/zlib-1.3.1.tar.gz": "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23",
}
20 changes: 11 additions & 9 deletions build/nodejs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ load("@aspect_bazel_lib//lib/private:copy_directory_toolchain.bzl", "copy_direct
load("@aspect_bazel_lib//lib/private:copy_to_directory_toolchain.bzl", "copy_to_directory_toolchains_repo")
load("@rules_nodejs//nodejs:repositories.bzl", "node_repositories")
load("@rules_nodejs//nodejs/private:nodejs_repo_host_os_alias.bzl", "nodejs_repo_host_os_alias")
load("@rules_nodejs//nodejs/private:toolchains_repo.bzl", "toolchains_repo")
load("@rules_nodejs//nodejs/private:nodejs_toolchains_repo.bzl", "nodejs_toolchains_repo")

_NODE_VERSION = "16.14.2"
_NODE_VERSION = "22.11.0"
_NODE_VERSIONS = {
"darwin_arm64": ("node-v16.14.2-darwin-arm64.tar.gz", "node-v16.14.2-darwin-arm64", "a66d9217d2003bd416d3dd06dfd2c7a044c4c9ff2e43a27865790bd0d59c682d"),
"linux_amd64": ("node-v16.14.2-linux-x64.tar.xz", "node-v16.14.2-linux-x64", "e40c6f81bfd078976d85296b5e657be19e06862497741ad82902d0704b34bb1b"),
"linux_arm64": ("node-v16.14.2-linux-arm64.tar.xz", "node-v16.14.2-linux-arm64", "f7c5a573c06a520d6c2318f6ae204141b8420386553a692fc359f8ae3d88df96"),
"linux_s390x": ("node-v16.14.2-linux-s390x.tar.xz", "node-v16.14.2-linux-s390x", "3197925919ca357e17a31132dc6ef4e5afae819fa09905cfe9f7ff7924a00bf5"),
"windows_amd64": ("node-v16.14.2-win-x64.zip", "node-v16.14.2-win-x64", "4731da4fbb2015d414e871fa9118cabb643bdb6dbdc8a69a3ed563266ac93229"),
"darwin_arm64": ("node-v22.11.0-darwin-arm64.tar.gz", "node-v22.11.0-darwin-arm64", "2e89afe6f4e3aa6c7e21c560d8a0453d84807e97850bbb819b998531a22bdfde"),
"linux_amd64": ("node-v22.11.0-linux-x64.tar.xz", "node-v22.11.0-linux-x64", "83bf07dd343002a26211cf1fcd46a9d9534219aad42ee02847816940bf610a72"),
"linux_arm64": ("node-v22.11.0-linux-arm64.tar.xz", "node-v22.11.0-linux-arm64", "6031d04b98f59ff0f7cb98566f65b115ecd893d3b7870821171708cdbaf7ae6e"),
"linux_s390x": ("node-v22.11.0-linux-s390x.tar.xz", "node-v22.11.0-linux-s390x", "f474ed77d6b13d66d07589aee1c2b9175be4c1b165483e608ac1674643064a99"),
"windows_amd64": ("node-v22.11.0-win-x64.zip", "node-v22.11.0-win-x64", "905373a059aecaf7f48c1ce10ffbd5334457ca00f678747f19db5ea7d256c236"),
}

# Versions of copy_directory and copy_to_directory from bazel-lib (github.com/aspect-build/bazel-lib)
Expand Down Expand Up @@ -106,14 +106,16 @@ def declare_nodejs_repos():
_NODE_VERSION + "-" + name: _NODE_VERSIONS[name]
},
node_urls = [
"https://storage.googleapis.com/public-bazel-artifacts/js/node/v{version}/{filename}",
# NOTE: Add GCS mirror URL first once Node 22 binaries are uploaded
# "https://storage.googleapis.com/public-bazel-artifacts/js/node/v{version}/{filename}",
"https://nodejs.org/dist/v{version}/{filename}",
],
node_version = _NODE_VERSION,
platform = name,
)
nodejs_repo_host_os_alias(name = "nodejs", user_node_repository_name = "nodejs")
nodejs_repo_host_os_alias(name = "nodejs_host", user_node_repository_name = "nodejs")
toolchains_repo(name = "nodejs_toolchains", user_node_repository_name = "nodejs")
nodejs_toolchains_repo(name = "nodejs_toolchains", user_node_repository_name = "nodejs")
# NB: npm_import has weird behavior where it transparently makes these
# copy_directory/copy_to_directory repos for you if you do not set up the
# repositories beforehand. This is weird behavior that will hopefully be
Expand Down
2 changes: 1 addition & 1 deletion dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi
set -euo pipefail

# Bump this counter to force rebuilding `dev` on all machines.
DEV_VERSION=114
DEV_VERSION=116

THIS_DIR=$(cd "$(dirname "$0")" && pwd)
BINARY_DIR=$THIS_DIR/bin/dev-versions
Expand Down
22 changes: 10 additions & 12 deletions pkg/cmd/dev/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ type UIDirectories struct {
e2eTests string
// eslintPlugin is the absolute path to ./pkg/ui/workspaces/eslint-plugin-crdb.
eslintPlugin string
// protoOss is the absolute path to ./pkg/ui/workspaces/db-console/src/js/.
protoOss string
// protoBase is the absolute path to ./pkg/ui/workspaces/db-console/src/js/.
protoBase string
// protoCcl is the absolute path to ./pkg/ui/workspaces/db-console/ccl/src/js/.
protoCcl string
// crdbJsProto is the absolute path to ./pkg/ui/workspaces/crdb-js-proto/.
Expand All @@ -73,7 +73,7 @@ func getUIDirs(d *dev) (*UIDirectories, error) {
dbConsole: filepath.Join(workspace, "./pkg/ui/workspaces/db-console"),
e2eTests: filepath.Join(workspace, "./pkg/ui/workspaces/e2e-tests"),
eslintPlugin: filepath.Join(workspace, "./pkg/ui/workspaces/eslint-plugin-crdb"),
protoOss: filepath.Join(workspace, "./pkg/ui/workspaces/db-console/src/js"),
protoBase: filepath.Join(workspace, "./pkg/ui/workspaces/db-console/src/js"),
protoCcl: filepath.Join(workspace, "./pkg/ui/workspaces/db-console/ccl/src/js"),
crdbApiClient: filepath.Join(workspace, "./pkg/ui/workspaces/crdb-api-client"),
}, nil
Expand Down Expand Up @@ -112,7 +112,7 @@ func (d *dev) assertNoLinkedNpmDeps(targets []buildTarget) error {
jsPkgRoots := []string{
uiDirs.root,
uiDirs.eslintPlugin,
uiDirs.protoOss,
uiDirs.protoBase,
uiDirs.protoCcl,
uiDirs.clusterUI,
uiDirs.dbConsole,
Expand Down Expand Up @@ -342,7 +342,7 @@ Replaces 'make ui-watch'.`,

// Add additional webpack args to copy cluster-ui output to external directories.
for _, dst := range clusterUiDestinations {
argv = append(argv, "--env.copy-to="+dst)
argv = append(argv, "--env", "copy-to="+dst)
}

err = nbExec.CommandContextInheritingStdStreams(ctx, "pnpm", argv...)
Expand Down Expand Up @@ -376,11 +376,9 @@ Replaces 'make ui-watch'.`,
"webpack-dev-server",
"--config", "webpack.config.js",
"--mode", "development",
// Polyfill WEBPACK_SERVE for webpack v4; it's set in webpack v5 via
// `webpack serve`.
"--env.WEBPACK_SERVE",
"--env.dist=ccl",
"--env.target=" + dbTarget,
"--env", "WEBPACK_SERVE",
"--env", "dist=ccl",
"--env", "target=" + dbTarget,
"--port", port,
}
if secure {
Expand Down Expand Up @@ -747,8 +745,8 @@ func arrangeFilesForWatchers(d *dev) error {

// Recreate protobuf client files that were previously copied out of the sandbox
for _, relPath := range protoFiles {
ossDst := filepath.Join(dbConsoleDst, relPath)
if err := d.os.CopyFile(filepath.Join(dbConsoleSrc, relPath), ossDst); err != nil {
baseDst := filepath.Join(dbConsoleDst, relPath)
if err := d.os.CopyFile(filepath.Join(dbConsoleSrc, relPath), baseDst); err != nil {
return err
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/mirror/npm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func getUnmirroredUrls(

for key := range lf.Packages {
// Example key:
// /@ant-design/create-react-context@0.2.6(prop-types@15.8.1)(react@16.12.0)
// @ant-design/create-react-context@0.2.6(prop-types@15.8.1)(react@16.12.0)
// ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ ~~~~~
// [NPM scope] package name version

// Remove the leading '/' and everything after the first '('.
scopedNameAtVersion, _, _ := strings.Cut(key[1:], "(")
// Remove everything after the first '('.
scopedNameAtVersion, _, _ := strings.Cut(key, "(")

// Split the scoped name and version apart.
lastAt := strings.LastIndex(scopedNameAtVersion, "@")
Expand Down
5 changes: 0 additions & 5 deletions pkg/ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ yarn.cluster-ui.installed
yarn.protobuf.installed
yarn-error.log
assets.ccl.installed
assets.oss.installed

# Generated intermediates
.cache-loader
Expand All @@ -21,8 +20,4 @@ dist_vendor/**
!distccl/distccl.go
!distccl/distccl_no_bazel.go
!distccl/BUILD.bazel
!distoss/assets/.gitkeep
!distoss/distoss.go
!distoss/distoss_no_bazel.go
!distoss/BUILD.bazel
*manifest.json
24 changes: 12 additions & 12 deletions pkg/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ bazel clean --expunge
```
though be warned your next build will take a while.

## CCL Build

In CCL builds, code in `pkg/ui/ccl/src` overrides code in `pkg/ui/src` at build
time, via a Webpack import resolution rule. E.g. if a file imports
`src/views/shared/components/licenseType`, it'll resolve to
`pkg/ui/src/views/shared/components/licenseType` in an OSS build, and
`pkg/ui/ccl/src/views/shared/components/licenseType` in a CCL build.

CCL code can import OSS code by prefixing paths with `oss/`, e.g.
`import "oss/src/myComponent"`. By convention, this is only done by a CCL file
importing the OSS version of itself, e.g. to render the OSS version of itself
when the trial period has expired.
## Module Resolution

Code in `pkg/ui/ccl/src` overrides code in `pkg/ui/src` at build time, via a
Webpack import resolution rule. E.g. if a file imports
`src/views/shared/components/licenseType`, it'll first look for the file in
`pkg/ui/ccl/src/views/shared/components/licenseType`, then fall back to
`pkg/ui/src/views/shared/components/licenseType`.

CCL code can import base code by prefixing paths with `oss/`, e.g.
`import "oss/src/myComponent"`. By convention, this is done by a CCL file
importing the base version of itself, e.g. to render the base version when
the license doesn't support a particular feature.

## Running tests

Expand Down
5 changes: 3 additions & 2 deletions pkg/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"pnpm": ">=8.6.10"
},
"pnpm": {
"neverBuiltDependencies": [
"contextify"
"onlyBuiltDependencies": [
"esbuild",
"protobufjs"
],
"packageExtensions": {
"// meta": [
Expand Down
Loading
Loading