@cubejs-backend/shared
Advanced tools
Comparing version 0.24.4 to 0.24.5
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.24.5](https://github.com/cube-js/cube.js/compare/v0.24.4...v0.24.5) (2020-12-09) | ||
### Features | ||
* **cubejs-cli:** improve DX for docker ([#1457](https://github.com/cube-js/cube.js/issues/1457)) ([72ad782](https://github.com/cube-js/cube.js/commit/72ad782090c52e677b9e51e43818f1dca40db791)) | ||
## [0.24.4](https://github.com/cube-js/cube.js/compare/v0.24.3...v0.24.4) (2020-12-07) | ||
@@ -8,0 +19,0 @@ |
@@ -7,2 +7,4 @@ declare const variables: { | ||
webSockets: () => boolean; | ||
dockerImageVersion: () => string | undefined; | ||
internalExceptions: () => "false" | "exit" | "log"; | ||
}; | ||
@@ -9,0 +11,0 @@ declare type Vars = typeof variables; |
@@ -23,2 +23,8 @@ "use strict"; | ||
.asBoolStrict(), | ||
dockerImageVersion: () => env_var_1.get('CUBEJS_DOCKER_IMAGE_VERSION') | ||
.asString(), | ||
// It's only excepted for CI, nothing else. | ||
internalExceptions: () => env_var_1.get('INTERNAL_EXCEPTIONS_YOU_WILL_BE_FIRED') | ||
.default('false') | ||
.asEnum(['exit', 'log', 'false']) | ||
}; | ||
@@ -25,0 +31,0 @@ function getEnv(key) { |
export * from './env'; | ||
export * from './package'; | ||
export * from './track'; | ||
export * from './errors'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -15,2 +15,4 @@ "use strict"; | ||
__exportStar(require("./package"), exports); | ||
__exportStar(require("./track"), exports); | ||
__exportStar(require("./errors"), exports); | ||
//# sourceMappingURL=index.js.map |
export declare const packageExists: (moduleName: string, relative?: boolean, basePath?: string) => boolean; | ||
declare type RequireFromPackageOptions = { | ||
basePath?: string; | ||
relative: boolean; | ||
silent?: true; | ||
}; | ||
export declare type PackageManifest = { | ||
@@ -12,7 +7,21 @@ version: string; | ||
}; | ||
export declare function requireFromPackage<T = unknown>(pkg: string, { basePath, relative, silent }: RequireFromPackageOptions): Promise<T | null>; | ||
declare type RequireBaseOptions = { | ||
basePath?: string; | ||
relative?: boolean; | ||
}; | ||
export declare function requireFromPackage<T = unknown | null>(pkg: string, opts: RequireBaseOptions & { | ||
silent: true; | ||
}): Promise<T | null>; | ||
export declare function requireFromPackage<T = unknown>(pkg: string, opts?: RequireBaseOptions): Promise<T>; | ||
export declare function isSslKey(content: string): boolean; | ||
export declare function isSslCert(content: string): boolean; | ||
export declare function isFilePath(fp: string): boolean; | ||
export declare function requirePackageManifest<T = PackageManifest>(pkg: string, opts: RequireBaseOptions & { | ||
silent: true; | ||
}): Promise<T | null>; | ||
export declare function requirePackageManifest<T = PackageManifest>(pkg: string, opts?: RequireBaseOptions): Promise<T>; | ||
export declare function resolvePackageVersion(basePath: string, pkgName: string): Promise<string | null>; | ||
export declare function resolveBuiltInPackageVersion(pkgName: string): Promise<string | null>; | ||
export declare function resolveUserPackageVersion(pkgName: string): Promise<string | null>; | ||
export {}; | ||
//# sourceMappingURL=package.d.ts.map |
@@ -25,3 +25,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isFilePath = exports.isSslCert = exports.isSslKey = exports.requireFromPackage = exports.packageExists = void 0; | ||
exports.resolveUserPackageVersion = exports.resolveBuiltInPackageVersion = exports.resolvePackageVersion = exports.requirePackageManifest = exports.isFilePath = exports.isSslCert = exports.isSslKey = exports.requireFromPackage = exports.packageExists = void 0; | ||
const path_1 = __importDefault(require("path")); | ||
@@ -44,3 +44,4 @@ const fs = __importStar(require("fs")); | ||
exports.packageExists = packageExists; | ||
async function requireFromPackage(pkg, { basePath = process.cwd(), relative, silent }) { | ||
async function requireFromPackage(pkg, options) { | ||
const { basePath = process.cwd(), relative = false, silent = undefined } = options || {}; | ||
const exists = await exports.packageExists(pkg, relative, basePath); | ||
@@ -81,2 +82,28 @@ if (!exists) { | ||
exports.isFilePath = isFilePath; | ||
async function requirePackageManifest(pkgName, options) { | ||
return requireFromPackage(path_1.default.join(pkgName, 'package.json'), options); | ||
} | ||
exports.requirePackageManifest = requirePackageManifest; | ||
async function resolvePackageVersion(basePath, pkgName) { | ||
const resolvedManifest = await requirePackageManifest(pkgName, { | ||
basePath, | ||
relative: false, | ||
silent: true, | ||
}); | ||
if (resolvedManifest) { | ||
return resolvedManifest.version; | ||
} | ||
return null; | ||
} | ||
exports.resolvePackageVersion = resolvePackageVersion; | ||
async function resolveBuiltInPackageVersion(pkgName) { | ||
return resolvePackageVersion('/cube', pkgName); | ||
} | ||
exports.resolveBuiltInPackageVersion = resolveBuiltInPackageVersion; | ||
async function resolveUserPackageVersion(pkgName) { | ||
return resolvePackageVersion( | ||
// In the official docker image, it will be resolved to /cube/conf | ||
process.cwd(), pkgName); | ||
} | ||
exports.resolveUserPackageVersion = resolveUserPackageVersion; | ||
//# sourceMappingURL=package.js.map |
{ | ||
"name": "@cubejs-backend/shared", | ||
"version": "0.24.4", | ||
"version": "0.24.5", | ||
"description": "Shared code for Cube.js backend packages", | ||
@@ -25,4 +25,5 @@ "main": "dist/src/index.js", | ||
"devDependencies": { | ||
"@cubejs-backend/linter": "^0.24.4", | ||
"@cubejs-backend/linter": "^0.24.5", | ||
"@types/jest": "^26.0.16", | ||
"@types/node-fetch": "^2.5.7", | ||
"jest": "^26.6.3", | ||
@@ -32,3 +33,5 @@ "typescript": "~4.1.2" | ||
"dependencies": { | ||
"env-var": "^6.3.0" | ||
"env-var": "^6.3.0", | ||
"node-fetch": "^2.6.1", | ||
"node-machine-id": "^1.1.12" | ||
}, | ||
@@ -41,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "35e72f40b6e5595f26ea3508b988cc586092efb4" | ||
"gitHead": "1018d6366db3bb204a473a8b436857bbae04aa0d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34579
24
291
0
3
5
+ Addednode-fetch@^2.6.1
+ Addednode-machine-id@^1.1.12
+ Addednode-fetch@2.7.0(transitive)
+ Addednode-machine-id@1.1.12(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)