Skip to content

Commit

Permalink
feat: Sort lockfile (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian committed Apr 29, 2019
1 parent df03823 commit 911ab7c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 41 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
"commander": "2.20.0",
"fs-extra": "7.0.1",
"json-schema-to-typescript": "6.1.3",
"jsonabc": "2.3.1",
"semver": "6.0.0",
"simple-git": "1.110.0"
},
"devDependencies": {
"@ffflorian/prettier-config": "0.0.3",
"@types/cli-interact": "0.1.0",
"@types/fs-extra": "5.0.5",
"@types/jsonabc": "2.3.0",
"@types/rimraf": "2.0.2",
"@types/semver": "6.0.0",
"cross-env": "5.2.0",
Expand Down
56 changes: 28 additions & 28 deletions schemas/json-schemas.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"hash": "6c8f46ced6ba7bbe1b409ce0820d1efa07ac470cda85e0499e3d91731b718295",
"version": "0.0.2"
},
"appsscript.json": {
"hash": "379d95dc88cc7f9423397861fae2979d5bb2e7fb3a5381d7b865c3df38c862b8",
"version": "1.0.1"
},
"appveyor.json": {
"hash": "e060df45f3843a2d858fbc9caecc0bef4c8a0d119193f775a6a5a255a7a31d3d",
"version": "0.0.2"
Expand All @@ -31,10 +35,22 @@
"hash": "2f7d10495534462e0dd85886d6aec88183dac0b71ecf5d7a9a5cab2adca4711a",
"version": "0.0.1"
},
"bozr.json": {
"hash": "1df26248def39755c4bd1665ef5a0fe89861ec7f74c0f890d081801c1c7d0e90",
"version": "1.0.1"
},
"bukkit-plugin.json": {
"hash": "5ef6e55e702d20431df4e88059bc3ba5edeb6902881174417c11fa16e501a3f0",
"version": "1.0.1"
},
"bundleconfig.json": {
"hash": "ffcb7b8e2b5767e4e0c24549ddfd95387739d1d0ed6c4fc1f4d9ff54833fa7d4",
"version": "0.0.1"
},
"bungee-plugin.json": {
"hash": "782ee73bfded5335de76d2e77cd0a6e8b0477467b3a19cf7ff458e292062c363",
"version": "1.0.1"
},
"chutzpah.json": {
"hash": "b0740a0b315f1553e3ca972b383070cb06f48ec03dceddee4ac9fb367ada4041",
"version": "0.0.2"
Expand All @@ -43,6 +59,10 @@
"hash": "4035d7d8b18e7974b3466bf9e593ad45b765e28ae8610734a9760a88e7bcbe3b",
"version": "0.0.2"
},
"clasp.json": {
"hash": "e54d46c347f1a6e2150e8a07806e02feb88d34a634a26a48fa7a481eaa85e111",
"version": "1.0.1"
},
"coffeelint.json": {
"hash": "d5e5e50d25bf207a8f6e4496868a5439312b8636f4882342de72421b70d7e8e6",
"version": "0.0.1"
Expand Down Expand Up @@ -131,6 +151,10 @@
"hash": "f3dda50f235e2dcde73f3c165c0001f17a52d26d63b27eb8f86e10152ea0dbb9",
"version": "0.0.1"
},
"gitlab-ci.json": {
"hash": "00ffc235209fdac3fc80edeb03c0de02171b3050a2f060226213b762d1e3a83b",
"version": "1.0.1"
},
"global.json": {
"hash": "64cf7c6371614299da78997dc013cb399a45ea3ac54a9170ecb8cf421db9bc24",
"version": "0.0.1"
Expand Down Expand Up @@ -247,6 +271,10 @@
"hash": "15d10200cce962a8b7db907d80c016a4da3f353790ee3dbc94bad9ae411bebb1",
"version": "0.0.1"
},
"nlu.json": {
"hash": "4085ae872de074f028a24e0c57e097a129f55ec4ae09852096b9a001c99480ab",
"version": "1.0.2"
},
"npm-link-up.json": {
"hash": "8a5c13e2f04ae7f519580b6f9ff9bc062cd66b544014c72d4a3e651d5cd43c29",
"version": "0.0.2"
Expand Down Expand Up @@ -442,33 +470,5 @@
"xunit.runner.schema.json": {
"hash": "45a531de2248d20309cb355c689f26e6a3e96e79f8c85dc06452ef60ae25f99b",
"version": "0.0.1"
},
"appsscript.json": {
"hash": "379d95dc88cc7f9423397861fae2979d5bb2e7fb3a5381d7b865c3df38c862b8",
"version": "1.0.1"
},
"bozr.json": {
"hash": "1df26248def39755c4bd1665ef5a0fe89861ec7f74c0f890d081801c1c7d0e90",
"version": "1.0.1"
},
"bukkit-plugin.json": {
"hash": "5ef6e55e702d20431df4e88059bc3ba5edeb6902881174417c11fa16e501a3f0",
"version": "1.0.1"
},
"bungee-plugin.json": {
"hash": "782ee73bfded5335de76d2e77cd0a6e8b0477467b3a19cf7ff458e292062c363",
"version": "1.0.1"
},
"clasp.json": {
"hash": "e54d46c347f1a6e2150e8a07806e02feb88d34a634a26a48fa7a481eaa85e111",
"version": "1.0.1"
},
"gitlab-ci.json": {
"hash": "00ffc235209fdac3fc80edeb03c0de02171b3050a2f060226213b762d1e3a83b",
"version": "1.0.1"
},
"nlu.json": {
"hash": "4085ae872de074f028a24e0c57e097a129f55ec4ae09852096b9a001c99480ab",
"version": "1.0.2"
}
}
2 changes: 1 addition & 1 deletion settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"host.json",
"htmlhint.json",
"jscsrc.json",
"lsdlschema-1.0.json",
"lsdlschema.json",
"lsdlschema-1.0.json",
"modernizrrc.json",
"pocketmine-plugin.json",
"project-1.0.0-beta4.json",
Expand Down
5 changes: 4 additions & 1 deletion src/SchemaGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as crypto from 'crypto';
import * as fs from 'fs-extra';
import * as schemaGenerator from 'json-schema-to-typescript';
import * as jsonAbc from 'jsonabc';
import * as logdown from 'logdown';
import * as path from 'path';
import * as semver from 'semver';
import * as simpleGit from 'simple-git/promise';

