Skip to content

Commit

Permalink
Minor version updates on generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian committed Jul 23, 2018
1 parent c107597 commit 94235e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"dependencies": {
"@types/fs-extra": "5.0.4",
"@types/rimraf": "2.0.2",
"@types/semver": "5.5.0",
"commander": "2.16.0",
"fs-extra": "7.0.0",
"json-schema-to-typescript": "5.5.0",
"rimraf": "2.6.2",
"semver": "5.5.0",
"simple-git": "1.96.0",
"typescript": "2.9.2"
},
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as simpleGit from 'simple-git/promise';
import * as fs from 'fs-extra';
import * as crypto from 'crypto';
import * as schemaGenerator from 'json-schema-to-typescript';
import * as semver from 'semver';
const logdown = require('logdown');

interface SchemaHashes {
Expand Down Expand Up @@ -85,6 +86,7 @@ class SchemaGenerator {
}

private async generatePackageJson(schemaName: string, schemaHash: {hash: string, version: string}): Promise<string> {
const newVersion = semver.minor(schemaHash.version);
return `{
"author": "Florian Keller <github@floriankeller.de>",
"dependencies": {},
Expand All @@ -96,7 +98,7 @@ class SchemaGenerator {
"scripts": {},
"typesPublisherContentHash": "${schemaHash.hash}",
"typings": "index.d.ts",
"version": "${schemaHash.version}"
"version": "${newVersion}"
}
`
}
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
"@types/glob" "*"
"@types/node" "*"

"@types/semver@5.5.0":
version "5.5.0"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45"

ansi-regex@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
Expand Down Expand Up @@ -412,7 +416,7 @@ rimraf@2.6.2:
dependencies:
glob "^7.0.5"

semver@^5.5.0:
semver@5.5.0, semver@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"

Expand Down

0 comments on commit 94235e3

Please sign in to comment.