@simplysm/sd-cli 12.16.6 → 12.16.8

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.
@@ -58,6 +58,7 @@ export class SdCliCapacitor {
58
58
  volta: projNpmConfig.volta,
59
59
  dependencies: {
60
60
  "@capacitor/core": "^7.0.0",
61
+ "@capacitor/app": "^7.0.0",
61
62
  },
62
63
  devDependencies: {
63
64
  "@capacitor/cli": "^7.0.0",
@@ -161,11 +162,10 @@ export class SdCliCapacitor {
161
162
  }
162
163
  }
163
164
  // 새 플러그인 설치
164
- const mainPkgJson = this._npmConfig;
165
165
  const mainDeps = {
166
- ...mainPkgJson.dependencies,
167
- ...mainPkgJson.devDependencies,
168
- ...mainPkgJson.peerDependencies,
166
+ ...this._npmConfig.dependencies,
167
+ ...this._npmConfig.devDependencies,
168
+ ...this._npmConfig.peerDependencies,
169
169
  };
170
170
  for (const plugin of usePlugins) {
171
171
  if (!currentDeps.includes(plugin)) {
@@ -193,12 +193,10 @@ export class SdCliCapacitor {
193
193
  if (this._opt.config.icon != null) {
194
194
  await FsUtils.mkdirsAsync(iconDirPath);
195
195
  const iconSource = path.resolve(this._opt.pkgPath, this._opt.config.icon);
196
- // Adaptive Icon용 여백 추가된 이미지 생성
197
- // 1024x1024 680x680이 safe zone ( 66%)
198
- const paddedIconPath = path.resolve(iconDirPath, "icon-only.png");
199
- await this._createPaddedIconAsync(iconSource, paddedIconPath);
200
- // splash, icon 복사
201
- await FsUtils.copyAsync(iconSource, path.resolve(iconDirPath, "icon.png"));
196
+ // icon.png 자체를 여백 포함으로 생성
197
+ const iconPath = path.resolve(iconDirPath, "icon.png");
198
+ await this._createPaddedIconAsync(iconSource, iconPath);
199
+ // splash는 원본 사용
202
200
  await FsUtils.copyAsync(iconSource, path.resolve(iconDirPath, "splash.png"));
203
201
  try {
204
202
  await SdCliCapacitor._execAsync("npx", ["@capacitor/assets", "generate", "--android"], capacitorPath);
@@ -212,17 +210,21 @@ export class SdCliCapacitor {
212
210
  }
213
211
  }
214
212
  async _createPaddedIconAsync(sourcePath, outputPath) {
215
- const size = 1024;
216
- const iconSize = 680; // safe zone
217
- const padding = Math.floor((size - iconSize) / 2); // 172px
213
+ const outputSize = 1024;
214
+ const iconSize = 680; // safe zone (66%)
215
+ const padding = Math.floor((outputSize - iconSize) / 2); // 172px
216
+ // 원본 크기 상관없이 iconSize로 리사이즈 후 여백 추가
218
217
  await sharp(sourcePath)
219
- .resize(iconSize, iconSize, { fit: "contain", background: { r: 0, g: 0, b: 0, alpha: 0 } })
218
+ .resize(iconSize, iconSize, {
219
+ fit: "contain",
220
+ background: { r: 0, g: 0, b: 0, alpha: 0 },
221
+ })
220
222
  .extend({
221
223
  top: padding,
222
224
  bottom: padding,
223
225
  left: padding,
224
226
  right: padding,
225
- background: { r: 0, g: 0, b: 0, alpha: 0 }, // 투명
227
+ background: { r: 0, g: 0, b: 0, alpha: 0 },
226
228
  })
227
229
  .toFile(outputPath);
228
230
  }
@@ -511,8 +513,9 @@ export class SdCliCapacitor {
511
513
  try {
512
514
  await this._execAsync("npx", ["cap", "run", opt.platform], capacitorPath);
513
515
  }
514
- catch {
516
+ catch (err) {
515
517
  await SdProcess.spawnAsync("adb", ["kill-server"]);
518
+ throw err;
516
519
  }
517
520
  }
518
521
  }
@@ -109,7 +109,7 @@ Options = UnsafeLegacyRenegotiation`.trim());
109
109
  arrayProcess: "concat",
110
110
  useDelTargetNull: true
111
111
  };`
112
- .replaceAll("\n ", "\n")
112
+ .replace(/\n {8}/g, "\n")
113
113
  .trim();
114
114
  FsUtils.writeFile(path.resolve(this._opt.pkgPath, "dist/pm2.config.cjs"), str);
115
115
  }
@@ -334,7 +334,7 @@ export class SdTsCompiler {
334
334
  (transformers.before ??= []).push(createWorkerTransformer((file, importer) => {
335
335
  const fullPath = path.resolve(path.dirname(importer), file);
336
336
  const relPath = path.relative(path.resolve(this._opt.pkgPath, "src"), fullPath);
337
- return relPath.replace(/\.ts$/, "").replaceAll("\\", "/") + ".js";
337
+ return relPath.replace(/\.ts$/, "").replace(/\\/, "/") + ".js";
338
338
  }));
339
339
  }
340
340
  this._debug(`파일 출력 중...`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/sd-cli",
3
- "version": "12.16.6",
3
+ "version": "12.16.8",
4
4
  "description": "심플리즘 패키지 - CLI",
5
5
  "author": "김석래",
6
6
  "repository": {
@@ -17,21 +17,21 @@
17
17
  "@angular/compiler-cli": "^20.3.15",
18
18
  "@anthropic-ai/sdk": "^0.71.2",
19
19
  "@electron/rebuild": "^4.0.2",
20
- "@simplysm/sd-core-common": "12.16.6",
21
- "@simplysm/sd-core-node": "12.16.6",
22
- "@simplysm/sd-service-server": "12.16.6",
23
- "@simplysm/sd-storage": "12.16.6",
20
+ "@simplysm/sd-core-common": "12.16.8",
21
+ "@simplysm/sd-core-node": "12.16.8",
22
+ "@simplysm/sd-service-server": "12.16.8",
23
+ "@simplysm/sd-storage": "12.16.8",
24
24
  "browserslist": "^4.28.1",
25
25
  "cordova": "^13.0.0",
26
26
  "electron": "^33.4.11",
27
27
  "electron-builder": "^25.1.8",
28
28
  "esbuild": "0.25.9",
29
29
  "esbuild-sass-plugin": "^3.3.1",
30
- "eslint": "^9.39.1",
30
+ "eslint": "^9.39.2",
31
31
  "glob": "^13.0.0",
32
32
  "node-stdlib-browser": "^1.3.1",
33
33
  "rxjs": "^7.8.2",
34
- "sass-embedded": "^1.96.0",
34
+ "sass-embedded": "^1.97.0",
35
35
  "semver": "^7.7.3",
36
36
  "sharp": "^0.34.5",
37
37
  "specifier-resolution-node": "^1.1.4",
@@ -82,6 +82,7 @@ export class SdCliCapacitor {
82
82
  volta: projNpmConfig.volta,
83
83
  dependencies: {
84
84
  "@capacitor/core": "^7.0.0",
85
+ "@capacitor/app": "^7.0.0",
85
86
  },
86
87
  devDependencies: {
87
88
  "@capacitor/cli": "^7.0.0",
@@ -220,11 +221,10 @@ export class SdCliCapacitor {
220
221
  }
221
222
 
222
223
  // 새 플러그인 설치
223
- const mainPkgJson = this._npmConfig;
224
224
  const mainDeps = {
225
- ...mainPkgJson.dependencies,
226
- ...mainPkgJson.devDependencies,
227
- ...mainPkgJson.peerDependencies,
225
+ ...this._npmConfig.dependencies,
226
+ ...this._npmConfig.devDependencies,
227
+ ...this._npmConfig.peerDependencies,
228
228
  };
229
229
 
230
230
  for (const plugin of usePlugins) {
@@ -262,13 +262,11 @@ export class SdCliCapacitor {
262
262
 
263
263
  const iconSource = path.resolve(this._opt.pkgPath, this._opt.config.icon);
264
264
 
265
- // Adaptive Icon용 여백 추가된 이미지 생성
266
- // 1024x1024 680x680이 safe zone ( 66%)
267
- const paddedIconPath = path.resolve(iconDirPath, "icon-only.png");
268
- await this._createPaddedIconAsync(iconSource, paddedIconPath);
265
+ // icon.png 자체를 여백 포함으로 생성
266
+ const iconPath = path.resolve(iconDirPath, "icon.png");
267
+ await this._createPaddedIconAsync(iconSource, iconPath);
269
268
 
270
- // splash, icon 복사
271
- await FsUtils.copyAsync(iconSource, path.resolve(iconDirPath, "icon.png"));
269
+ // splash 원본 사용
272
270
  await FsUtils.copyAsync(iconSource, path.resolve(iconDirPath, "splash.png"));
273
271
 
274
272
  try {
@@ -286,18 +284,22 @@ export class SdCliCapacitor {
286
284
  }
287
285
 
288
286
  private async _createPaddedIconAsync(sourcePath: string, outputPath: string): Promise<void> {
289
- const size = 1024;
290
- const iconSize = 680; // safe zone
291
- const padding = Math.floor((size - iconSize) / 2); // 172px
287
+ const outputSize = 1024;
288
+ const iconSize = 680; // safe zone (66%)
289
+ const padding = Math.floor((outputSize - iconSize) / 2); // 172px
292
290
 
291
+ // 원본 크기 상관없이 iconSize로 리사이즈 후 여백 추가
293
292
  await sharp(sourcePath)
294
- .resize(iconSize, iconSize, { fit: "contain", background: { r: 0, g: 0, b: 0, alpha: 0 } })
293
+ .resize(iconSize, iconSize, {
294
+ fit: "contain",
295
+ background: { r: 0, g: 0, b: 0, alpha: 0 },
296
+ })
295
297
  .extend({
296
298
  top: padding,
297
299
  bottom: padding,
298
300
  left: padding,
299
301
  right: padding,
300
- background: { r: 0, g: 0, b: 0, alpha: 0 }, // 투명
302
+ background: { r: 0, g: 0, b: 0, alpha: 0 },
301
303
  })
302
304
  .toFile(outputPath);
303
305
  }
@@ -738,8 +740,9 @@ export class SdCliCapacitor {
738
740
 
739
741
  try {
740
742
  await this._execAsync("npx", ["cap", "run", opt.platform], capacitorPath);
741
- } catch {
743
+ } catch (err) {
742
744
  await SdProcess.spawnAsync("adb", ["kill-server"]);
745
+ throw err;
743
746
  }
744
747
  }
745
748
  }
@@ -136,7 +136,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
136
136
  arrayProcess: "concat",
137
137
  useDelTargetNull: true
138
138
  };`
139
- .replaceAll("\n ", "\n")
139
+ .replace(/\n {8}/g, "\n")
140
140
  .trim();
141
141
 
142
142
  FsUtils.writeFile(path.resolve(this._opt.pkgPath, "dist/pm2.config.cjs"), str);
@@ -499,7 +499,7 @@ export class SdTsCompiler {
499
499
  createWorkerTransformer((file, importer) => {
500
500
  const fullPath = path.resolve(path.dirname(importer), file);
501
501
  const relPath = path.relative(path.resolve(this._opt.pkgPath, "src"), fullPath);
502
- return relPath.replace(/\.ts$/, "").replaceAll("\\", "/") + ".js";
502
+ return relPath.replace(/\.ts$/, "").replace(/\\/, "/") + ".js";
503
503
  }),
504
504
  );
505
505
  }