@simplysm/sd-cli 7.0.38 → 7.0.43
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.
- package/.eslintrc.cjs +2 -2
- package/dist/bin/sd-cli.mjs +3 -2
- package/dist/build-tool/SdCliCacheCompilerHost.mjs +1 -1
- package/dist/build-tool/SdCliNgCacheCompilerHost.mjs +3 -3
- package/dist/build-tool/SdCliPackageLinter.mjs +1 -1
- package/dist/builder/SdCliClientBuilder.mjs +197 -120
- package/dist/builder/SdCliJsLibBuilder.mjs +7 -3
- package/dist/builder/SdCliServerBuilder.mjs +58 -34
- package/dist/builder/SdCliTsLibBuilder.d.ts +1 -1
- package/dist/builder/SdCliTsLibBuilder.mjs +13 -9
- package/dist/commons.d.ts +1 -0
- package/dist/entry-points/SdCliLocalUpdate.mjs +1 -1
- package/dist/entry-points/SdCliNpm.mjs +1 -1
- package/dist/entry-points/SdCliPrepare.mjs +1 -1
- package/dist/entry-points/SdCliWorkspace.mjs +5 -5
- package/dist/packages/SdCliPackage.mjs +2 -2
- package/dist/utils/SdCliBuildResultUtil.mjs +2 -2
- package/dist/utils/SdCliConfigUtil.mjs +2 -2
- package/package.json +5 -5
- package/src/bin/sd-cli.ts +2 -1
- package/src/build-tool/SdCliCacheCompilerHost.ts +1 -1
- package/src/build-tool/SdCliNgCacheCompilerHost.ts +3 -3
- package/src/build-tool/SdCliPackageLinter.ts +1 -1
- package/src/builder/SdCliClientBuilder.ts +199 -118
- package/src/builder/SdCliJsLibBuilder.ts +7 -3
- package/src/builder/SdCliServerBuilder.ts +59 -33
- package/src/builder/SdCliTsLibBuilder.ts +14 -9
- package/src/commons.ts +1 -0
- package/src/entry-points/SdCliLocalUpdate.ts +1 -1
- package/src/entry-points/SdCliNpm.ts +1 -1
- package/src/entry-points/SdCliPrepare.ts +1 -1
- package/src/entry-points/SdCliWorkspace.ts +5 -4
- package/src/packages/SdCliPackage.ts +2 -2
- package/src/utils/SdCliBuildResultUtil.ts +1 -1
- package/src/utils/SdCliConfigUtil.ts +2 -2
- package/tsconfig.json +4 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { INpmConfig, ISdCliPackageBuildResult } from "../commons";
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
-
import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core
|
|
4
|
+
import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core/node";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { createHash } from "crypto";
|
|
7
7
|
import { SdCliBuildResultUtil } from "../utils/SdCliBuildResultUtil";
|
|
@@ -33,7 +33,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
33
33
|
|
|
34
34
|
private readonly _isAngular: boolean;
|
|
35
35
|
|
|
36
|
-
public constructor(private readonly _rootPath) {
|
|
36
|
+
public constructor(private readonly _rootPath: string) {
|
|
37
37
|
super();
|
|
38
38
|
this._linter = new SdCliPackageLinter(this._rootPath);
|
|
39
39
|
|
|
@@ -78,15 +78,20 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
78
78
|
this._fileCache.delete(PathUtil.posix(changeFilePath));
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
const watchBuildResults: ISdCliPackageBuildResult[] = [];
|
|
82
|
+
|
|
81
83
|
// 빌드
|
|
82
84
|
const watchBuildPack = this._createSdBuildPack(this._parsedTsconfig);
|
|
85
|
+
watchBuildResults.push(...await this._runBuilderAsync(watchBuildPack.builder, watchBuildPack.ngCompiler));
|
|
83
86
|
|
|
84
87
|
// 린트
|
|
85
|
-
const
|
|
86
|
-
watchBuildResults.push(...await this._linter.lintAsync([
|
|
88
|
+
const lintFilePaths = [
|
|
87
89
|
...watchBuildPack.affectedSourceFiles.map((item) => item.fileName),
|
|
88
|
-
...
|
|
89
|
-
]
|
|
90
|
+
...changeInfos.filter((item) => ["add", "change"].includes(item.event)).map((item) => item.path)
|
|
91
|
+
];
|
|
92
|
+
if (lintFilePaths.length > 0) {
|
|
93
|
+
watchBuildResults.push(...await this._linter.lintAsync(lintFilePaths, watchBuildPack.program));
|
|
94
|
+
}
|
|
90
95
|
|
|
91
96
|
const watchRelatedPaths = await this.getAllRelatedPathsAsync();
|
|
92
97
|
watcher.add(watchRelatedPaths);
|
|
@@ -194,7 +199,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
194
199
|
}
|
|
195
200
|
catch (err) {
|
|
196
201
|
if (err instanceof sass.Exception) {
|
|
197
|
-
const matches =
|
|
202
|
+
const matches = (/^(.*\.sd\.scss) ([0-9]*):([0-9]*)/).exec(err.sassStack)!;
|
|
198
203
|
const filePath = path.resolve(matches[1].replace(/\.sd\.scss/, "").replace(/^\.:/, item => item.toUpperCase()));
|
|
199
204
|
const scssLine = matches[2];
|
|
200
205
|
const scssChar = matches[3];
|
|
@@ -206,7 +211,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
206
211
|
char: undefined,
|
|
207
212
|
code: undefined,
|
|
208
213
|
severity: "error",
|
|
209
|
-
message: `스타일(${scssLine}:${scssChar}): ${message}`
|
|
214
|
+
message: `스타일(${scssLine}:${scssChar}): ${message}\n${err.message}`
|
|
210
215
|
}];
|
|
211
216
|
}
|
|
212
217
|
|
|
@@ -234,7 +239,7 @@ export class SdCliTsLibBuilder extends EventEmitter {
|
|
|
234
239
|
const affectedSourceFileSet: Set<ts.SourceFile> = new Set<ts.SourceFile>();
|
|
235
240
|
while (true) {
|
|
236
241
|
const result = this._builder.getSemanticDiagnosticsOfNextAffectedFile(undefined, (sourceFile) => {
|
|
237
|
-
if (ngCompiler
|
|
242
|
+
if (ngCompiler?.ignoreForDiagnostics.has(sourceFile) && sourceFile.fileName.endsWith(".ngtypecheck.ts")) {
|
|
238
243
|
const orgFileName = sourceFile.fileName.slice(0, -15) + ".ts";
|
|
239
244
|
const orgSourceFile = this._builder!.getSourceFile(orgFileName);
|
|
240
245
|
if (orgSourceFile) {
|
package/src/commons.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SdCliConfigUtil } from "../utils/SdCliConfigUtil";
|
|
2
|
-
import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core
|
|
2
|
+
import { FsUtil, Logger, PathUtil, SdFsWatcher } from "@simplysm/sd-core/node";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
|
|
5
5
|
export class SdCliLocalUpdate {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FsUtil, Logger, SdProcess } from "@simplysm/sd-core
|
|
1
|
+
import { FsUtil, Logger, SdProcess } from "@simplysm/sd-core/node";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { INpmConfig, ISdCliConfig, ISdCliPackageBuildResult } from "../commons";
|
|
4
4
|
import { SdCliPackage } from "../packages/SdCliPackage";
|
|
5
|
-
import { Uuid, Wait } from "@simplysm/sd-core
|
|
5
|
+
import { Uuid, Wait } from "@simplysm/sd-core/common";
|
|
6
6
|
import os from "os";
|
|
7
7
|
import { SdCliBuildResultUtil } from "../utils/SdCliBuildResultUtil";
|
|
8
8
|
import semver from "semver/preload";
|
|
@@ -238,7 +238,7 @@ export class SdCliWorkspace {
|
|
|
238
238
|
if (i !== sec) {
|
|
239
239
|
process.stdout.cursorTo(0);
|
|
240
240
|
}
|
|
241
|
-
process.stdout.write(msg
|
|
241
|
+
process.stdout.write(`${msg} ${i}`);
|
|
242
242
|
await Wait.time(1000);
|
|
243
243
|
}
|
|
244
244
|
|
|
@@ -252,6 +252,7 @@ export class SdCliWorkspace {
|
|
|
252
252
|
throw new Error("최상위 'package.json'에서 'workspaces'를 찾을 수 없습니다.");
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
|
|
255
256
|
return pkgRootPaths.map((pkgRootPath) => {
|
|
256
257
|
const pkgConfig = conf.packages[path.basename(pkgRootPath)];
|
|
257
258
|
return pkgConfig ? new SdCliPackage(this._rootPath, pkgRootPath, pkgConfig) : undefined;
|
|
@@ -264,7 +265,7 @@ export class SdCliWorkspace {
|
|
|
264
265
|
pkgName: item[0],
|
|
265
266
|
...item1
|
|
266
267
|
})))
|
|
267
|
-
.orderBy((item) => item.pkgName
|
|
268
|
+
.orderBy((item) => `${item.pkgName}_${item.filePath}`);
|
|
268
269
|
|
|
269
270
|
const warnings = totalResults
|
|
270
271
|
.filter((item) => item.severity === "warning")
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { INpmConfig, ISdCliPackageBuildResult, ITsconfig, TSdCliPackageConfig } from "../commons";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { FsUtil, SdProcess } from "@simplysm/sd-core
|
|
3
|
+
import { FsUtil, SdProcess } from "@simplysm/sd-core/node";
|
|
4
4
|
import { EventEmitter } from "events";
|
|
5
|
-
import { ObjectUtil } from "@simplysm/sd-core
|
|
5
|
+
import { ObjectUtil } from "@simplysm/sd-core/common";
|
|
6
6
|
import { SdCliTsLibBuilder } from "../builder/SdCliTsLibBuilder";
|
|
7
7
|
import { SdCliJsLibBuilder } from "../builder/SdCliJsLibBuilder";
|
|
8
8
|
import { SdCliServerBuilder } from "../builder/SdCliServerBuilder";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ISdCliConfig, TSdCliPackageConfig } from "../commons";
|
|
2
|
-
import { FsUtil } from "@simplysm/sd-core
|
|
3
|
-
import { ObjectUtil } from "@simplysm/sd-core
|
|
2
|
+
import { FsUtil } from "@simplysm/sd-core/node";
|
|
3
|
+
import { ObjectUtil } from "@simplysm/sd-core/common";
|
|
4
4
|
import path from "path";
|
|
5
5
|
|
|
6
6
|
export class SdCliConfigUtil {
|
package/tsconfig.json
CHANGED
|
@@ -7,14 +7,11 @@
|
|
|
7
7
|
"outDir": "./dist",
|
|
8
8
|
"baseUrl": ".",
|
|
9
9
|
"paths": {
|
|
10
|
-
"@simplysm/sd-core
|
|
11
|
-
"../sd-core
|
|
10
|
+
"@simplysm/sd-core/*": [
|
|
11
|
+
"../sd-core/src/*/index.ts"
|
|
12
12
|
],
|
|
13
|
-
"@simplysm/sd-
|
|
14
|
-
"../sd-
|
|
15
|
-
],
|
|
16
|
-
"@simplysm/sd-service/server": [
|
|
17
|
-
"../sd-service/src/server.ts"
|
|
13
|
+
"@simplysm/sd-service/*": [
|
|
14
|
+
"../sd-service/src/*/index.ts"
|
|
18
15
|
]
|
|
19
16
|
}
|
|
20
17
|
}
|