@simplysm/sd-cli 12.5.50 → 12.5.52

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.
@@ -15,3 +15,16 @@ import fs from "node:fs";
15
15
  contents = contents.replace("console.error(err.message);", "console.error(err);");
16
16
  fs.writeFileSync(filePath, contents);
17
17
  }
18
+
19
+ {
20
+ const filePath = fileURLToPath(import.meta.resolve("@angular/core"));
21
+ let contents = fs.readFileSync(filePath).toString();
22
+ contents = contents.replace(`
23
+ signalSetFn$1(node, newValue);
24
+ emitterRef.emit(newValue);`, `
25
+ if(emitterRef.listeners?.[0] == null){
26
+ signalSetFn$1(node, newValue);
27
+ }
28
+ emitterRef.emit(newValue);`);
29
+ fs.writeFileSync(filePath, contents);
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/sd-cli",
3
- "version": "12.5.50",
3
+ "version": "12.5.52",
4
4
  "description": "심플리즘 패키지 - CLI",
5
5
  "author": "김석래",
6
6
  "repository": {
@@ -18,17 +18,17 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@angular/build": "^18.2.11",
21
- "@angular/compiler": "^18.2.10",
22
- "@angular/compiler-cli": "^18.2.10",
21
+ "@angular/compiler": "^18.2.11",
22
+ "@angular/compiler-cli": "^18.2.11",
23
23
  "@electron/rebuild": "^3.7.0",
24
- "@simplysm/sd-core-common": "12.5.50",
25
- "@simplysm/sd-core-node": "12.5.50",
26
- "@simplysm/sd-service-server": "12.5.50",
27
- "@simplysm/sd-storage": "12.5.50",
24
+ "@simplysm/sd-core-common": "12.5.52",
25
+ "@simplysm/sd-core-node": "12.5.52",
26
+ "@simplysm/sd-service-server": "12.5.52",
27
+ "@simplysm/sd-storage": "12.5.52",
28
28
  "browserslist": "^4.24.2",
29
29
  "cordova": "^12.0.0",
30
30
  "css-has-pseudo": "^7.0.1",
31
- "electron": "^33.0.2",
31
+ "electron": "^33.2.0",
32
32
  "electron-builder": "^25.1.8",
33
33
  "esbuild": "^0.24.0",
34
34
  "eslint": "^9.14.0",
@@ -34,10 +34,10 @@ export class SdCliElectron {
34
34
  main: "electron-main.js",
35
35
  ...(pkgConf.builder.electron.postInstallScript !== undefined
36
36
  ? {
37
- scripts: {
38
- postinstall: pkgConf.builder.electron.postInstallScript,
39
- },
40
- }
37
+ scripts: {
38
+ postinstall: pkgConf.builder.electron.postInstallScript,
39
+ },
40
+ }
41
41
  : {}),
42
42
  dependencies: reinstallPkgNames.toObject(
43
43
  (item) => item,
@@ -95,10 +95,10 @@ export class SdCliElectron {
95
95
  main: "electron-main.js",
96
96
  ...(pkgConf.builder.electron.postInstallScript !== undefined
97
97
  ? {
98
- scripts: {
99
- postinstall: pkgConf.builder.electron.postInstallScript,
100
- },
101
- }
98
+ scripts: {
99
+ postinstall: pkgConf.builder.electron.postInstallScript,
100
+ },
101
+ }
102
102
  : {}),
103
103
  dependencies: reinstallPkgNames.toObject(
104
104
  (item) => item,
@@ -138,8 +138,8 @@ export class SdCliElectron {
138
138
  },
139
139
  ...(pkgConf.builder.electron.installerIcon !== undefined
140
140
  ? {
141
- icon: path.resolve(pkgPath, pkgConf.builder.electron.installerIcon),
142
- }
141
+ icon: path.resolve(pkgPath, pkgConf.builder.electron.installerIcon),
142
+ }
143
143
  : {}),
144
144
  removePackageScripts: false,
145
145
  },
@@ -169,10 +169,10 @@ export class SdCliElectron {
169
169
  main: "electron-main.js",
170
170
  ...(opt.config.postInstallScript !== undefined
171
171
  ? {
172
- scripts: {
173
- postinstall: opt.config.postInstallScript,
174
- },
175
- }
172
+ scripts: {
173
+ postinstall: opt.config.postInstallScript,
174
+ },
175
+ }
176
176
  : {}),
177
177
  dependencies: reinstallPkgNames.toObject(
178
178
  (item) => item,
@@ -212,8 +212,8 @@ export class SdCliElectron {
212
212
  },
213
213
  ...(opt.config.installerIcon !== undefined
214
214
  ? {
215
- icon: path.resolve(opt.pkgPath, opt.config.installerIcon),
216
- }
215
+ icon: path.resolve(opt.pkgPath, opt.config.installerIcon),
216
+ }
217
217
  : {}),
218
218
  removePackageScripts: false,
219
219
  },
@@ -223,5 +223,10 @@ export class SdCliElectron {
223
223
  path.resolve(electronDistPath, `${npmConfig.description} Setup ${npmConfig.version}.exe`),
224
224
  path.resolve(opt.pkgPath, `dist/electron/${npmConfig.description}-latest.exe`),
225
225
  );
226
+
227
+ FsUtil.copy(
228
+ path.resolve(electronDistPath, `${npmConfig.description} Setup ${npmConfig.version}.exe`),
229
+ path.resolve(opt.pkgPath, `dist/electron/updates/${npmConfig.version}.exe`),
230
+ );
226
231
  }
