cordova-res
Advanced tools
Comparing version 0.8.1 to 0.9.0
@@ -17,3 +17,6 @@ "use strict"; | ||
const { resourcesDirectory = resources_1.DEFAULT_RESOURCES_DIRECTORY } = parsedOptions; | ||
return Object.assign(Object.assign({}, Object.assign({ directory }, platformList.length > 0 ? { platforms: generatePlatformOptions(platformList, resourcesDirectory, args) } : {})), parsedOptions); | ||
return { | ||
...{ directory, ...platformList.length > 0 ? { platforms: generatePlatformOptions(platformList, resourcesDirectory, args) } : {} }, | ||
...parsedOptions, | ||
}; | ||
} | ||
@@ -26,3 +29,8 @@ exports.resolveOptions = resolveOptions; | ||
const platformList = platform_1.validatePlatforms(platformArg && !platformArg.startsWith('-') ? [platformArg] : []); | ||
return Object.assign({ resourcesDirectory, logstream: json ? process.stderr : process.stdout, errstream: process.stderr }, platformList.length > 0 ? { platforms: generatePlatformOptions(platformList, resourcesDirectory, args) } : {}); | ||
return { | ||
resourcesDirectory, | ||
logstream: json ? process.stderr : process.stdout, | ||
errstream: process.stderr, | ||
...platformList.length > 0 ? { platforms: generatePlatformOptions(platformList, resourcesDirectory, args) } : {}, | ||
}; | ||
} | ||
@@ -29,0 +37,0 @@ exports.parseOptions = parseOptions; |
@@ -16,5 +16,5 @@ "use strict"; | ||
const colors = sources.filter((source) => source.type === "color" /* COLOR */); | ||
const androidPlatformElement = resolvePlatformElement(doc.getroot(), "android" /* ANDROID */); | ||
if (colors.length > 0) { | ||
debug('Color sources found--generating colors document.'); | ||
const androidPlatformElement = resolvePlatformElement(doc.getroot(), "android" /* ANDROID */); | ||
const colorsPath = path_1.default.join(resourcesDirectory, 'values', 'colors.xml'); | ||
@@ -21,0 +21,0 @@ await runColorsConfig(colorsPath, colors); |
@@ -44,3 +44,3 @@ import { ResourceType } from './resources'; | ||
toJSON(): { | ||
details: BadImageFormatValidationErrorDetails | BadImageSizeValidationErrorDetails; | ||
details: ValidationErrorDetails; | ||
}; | ||
@@ -47,0 +47,0 @@ } |
@@ -38,3 +38,3 @@ "use strict"; | ||
toJSON() { | ||
return Object.assign(Object.assign({}, super.toJSON()), { details: this.details }); | ||
return { ...super.toJSON(), details: this.details }; | ||
} | ||
@@ -52,5 +52,5 @@ } | ||
toJSON() { | ||
return Object.assign(Object.assign({}, super.toJSON()), { sourceErrors: this.errors }); | ||
return { ...super.toJSON(), sourceErrors: this.errors }; | ||
} | ||
} | ||
exports.ResolveSourceImageError = ResolveSourceImageError; |
@@ -80,3 +80,6 @@ "use strict"; | ||
const config = resources_1.getResourcesConfig(platform, type); | ||
const resources = await Promise.all(config.resources.map(async (resource) => (Object.assign(Object.assign({}, resource), await generateImageResource(type, platform, resourcesDirectory, config, source.image, resource, errstream))))); | ||
const resources = await Promise.all(config.resources.map(async (resource) => ({ | ||
...resource, | ||
...await generateImageResource(type, platform, resourcesDirectory, config, source.image, resource, errstream), | ||
}))); | ||
return { | ||
@@ -122,3 +125,3 @@ resources, | ||
? await generateAdaptiveIconResourcesPortionFromImageSource(resourcesDirectory, "background" /* BACKGROUND */, resolvedBackgroundSource, errstream) | ||
: foregroundResources.map(resource => (Object.assign(Object.assign({}, resource), { src: '@color/background' }))); | ||
: foregroundResources.map(resource => ({ ...resource, src: '@color/background' })); | ||
const resources = await consolidateAdaptiveIconResources(foregroundResources, backgroundResources); | ||
@@ -166,3 +169,6 @@ return { | ||
const config = resources_1.getResourcesConfig("android" /* ANDROID */, "adaptive-icon" /* ADAPTIVE_ICON */); | ||
const resources = await Promise.all(config.resources.map(async (resource) => (Object.assign(Object.assign({}, resource), await generateImageResource("adaptive-icon" /* ADAPTIVE_ICON */, "android" /* ANDROID */, resourcesDirectory, config, source.image, Object.assign(Object.assign({}, resource), { src: resource[type] }), errstream))))); | ||
const resources = await Promise.all(config.resources.map(async (resource) => ({ | ||
...resource, | ||
...await generateImageResource("adaptive-icon" /* ADAPTIVE_ICON */, "android" /* ANDROID */, resourcesDirectory, config, source.image, { ...resource, src: resource[type] }, errstream), | ||
}))); | ||
return resources; | ||
@@ -169,0 +175,0 @@ } |
{ | ||
"name": "cordova-res", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "This tool will crop and resize PNG source images into appropriate sizes for modern iOS and Android devices.", | ||
@@ -10,2 +10,5 @@ "homepage": "https://ionicframework.com", | ||
"types": "dist/index.d.ts", | ||
"engines": { | ||
"node": ">=10.3.0" | ||
}, | ||
"bin": { | ||
@@ -51,3 +54,3 @@ "cordova-res": "./bin/cordova-res" | ||
"elementtree": "^0.1.7", | ||
"sharp": "^0.23.1", | ||
"sharp": "^0.24.0", | ||
"tslib": "^1.9.3" | ||
@@ -60,11 +63,11 @@ }, | ||
"@types/jest": "^24.0.12", | ||
"@types/node": "~8.10.56", | ||
"@types/sharp": "^0.23.0", | ||
"husky": "^3.0.0", | ||
"jest": "^23.6.0", | ||
"ts-jest": "^23.10.5", | ||
"@types/node": "~10.17.13", | ||
"@types/sharp": "^0.24.0", | ||
"husky": "^4.0.9", | ||
"jest": "~25.1.0", | ||
"ts-jest": "~25.0.0", | ||
"tslint": "^5.12.1", | ||
"tslint-ionic-rules": "0.0.21", | ||
"typescript": "~3.6.4" | ||
"typescript": "~3.7.2" | ||
} | ||
} |
1570
87328
+ Addedchownr@2.0.0(transitive)
+ Addedminipass@5.0.0(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedsemver@7.7.1(transitive)
+ Addedsharp@0.24.1(transitive)
+ Addedtar@6.2.1(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedsemver@6.3.1(transitive)
- Removedsharp@0.23.4(transitive)
- Removedtar@5.0.11(transitive)
Updatedsharp@^0.24.0