Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to rulesjs and pnpm #1815

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Working SQLX tests
  • Loading branch information
Ekrekr committed Aug 21, 2024
commit 0117125734d1e3d626f536793c7a1c6bc17d953f
40 changes: 19 additions & 21 deletions cli/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("//tools:ts_library.bzl", "ts_library")
load("//tools:ts_library.bzl", "ts_library", "ts_test_suite")
load("//tools/common:copy.bzl", "copy_file")
load("//:version.bzl", "DF_VERSION")
load("//testing:index.bzl", "ts_test_suite")
load("//tools:node_modules.bzl", "node_modules")

package(default_visibility = ["//visibility:public"])
Expand All @@ -21,17 +20,17 @@ ts_library(
"//core",
"//protos:ts",
"//sqlx:format",
"@npm//@types/glob",
"@npm//@types/long",
"@npm//@types/node",
"@npm//@types/readline-sync",
"@npm//@types/yargs",
"@npm//chokidar",
"@npm//glob",
"@npm//parse-duration",
"@npm//readline-sync",
"@npm//untildify",
"@npm//yargs",
"//:node_modules/@types/glob",
"//:node_modules/@types/long",
"//:node_modules/@types/node",
"//:node_modules/@types/readline-sync",
"//:node_modules/@types/yargs",
"//:node_modules/chokidar",
"//:node_modules/glob",
"//:node_modules/parse-duration",
"//:node_modules/readline-sync",
"//:node_modules/untildify",
"//:node_modules/yargs",
],
)

Expand All @@ -43,7 +42,6 @@ node_modules(
)

ts_test_suite(
name = "tests",
srcs = ["index_test.ts"],
data = [
":node_modules",
Expand All @@ -56,13 +54,13 @@ ts_test_suite(
"//core",
"//protos:ts",
"//testing",
"@npm//@types/chai",
"@npm//@types/fs-extra",
"@npm//@types/js-yaml",
"@npm//@types/node",
"@npm//chai",
"@npm//fs-extra",
"@npm//js-yaml",
"//:node_modules/@types/chai",
"//:node_modules/@types/fs-extra",
"//:node_modules/@types/js-yaml",
"//:node_modules/@types/node",
"//:node_modules/chai",
"//:node_modules/fs-extra",
"//:node_modules/js-yaml",
],
)

Expand Down
38 changes: 19 additions & 19 deletions cli/api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ ts_library(
"//cli/vm:compile_loader",
"//sqlx:lexer",
"//cli/vm:vm",
"@npm//@google-cloud/bigquery",
"@npm//@types/fs-extra",
"@npm//@types/glob",
"@npm//@types/js-beautify",
"@npm//@types/js-yaml",
"@npm//@types/long",
"@npm//@types/node",
"@npm//@types/semver",
"@npm//@types/tmp",
"@npm//deepmerge",
"@npm//fs-extra",
"@npm//glob",
"@npm//google-sql-syntax-ts",
"@npm//js-beautify",
"@npm//js-yaml",
"@npm//promise-pool-executor",
"@npm//protobufjs",
"@npm//semver",
"@npm//tmp",
"//:node_modules/@google-cloud/bigquery",
"//:node_modules/@types/fs-extra",
"//:node_modules/@types/glob",
"//:node_modules/@types/js-beautify",
"//:node_modules/@types/js-yaml",
"//:node_modules/@types/long",
"//:node_modules/@types/node",
"//:node_modules/@types/semver",
"//:node_modules/@types/tmp",
"//:node_modules/deepmerge",
"//:node_modules/fs-extra",
"//:node_modules/glob",
"//:node_modules/google-sql-syntax-ts",
"//:node_modules/js-beautify",
"//:node_modules/js-yaml",
"//:node_modules/promise-pool-executor",
"//:node_modules/protobufjs",
"//:node_modules/semver",
"//:node_modules/tmp",
],
)
4 changes: 2 additions & 2 deletions cli/api/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ts_library(
"//common/strings",
"//core",
"//protos:ts",
"@npm//@types/node",
"@npm//object-sizeof",
"//:node_modules/@types/node",
"//:node_modules/object-sizeof",
],
)
16 changes: 8 additions & 8 deletions cli/vm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ ts_library(
"//common/protos",
"//core",
"//protos:ts",
"@npm//@types/glob",
"@npm//@types/node",
"@npm//@types/semver",
"@npm//glob",
"@npm//semver",
"@npm//vm2",
"//:node_modules/@types/glob",
"//:node_modules/@types/node",
"//:node_modules/@types/semver",
"//:node_modules/glob",
"//:node_modules/semver",
"//:node_modules/vm2",
],
)