227
232
  }
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export * from "./pkg-builders/SdMultiBuildRunner";
15
15
  export * from "./pkg-builders/server/createSdServerPlugin";
16
16
  export * from "./pkg-builders/server/SdServerBuildRunner";
17
17
  export * from "./pkg-builders/server/SdServerBundler";
18
+ import "./sd-cli";
18
19
  export * from "./ts-builder/SdTsCompiler";
19
20
  export * from "./types/build-plugin.type";
20
21
  export * from "./types/build-runner.type";
@@ -25,3 +26,6 @@ export * from "./types/ts-compiler.type";
25
26
  export * from "./types/workers.type";
26
27
  export * from "./utils/SdCliConvertMessageUtil";
27
28
  export * from "./utils/SdCliPerformanceTime";
29
+ import "./workers/build-runner-worker";
30
+ import "./workers/lint-worker";
31
+ import "./workers/server-worker";
@@ -29,7 +29,10 @@ export class SdClientBuildRunner extends EventEmitter {
29
29
  FsUtil.glob(path.resolve(this._pkgPath, "../../node_modules", key)),
30
30
  );
31
31
  this._watchScopePathSet = new Set(
32
- [path.resolve(this._pkgPath, "../"), ...localUpdatePaths].map((item) => PathUtil.norm(item)),
32
+ [
33
+ path.resolve(this._pkgPath, "../"),
34
+ ...localUpdatePaths
35
+ ].map((item) => PathUtil.norm(item)),
33
36
  );
34
37
  }
35
38
 
