@gnuechtel/shared-util 1.0.0-rc.4 → 1.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnuechtel/shared-util",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.6",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.0",
package/src/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './lib/create-process';
2
2
  export * from './lib/error-message';
3
+ export * from './lib/get-package-version';
3
4
  export * from './lib/replace-in-file';
4
5
  export * from './lib/root-directory';
5
6
  export * from './lib/wait-for-url';
package/src/index.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./lib/create-process"), exports);
5
5
  tslib_1.__exportStar(require("./lib/error-message"), exports);
6
+ tslib_1.__exportStar(require("./lib/get-package-version"), exports);
6
7
  tslib_1.__exportStar(require("./lib/replace-in-file"), exports);
7
8
  tslib_1.__exportStar(require("./lib/root-directory"), exports);
8
9
  tslib_1.__exportStar(require("./lib/wait-for-url"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/shared-util/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,8DAAoC;AACpC,gEAAsC;AACtC,+DAAqC;AACrC,6DAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/shared-util/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,8DAAoC;AACpC,oEAA0C;AAC1C,gEAAsC;AACtC,+DAAqC;AACrC,6DAAmC"}
@@ -0,0 +1 @@
1
+ export declare function getPackageVersion(packageName: string): any;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPackageVersion = void 0;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ const root_directory_1 = require("./root-directory");
7
+ function getPackageVersion(packageName) {
8
+ try {
9
+ const packageFile = (0, path_1.join)((0, root_directory_1.rootDirectory)(), 'node_modules', packageName, 'package.json');
10
+ return (0, fs_1.existsSync)(packageFile) ? JSON.parse((0, fs_1.readFileSync)(packageFile).toString()).version : undefined;
11
+ }
12
+ catch (err) {
13
+ console.error(err);
14
+ return undefined;
15
+ }
16
+ }
17
+ exports.getPackageVersion = getPackageVersion;
18
+ //# sourceMappingURL=get-package-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-package-version.js","sourceRoot":"","sources":["../../../../../libs/shared-util/src/lib/get-package-version.ts"],"names":[],"mappings":";;;AAAA,2BAA8C;AAC9C,+BAA4B;AAC5B,qDAAiD;AAEjD,SAAgB,iBAAiB,CAAC,WAAmB;IACnD,IAAI;QACF,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,IAAA,8BAAa,GAAE,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QACvF,OAAO,IAAA,eAAU,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;KACvG;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AARD,8CAQC"}