Skip to content

Commit 80ba08f

Browse files
authored
Merge pull request yoheimuta#363 from carstencodes/contrib/carstencodes/npm-download-issue
fix: Two different NPM Issues
2 parents 2f86d18 + b7ae38c commit 80ba08f

File tree

4 files changed

+59
-179
lines changed

4 files changed

+59
-179
lines changed

bdist/js/ReadMe.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# protolint
2+
3+
Protolint is a go based linter for `.proto` files for google protobuf und gRPC. It follows the best practices at the [protobuf.dev](https://protobuf.dev/programming-guides/style/) (and ff.). Please note, that this should be a dev-dependency.
4+
5+
The npm package provides a wrapper around the executables `protolint` and `protoc-gen-protolint`. During installation process, it will download the binaries matching the version and your operating system and CPU architecture from github.
6+
7+
If your behind a proxy, you can add the `PROTOLINT_PROXY` environment variable including the HTTP basic authentication information like username and password.
8+
9+
If your running an airgapped environment, you can add the following environment variables:
10+
11+
`PROTOLINT_MIRROR_HOST`: The basic url you are using to serve the binaries. Defaults to `https://github.com`
12+
`PROTOLINT_MIRROR_REMOTE_PATH`: The relative path on the mirror host. Defaults to `yoheimuta/protolint/releases/download/`
13+
14+
Within the remote path, make sure, that a folder `v<version>` exists containing the files downloaded from the github releases.
15+
16+
If you are required to authenticate against your mirror, use the following environment variables:
17+
18+
`PROTOLINT_MIRROR_USERNAME`: The user name. Defaults to an empty string.
19+
`PROTOLINT_MIRROR_PASSWORD`: The password or identifaction token. Defaults to an empty string.
20+
21+
For node based projects, you can add the protobuf configuration to your `package.json` using a node called `protolint`.
22+
23+
For more information about protolint, its parameters and command-line arguments refer to the original ReadMe in the [github repository](https://github.com/yoheimuta/protolint).

bdist/js/install.mjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,24 @@ const arch = _arch_mapping[_arch] ?? _arch;
2626

2727
const url = `${protolint_host}/${protolint_path}/v${protolint_version}/${module_name}_${protolint_version}_${platform}_${arch}.tar.gz`;
2828

29-
var agent = null;
29+
let agent;
3030
if (process.env.PROTOLINT_PROXY) {
3131
agent = HttpProxyAgent(process.env.PROTOLINT_PROXY);
3232
}
3333

34-
const instance = got.extend({
34+
const agent_config = {
35+
http: agent
36+
};
37+
38+
const got_config = {
3539
followRedirect: true,
3640
maxRedirects: 3,
3741
username: process.env.PROTOLINT_MIRROR_USERNAME ?? '',
3842
password: process.env.PROTOLINT_MIRROR_PASSWORD ?? '',
39-
agent: {
40-
http: agent
41-
}
42-
});
43+
agent: agent_config,
44+
};
45+
46+
const instance = got.extend(got_config);
4347

4448
function get_filename_with_extension(fileName) {
4549
const ext = process.platform == "win32" ? ".exe" : "";

bdist/js/package-lock.json

Lines changed: 23 additions & 170 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bdist/js/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "protolint",
3-
"version": "0.46.0",
3+
"version": "0.47.4",
44
"description": "A pluggable linter and fixer to enforce Protocol Buffer style and conventions.",
55
"main": "index.js",
66
"bin": {
@@ -46,7 +46,7 @@
4646
"http-proxy-agent": "^7.0.0",
4747
"npmlog": "^7.0.1",
4848
"semver": "^7.5.4",
49-
"tar": "^6.1.15",
49+
"tar": "^6.2.0",
5050
"tempy": "^3.1.0"
5151
}
52-
}
52+
}

0 commit comments

Comments
 (0)