@simplysm/sd-cli 12.15.39 → 12.15.41

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.
Files changed (58) hide show
  1. package/dist/entry/SdCliCordova.d.ts +33 -1
  2. package/dist/entry/SdCliCordova.js +84 -88
  3. package/dist/entry/SdCliElectron.d.ts +5 -1
  4. package/dist/entry/SdCliElectron.js +21 -21
  5. package/dist/entry/SdCliLocalUpdate.d.ts +1 -1
  6. package/dist/entry/SdCliLocalUpdate.js +3 -3
  7. package/dist/entry/SdCliProject.d.ts +4 -1
  8. package/dist/entry/SdCliProject.js +11 -11
  9. package/dist/pkg-builders/SdProjectBuildRunner.d.ts +6 -1
  10. package/dist/pkg-builders/SdProjectBuildRunner.js +27 -27
  11. package/dist/pkg-builders/client/SdClientBuildRunner.d.ts +2 -1
  12. package/dist/pkg-builders/client/SdClientBuildRunner.js +8 -10
  13. package/dist/pkg-builders/client/SdNgBundler.d.ts +22 -1
  14. package/dist/pkg-builders/client/SdNgBundler.js +70 -80
  15. package/dist/pkg-builders/client/SdNgBundlerContext.d.ts +3 -1
  16. package/dist/pkg-builders/client/SdNgBundlerContext.js +9 -10
  17. package/dist/pkg-builders/lib/SdCliIndexFileGenerator.d.ts +2 -1
  18. package/dist/pkg-builders/lib/SdCliIndexFileGenerator.js +5 -5
  19. package/dist/pkg-builders/lib/SdJsLibBuildRunner.d.ts +1 -1
  20. package/dist/pkg-builders/lib/SdJsLibBuildRunner.js +2 -2
  21. package/dist/pkg-builders/lib/SdTsLibBuildRunner.d.ts +1 -1
  22. package/dist/pkg-builders/lib/SdTsLibBuildRunner.js +2 -3
  23. package/dist/pkg-builders/lib/SdTsLibBuilder.d.ts +2 -1
  24. package/dist/pkg-builders/lib/SdTsLibBuilder.js +7 -8
  25. package/dist/pkg-builders/server/SdServerBuildRunner.d.ts +3 -1
  26. package/dist/pkg-builders/server/SdServerBuildRunner.js +6 -7
  27. package/dist/pkg-builders/server/SdServerBundler.d.ts +6 -1
  28. package/dist/pkg-builders/server/SdServerBundler.js +21 -23
  29. package/dist/ts-compiler/ScopePathSet.d.ts +1 -1
  30. package/dist/ts-compiler/ScopePathSet.js +3 -4
  31. package/dist/ts-compiler/SdDepCache.d.ts +45 -1
  32. package/dist/ts-compiler/SdDepCache.js +71 -69
  33. package/dist/ts-compiler/SdStyleBundler.d.ts +5 -1
  34. package/dist/ts-compiler/SdStyleBundler.js +25 -26
  35. package/dist/ts-compiler/SdTsCompiler.d.ts +20 -1
  36. package/dist/ts-compiler/SdTsCompiler.js +122 -129
  37. package/dist/utils/SdCliPerformanceTimer.d.ts +2 -1
  38. package/dist/utils/SdCliPerformanceTimer.js +9 -9
  39. package/package.json +8 -8
  40. package/src/entry/SdCliCordova.ts +89 -89
  41. package/src/entry/SdCliElectron.ts +21 -21
  42. package/src/entry/SdCliLocalUpdate.ts +3 -3
  43. package/src/entry/SdCliProject.ts +11 -11
  44. package/src/pkg-builders/SdProjectBuildRunner.ts +27 -27
  45. package/src/pkg-builders/client/SdClientBuildRunner.ts +10 -10
  46. package/src/pkg-builders/client/SdNgBundler.ts +78 -78
  47. package/src/pkg-builders/client/SdNgBundlerContext.ts +10 -10
  48. package/src/pkg-builders/lib/SdCliIndexFileGenerator.ts +5 -5
  49. package/src/pkg-builders/lib/SdJsLibBuildRunner.ts +2 -2
  50. package/src/pkg-builders/lib/SdTsLibBuildRunner.ts +3 -3
  51. package/src/pkg-builders/lib/SdTsLibBuilder.ts +8 -8
  52. package/src/pkg-builders/server/SdServerBuildRunner.ts +7 -7
  53. package/src/pkg-builders/server/SdServerBundler.ts +23 -23
  54. package/src/ts-compiler/ScopePathSet.ts +4 -4
  55. package/src/ts-compiler/SdDepCache.ts +47 -47
  56. package/src/ts-compiler/SdStyleBundler.ts +26 -26
  57. package/src/ts-compiler/SdTsCompiler.ts +130 -130
  58. package/src/utils/SdCliPerformanceTimer.ts +9 -9
