Skip to content

Commit

Permalink
fix: executable issue on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Sep 15, 2021
1 parent 736555e commit ca59539
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
with:
Expand Down
3 changes: 1 addition & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ pkg_npm(
name = "package",
package_name = "protoc-gen-ts",
srcs = [
"//bin:protoc-gen-ts",
"//bin:protoc-gen-ts.cmd",
"//bin:protoc-gen-ts.js",
"index.bzl",
"package.json",
"README.md",
Expand Down
11 changes: 6 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Setup NodeJS toolchain
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "5c40083120eadec50a3497084f99bc75a85400ea727e82e0b2f422720573130f",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0-beta.0/rules_nodejs-4.0.0-beta.0.tar.gz"],
sha256 = "b32a4713b45095e9e1921a7fcb1adf584bc05959f3336e7351bcf77f015a2d7c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.1.0/rules_nodejs-4.1.0.tar.gz"],
)

load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
Expand All @@ -29,10 +29,11 @@ yarn_install(
# Setup Protocol Buffers toolchain
http_archive(
name = "rules_proto",
sha256 = "57001a3b33ec690a175cdf0698243431ef27233017b9bed23f96d44b9c98242f",
strip_prefix = "rules_proto-9cd4f8f1ede19d81c6d48910429fe96776e567b1",
sha256 = "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da",
strip_prefix = "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/9cd4f8f1ede19d81c6d48910429fe96776e567b1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz",
],
)

Expand Down
6 changes: 3 additions & 3 deletions bin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ package(default_visibility = ["//visibility:public"])

nodejs_binary(
name = "bin",
entry_point = ":protoc-gen-ts",
entry_point = ":protoc-gen-ts.js",
data = [
"//src",
":protoc-gen-ts"
":protoc-gen-ts.js"
],
# See: https://github.com/bazelbuild/rules_nodejs/issues/2600
templated_args = ["--bazel_patch_module_resolver"],
)

exports_files(["protoc-gen-ts", "protoc-gen-ts.cmd"])
exports_files(["protoc-gen-ts.js"])
14 changes: 0 additions & 14 deletions bin/protoc-gen-ts.cmd

This file was deleted.

1 change: 0 additions & 1 deletion bin/protoc-gen-ts → bin/protoc-gen-ts.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/usr/bin/env node

require('../src/index')
5 changes: 3 additions & 2 deletions index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ ts_proto_library = rule(
),
"protoc_gen_ts_bin": attr.label(
executable = True,
cfg = "exec",
cfg = "host",
default = _get_bin(),
),
"_protoc": attr.label(
cfg = "host",
executable = True,
cfg = "exec",
allow_single_file = True,
default = (
"@com_google_protobuf//:protoc"
),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"codegen": "node ./scripts/sync_compiler_protos.js && bazel build //src:codegen && node ./scripts/sync_generated_protos.js src/compiler && bazel build //src:compiler && node ./scripts/sync_generated_protos.js src/compiler js"
},
"bin": {
"protoc-gen-ts": "./bin/protoc-gen-ts"
"protoc-gen-ts": "./bin/protoc-gen-ts.js"
},
"peerDependencies": {
"google-protobuf": "^3.13.0",
Expand Down

0 comments on commit ca59539

Please sign in to comment.