yeoman-generator
Advanced tools
Comparing version 6.0.0-beta.7 to 6.0.0-rc.0
@@ -1,2 +0,2 @@ | ||
import type BaseGenerator from '../generator.js'; | ||
import type { BaseGenerator } from '../generator.js'; | ||
export declare class PackageJsonMixin { | ||
@@ -3,0 +3,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
import latestVersion from 'latest-version'; | ||
export class PackageJsonMixin { | ||
@@ -12,8 +13,17 @@ /** | ||
} | ||
else if (!Array.isArray(dependencies)) { | ||
const deps = await Promise.all(Object.entries(dependencies).map(async ([pkg, version]) => version ? Promise.resolve([pkg, version]) : this.env.resolvePackage(pkg, version))); | ||
return Object.fromEntries(deps.filter(args => args.length > 0 && args[0])); | ||
} | ||
const entries = await Promise.all(dependencies.map(async (dependency) => this.env.resolvePackage(dependency))); | ||
return Object.fromEntries(entries); | ||
const depMap = Array.isArray(dependencies) | ||
? Object.fromEntries(dependencies.map(dependency => { | ||
const lastIndex = dependency.lastIndexOf('@'); | ||
if (lastIndex > 0) { | ||
const depName = dependency.slice(0, lastIndex); | ||
const version = dependency.slice(lastIndex + 1); | ||
return [depName, version]; | ||
} | ||
return [dependency, undefined]; | ||
})) | ||
: dependencies; | ||
return Object.fromEntries(await Promise.all( | ||
// Make sure to convert empty string too | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
Object.entries(depMap).map(async ([pkg, version]) => [pkg, version || (await latestVersion(pkg))]))); | ||
} | ||
@@ -20,0 +30,0 @@ /** |
{ | ||
"name": "yeoman-generator", | ||
"version": "6.0.0-beta.7", | ||
"version": "6.0.0-rc.0", | ||
"description": "Rails-inspired generator system that provides scaffolding for your apps", | ||
@@ -61,2 +61,3 @@ "keywords": [ | ||
"json-schema": "^0.4.0", | ||
"latest-version": "^7.0.0", | ||
"lodash": "^4.17.11", | ||
@@ -94,3 +95,3 @@ "mem-fs-editor": "^10.0.1", | ||
"yeoman-environment": "^3.18.4", | ||
"yeoman-test": "^8.0.0-beta.6" | ||
"yeoman-test": "^8.0.0-rc.0" | ||
}, | ||
@@ -97,0 +98,0 @@ "peerDependencies": { |
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
131330
3080
18
+ Addedlatest-version@^7.0.0
+ Added@sindresorhus/is@5.6.0(transitive)
+ Added@szmarczak/http-timer@5.0.1(transitive)
+ Added@types/http-cache-semantics@4.0.4(transitive)
+ Addedcacheable-lookup@7.0.0(transitive)
+ Addedcacheable-request@10.2.14(transitive)
+ Addeddecompress-response@6.0.0(transitive)
+ Addeddefer-to-connect@2.0.1(transitive)
+ Addedform-data-encoder@2.1.4(transitive)
+ Addedgot@12.6.1(transitive)
+ Addedhttp2-wrapper@2.2.1(transitive)
+ Addedjson-buffer@3.0.1(transitive)
+ Addedkeyv@4.5.4(transitive)
+ Addedlatest-version@7.0.0(transitive)
+ Addedlowercase-keys@3.0.0(transitive)
+ Addedmimic-response@3.1.04.0.0(transitive)
+ Addednormalize-url@8.0.1(transitive)
+ Addedp-cancelable@3.0.0(transitive)
+ Addedpackage-json@8.1.1(transitive)
+ Addedquick-lru@5.1.1(transitive)
+ Addedresolve-alpn@1.2.1(transitive)
+ Addedresponselike@3.0.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)