Skip to content

Commit 3185eea

Browse files
committed
refactor: inline provider file
1 parent eff3276 commit 3185eea

File tree

10 files changed

+17
-33
lines changed

10 files changed

+17
-33
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
docs/*.md
2+
examples/plugins/expected_*.js
23
**/expected.js
34
**/expected.cjs

examples/plugins/expected_rc.js

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import map from"lodash/map";import sort from"lodash/test/sort";var foo="bar";var _m=map;var _s=sort;
1+
import{map}from"lodash";import{sort}from"lodash2";var foo="bar";var _m=map;var _s=sort;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import map from "lodash/map";
2-
import sort from "lodash/test/sort";
1+
import { map } from "lodash";
2+
import { sort } from "lodash2";
33
const foo = "bar";
44
let _m = map;
55
let _s = sort;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import map from "lodash/map";
2-
import sort from "lodash/test/sort";
1+
import { map } from "lodash";
2+
import { sort } from "lodash2";
33
var foo = "bar";
44
var _m = map;
55
var _s = sort;

swc/BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,4 @@ bzl_library(
5757
name = "providers",
5858
srcs = ["providers.bzl"],
5959
visibility = ["//visibility:public"],
60-
deps = [
61-
"//swc/private:swc_plugin_config_info",
62-
],
6360
)

swc/private/BUILD.bazel

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,18 @@ bzl_library(
1414
visibility = ["//swc:__subpackages__"],
1515
)
1616

17-
bzl_library(
18-
name = "swc_plugin_config_info",
19-
srcs = ["swc_plugin_config_info.bzl"],
20-
visibility = ["//swc:__subpackages__"],
21-
)
22-
2317
bzl_library(
2418
name = "swc_plugin",
2519
srcs = ["swc_plugin.bzl"],
2620
visibility = ["//swc:__subpackages__"],
27-
deps = [
28-
":swc_plugin_config_info",
29-
],
21+
deps = ["//swc:providers"],
3022
)
3123

3224
bzl_library(
3325
name = "swc",
3426
srcs = ["swc.bzl"],
3527
visibility = ["//swc:__subpackages__"],
3628
deps = [
37-
":swc_plugin_config_info",
3829
"@aspect_bazel_lib//lib:platform_utils",
3930
"@aspect_rules_js//js:libs",
4031
"@aspect_rules_js//js:providers",

swc/private/swc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@aspect_bazel_lib//lib:platform_utils.bzl", "platform_utils")
44
load("@aspect_rules_js//js:libs.bzl", "js_lib_helpers")
55
load("@aspect_rules_js//js:providers.bzl", "js_info")
66
load("@bazel_skylib//lib:paths.bzl", "paths")
7-
load(":swc_plugin_config_info.bzl", "SwcPluginConfigInfo")
7+
load("//swc:providers.bzl", "SwcPluginConfigInfo")
88

99
_attrs = {
1010
"srcs": attr.label_list(

swc/private/swc_plugin.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"Internal implementation details"
1+
"Implementation details for swc_plugin rule"
22

3-
load(":swc_plugin_config_info.bzl", "SwcPluginConfigInfo")
3+
load("//swc:providers.bzl", "SwcPluginConfigInfo")
44

55
_attrs = {
66
"src": attr.label(

swc/private/swc_plugin_config_info.bzl

Lines changed: 0 additions & 9 deletions
This file was deleted.

swc/providers.bzl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""Providers for building derivative rules"""
22

3-
load("//swc/private:swc_plugin_config_info.bzl", _SwcPluginConfigInfo = "SwcPluginConfigInfo")
4-
5-
SwcPluginConfigInfo = _SwcPluginConfigInfo
3+
SwcPluginConfigInfo = provider(
4+
doc = "Provides a configuration for an SWC plugin",
5+
fields = {
6+
"label": "the label of the target that created this provider",
7+
"config": "the plugin configuration",
8+
},
9+
)

0 commit comments

Comments
 (0)