import {BuildResult, FileSettings, SchemaData, SchemaHashes} from './interfaces';

interface SchemaGeneratorOptions extends Partial<FileSettings> {
Expand Down Expand Up @@ -63,7 +65,8 @@ class SchemaGenerator {
}

private async generateLockFile(fileName: string, data: SchemaHashes): Promise<void> {
await fs.writeJson(path.resolve(fileName), data, {spaces: 2});
const sortedData = jsonAbc.sortObj(data, true);
await fs.writeJson(path.resolve(fileName), sortedData, {spaces: 2});
}

private async generateSchemas(jsonData: SchemaHashes): Promise<BuildResult> {
Expand Down
11 changes: 0 additions & 11 deletions versions.js

This file was deleted.

10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636"
integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==

"@types/jsonabc@2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@types/jsonabc/-/jsonabc-2.3.0.tgz#e4d92d5d5383008769a6464619172841493b82cc"
integrity sha512-DfHAOVkaIoFYuoPlsFa8ilwjVOEyjWJi2BFfxhVJKW6uxq3TXTqKSW1PW4qlP8HJOgDkNIk5lMPZiHUalIk+bA==

"@types/lodash@^4.14.121":
version "4.14.121"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.121.tgz#9327e20d49b95fc2bf983fc2f045b2c6effc80b9"
Expand Down Expand Up @@ -1168,6 +1173,11 @@ json-stringify-safe@^5.0.1:
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=

jsonabc@2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/jsonabc/-/jsonabc-2.3.1.tgz#800a1bd158fb30ace2b4613f8725adfcb040bfb4"
integrity sha1-gAob0Vj7MKzitGE/hyWt/LBAv7Q=

jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
Expand Down

0 comments on commit 911ab7c

Please sign in to comment.