Expand All @@ -26,7 +26,7 @@ ts_library(
],
deps = [
":vm",
"@npm//source-map-support",
"//:node_modules/source-map-support",
],
)

Expand All @@ -42,7 +42,7 @@ nodejs_binary(
name = "compile",
data = [
":vm",
"@npm//source-map-support",
"//:node_modules/source-map-support",
],
entry_point = ":compile.ts",
templated_args = [
Expand Down
4 changes: 1 addition & 3 deletions common/promises/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@df//tools:ts_library.bzl", "ts_library")
load("@df//testing:index.bzl", "ts_test_suite")
load("//tools:ts_library.bzl", "ts_library", "ts_test_suite")

package(default_visibility = ["//visibility:public"])

Expand All @@ -15,7 +14,6 @@ ts_library(
)

ts_test_suite(
name = "tests",
srcs = glob(["*.spec.ts"]),
data = [
"//:node_modules/source-map-support",
Expand Down
4 changes: 1 addition & 3 deletions common/strings/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("@df//testing:index.bzl", "ts_test_suite")
load("//tools:ts_library.bzl", "ts_library")
load("//tools:ts_library.bzl", "ts_library", "ts_test_suite")

package(default_visibility = ["//visibility:public"])

Expand All @@ -16,7 +15,6 @@ ts_library(
)

ts_test_suite(
name = "tests",
srcs = glob(["*.spec.ts"]),
data = [
"//:node_modules/source-map-support",
Expand Down
38 changes: 18 additions & 20 deletions core/BUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
load("//:version.bzl", "DF_VERSION")
load("//testing:index.bzl", "ts_test_suite")
load("//tools:expand_template.bzl", "expand_template")
load("//tools:node_modules.bzl", "node_modules")
load("//tools:ts_library.bzl", "ts_library")
load("//tools:ts_library.bzl", "ts_library", "ts_test_suite")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -47,20 +46,19 @@ ts_library(
"//core/compilation_sql",
"//protos:ts",
"//sqlx:lexer",
"@npm//@types/fs-extra",
"@npm//@types/js-yaml",
"@npm//@types/node",
"@npm//@types/semver",
"@npm//fs-extra",
"@npm//js-yaml",
"@npm//protobufjs",
"@npm//semver",
"@npm//tarjan-graph",
"//:node_modules/@types/fs-extra",
"//:node_modules/@types/js-yaml",
"//:node_modules/@types/node",
"//:node_modules/@types/semver",
"//:node_modules/fs-extra",
"//:node_modules/js-yaml",
"//:node_modules/protobufjs",
"//:node_modules/semver",
"//:node_modules/tarjan-graph",
],
)

ts_test_suite(
name = "tests",
srcs = [
"main_test.ts",
],
Expand All @@ -72,14 +70,14 @@ ts_test_suite(
"//common/protos",
"//protos:ts",
"//testing",
"@npm//@types/chai",
"@npm//@types/fs-extra",
"@npm//@types/js-yaml",
"@npm//@types/node",
"@npm//chai",
"@npm//fs-extra",
"@npm//js-yaml",
"@npm//vm2",
"//:node_modules/@types/chai",
"//:node_modules/@types/fs-extra",
"//:node_modules/@types/js-yaml",
"//:node_modules/@types/node",
"//:node_modules/chai",
"//:node_modules/fs-extra",
"//:node_modules/js-yaml",
"//:node_modules/vm2",
],
)

Expand Down
13 changes: 6 additions & 7 deletions examples/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//testing:index.bzl", "ts_test_suite")
load("//tools:ts_library.bzl", "ts_library", "ts_test_suite")
load("//tools:node_modules.bzl", "node_modules")

package(default_visibility = ["//visibility:private"])
Expand All @@ -17,7 +17,6 @@ filegroup(
)

ts_test_suite(
name = "tests",
srcs = ["examples_test.ts"],
data = [
":all_projects",
Expand All @@ -31,11 +30,11 @@ ts_test_suite(
"//common/protos",
"//protos:ts",
"//testing",
"@npm//@types/chai",
"@npm//@types/fs-extra",
"@npm//@types/node",
"@npm//chai",
"@npm//fs-extra",
"//:node_modules/@types/chai",
"//:node_modules/@types/fs-extra",
"//:node_modules/@types/node",
"//:node_modules/chai",
"//:node_modules/fs-extra",
],
)

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/json-stable-stringify": "^1.0.32",
"@types/lodash": "^4.14.149",
"@types/long": "^4.0.0",
"@types/moo": "^0.5.0",
"@types/moo": "^0.5.2",
"@types/mssql": "^6.0.8",
"@types/node": "^12.20.55",
"@types/node-cache": "^4.2.5",
Expand Down Expand Up @@ -82,13 +82,14 @@
"jasmine": "^5.2.0",
"jasmine-reporters": "^2.5.2",
"js-beautify": "^1.10.2",
"js-yaml": "^4.1.0",
"jsdoc": "^3.6.11",
"json-stable-stringify": "^1.0.1",
"lodash": "^4.17.21",
"long": "^4.0.0",
"minimist": "^1.2.6",
"mocha": "^10.3.0",
"moo": "^0.5.0",
"moo": "^0.5.2",
"mssql": "^8.1.2",
"next-images": "^1.0.4",
"node-cache": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@dataform/cli/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nodejs_binary(
name = "bin",
data = [
":cli",
"@npm//source-map-support",
"//:node_modules/source-map-support",
],
entry_point = ":index.ts",
templated_args = [
Expand Down
8 changes: 4 additions & 4 deletions packages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ ts_library(
name = "gen-package-json",
srcs = ["gen_package_json.ts"],
deps = [
"@npm//@types/node",
"@npm//@types/yargs",
"@npm//yargs",
"//:node_modules/@types/node",
"//:node_modules/@types/yargs",
"//:node_modules/yargs",
],
)

Expand All @@ -26,7 +26,7 @@ nodejs_binary(
],
data = [
":gen-package-json",
"@npm//source-map-support",
"//:node_modules/source-map-support",
],
entry_point = ":gen_package_json.ts",
)
6 changes: 3 additions & 3 deletions packages/index.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("//:node_modules/@bazel/rollup:index.bzl", "rollup_bundle")
load(":rollup_bundle_dts.bzl", "rollup_bundle_dts")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")

Expand Down Expand Up @@ -37,7 +37,7 @@ def pkg_bundle(deps, externals, allow_node_builtins = False, args = [], **kwargs
format = "cjs",
sourcemap = "false",
deps = [
"@npm//@rollup/plugin-node-resolve",
"//:node_modules/@rollup/plugin-node-resolve",
] + deps,
**kwargs
)
Expand All @@ -49,7 +49,7 @@ def pkg_bundle_dts(deps, externals, args = [], **kwargs):
format = "cjs",
sourcemap = "false",
deps = [
"@npm//rollup-plugin-dts",
"//:node_modules/rollup-plugin-dts",
] + deps,
**kwargs
)
Expand Down
6 changes: 3 additions & 3 deletions packages/rollup_bundle_dts.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ Otherwise, the outputs are assumed to be a single file.
doc = "Target that executes the rollup binary",
executable = True,
cfg = "host",
default = "@npm//rollup/bin:rollup",
default = "//:node_modules/rollup/bin:rollup",
),
"rollup_worker_bin": attr.label(
doc = "Internal use only",
executable = True,
cfg = "host",
# NB: will be substituted with "@npm//@bazel/rollup/bin:rollup-worker" when the pkg_npm target is built
default = "@npm//@bazel/rollup/bin:rollup-worker",
# NB: will be substituted with "//:node_modules/@bazel/rollup/bin:rollup-worker" when the pkg_npm target is built
default = "//:node_modules/@bazel/rollup/bin:rollup-worker",
),
"silent": attr.bool(
doc = """Whether to execute the rollup binary with the --silent flag, defaults to False.
Expand Down
Loading