specmatic 0.81.0 → 1.0.3

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,7 @@
1
1
  {
2
2
  "name": "specmatic",
3
- "version": "0.81.0",
3
+ "version": "1.0.3",
4
+ "specmaticVersion": "1.0.3",
4
5
  "description": "Node wrapper for Specmatic",
5
6
  "main": "dist/index.js",
6
7
  "scripts": {
@@ -9,7 +10,8 @@
9
10
  "build": "npm test && rimraf dist && npm run build:types && npm run build:js",
10
11
  "build:types": "tsc --emitDeclarationOnly",
11
12
  "build:js": "babel src --out-dir dist --ignore 'src/**/__tests__/**/*.ts' --extensions \".ts,.tsx\" --source-maps inline",
12
- "test": "rimraf coverage && jest --coverage"
13
+ "test": "rimraf coverage && jest --coverage",
14
+ "postinstall": "node src/downloadSpecmaticJar.js"
13
15
  },
14
16
  "repository": {
15
17
  "type": "git",
package/specmatic.jar CHANGED
Binary file
@@ -0,0 +1,30 @@
1
+ const axios = require('axios');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const packageJson = require('../package.json'); // Import the package.json file
5
+
6
+ const specmaticVersion = packageJson.specmaticVersion;
7
+ const jarUrl = `https://github.com/znsio/specmatic/releases/download/${specmaticVersion}/specmatic.jar`;
8
+ const jarFilename = 'specmatic.jar'; // Specify the desired filename for the JAR
9
+
10
+ const downloadPath = path.resolve(__dirname, '..', jarFilename);
11
+
12
+ if (fs.existsSync(downloadPath)) {
13
+ console.log(`Deleting existing jar ...`);
14
+ fs.unlinkSync(downloadPath);
15
+ }
16
+
17
+ console.log("Downloading Specmatic jar version: " + specmaticVersion + " ...");
18
+ axios({
19
+ method: 'get',
20
+ url: jarUrl,
21
+ responseType: 'stream',
22
+ })
23
+ .then((response) => {
24
+ response.data.pipe(fs.createWriteStream(downloadPath));
25
+ console.log("Finished downloading Specmatic jar");
26
+ })
27
+ .catch((error) => {
28
+ console.error('Error downloading Specmatic Core JAR file version: ' + specmaticVersion, error);
29
+ process.exit(1);
30
+ });