@open-rpc/typings
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -47,2 +47,25 @@ #!/usr/bin/env node | ||
var version = require("../package.json").version; // tslint:disable-line | ||
function makeOptions(fileName, dirName, lang) { | ||
return { | ||
dirName: dirName, | ||
fileName: fileName, | ||
lang: lang, | ||
}; | ||
} | ||
function parseTypingsOptions(programOpt) { | ||
if (!programOpt.outputRs && !programOpt.outputTs && !programOpt.outputGo) { | ||
throw Error("Please specify an output directory for typings."); | ||
} | ||
var options = []; | ||
if (programOpt.outputRs) { | ||
options.push(makeOptions(programOpt.nameRs, programOpt.outputRs, "rust")); | ||
} | ||
if (programOpt.outputTs) { | ||
options.push(makeOptions(programOpt.nameTs, programOpt.outputTs, "typescript")); | ||
} | ||
if (programOpt.outputGo) { | ||
options.push(makeOptions(programOpt.nameGo, programOpt.outputGo, "go")); | ||
} | ||
return options; | ||
} | ||
commander_1.default | ||
@@ -82,24 +105,1 @@ .version(version, "-v, --version") | ||
.parse(process.argv); | ||
function parseTypingsOptions(programOpt) { | ||
if (!programOpt.outputRs && !programOpt.outputTs && !programOpt.outputGo) { | ||
throw Error("Please specify an output directory for typings."); | ||
} | ||
var options = []; | ||
if (programOpt.outputRs) { | ||
options.push(makeOptions(programOpt.nameRs, programOpt.outputRs, "rust")); | ||
} | ||
if (programOpt.outputTs) { | ||
options.push(makeOptions(programOpt.nameTs, programOpt.outputTs, "typescript")); | ||
} | ||
if (programOpt.outputGo) { | ||
options.push(makeOptions(programOpt.nameGo, programOpt.outputGo, "go")); | ||
} | ||
return options; | ||
} | ||
function makeOptions(fileName, dirName, lang) { | ||
return { | ||
dirName: dirName, | ||
fileName: fileName, | ||
lang: lang, | ||
}; | ||
} |
@@ -42,2 +42,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateTypingsFile = exports.getExtension = void 0; | ||
var fs_extra_1 = require("fs-extra"); | ||
@@ -44,0 +45,0 @@ var _1 = __importDefault(require("./")); |
import { Generator, GetMethodTypings, GetMethodAliasName } from "./generator-interface"; | ||
export declare const getMethodAliasName: GetMethodAliasName; | ||
export declare const getMethodTypings: GetMethodTypings; | ||
export declare const getMethodAliasName: GetMethodAliasName; | ||
declare const generator: Generator; | ||
export default generator; |
@@ -14,3 +14,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMethodTypings = exports.getMethodAliasName = void 0; | ||
var utils_1 = require("@etclabscore/json-schema-to-types/build/utils"); | ||
exports.getMethodAliasName = function (method) { | ||
return utils_1.languageSafeName(method.name); | ||
}; | ||
var getMethodTyping = function (method) { | ||
@@ -31,5 +35,2 @@ var mResult = method.result; | ||
}; | ||
exports.getMethodAliasName = function (method) { | ||
return utils_1.languageSafeName(method.name); | ||
}; | ||
var generator = { | ||
@@ -36,0 +37,0 @@ getMethodAliasName: exports.getMethodAliasName, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMethodAliasName = exports.getMethodTypings = void 0; | ||
var utils_1 = require("@etclabscore/json-schema-to-types/build/utils"); | ||
@@ -4,0 +5,0 @@ var getMethodTyping = function (method) { |
import { Generator, GetMethodTypings, GetMethodAliasName } from "./generator-interface"; | ||
export declare const getMethodAliasName: GetMethodAliasName; | ||
export declare const getMethodTypings: GetMethodTypings; | ||
export declare const getMethodAliasName: GetMethodAliasName; | ||
declare const generator: Generator; | ||
export default generator; |
@@ -14,3 +14,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMethodTypings = exports.getMethodAliasName = void 0; | ||
var utils_1 = require("@etclabscore/json-schema-to-types/build/utils"); | ||
exports.getMethodAliasName = function (method) { | ||
return utils_1.languageSafeName(method.name); | ||
}; | ||
var getMethodTyping = function (method) { | ||
@@ -30,5 +34,2 @@ var mResult = method.result; | ||
}; | ||
exports.getMethodAliasName = function (method) { | ||
return utils_1.languageSafeName(method.name); | ||
}; | ||
var generator = { | ||
@@ -35,0 +36,0 @@ getMethodAliasName: exports.getMethodAliasName, |
@@ -14,2 +14,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMethodTypings = exports.getMethodAliasName = void 0; | ||
var utils_1 = require("@etclabscore/json-schema-to-types/build/utils"); | ||
@@ -25,3 +26,3 @@ exports.getMethodAliasName = function (method) { | ||
var params = method.params.map(function (param) { return [ | ||
"" + param.name + (param.required ? "" : "?") + ": ", | ||
"" + param.name + (param.required === false ? "?" : "") + ": ", | ||
"" + utils_1.languageSafeName(utils_1.ensureSchemaTitles(param.schema).title), | ||
@@ -28,0 +29,0 @@ ].join(""); }).join(", "); |
@@ -10,2 +10,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getSchemasForOpenRPCDocument = void 0; | ||
var flatten = function (arr) { | ||
@@ -12,0 +13,0 @@ return arr.reduce(function (memo, val) { |
@@ -0,1 +1,25 @@ | ||
# [1.10.0](https://github.com/open-rpc/typings/compare/1.9.0...1.10.0) (2020-05-19) | ||
### Bug Fixes | ||
* dont deploy during test ([007661d](https://github.com/open-rpc/typings/commit/007661d834fcb534cbffe485ba431f21c4707d08)) | ||
* linting issues ([a103b60](https://github.com/open-rpc/typings/commit/a103b601ef2aa088b61ba3ff583af0711e4ab4e8)) | ||
* more mistakes ([aa1460a](https://github.com/open-rpc/typings/commit/aa1460ada83e3594a374f349502f0ef7026a7e8f)) | ||
* move around deps for linting sake ([e45eb53](https://github.com/open-rpc/typings/commit/e45eb53dafc1a05a17a91fb9cf9fddf1758a117b)) | ||
* package scripts had a loop ([eb02267](https://github.com/open-rpc/typings/commit/eb0226721919aaac92affd67adf6c467850efcb0)) | ||
* params required by default ([cf33d7a](https://github.com/open-rpc/typings/commit/cf33d7a763ba38c52e0440a3f75be4de5cd5c3d0)), closes [#281](https://github.com/open-rpc/typings/issues/281) | ||
* release no longer handles docs ([94cc25b](https://github.com/open-rpc/typings/commit/94cc25b81bc26abe053d158480ac741aa5e1bffa)) | ||
* remove junk ([9534a14](https://github.com/open-rpc/typings/commit/9534a148a08d5c428b72bf61b8a696b97ef92d65)) | ||
* remove name ([85e1963](https://github.com/open-rpc/typings/commit/85e19632844ca8a0ec41496366e5aabf57dc6f23)) | ||
* split out gh actions ([4bbe6a6](https://github.com/open-rpc/typings/commit/4bbe6a6f1ace2bf58af9b9f6e923f42a5c9b6c27)) | ||
* typedocs stuff ([1889b9e](https://github.com/open-rpc/typings/commit/1889b9e4b80f76d2598721b60b462754cab4829b)) | ||
* update package lock ([e17d7db](https://github.com/open-rpc/typings/commit/e17d7db1ce0063f44a59b7d55879bba4407b02bd)) | ||
* use gh actions for linting ([dda3821](https://github.com/open-rpc/typings/commit/dda38214716495abc8086f4e3b78280b70340dd6)) | ||
### Features | ||
* move typedoc gen to a gh action ([ee855ee](https://github.com/open-rpc/typings/commit/ee855ee97dab05d18a5804baefdff08e2def689c)) | ||
# [1.9.0](https://github.com/open-rpc/typings/compare/1.8.0...1.9.0) (2020-02-12) | ||
@@ -2,0 +26,0 @@ |
{ | ||
"name": "@open-rpc/typings", | ||
"private": false, | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "", | ||
@@ -11,8 +11,5 @@ "main": "build/index.js", | ||
"scripts": { | ||
"build": "npm run build:code && npm run build:docs", | ||
"build:docs": "typedoc", | ||
"build:code": "tsc", | ||
"build": "tsc", | ||
"generate:typings": "build/cli.js", | ||
"test": "npm run test:lint && npm run test:unit", | ||
"test:lint": "tslint -c tslint.json 'src/**/*.ts' --fix", | ||
"test": "npm run build && npm run test:unit", | ||
"test:unit": "jest --coverage", | ||
@@ -38,4 +35,4 @@ "watch:test": "jest --watch" | ||
"@open-rpc/schema-utils-js": "^1.12.0", | ||
"commander": "^4.0.1", | ||
"fs-extra": "^8.0.1" | ||
"commander": "^5.0.0", | ||
"fs-extra": "^9.0.0" | ||
}, | ||
@@ -45,10 +42,8 @@ "devDependencies": { | ||
"@types/commander": "^2.12.2", | ||
"@types/fs-extra": "^8.0.1", | ||
"@types/fs-extra": "^9.0.0", | ||
"@types/jest": "^25.1.0", | ||
"jest": "^25.1.0", | ||
"ts-jest": "^25.0.0", | ||
"tslint": "^6.0.0", | ||
"typedoc": "^0.16.0", | ||
"typescript": "^3.5.1" | ||
} | ||
} |
40983
7
2469
573
+ Addedat-least-node@1.0.0(transitive)
+ Addedcommander@5.1.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
- Removedcommander@4.1.1(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removeduniversalify@0.1.2(transitive)
Updatedcommander@^5.0.0
Updatedfs-extra@^9.0.0