@@ -118,7 +121,7 @@ export class SdClientBuildRunner extends EventEmitter {
118
121
  | "web"
119
122
  | "electron"
120
123
  | "cordova"
121
- )[];
124
+ )[];
122
125
  if (this._pkgConf.builder?.cordova && !this._cordova) {
123
126
  this._debug("CORDOVA 준비...");
124
127
  this._cordova = new SdCliCordova({
@@ -203,7 +203,8 @@ export class SdNgBundler {
203
203
  const serviceWorkerResult = await this._genServiceWorkerAsync(outputFiles, assetFiles);
204
204
  outputFiles.push(createOutputFile("ngsw.json", serviceWorkerResult.manifest, BuildOutputFileType.Root));
205
205
  assetFiles.push(...serviceWorkerResult.assetFiles);
206
- } catch (err) {
206
+ }
207
+ catch (err) {
207
208
  results.push({
208
209
  filePath: undefined,
209
210
  line: undefined,
@@ -339,27 +340,27 @@ export class SdNgBundler {
339
340
  ...(this._opt.dev ? [{ input: "public-dev", glob: "**/*", output: "." }] : []),
340
341
  ...(this._opt.dev && this._opt.builderType === "cordova"
341
342
  ? Object.keys(this._opt.cordovaConfig?.platform ?? { browser: {} }).mapMany((platform) => [
342
- {
343
- input: `.cordova/platforms/${platform}/platform_www/plugins`,
344
- glob: "**/*",
345
- output: `cordova-${platform}/plugins`,
346
- },
347
- {
348
- input: `.cordova/platforms/${platform}/platform_www`,
349
- glob: "cordova.js",
350
- output: `cordova-${platform}`,
351
- },
352
- {
353
- input: `.cordova/platforms/${platform}/platform_www`,
354
- glob: "cordova_plugins.js",
355
- output: `cordova-${platform}`,
356
- },
357
- {
358
- input: `.cordova/platforms/${platform}/www`,
359
- glob: "config.xml",
360
- output: `cordova-${platform}`,
361
- },
362
- ])
343
+ {
344
+ input: `.cordova/platforms/${platform}/platform_www/plugins`,
345
+ glob: "**/*",
346
+ output: `cordova-${platform}/plugins`,
347
+ },
348
+ {
349
+ input: `.cordova/platforms/${platform}/platform_www`,
350
+ glob: "cordova.js",
351
+ output: `cordova-${platform}`,
352
+ },
353
+ {
354
+ input: `.cordova/platforms/${platform}/platform_www`,
355
+ glob: "cordova_plugins.js",
356
+ output: `cordova-${platform}`,
357
+ },
358
+ {
359
+ input: `.cordova/platforms/${platform}/www`,
360
+ glob: "config.xml",
361
+ output: `cordova-${platform}`,
362
+ },
363
+ ])
363
364
  : []),
364
365
  ],
365
366
  this._opt.pkgPath,
@@ -425,9 +426,9 @@ export class SdNgBundler {
425
426
  "process.env.NODE_ENV": JSON.stringify(this._opt.dev ? "development" : "production"),
426
427
  ...(this._opt.env
427
428
  ? Object.keys(this._opt.env).toObject(
428
- (key) => `process.env.${key}`,
429
- (key) => JSON.stringify(this._opt.env![key]),
430
- )
429
+ (key) => `process.env.${key}`,
430
+ (key) => JSON.stringify(this._opt.env![key]),
431
+ )
431
432
  : {}),
432
433
  },
433
434
  mainFields: ["es2020", "es2015", "browser", "module", "main"],
@@ -439,11 +440,11 @@ export class SdNgBundler {
439
440
  polyfills: path.resolve(this._opt.pkgPath, "src/polyfills.ts"),
440
441
  ...(this._opt.builderType === "cordova"
441
442
  ? {
442
- "cordova-entry": path.resolve(
443
- path.dirname(fileURLToPath(import.meta.url)),
444
- `../../../lib/cordova-entry.js`,
445
- ),
446
- }
443
+ "cordova-entry": path.resolve(
444
+ path.dirname(fileURLToPath(import.meta.url)),
445
+ `../../../lib/cordova-entry.js`,
446
+ ),
447
+ }
447
448
  : {}),
448
449
 
449
450
  // TODO: Workers Bundler 분리
@@ -479,17 +480,17 @@ export class SdNgBundler {
479
480
  },
480
481
  ...(this._opt.builderType === "electron"
481
482
  ? {
482
- platform: "node",
483
- target: "node20",
484
- external: ["electron", ...nodeModule.builtinModules, ...this._opt.external],
485
- }
483
+ platform: "node",
484
+ target: "node20",
485
+ external: ["electron", ...nodeModule.builtinModules, ...this._opt.external],
486
+ }
486
487
  : {
487
- platform: "browser",
488
- target: this.#browserTarget,
489
- format: "esm",
490
- splitting: true,
491
- inject: [PathUtil.posix(fileURLToPath(import.meta.resolve("node-stdlib-browser/helpers/esbuild/shim")))],
492
- }),
488
+ platform: "browser",
489
+ target: this.#browserTarget,
490
+ format: "esm",
491
+ splitting: true,
492
+ inject: [PathUtil.posix(fileURLToPath(import.meta.resolve("node-stdlib-browser/helpers/esbuild/shim")))],
493
+ }),
493
494
  plugins: [
494
495
  /*...(this._opt.builderType === "cordova" && this._opt.cordovaConfig?.plugins
495
496
  ? [
@@ -630,9 +631,9 @@ export class SdNgBundler {
630
631
  "process.env.NODE_ENV": JSON.stringify(this._opt.dev ? "development" : "production"),
631
632
  ...(this._opt.env
632
633
  ? Object.keys(this._opt.env).toObject(
633
- (key) => `process.env.${key}`,
634
- (key) => JSON.stringify(this._opt.env![key]),
635
- )
634
+ (key) => `process.env.${key}`,
635
+ (key) => JSON.stringify(this._opt.env![key]),
636
+ )
636
637
  : {}),
637
638
  },
638
639
  platform: "node",
@@ -7,6 +7,7 @@ import { ISdBuildMessage } from "../../types/build.type";
7
7
  import { createSdServerPlugin } from "./createSdServerPlugin";
8
8
  import { BuildOutputFile, BuildOutputFileType } from "@angular/build/src/tools/esbuild/bundler-context";
9
9
  import { convertOutputFile } from "@angular/build/src/tools/esbuild/utils";
10
+ import { resolveAssets } from "@angular/build/src/utils/resolve-assets";
10
11
 
11
12
  export class SdServerBundler {
12
13
  readonly #logger = Logger.get(["simplysm", "sd-cli", "SdServerBundler"]);
@@ -26,7 +27,8 @@ export class SdServerBundler {
26
27
  external?: string[];
27
28
  watchScopePaths: TNormPath[];
28
29
  },
29
- ) {}
30
+ ) {
31
+ }
30
32
 
31
33
  async bundleAsync(modifiedFileSet?: Set<TNormPath>): Promise<{
32
34
  watchFileSet: Set<TNormPath>;
@@ -124,7 +126,27 @@ const __dirname = __path__.dirname(__filename);`.trim(),
124
126
  emitFileSet.add(distFilePath);
125
127
  }
126
128
  }
127
- } catch (err) {
129
+
130
+ //-- copy assets
131
+ const assetFiles = await resolveAssets(
132
+ [
133
+ { input: "public", glob: "**/*", output: "." },
134
+ ...(this._opt.dev ? [{ input: "public-dev", glob: "**/*", output: "." }] : []),
135
+ ],
136
+ this._opt.pkgPath,
137
+ );
138
+
139
+ for (const assetFile of assetFiles) {
140
+ const prev = this.#outputCache.get(PathUtil.norm(assetFile.source));
141
+ const curr = FsUtil.lstat(assetFile.source).mtime.getTime();
142
+ if (prev !== curr) {
143
+ FsUtil.copy(assetFile.source, path.resolve(this._opt.pkgPath, "dist", assetFile.destination));
144
+ this.#outputCache.set(PathUtil.norm(assetFile.source), curr);
145
+ emitFileSet.add(PathUtil.norm(assetFile.destination));
146
+ }
147
+ }
148
+ }
149
+ catch (err) {
128
150
  result = err;
129
151
  for (const e of err.errors) {
130
152
  if (e.detail != null) {