grpc-code-gen
Advanced tools
Comparing version 6.1.15-rc.1 to 6.1.16
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -11,2 +12,3 @@ }); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.gen = void 0; | ||
const fs = require("fs-extra"); | ||
@@ -60,3 +62,2 @@ const load_proto_1 = require("load-proto"); | ||
const newUrl = typeof gitConfig === 'string' ? gitConfig : gitConfig.url; | ||
const host = typeof gitConfig === 'object' ? (gitConfig.host || '') : ''; | ||
const root = yield load_proto_1.loadProto({ | ||
@@ -76,2 +77,3 @@ gitUrls: [...firstUrl, ...deps, gitConfig], | ||
.reverse(); | ||
const host = typeof gitConfig === 'object' ? (gitConfig.host || service) : service; | ||
allResult.push({ | ||
@@ -78,0 +80,0 @@ result: pbjs_1.inspectNamespace(root), |
@@ -1,2 +0,2 @@ | ||
import { Root } from 'protobufjs'; | ||
import { Root } from '@yunke/protobufjs'; | ||
import { Options as LoaderOptions } from 'load-proto/build/loader'; | ||
@@ -3,0 +3,0 @@ import { TEnum, TMessage, TMethod, TService } from "./types"; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -28,3 +29,2 @@ }); | ||
// 新增团队级的文件夹 | ||
const oldService = service_; | ||
baseDir = space ? `${baseDir}/${space}/${service_}` : baseDir; | ||
@@ -59,3 +59,3 @@ service_ = service_.replace(/-/g, '_'); | ||
services.forEach((service) => { | ||
servicesWithMethods[service.fullName] = Object.assign({}, service, { methods: [] }); | ||
servicesWithMethods[service.fullName] = Object.assign(Object.assign({}, service), { methods: [] }); | ||
}); | ||
@@ -136,3 +136,3 @@ methods.forEach((method) => { | ||
`const Service: ${typeName} = get<any, string>(grpcObject, '${space}_${service_}.${service.fullName}');`, | ||
`Service.serverName = '${host || oldService}';`, | ||
`Service.serverName = '${host}';`, | ||
`Service.$FILE_NAME = '${service.filename && service.filename.replace(/\\/g, '/')}';`, | ||
@@ -139,0 +139,0 @@ `export const ${service.name}: ${typeName} = serviceWrapper<${typeName}>(Service);`, |
@@ -1,2 +0,2 @@ | ||
import { Root } from 'protobufjs'; | ||
import { Root } from '@yunke/protobufjs'; | ||
import { Options as LoaderOptions } from 'load-proto/build/loader'; | ||
@@ -3,0 +3,0 @@ import { TEnum, TMessage, TNamespace } from "./types"; |
@@ -1,2 +0,2 @@ | ||
import { INamespace, ReflectionObject } from 'protobufjs'; | ||
import { INamespace, ReflectionObject } from '@yunke/protobufjs'; | ||
import { TEnum, TMessage, TMethod, TService } from "./types"; | ||
@@ -3,0 +3,0 @@ interface HasName { |
@@ -7,7 +7,10 @@ "use strict"; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.inspectNamespace = void 0; | ||
const lodash_1 = require("lodash"); | ||
@@ -198,3 +201,3 @@ function formatFullName(fullName) { | ||
const { methods: methodsClone, nested: nestedClone } = clone, restClone = __rest(clone, ["methods", "nested"]); | ||
collectServices.push(Object.assign({}, restClone, { methods: collectMethods, filename: service.filename && service.filename.replace(/^.+\/.load-proto-cache\/[^/]+\//, '') })); | ||
collectServices.push(Object.assign(Object.assign({}, restClone), { methods: collectMethods, filename: service.filename && service.filename.replace(/^.+\/.load-proto-cache\/[^/]+\//, '') })); | ||
return { | ||
@@ -201,0 +204,0 @@ json: clone, |
@@ -1,2 +0,2 @@ | ||
import { Root } from "protobufjs"; | ||
import { Root } from "@yunke/protobufjs"; | ||
import { TEnum, TMessage } from "./types"; | ||
@@ -3,0 +3,0 @@ import { Options as LoaderOptions } from "load-proto/build/loader"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTsTypeFactory = exports.getAbsPath = exports.getPackageName = exports.getImportPath = exports.PROTO_TYPE_2_JSON_SEMANTIC_MAP = exports.PROTO_TYPE_2_TS_TYPE_MAP = exports.fileTip = exports.tslintDisable = exports.BASE_DIR = void 0; | ||
const path = require("path"); | ||
@@ -4,0 +5,0 @@ exports.BASE_DIR = path.join(process.cwd(), 'code-gen'); |
{ | ||
"name": "grpc-code-gen", | ||
"version": "6.1.15-rc.1", | ||
"version": "6.1.16", | ||
"license": "MIT", | ||
@@ -24,3 +24,3 @@ "repository": "https://github.com/yunkeCN/grpc-code-gen.git", | ||
"load-git": "^1.5.2", | ||
"load-proto": "^2.1.6", | ||
"load-proto": "^2.2.1", | ||
"lodash": "^4.17.19" | ||
@@ -33,4 +33,4 @@ }, | ||
"@types/lodash": "^4.14.116", | ||
"@types/protobufjs": "^6.0.0", | ||
"gts": "^2.0.2", | ||
"@types/node": "^12.12.21", | ||
"gts": "^3.1.0", | ||
"json-semantic": "^1.1.0", | ||
@@ -40,4 +40,4 @@ "prettier": "^1.18.2", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.1.1" | ||
"typescript": "^4.2.3" | ||
} | ||
} |
@@ -81,3 +81,2 @@ import * as fs from 'fs-extra'; | ||
const newUrl: string = typeof gitConfig === 'string' ? gitConfig : gitConfig.url | ||
const host: string = typeof gitConfig === 'object' ? (gitConfig.host ||'' ) : '' | ||
const root = await loadProto({ | ||
@@ -99,2 +98,4 @@ gitUrls: [...firstUrl, ...deps, gitConfig], | ||
const host: string = typeof gitConfig === 'object' ? (gitConfig.host || service) : service | ||
allResult.push({ | ||
@@ -101,0 +102,0 @@ result: inspectNamespace(root), |
import * as fs from "fs-extra"; | ||
import { get, set } from 'lodash'; | ||
import { Root } from 'protobufjs'; | ||
import { Root } from '@yunke/protobufjs'; | ||
import { Options as LoaderOptions } from 'load-proto/build/loader'; | ||
@@ -73,3 +73,2 @@ import { TEnum, TMessage, TMethod, TService } from "./types"; | ||
// 新增团队级的文件夹 | ||
const oldService = service_ | ||
baseDir = space ? `${baseDir}/${space}/${service_}` : baseDir | ||
@@ -188,3 +187,3 @@ service_ = service_.replace(/-/g, '_') | ||
`const Service: ${typeName} = get<any, string>(grpcObject, '${space}_${service_}.${service.fullName}');`, | ||
`Service.serverName = '${host || oldService}';`, | ||
`Service.serverName = '${host}';`, | ||
`Service.$FILE_NAME = '${service.filename && service.filename.replace(/\\/g, '/')}';`, | ||
@@ -191,0 +190,0 @@ `export const ${service.name}: ${typeName} = serviceWrapper<${typeName}>(Service);`, |
@@ -1,2 +0,2 @@ | ||
import { Root } from 'protobufjs'; | ||
import { Root } from '@yunke/protobufjs'; | ||
import { Options as LoaderOptions } from 'load-proto/build/loader'; | ||
@@ -3,0 +3,0 @@ import { TEnum, TMessage, TNamespace } from "./types"; |
@@ -14,3 +14,3 @@ import { uniqBy } from 'lodash'; | ||
Type, | ||
} from 'protobufjs'; | ||
} from '@yunke/protobufjs'; | ||
import { TEnum, TField, TMessage, TMethod, TService } from "./types"; | ||
@@ -17,0 +17,0 @@ |
import * as path from "path"; | ||
import { Root } from "protobufjs"; | ||
import { Root } from "@yunke/protobufjs"; | ||
import { TEnum, TMessage } from "./types"; | ||
@@ -4,0 +4,0 @@ import { Options as LoaderOptions } from "load-proto/build/loader"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
104768
2715
1
Updatedload-proto@^2.2.1