Skip to content

Commit

Permalink
Release version 2.0.0 (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
silas authored Oct 18, 2024
1 parent a4ac24c commit a7a59db
Show file tree
Hide file tree
Showing 36 changed files with 2,261 additions and 186 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/nodejs.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Node CI

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
CI: true

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18, 20]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install
run: pnpm install

- name: Test
run: pnpm test
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
release:
types: [published]

permissions:
contents: read

jobs:
npm:
name: npm
runs-on: ubuntu-latest

environment:
name: npm
url: https://www.npmjs.com/package/consul

permissions:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Install
run: pnpm install

- name: Publish
run: pnpm publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.log
*.pid
*swp
.env
.idea
.nyc_output
.rock.yml
config
coverage
example*.js
node_modules
package-lock.json
pnpm-lock.yaml
tmp
2 changes: 1 addition & 1 deletion lib/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Catalog {
if (!opts.node || !opts.address) {
throw this.consul._err(
errors.Validation("node and address required"),
req
req,
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/health.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ declare class Health {

state(options: StateOptions): Promise<StateResult>;
state(
state: "any" | "passing" | "warning" | "critical"
state: "any" | "passing" | "warning" | "critical",
): Promise<StateResult>;
}
2 changes: 1 addition & 1 deletion lib/health.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Health {
if (opts.state !== "any" && constants.CHECK_STATE.indexOf(opts.state) < 0) {
throw this.consul._err(
errors.Validation("state invalid: " + opts.state),
req
req,
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/kv.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ declare class Kv {
set(
key: string,
value: string | Buffer,
options: SetOptions
options: SetOptions,
): Promise<SetResult>;

del(options: DelOptions): Promise<DelResult>;
Expand Down
2 changes: 1 addition & 1 deletion lib/kv.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Kv {
return next(
false,
undefined,
utils.responseResult(request, res.body[0])
utils.responseResult(request, res.body[0]),
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/transaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ declare class Transaction {
create(options: CreateOptions): Promise<CreateResult>;
create(
operations: Operation[],
options: CreateOptions
options: CreateOptions,
): Promise<CreateResult>;
}
6 changes: 3 additions & 3 deletions lib/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Transaction {
default:
throw this.consul._err(
errors.Validation(
"a list of operations are required as first arguments"
"a list of operations are required as first arguments",
),
{ name: "Transaction.create" }
{ name: "Transaction.create" },
);
}

Expand All @@ -45,7 +45,7 @@ class Transaction {
if (!(Array.isArray(opts.operations) && opts.operations.length > 0)) {
throw this.consul._err(
errors.Validation("operations must be an array with at least one item"),
req
req,
);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function _createServiceCheck(src) {
if (src.hasOwnProperty("aliasservice")) dst.AliasService = src.aliasservice;
} else {
throw new Error(
"args/grpc/h2ping/http/tcp/udp and interval, ttl, or aliasnode/aliasservice"
"args/grpc/h2ping/http/tcp/udp and interval, ttl, or aliasnode/aliasservice",
);
}
if (src.hasOwnProperty("notes")) dst.Notes = src.notes;
Expand Down Expand Up @@ -438,7 +438,7 @@ function _createService(src, isSidecar) {
if (!isSidecar) {
dst.Connect.SidecarService = _createService(
normalizeKeys(connect.sidecarservice),
true
true,
);
} else {
throw new Error("sidecarservice cannot be nested");
Expand All @@ -452,7 +452,7 @@ function _createService(src, isSidecar) {

if (src.taggedaddresses) {
dst.TaggedAddresses = _createTaggedAddresses(
normalizeKeys(src.taggedaddresses)
normalizeKeys(src.taggedaddresses),
);
}

Expand Down Expand Up @@ -544,7 +544,7 @@ function _createCatalogRegistration(src) {

if (src.taggedaddresses) {
dst.TaggedAddresses = _createTaggedAddresses(
normalizeKeys(src.taggedaddresses)
normalizeKeys(src.taggedaddresses),
);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Watch extends events.EventEmitter {
this._run();
},
this,
this._wait()
this._wait(),
);
}

Expand Down Expand Up @@ -157,7 +157,7 @@ class Watch extends events.EventEmitter {
if (newIndex === 0n) {
return this._err(
errors.Consul("Consul returned zero index value"),
res
res,
);
}

Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
{
"name": "consul",
"version": "2.0.0-next.3",
"version": "2.0.0",
"description": "Consul client",
"main": "./lib",
"types": "./lib/index.d.ts",
"files": [
"./lib"
],
"dependencies": {
"papi": "^1.1.0"
"papi": "^1.1.0",
"uuid": "^10.0.0"
},
"devDependencies": {
"@definitelytyped/dtslint": "^0.0.159",
"@types/node": "*",
"@types/node": "^22.7.6",
"async": "^3.2.0",
"debug": "^4.3.1",
"jshint": "^2.5.5",
"mocha": "^8.3.0",
"mocha": "^10.7.3",
"nock": "^13.0.7",
"node-uuid": "^1.4.3",
"nyc": "^15.1.0",
"prettier": "^2.7.1",
"nyc": "^17.1.0",
"prettier": "^3.3.3",
"should": "^13.2.1",
"sinon": "^9.2.4",
"sinon": "^19.0.2",
"temp": "^0.9.4"
},
"scripts": {
Expand Down
Loading

0 comments on commit a7a59db

Please sign in to comment.