@@ -7,10 +7,10 @@ import { ScopePathSet } from "./ScopePathSet";
7
7
  import path from "path";
8
8
 
9
9
  export class SdStyleBundler {
10
- #ngStyleBundler: ComponentStylesheetBundler;
11
- #resultCache = new Map<TNormPath, TStylesheetBundlingResult>();
12
- #refCache = new Map<TNormPath, Set<TNormPath>>();
13
- #revRefCache = new Map<TNormPath, Set<TNormPath>>();
10
+ private readonly _ngStyleBundler: ComponentStylesheetBundler;
11
+ private readonly _resultCache = new Map<TNormPath, TStylesheetBundlingResult>();
12
+ private readonly _refCache = new Map<TNormPath, Set<TNormPath>>();
13
+ private readonly _revRefCache = new Map<TNormPath, Set<TNormPath>>();
14
14
 
15
15
  constructor(
16
16
  private readonly _opt: {
@@ -19,7 +19,7 @@ export class SdStyleBundler {
19
19
  dev: boolean;
20
20
  },
21
21
  ) {
22
- this.#ngStyleBundler = new ComponentStylesheetBundler(
22
+ this._ngStyleBundler = new ComponentStylesheetBundler(
23
23
  {
24
24
  workspaceRoot: this._opt.pkgPath,
25
25
  inlineFonts: !this._opt.dev,
@@ -51,7 +51,7 @@ export class SdStyleBundler {
51
51
  }
52
52
 
53
53
  getResultCache() {
54
- return this.#resultCache;
54
+ return this._resultCache;
55
55
  }
56
56
 
57
57
  async bundleAsync(
@@ -64,9 +64,9 @@ export class SdStyleBundler {
64
64
  // referencedFiles: import한 외부 scss 파일 혹은 woff파일등 외부 파일
65
65
 
66
66
  const fileNPath = PathUtils.norm(resourceFile ?? containingFile);
67
- if (this.#resultCache.has(fileNPath)) {
67
+ if (this._resultCache.has(fileNPath)) {
68
68
  return {
69
- ...this.#resultCache.get(fileNPath)!,
69
+ ...this._resultCache.get(fileNPath)!,
70
70
  cached: true,
71
71
  };
72
72
  }
@@ -74,8 +74,8 @@ export class SdStyleBundler {
74
74
  try {
75
75
  const result =
76
76
  resourceFile != null
77
- ? await this.#ngStyleBundler.bundleFile(resourceFile)
78
- : await this.#ngStyleBundler.bundleInline(data, containingFile, "scss");
77
+ ? await this._ngStyleBundler.bundleFile(resourceFile)
78
+ : await this._ngStyleBundler.bundleInline(data, containingFile, "scss");
79
79
 
80
80
  for (const referencedFile of result.referencedFiles ?? []) {
81
81
  if (
@@ -85,10 +85,10 @@ export class SdStyleBundler {
85
85
  continue;
86
86
 
87
87
  // 참조하는 파일과 참조된 파일 사이의 의존성 관계 추가
88
- this.#addReference(fileNPath, PathUtils.norm(referencedFile));
88
+ this._addReference(fileNPath, PathUtils.norm(referencedFile));
89
89
  }
90
90
 
91
- this.#resultCache.set(fileNPath, result);
91
+ this._resultCache.set(fileNPath, result);
92
92
 
93
93
  return { ...result, cached: false };
94
94
  } catch (err) {
@@ -101,7 +101,7 @@ export class SdStyleBundler {
101
101
  ],
102
102
  warnings: [],
103
103
  };
104
- this.#resultCache.set(fileNPath, result);
104
+ this._resultCache.set(fileNPath, result);
105
105
  return { ...result, cached: false };
106
106
  }
107
107
  }
@@ -109,44 +109,44 @@ export class SdStyleBundler {
109
109
  invalidate(modifiedNPathSet: Set<TNormPath>) {
110
110
  const affectedFileSet = this.getAffectedFileSet(modifiedNPathSet);
111
111
 
112
- this.#ngStyleBundler.invalidate(affectedFileSet);
112
+ this._ngStyleBundler.invalidate(affectedFileSet);
113
113
  for (const fileNPath of affectedFileSet) {
114
- this.#resultCache.delete(fileNPath);
114
+ this._resultCache.delete(fileNPath);
115
115
  }
116
116
 
117
117
  // revRefCache/refCache
118
118
  const targetSet = new Set<TNormPath>();
119
119
  for (const fileNPath of affectedFileSet) {
120
- targetSet.adds(...(this.#refCache.get(fileNPath) ?? []));
120
+ targetSet.adds(...(this._refCache.get(fileNPath) ?? []));
121
121
  }
122
122
 
123
123
  for (const target of [...targetSet]) {
124
- const source = this.#revRefCache.get(target);
124
+ const source = this._revRefCache.get(target);
125
125
  if (source == null) continue;
126
126
 
127
127
  for (const affectedFile of affectedFileSet) {
128
128
  source.delete(affectedFile);
129
129
  }
130
130
  if (source.size === 0) {
131
- this.#revRefCache.delete(target);
131
+ this._revRefCache.delete(target);
132
132
  }
133
133
 
134
- this.#refCache.delete(target);
134
+ this._refCache.delete(target);
135
135
  }
136
136
 
137
137
  return affectedFileSet;
138
138
  }
139
139
 
140
- #addReference(fileNPath: TNormPath, referencedFile: TNormPath) {
140
+ private _addReference(fileNPath: TNormPath, referencedFile: TNormPath) {
141
141
  if (fileNPath === referencedFile) return;
142
- this.#refCache.getOrCreate(fileNPath, new Set()).add(referencedFile);
143
- this.#revRefCache.getOrCreate(referencedFile, new Set()).add(fileNPath);
142
+ this._refCache.getOrCreate(fileNPath, new Set()).add(referencedFile);
143
+ this._revRefCache.getOrCreate(referencedFile, new Set()).add(fileNPath);
144
144
  }
145
145
 
146
146
  getAllStyleFileSet() {
147
147
  return new Set([
148
- ...this.#revRefCache.keys(),
149
- ...Array.from(this.#revRefCache.values()).mapMany((item) => Array.from(item)),
148
+ ...this._revRefCache.keys(),
149
+ ...Array.from(this._revRefCache.values()).mapMany((item) => Array.from(item)),
150
150
  ]);
151
151
  }
152
152
 
@@ -155,13 +155,13 @@ export class SdStyleBundler {
155
155
  // 수정파일중 Result에 있는것
156
156
  const modifiedResultFiles = Array.from(modifiedNPathSet)
157
157
  // .filter((item) => item.endsWith(".scss"))
158
- .filter((item) => this.#resultCache.has(item));
158
+ .filter((item) => this._resultCache.has(item));
159
159
  affectedFileSet.adds(...modifiedResultFiles);
160
160
 
161
161
  // 수정파일을 사용하는 파일
162
162
  const modifiedScssFiles = Array.from(modifiedNPathSet).filter((item) => item.endsWith(".scss"));
163
163
  for (const modifiedScss of modifiedScssFiles) {
164
- affectedFileSet.adds(...(this.#revRefCache.get(modifiedScss) ?? []));
164
+ affectedFileSet.adds(...(this._revRefCache.get(modifiedScss) ?? []));
165
165
  }
166
166
 
167
167
  return affectedFileSet;