nativescript 8.9.3-dev.0 → 8.9.3-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,7 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
30
30
  const packageJsonPath = path.join(pathToSave, "package.json");
31
31
  const jsonContentBefore = this.$fs.readJson(packageJsonPath);
32
32
  const flags = this.getFlagsString(config, true);
33
- let params = ["install", "--legacy-peer-deps"];
33
+ let params = ["install"];
34
34
  const isInstallingAllDependencies = packageName === pathToSave;
35
35
  if (!isInstallingAllDependencies) {
36
36
  params.push(packageName);
@@ -30,7 +30,7 @@ class NodePackageManager extends base_package_manager_1.BasePackageManager {
30
30
  const packageJsonPath = (0, path_1.join)(pathToSave, "package.json");
31
31
  const jsonContentBefore = this.$fs.readJson(packageJsonPath);
32
32
  const flags = this.getFlagsString(config, true);
33
- let params = ["install", "--legacy-peer-deps"];
33
+ let params = ["install"];
34
34
  const isInstallingAllDependencies = packageName === pathToSave;
35
35
  if (!isInstallingAllDependencies) {
36
36
  params.push(packageName);
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.AssetsGenerationService = void 0;
10
- const jimp_1 = require("jimp");
10
+ const JimpModule = require("jimp");
11
11
  const Color = require("color");
12
12
  const decorators_1 = require("../../common/decorators");
13
13
  const constants_1 = require("../../constants");
@@ -67,7 +67,7 @@ class AssetsGenerationService {
67
67
  }
68
68
  try {
69
69
  const color = (_e = (_c = generationData[(_b = assetItem.data) === null || _b === void 0 ? void 0 : _b.fromKey]) !== null && _c !== void 0 ? _c : (_d = assetItem.data) === null || _d === void 0 ? void 0 : _d.default) !== null && _e !== void 0 ? _e : "white";
70
- const colorHEX = (0, jimp_1.cssColorToHex)(color);
70
+ const colorHEX = JimpModule.cssColorToHex(color);
71
71
  const hex = (_f = colorHEX === null || colorHEX === void 0 ? void 0 : colorHEX.toString(16).substring(0, 6)) !== null && _f !== void 0 ? _f : "FFFFFF";
72
72
  this.$fs.writeFile(assetItem.path, [
73
73
  `<?xml version="1.0" encoding="utf-8"?>`,
@@ -112,41 +112,49 @@ class AssetsGenerationService {
112
112
  constants_1.AssetConstants.defaultOverlayImageScale;
113
113
  const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
114
114
  image = await this.resize(generationData.imagePath, imageResize, imageResize);
115
- image = this.generateImage(background, width, height, outputPath, image);
115
+ image = this.generateImage(background, width, height, image);
116
116
  break;
117
117
  case "blank":
118
- image = this.generateImage(background, width, height, outputPath);
118
+ image = this.generateImage(background, width, height);
119
119
  break;
120
120
  case "resize":
121
121
  image = await this.resize(generationData.imagePath, width, height);
122
122
  break;
123
123
  case "outerScale":
124
124
  image = await this.resize(generationData.imagePath, assetItem.width, assetItem.height);
125
- image = this.generateImage("#00000000", width, height, outputPath, image);
125
+ image = this.generateImage("#00000000", width, height, image);
126
126
  break;
127
127
  default:
128
128
  throw new Error(`Invalid image generation operation: ${operation}`);
129
129
  }
130
130
  if (assetItem.rgba === false) {
131
- image = image.colorType(2);
131
+ image = this.generateImage("#FFFFFF", image.width, image.height, image);
132
+ }
133
+ if (this.isAssetFilePath(outputPath)) {
134
+ image.write(outputPath);
135
+ }
136
+ else {
137
+ this.$logger.warn(`Incorrect destination path ${outputPath} for image ${assetItem.filename}`);
132
138
  }
133
- image.write(outputPath);
134
139
  }
135
140
  }
136
141
  async resize(imagePath, width, height) {
137
- const image = await jimp_1.Jimp.read(imagePath);
142
+ const image = await JimpModule.Jimp.read(imagePath);
138
143
  return image.scaleToFit({
139
144
  w: width,
140
145
  h: height,
141
146
  });
142
147
  }
143
- generateImage(background, width, height, outputPath, overlayImage) {
144
- const J = jimp_1.Jimp;
148
+ generateImage(background, width, height, overlayImage) {
145
149
  const backgroundColor = this.getRgbaNumber(background);
146
- let image = new J(width, height, backgroundColor);
150
+ let image = new JimpModule.Jimp({
151
+ width,
152
+ height,
153
+ color: backgroundColor,
154
+ });
147
155
  if (overlayImage) {
148
- const centeredWidth = (width - overlayImage.bitmap.width) / 2;
149
- const centeredHeight = (height - overlayImage.bitmap.height) / 2;
156
+ const centeredWidth = (width - overlayImage.width) / 2;
157
+ const centeredHeight = (height - overlayImage.height) / 2;
150
158
  image = image.composite(overlayImage, centeredWidth, centeredHeight);
151
159
  }
152
160
  return image;
@@ -155,7 +163,14 @@ class AssetsGenerationService {
155
163
  const color = new Color(colorString);
156
164
  const colorRgb = color.rgb();
157
165
  const alpha = Math.round(colorRgb.alpha() * 255);
158
- return (0, jimp_1.rgbaToInt)(colorRgb.red(), colorRgb.green(), colorRgb.blue(), alpha);
166
+ return JimpModule.rgbaToInt(colorRgb.red(), colorRgb.green(), colorRgb.blue(), alpha);
167
+ }
168
+ isAssetFilePath(path) {
169
+ if (!path) {
170
+ return false;
171
+ }
172
+ const index = path.lastIndexOf(".");
173
+ return index > -1 && index < path.length - 1;
159
174
  }
160
175
  }
161
176
  exports.AssetsGenerationService = AssetsGenerationService;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nativescript",
3
3
  "main": "./lib/nativescript-cli-lib.js",
4
- "version": "8.9.3-dev.0",
4
+ "version": "8.9.3-dev.1",
5
5
  "author": "NativeScript <oss@nativescript.org>",
6
6
  "description": "Command-line interface for building NativeScript projects",
7
7
  "bin": {