@simplysm/sd-cli 12.7.7 → 12.7.9
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/dist/entry/sd-cli-ai-command.js +21 -22
- package/dist/entry/sd-cli-ai-command.js.map +1 -1
- package/dist/entry/sd-cli-cordova.d.ts +1 -1
- package/dist/entry/sd-cli-cordova.js +20 -14
- package/dist/entry/sd-cli-cordova.js.map +1 -1
- package/dist/entry/sd-cli-electron.d.ts +1 -1
- package/dist/entry/sd-cli-electron.js +2 -4
- package/dist/entry/sd-cli-electron.js.map +1 -1
- package/dist/entry/sd-cli-local-update.js +0 -1
- package/dist/entry/sd-cli-local-update.js.map +1 -1
- package/dist/entry/sd-cli-project.js +25 -16
- package/dist/entry/sd-cli-project.js.map +1 -1
- package/dist/pkg-builders/client/sd-cli-ng-routes.file-generator.js +1 -1
- package/dist/pkg-builders/client/sd-client.build-runner.d.ts +3 -3
- package/dist/pkg-builders/client/sd-client.build-runner.js +0 -3
- package/dist/pkg-builders/client/sd-client.build-runner.js.map +1 -1
- package/dist/pkg-builders/client/sd-ng.bundler.d.ts +3 -3
- package/dist/pkg-builders/client/sd-ng.bundler.js +4 -10
- package/dist/pkg-builders/client/sd-ng.bundler.js.map +1 -1
- package/dist/pkg-builders/client/sd-ng.plugin-creator.d.ts +2 -2
- package/dist/pkg-builders/client/sd-ng.plugin-creator.js +1 -4
- package/dist/pkg-builders/client/sd-ng.plugin-creator.js.map +1 -1
- package/dist/pkg-builders/lib/sd-js-lib.build-runner.d.ts +2 -2
- package/dist/pkg-builders/lib/sd-js-lib.build-runner.js +0 -3
- package/dist/pkg-builders/lib/sd-js-lib.build-runner.js.map +1 -1
- package/dist/pkg-builders/lib/sd-ts-lib.build-runner.d.ts +2 -2
- package/dist/pkg-builders/lib/sd-ts-lib.build-runner.js +0 -2
- package/dist/pkg-builders/lib/sd-ts-lib.build-runner.js.map +1 -1
- package/dist/pkg-builders/lib/sd-ts-lib.builder.d.ts +2 -2
- package/dist/pkg-builders/lib/sd-ts-lib.builder.js +0 -1
- package/dist/pkg-builders/lib/sd-ts-lib.builder.js.map +1 -1
- package/dist/pkg-builders/sd-multi.build-runner.d.ts +2 -2
- package/dist/pkg-builders/sd-multi.build-runner.js +0 -5
- package/dist/pkg-builders/sd-multi.build-runner.js.map +1 -1
- package/dist/pkg-builders/server/sd-server.build-runner.d.ts +3 -3
- package/dist/pkg-builders/server/sd-server.build-runner.js +10 -8
- package/dist/pkg-builders/server/sd-server.build-runner.js.map +1 -1
- package/dist/pkg-builders/server/sd-server.bundler.d.ts +2 -2
- package/dist/pkg-builders/server/sd-server.bundler.js +0 -2
- package/dist/pkg-builders/server/sd-server.bundler.js.map +1 -1
- package/dist/pkg-builders/server/sd-server.plugin-creator.d.ts +2 -2
- package/dist/pkg-builders/server/sd-server.plugin-creator.js +0 -3
- package/dist/pkg-builders/server/sd-server.plugin-creator.js.map +1 -1
- package/dist/ts-compiler/sd-ts-compiler.d.ts +2 -2
- package/dist/ts-compiler/sd-ts-compiler.js +0 -3
- package/dist/ts-compiler/sd-ts-compiler.js.map +1 -1
- package/dist/types/build-plugin.types.d.ts +1 -1
- package/dist/types/build-plugin.types.js +1 -2
- package/dist/types/build-plugin.types.js.map +1 -1
- package/dist/types/build-runner.types.d.ts +2 -2
- package/dist/types/build-runner.types.js +1 -2
- package/dist/types/build-runner.types.js.map +1 -1
- package/dist/types/build.types.d.ts +1 -1
- package/dist/types/build.types.js +1 -1
- package/dist/types/build.types.js.map +1 -1
- package/dist/types/ts-compiler.types.d.ts +3 -3
- package/dist/types/ts-compiler.types.js +1 -4
- package/dist/types/ts-compiler.types.js.map +1 -1
- package/dist/types/worker.types.d.ts +2 -2
- package/dist/types/worker.types.js +1 -2
- package/dist/types/worker.types.js.map +1 -1
- package/dist/utils/sd-cli-convert-message.utils.d.ts +2 -2
- package/dist/utils/sd-cli-convert-message.utils.js +0 -3
- package/dist/utils/sd-cli-convert-message.utils.js.map +1 -1
- package/dist/workers/build-runner.worker.js +0 -3
- package/dist/workers/build-runner.worker.js.map +1 -1
- package/dist/workers/server.worker.js +0 -1
- package/dist/workers/server.worker.js.map +1 -1
- package/package.json +6 -6
- package/src/entry/sd-cli-ai-command.ts +23 -25
- package/src/entry/sd-cli-cordova.ts +67 -38
- package/src/entry/sd-cli-electron.ts +4 -4
- package/src/entry/sd-cli-local-update.ts +1 -1
- package/src/entry/sd-cli-project.ts +67 -28
- package/src/pkg-builders/client/sd-cli-ng-routes.file-generator.ts +1 -1
- package/src/pkg-builders/client/sd-client.build-runner.ts +4 -4
- package/src/pkg-builders/client/sd-ng.bundler.ts +15 -15
- package/src/pkg-builders/client/sd-ng.plugin-creator.ts +4 -4
- package/src/pkg-builders/lib/sd-js-lib.build-runner.ts +2 -2
- package/src/pkg-builders/lib/sd-ts-lib.build-runner.ts +3 -3
- package/src/pkg-builders/lib/sd-ts-lib.builder.ts +2 -2
- package/src/pkg-builders/sd-multi.build-runner.ts +6 -6
- package/src/pkg-builders/server/sd-server.build-runner.ts +54 -38
- package/src/pkg-builders/server/sd-server.bundler.ts +4 -4
- package/src/pkg-builders/server/sd-server.plugin-creator.ts +3 -3
- package/src/ts-compiler/sd-ts-compiler.ts +6 -6
- package/src/types/build-plugin.types.ts +1 -1
- package/src/types/build-runner.types.ts +2 -2
- package/src/types/build.types.ts +1 -1
- package/src/types/ts-compiler.types.ts +3 -3
- package/src/types/worker.types.ts +2 -2
- package/src/utils/sd-cli-convert-message.utils.ts +2 -2
- package/src/workers/build-runner.worker.ts +3 -3
- package/src/workers/server.worker.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from "events";
|
|
2
|
-
import { FsUtils,
|
|
2
|
+
import { FsUtils, PathUtils, SdFsWatcher, SdLogger, TNormPath } from "@simplysm/sd-core-node";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { StringUtils } from "@simplysm/sd-core-common";
|
|
5
5
|
import { SdServerBundler } from "./sd-server.bundler";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { ISdProjectConfig, ISdServerPackageConfig } from "../../types/config.types";
|
|
7
|
+
import { ISdBuildMessage, ISdBuildRunnerResult } from "../../types/build.types";
|
|
8
|
+
import { INpmConfig, ITsConfig } from "../../types/common-configs.types";
|
|
9
9
|
|
|
10
10
|
export class SdServerBuildRunner extends EventEmitter {
|
|
11
11
|
private _logger = SdLogger.get(["simplysm", "sd-cli", "SdCliServerBuildRunner"]);
|
|
@@ -56,30 +56,34 @@ export class SdServerBuildRunner extends EventEmitter {
|
|
|
56
56
|
|
|
57
57
|
this._debug("WATCH...");
|
|
58
58
|
let lastWatchFileSet = result.watchFileSet;
|
|
59
|
-
SdFsWatcher.watch(Array.from(this._watchScopePathSet))
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
59
|
+
SdFsWatcher.watch(Array.from(this._watchScopePathSet))
|
|
60
|
+
.onChange({ delay: 100 }, async (changeInfos) => {
|
|
61
|
+
const currentChangeInfos = changeInfos.filter((item) => lastWatchFileSet.has(item.path));
|
|
62
|
+
if (currentChangeInfos.length < 1) return;
|
|
63
|
+
|
|
64
|
+
this.emit("change");
|
|
65
|
+
|
|
66
|
+
const watchResult = await this._runAsync(
|
|
67
|
+
true,
|
|
68
|
+
new Set(currentChangeInfos.map((item) => PathUtils.norm(item.path))),
|
|
69
|
+
);
|
|
70
|
+
const watchRes: ISdBuildRunnerResult = {
|
|
71
|
+
affectedFilePathSet: watchResult.affectedFileSet,
|
|
72
|
+
buildMessages: watchResult.buildMessages,
|
|
73
|
+
emitFileSet: watchResult.emitFileSet,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
this.emit("complete", watchRes);
|
|
77
|
+
|
|
78
|
+
lastWatchFileSet = watchResult.watchFileSet;
|
|
79
|
+
});
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
public async buildAsync(): Promise<ISdBuildRunnerResult> {
|
|
82
|
-
const projNpmConfig = FsUtils.readJson(path.resolve(
|
|
83
|
+
const projNpmConfig = FsUtils.readJson(path.resolve(
|
|
84
|
+
process.cwd(),
|
|
85
|
+
"package.json",
|
|
86
|
+
)) as INpmConfig;
|
|
83
87
|
const npmConfig = FsUtils.readJson(path.resolve(this._pkgPath, "package.json")) as INpmConfig;
|
|
84
88
|
const extModules = await this._getExternalModulesAsync();
|
|
85
89
|
|
|
@@ -113,12 +117,19 @@ export class SdServerBuildRunner extends EventEmitter {
|
|
|
113
117
|
|
|
114
118
|
distNpmConfig.volta = projNpmConfig.volta;
|
|
115
119
|
|
|
116
|
-
FsUtils.writeJson(
|
|
120
|
+
FsUtils.writeJson(
|
|
121
|
+
path.resolve(this._pkgPath, "dist/package.json"),
|
|
122
|
+
distNpmConfig,
|
|
123
|
+
{ space: 2 },
|
|
124
|
+
);
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
this._debug("GEN .yarnrc.yml...");
|
|
120
128
|
{
|
|
121
|
-
FsUtils.writeFile(
|
|
129
|
+
FsUtils.writeFile(
|
|
130
|
+
path.resolve(this._pkgPath, "dist/.yarnrc.yml"),
|
|
131
|
+
"nodeLinker: node-modules",
|
|
132
|
+
);
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
this._debug("GEN openssl.cnf...");
|
|
@@ -194,18 +205,19 @@ Options = UnsafeLegacyRenegotiation`.trim(),
|
|
|
194
205
|
this._debug("GEN web.config...");
|
|
195
206
|
|
|
196
207
|
const iisDistPath = path.resolve(this._pkgPath, "dist/web.config");
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
208
|
+
const nodeVersion = process.versions.node.substring(1);
|
|
209
|
+
const serverExeFilePath = this._pkgConf.iis.nodeExeFilePath
|
|
210
|
+
?? `%HOMEDRIVE%%HOMEPATH%\\AppData\\Local\\Volta\\tools\\image\\node\\${nodeVersion}\\node.exe`;
|
|
211
|
+
|
|
212
|
+
FsUtils.writeFile(iisDistPath, `
|
|
201
213
|
<configuration>
|
|
202
214
|
<appSettings>
|
|
203
215
|
<add key="NODE_ENV" value="production" />
|
|
204
216
|
<add key="TZ" value="Asia/Seoul" />
|
|
205
217
|
<add key="SD_VERSION" value="${npmConfig.version}" />
|
|
206
218
|
${Object.keys(this._pkgConf.env ?? {})
|
|
207
|
-
|
|
208
|
-
|
|
219
|
+
.map((key) => `<add key="${key}" value="${this._pkgConf.env![key]}"/>`)
|
|
220
|
+
.join("\n ")}
|
|
209
221
|
</appSettings>
|
|
210
222
|
<system.webServer>
|
|
211
223
|
<handlers>
|
|
@@ -225,9 +237,7 @@ Options = UnsafeLegacyRenegotiation`.trim(),
|
|
|
225
237
|
<httpErrors errorMode="Detailed" />
|
|
226
238
|
</system.webServer>
|
|
227
239
|
</configuration>
|
|
228
|
-
|
|
229
|
-
`.trim(),
|
|
230
|
-
);
|
|
240
|
+
`.trim());
|
|
231
241
|
}
|
|
232
242
|
|
|
233
243
|
const result = await this._runAsync(false);
|
|
@@ -266,7 +276,10 @@ Options = UnsafeLegacyRenegotiation`.trim(),
|
|
|
266
276
|
...FsUtils.glob(path.resolve(this._pkgPath, "src/workers/*.ts")),
|
|
267
277
|
],
|
|
268
278
|
external: this._extModules.map((item) => item.name),
|
|
269
|
-
watchScopePaths: [
|
|
279
|
+
watchScopePaths: [
|
|
280
|
+
path.resolve(this._pkgPath, "../"),
|
|
281
|
+
...localUpdatePaths,
|
|
282
|
+
].map((item) => PathUtils.norm(item)),
|
|
270
283
|
});
|
|
271
284
|
|
|
272
285
|
this._debug(`BUILD...`);
|
|
@@ -305,7 +318,10 @@ Options = UnsafeLegacyRenegotiation`.trim(),
|
|
|
305
318
|
const npmConfigMap = new Map<string, INpmConfig>();
|
|
306
319
|
|
|
307
320
|
const fn = async (currPath: string): Promise<void> => {
|
|
308
|
-
const npmConfig = npmConfigMap.getOrCreate(
|
|
321
|
+
const npmConfig = npmConfigMap.getOrCreate(
|
|
322
|
+
currPath,
|
|
323
|
+
FsUtils.readJson(path.resolve(currPath, "package.json")),
|
|
324
|
+
);
|
|
309
325
|
|
|
310
326
|
const deps = {
|
|
311
327
|
defaults: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import esbuild from "esbuild";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { FsUtils, SdLogger, PathUtils,
|
|
3
|
+
import { FsUtils, SdLogger, PathUtils, TNormPath } from "@simplysm/sd-core-node";
|
|
4
4
|
import { SdCliConvertMessageUtils } from "../../utils/sd-cli-convert-message.utils";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ISdCliServerPluginResultCache } from "../../types/build-plugin.types";
|
|
6
|
+
import { ISdBuildMessage } from "../../types/build.types";
|
|
7
7
|
import { createSdServerPlugin } from "./sd-server.plugin-creator";
|
|
8
|
-
import {
|
|
8
|
+
import { BuildOutputFile, BuildOutputFileType } from "@angular/build/src/tools/esbuild/bundler-context";
|
|
9
9
|
import { convertOutputFile } from "@angular/build/src/tools/esbuild/utils";
|
|
10
10
|
import { resolveAssets } from "@angular/build/src/utils/resolve-assets";
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import esbuild from "esbuild";
|
|
2
2
|
import { SdCliConvertMessageUtils } from "../../utils/sd-cli-convert-message.utils";
|
|
3
|
-
import {
|
|
4
|
-
import { PathUtils,
|
|
5
|
-
import {
|
|
3
|
+
import { ISdCliServerPluginResultCache } from "../../types/build-plugin.types";
|
|
4
|
+
import { PathUtils, TNormPath } from "@simplysm/sd-core-node";
|
|
5
|
+
import { ISdTsCompilerResult } from "../../types/ts-compiler.types";
|
|
6
6
|
import { SdTsCompiler } from "../../ts-compiler/sd-ts-compiler";
|
|
7
7
|
|
|
8
8
|
export function createSdServerPlugin(conf: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { FsUtils, SdLogger, PathUtils,
|
|
3
|
+
import { FsUtils, SdLogger, PathUtils, TNormPath } from "@simplysm/sd-core-node";
|
|
4
4
|
import { StringUtils } from "@simplysm/sd-core-common";
|
|
5
5
|
import { NgtscProgram, OptimizeFor } from "@angular/compiler-cli";
|
|
6
6
|
import {
|
|
7
7
|
ComponentStylesheetBundler,
|
|
8
8
|
} from "@angular/build/src/tools/esbuild/angular/component-stylesheets";
|
|
9
|
-
import {
|
|
9
|
+
import { AngularCompilerHost } from "@angular/build/src/tools/angular/angular-host";
|
|
10
10
|
import { transformSupportedBrowsersToTargets } from "@angular/build/src/tools/esbuild/utils";
|
|
11
11
|
import browserslist from "browserslist";
|
|
12
12
|
import {
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
import { SdCliPerformanceTimer } from "../utils/sd-cli-performance-time";
|
|
16
16
|
import { SdCliConvertMessageUtils } from "../utils/sd-cli-convert-message.utils";
|
|
17
17
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
ISdTsCompilerResult,
|
|
19
|
+
IStylesheetBundlingResult,
|
|
20
|
+
SdTsCompilerOptions,
|
|
21
21
|
} from "../types/ts-compiler.types";
|
|
22
|
-
import {
|
|
22
|
+
import { ISdBuildMessage } from "../types/build.types";
|
|
23
23
|
import {
|
|
24
24
|
createWorkerTransformer,
|
|
25
25
|
} from "@angular/build/src/tools/angular/transformers/web-worker-transformer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { TNormPath } from "@simplysm/sd-core-node";
|
|
2
|
+
import { ISdProjectConfig } from "./config.types";
|
|
3
3
|
|
|
4
4
|
export interface ISdBuildRunnerWorkerRequest {
|
|
5
5
|
cmd: "watch" | "build";
|
package/src/types/build.types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CompilerOptions } from "typescript";
|
|
2
2
|
import esbuild from "esbuild";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ISdBuildMessage } from "./build.types";
|
|
4
|
+
import { TNormPath } from "@simplysm/sd-core-node";
|
|
5
5
|
|
|
6
6
|
export interface SdTsCompilerOptions {
|
|
7
7
|
pkgPath: TNormPath;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ISdBuildRunnerWorkerRequest } from "./build-runner.types";
|
|
2
|
+
import { ISdBuildMessage, ISdBuildRunnerResult } from "./build.types";
|
|
3
3
|
|
|
4
4
|
export interface TServerWorkerType {
|
|
5
5
|
methods: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import os from "os";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import {
|
|
4
|
+
import { PartialMessage } from "esbuild";
|
|
5
5
|
import { ESLint } from "eslint";
|
|
6
|
-
import {
|
|
6
|
+
import { ISdBuildMessage } from "../types/build.types";
|
|
7
7
|
import { PathUtils } from "@simplysm/sd-core-node";
|
|
8
8
|
|
|
9
9
|
export class SdCliConvertMessageUtils {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createSdWorker, FsUtils, SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
2
|
-
import {
|
|
2
|
+
import { ISdBuildMessage } from "../types/build.types";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { SdServerBuildRunner } from "../pkg-builders/server/sd-server.build-runner";
|
|
5
5
|
import { SdClientBuildRunner } from "../pkg-builders/client/sd-client.build-runner";
|
|
6
6
|
import { SdTsLibBuildRunner } from "../pkg-builders/lib/sd-ts-lib.build-runner";
|
|
7
7
|
import { SdJsLibBuildRunner } from "../pkg-builders/lib/sd-js-lib.build-runner";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { TSdBuildRunnerWorkerType } from "../types/worker.types";
|
|
9
|
+
import { ISdBuildRunnerWorkerRequest } from "../types/build-runner.types";
|
|
10
10
|
import { EventEmitter } from "events";
|
|
11
11
|
|
|
12
12
|
Error.stackTraceLimit = Infinity;
|
|
@@ -3,7 +3,7 @@ import { pathToFileURL } from "url";
|
|
|
3
3
|
import { SdServiceServer } from "@simplysm/sd-service-server";
|
|
4
4
|
import { createSdWorker, SdLogger, SdLoggerSeverity } from "@simplysm/sd-core-node";
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
|
-
import {
|
|
6
|
+
import { TServerWorkerType } from "../types/worker.types";
|
|
7
7
|
|
|
8
8
|
Error.stackTraceLimit = Infinity;
|
|
9
9
|
EventEmitter.defaultMaxListeners = 0;
|