Skip to content
Permalink
Browse files

Include version number in version result.

  • Loading branch information...
legastero committed Jul 22, 2019
1 parent 4f0c038 commit 9a0e3e0f19be5577fd096aa0c0fedcbe242b5849
Showing with 8 additions and 4 deletions.
  1. +2 −2 scripts/build.ts
  2. +2 −0 src/Constants.ts
  3. +1 −1 src/index.ts
  4. +3 −1 src/plugins/version.ts
@@ -31,8 +31,8 @@ Child('npm run compile');
Child('npm run compile:module');

// Embed package version into CJS and ES modules
fileReplace('dist/cjs/index.js', '__STANZAJS_VERSION__', Pkg.version);
fileReplace('dist/es/index.js', '__STANZAJS_VERSION__', Pkg.version);
fileReplace('dist/cjs/Constants.js', '__STANZAJS_VERSION__', Pkg.version);
fileReplace('dist/es/Constants.js', '__STANZAJS_VERSION__', Pkg.version);

Child('npm run compile:rollup');

@@ -7,6 +7,8 @@ import {
NS_SERVER
} from './Namespaces';

export const VERSION = '__STANZAJS_VERSION__';

// ====================================================================
// Frequently Used Values
// ====================================================================
@@ -207,7 +207,7 @@ export interface TransportConfig {

export { Client, Constants, JXT, JID, Namespaces, Stanzas, Jingle, Utils, RTT, LibSASL as SASL };

export const VERSION = '__STANZAJS_VERSION__';
export const VERSION = Constants.VERSION;

import Plugins from './plugins';
export * from './plugins';
@@ -1,4 +1,5 @@
import { Agent } from '../';
import { VERSION } from '../Constants';
import { NS_VERSION } from '../Namespaces';
import { ReceivedIQGet, SoftwareVersion } from '../protocol';

@@ -29,7 +30,8 @@ export default function(client: Agent) {
client.on('iq:get:softwareVersion', iq => {
return client.sendIQResult(iq, {
softwareVersion: client.config.softwareVersion || {
name: 'stanzajs.org'
name: 'stanzajs.org',
version: VERSION
}
});
});

0 comments on commit 9a0e3e0

Please sign in to comment.
You can’t perform that action at this time.