nats-io / nats.ts

TypeScript Node.js client for NATS, the cloud native messaging system
https://www.nats.io
Apache License 2.0
178 stars 13 forks source link

exports.VERSION requires fs.existsSync #85

Closed pedrouid closed 4 years ago

pedrouid commented 4 years ago

Initially I opened an PR for removing fs.existsSync import fromnats.ts file: nats-io/nats.ts#84

However I forked this repo and built locally and the transpilled library doesn't include the existsSync import at all.

const nuid_1 = require("nuid");
/** Version of the ts-nats library */
exports.VERSION = require('../package.json').version;

But when you looked into the download library from NPM at v1.2.12 it looks like the following:

const nuid_1 = require("nuid");
const fs_1 = require("fs");
// locate our package.json
let pkgFile = __dirname + '/../package.json';
if (!fs_1.existsSync(pkgFile)) {
    // tests will find it here
    pkgFile = __dirname + '/../../package.json';
}
/** Version of the ts-nats library */
exports.VERSION = require(pkgFile).version;

As their been a recent change to this import that its still unpublished to NPM?

pedrouid commented 4 years ago

Ok after looking at the commit history I can see that this was changed recently on commit 0bfe414f785f33b9644ad1daccfb68f052373a01

Would it be possible to get v1.2.13 pushed to NPM including this fix? That would be hugely appreciated!

aricart commented 4 years ago

@pedrouid master doesn't match release for very long. For the current state of master you can do npm install ts-nats@next, that should pull 1.2.14-2 which is the next release candidate (and as of this second matches master)