Skip to content

Commit

Permalink
externalize @player-ui/player from native bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
sugarmanz committed Jul 6, 2024
1 parent cf46da3 commit 9203d45
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 39 deletions.
9 changes: 7 additions & 2 deletions core/make-flow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "MakeFlow"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/make-flow",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "MakeFlow",
native_bundle = NATIVE_BUNDLE,
deps = [
":node_modules/@player-ui/types",
],
Expand Down
9 changes: 7 additions & 2 deletions core/partial-match-registry/BUILD
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

tsup_config(name = "tsup_config")
NATIVE_BUNDLE = "Registry"

tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/partial-match-registry",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "Registry",
native_bundle = NATIVE_BUNDLE,
deps = [
"//:node_modules/@types/dlv",
"//:node_modules/dlv",
Expand Down
10 changes: 8 additions & 2 deletions core/player/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

# TODO: Would be nice to macro all the native things to avoid missing this setup (consequence is bundling Player in a plugin bundle)
NATIVE_BUNDLE = "Player"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/player",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "Player",
native_bundle = NATIVE_BUNDLE,
test_deps = [
":node_modules/@player-ui/make-flow",
"//:vitest_config",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"ebnf": "^1.9.0",
"error-polyfill": "^0.1.3",
"esbuild-wasm": "^0.19.8",
"esbuild-plugin-external-global": "^1.0.1",
"eslint": "^8.54.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
Expand Down
9 changes: 7 additions & 2 deletions plugins/async-node/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "AsyncNodePlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/async-node-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "AsyncNodePlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/beacon/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "BeaconPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/beacon-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "BeaconPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/check-path/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "CheckPathPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/check-path-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "CheckPathPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/common-expressions/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "CommonExpressionsPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/common-expressions-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "CommonExpressionsPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/common-types/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "CommonTypesPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/common-types-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "CommonTypesPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/computed-properties/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "ComputedPropertiesPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/computed-properties-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ComputedPropertiesPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/expression/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "ExpressionPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/expression-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ExpressionPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/external-action/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "ExternalActionPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/external-action-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ExternalActionPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/markdown/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "MarkdownPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/markdown-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "MarkdownPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
":node_modules/@player-ui/types",
Expand Down
9 changes: 7 additions & 2 deletions plugins/metrics/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "MetricsPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/metrics-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "MetricsPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/partial-match-fingerprint/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "PartialMatchFingerprintPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/partial-match-fingerprint-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "PartialMatchFingerprintPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/pubsub/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ load("@rules_player//javascript:defs.bzl", "js_pipeline")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")

NATIVE_BUNDLE = "PubSubPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

js_pipeline(
package_name = "@player-ui/pubsub-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "PubSubPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
9 changes: 7 additions & 2 deletions plugins/reference-assets/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ load("@npm//:defs.bzl", "npm_link_all_packages")
load("//tools:defs.bzl", "NATIVE_BUILD_DEPS", "tsup_config", "vitest_config")
load("@rules_player//player:defs.bzl", "js_xlr_pipeline")

NATIVE_BUNDLE = "ReferenceAssetsPlugin"

npm_link_all_packages(name = "node_modules")

tsup_config(name = "tsup_config")
tsup_config(
name = "tsup_config",
native_bundle = NATIVE_BUNDLE,
)

vitest_config(name = "vitest_config")

Expand All @@ -23,7 +28,7 @@ vitest_config(name = "vitest_config")
js_xlr_pipeline(
package_name = "@player-ui/reference-assets-plugin",
build_deps = NATIVE_BUILD_DEPS,
native_bundle = "ReferenceAssetsPlugin",
native_bundle = NATIVE_BUNDLE,
peer_deps = [
":node_modules/@player-ui/player",
],
Expand Down
Loading

0 comments on commit 9203d45

Please sign in to comment.