@simplysm/sd-cli 7.0.263 → 7.0.266

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 (78) hide show
  1. package/README.md +69 -22
  2. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-128x128.png +0 -0
  3. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-144x144.png +0 -0
  4. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-152x152.png +0 -0
  5. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-192x192.png +0 -0
  6. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-384x384.png +0 -0
  7. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-512x512.png +0 -0
  8. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-72x72.png +0 -0
  9. package/{src/entry-points/file/assets → assets/client-files}/assets/icons/icon-96x96.png +0 -0
  10. package/{src/entry-points/file/assets → assets/client-files}/favicon.ico +0 -0
  11. package/dist/bin/sd-cli.mjs +44 -5
  12. package/dist/build-tool/SdCliCordova.mjs +3 -3
  13. package/dist/build-tool/SdCliIndexFileGenerator.mjs +2 -3
  14. package/dist/builder/SdCliClientBuilder.d.ts +2 -0
  15. package/dist/builder/SdCliClientBuilder.mjs +45 -12
  16. package/dist/builder/SdCliServerBuilder.d.ts +2 -0
  17. package/dist/builder/SdCliServerBuilder.mjs +27 -13
  18. package/dist/entry-points/SdCliPrepare.mjs +34 -34
  19. package/dist/entry-points/SdCliProjectGenerator.d.ts +7 -0
  20. package/dist/entry-points/SdCliProjectGenerator.mjs +65 -33
  21. package/dist/entry-points/file/base/fc_package_eslintrc.mjs +11 -11
  22. package/dist/entry-points/file/base/fc_package_tsconfig.d.ts +1 -0
  23. package/dist/entry-points/file/base/fc_package_tsconfig.mjs +3 -2
  24. package/dist/entry-points/file/client/fc_package_AppModule.mjs +1 -1
  25. package/dist/entry-points/file/client/fc_package_AppPage.mjs +2 -22
  26. package/dist/entry-points/file/client/fc_package_Page.d.ts +4 -0
  27. package/dist/entry-points/file/client/fc_package_Page.mjs +19 -0
  28. package/dist/entry-points/file/project/fc_project_gitignore.mjs +1 -1
  29. package/dist/entry-points/file/project/fc_project_readme.mjs +3 -2
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.mjs +2 -2
  32. package/dist/ng-tools/SdCliNgModuleGenerator.mjs +35 -36
  33. package/dist/packages/SdCliPackage.mjs +2 -2
  34. package/docs/client-add-page.md +8 -0
  35. package/docs/client-router.md +85 -0
  36. package/docs/client-sw.md +101 -0
  37. package/docs/conf-orm.md +81 -0
  38. package/docs/conf-usage.md +5 -0
  39. package/docs/lib-local-update.md +50 -0
  40. package/docs/lib-ts-paths.md +25 -0
  41. package/package.json +6 -6
  42. package/src/SdCliBuildResultError.ts +9 -9
  43. package/src/bin/sd-cli.ts +48 -5
  44. package/src/build-tool/SdCliCacheCompilerHost.ts +77 -77
  45. package/src/build-tool/SdCliCordova.ts +2 -2
  46. package/src/build-tool/SdCliGithubApi.ts +110 -110
  47. package/src/build-tool/SdCliIndexFileGenerator.ts +79 -80
  48. package/src/build-tool/SdCliNgCacheCompilerHost.ts +58 -58
  49. package/src/build-tool/SdCliPackageLinter.ts +74 -74
  50. package/src/builder/SdCliClientBuilder.ts +58 -13
  51. package/src/builder/SdCliServerBuilder.ts +34 -14
  52. package/src/entry-points/SdCliFileCrypto.ts +87 -87
  53. package/src/entry-points/SdCliPrepare.ts +55 -55
  54. package/src/entry-points/SdCliProjectGenerator.ts +80 -38
  55. package/src/entry-points/file/base/fc_package_eslintrc.ts +10 -10
  56. package/src/entry-points/file/base/fc_package_tsconfig.ts +3 -2
  57. package/src/entry-points/file/client/fc_package_AppModule.ts +1 -1
  58. package/src/entry-points/file/client/fc_package_AppPage.ts +1 -21
  59. package/src/entry-points/file/client/fc_package_Page.ts +19 -0
  60. package/src/entry-points/file/project/fc_project_gitignore.ts +1 -1
  61. package/src/entry-points/file/project/fc_project_readme.ts +2 -1
  62. package/src/index.ts +55 -55
  63. package/src/ng-tools/SdCliNgModuleGenerator.ts +639 -640
  64. package/src/ng-tools/babel/SdCliBbFileMetadata.ts +568 -568
  65. package/src/ng-tools/babel/SdCliBbRootMetadata.ts +239 -239
  66. package/src/ng-tools/babel/SdCliBbUtil.ts +15 -15
  67. package/src/ng-tools/babel/TSdCliBbNgMetadata.ts +234 -234
  68. package/src/ng-tools/babel/TSdCliBbTypeMetadata.ts +177 -177
  69. package/src/ng-tools/commons.ts +3 -3
  70. package/src/ng-tools/typescript/SdCliTsFileMetadata.ts +384 -384
  71. package/src/ng-tools/typescript/SdCliTsRootMetadata.ts +32 -32
  72. package/src/ng-tools/typescript/SdCliTsUtil.ts +29 -29
  73. package/src/packages/SdCliPackage.ts +1 -1
  74. package/src/utils/SdCliConfigUtil.ts +94 -94
  75. package/src/utils/SdCliNpmConfigUtil.ts +16 -16
  76. package/dist/entry-points/file/client/fc_package_appicons.d.ts +0 -1
  77. package/dist/entry-points/file/client/fc_package_appicons.mjs +0 -6
  78. package/src/entry-points/file/client/fc_package_appicons.ts +0 -5
@@ -1,32 +1,32 @@
1
- import path from "path";
2
- import ts from "typescript";
3
- import { FsUtil } from "@simplysm/sd-core-node";
4
- import { SdCliTsFileMetadata } from "./SdCliTsFileMetadata";
5
-
6
- export class SdCliTsRootMetadata {
7
- private readonly _fileMetaCache = new Map<string, SdCliTsFileMetadata>();
8
-
9
- public constructor(private readonly _packagePath: string) {
10
- }
11
-
12
- public removeCaches(filePaths: string[]): void {
13
- for (const filePath of filePaths) {
14
- this._fileMetaCache.delete(filePath);
15
- }
16
- }
17
-
18
- public getFileMetas(): SdCliTsFileMetadata[] {
19
- const tsconfigPath = path.resolve(this._packagePath, "tsconfig-build.json");
20
- const tsconfig = FsUtil.readJson(tsconfigPath);
21
- const parsedTsconfig = ts.parseJsonConfigFileContent(tsconfig, ts.sys, this._packagePath, tsconfig.angularCompilerOptions);
22
-
23
- const result: SdCliTsFileMetadata[] = [];
24
- for (const fileName of parsedTsconfig.fileNames) {
25
- const filePath = path.resolve(fileName);
26
- const fileMeta = this._fileMetaCache.getOrCreate(filePath, () => new SdCliTsFileMetadata(filePath));
27
- result.push(fileMeta);
28
- }
29
-
30
- return result;
31
- }
32
- }
1
+ import path from "path";
2
+ import ts from "typescript";
3
+ import { FsUtil } from "@simplysm/sd-core-node";
4
+ import { SdCliTsFileMetadata } from "./SdCliTsFileMetadata";
5
+
6
+ export class SdCliTsRootMetadata {
7
+ private readonly _fileMetaCache = new Map<string, SdCliTsFileMetadata>();
8
+
9
+ public constructor(private readonly _packagePath: string) {
10
+ }
11
+
12
+ public removeCaches(filePaths: string[]): void {
13
+ for (const filePath of filePaths) {
14
+ this._fileMetaCache.delete(filePath);
15
+ }
16
+ }
17
+
18
+ public getFileMetas(): SdCliTsFileMetadata[] {
19
+ const tsconfigPath = path.resolve(this._packagePath, "tsconfig-build.json");
20
+ const tsconfig = FsUtil.readJson(tsconfigPath);
21
+ const parsedTsconfig = ts.parseJsonConfigFileContent(tsconfig, ts.sys, this._packagePath, tsconfig.angularCompilerOptions);
22
+
23
+ const result: SdCliTsFileMetadata[] = [];
24
+ for (const fileName of parsedTsconfig.fileNames) {
25
+ const filePath = path.resolve(fileName);
26
+ const fileMeta = this._fileMetaCache.getOrCreate(filePath, () => new SdCliTsFileMetadata(filePath));
27
+ result.push(fileMeta);
28
+ }
29
+
30
+ return result;
31
+ }
32
+ }
@@ -1,29 +1,29 @@
1
- import ts from "typescript";
2
- import { SdCliBuildResultError } from "../../SdCliBuildResultError";
3
- import path from "path";
4
-
5
- export class SdCliTsUtil {
6
- public static error(message: string, sourceFile: ts.SourceFile, meta?: ts.Node): SdCliBuildResultError {
7
- if (meta) {
8
- const pos = sourceFile.getLineAndCharacterOfPosition(meta.getStart());
9
- return new SdCliBuildResultError({
10
- filePath: path.resolve(sourceFile.fileName),
11
- line: pos.line,
12
- char: pos.character,
13
- code: undefined,
14
- severity: "error",
15
- message: message
16
- });
17
- }
18
- else {
19
- return new SdCliBuildResultError({
20
- filePath: path.resolve(sourceFile.fileName),
21
- line: undefined,
22
- char: undefined,
23
- code: undefined,
24
- severity: "error",
25
- message: message
26
- });
27
- }
28
- }
29
- }
1
+ import ts from "typescript";
2
+ import { SdCliBuildResultError } from "../../SdCliBuildResultError";
3
+ import path from "path";
4
+
5
+ export class SdCliTsUtil {
6
+ public static error(message: string, sourceFile: ts.SourceFile, meta?: ts.Node): SdCliBuildResultError {
7
+ if (meta) {
8
+ const pos = sourceFile.getLineAndCharacterOfPosition(meta.getStart());
9
+ return new SdCliBuildResultError({
10
+ filePath: path.resolve(sourceFile.fileName),
11
+ line: pos.line,
12
+ char: pos.character,
13
+ code: undefined,
14
+ severity: "error",
15
+ message: message
16
+ });
17
+ }
18
+ else {
19
+ return new SdCliBuildResultError({
20
+ filePath: path.resolve(sourceFile.fileName),
21
+ line: undefined,
22
+ char: undefined,
23
+ code: undefined,
24
+ severity: "error",
25
+ message: message
26
+ });
27
+ }
28
+ }
29
+ }
@@ -178,7 +178,7 @@ export class SdCliPackage extends EventEmitter {
178
178
  return process.env[envName] ?? item;
179
179
  });
180
180
 
181
- const filePaths = await FsUtil.globAsync(path.resolve(this.rootPath, "**", "*"), {
181
+ const filePaths = await FsUtil.globAsync(path.resolve(parsedTsconfig.options.outDir!, "**", "*"), {
182
182
  dot: true,
183
183
  nodir: true
184
184
  });
@@ -1,94 +1,94 @@
1
- import { ISdCliConfig, TSdCliPackageConfig } from "../commons";
2
- import { FsUtil } from "@simplysm/sd-core-node";
3
- import { ObjectUtil } from "@simplysm/sd-core-common";
4
- import path from "path";
5
-
6
- export class SdCliConfigUtil {
7
- public static async loadConfigAsync(confFilePath: string, isDev: boolean, opts?: string[]): Promise<ISdCliConfig> {
8
- const confFileCont = await FsUtil.readJsonAsync(confFilePath);
9
- let conf = this._getConfigFromFileContent(confFileCont, isDev, opts);
10
-
11
- // extends
12
- if (conf.extends) {
13
- for (const extConfFilePath of conf.extends) {
14
- const extConf = await this.loadConfigAsync(path.resolve(path.dirname(confFilePath), extConfFilePath), isDev, opts);
15
- conf = this._mergeObj(extConf, conf);
16
- }
17
- }
18
- delete conf["extends"];
19
-
20
- return conf as ISdCliConfig;
21
- }
22
-
23
- private static _getConfigFromFileContent(confFileCont: ISdCliConfigFileContent, isDev: boolean, opts?: string[]): ISdCliConfigFileContent {
24
- const conf = ObjectUtil.clone(confFileCont);
25
-
26
- if (conf.packages) {
27
- for (const pkgName of Object.keys(conf.packages)) {
28
- conf.packages[pkgName] = this._getPkgConfigFromFileContent(conf, conf.packages[pkgName], isDev, opts);
29
- }
30
- }
31
- return conf;
32
- }
33
-
34
- private static _getPkgConfigFromFileContent(confFileCont: ISdCliConfigFileContent, pkgConfFileCont: TSdCliPackageConfigFileContent, isDev: boolean, opts?: string[]): TSdCliPackageConfig {
35
- let pkgConf = ObjectUtil.clone(pkgConfFileCont);
36
-
37
- // override
38
- const pkgOvrNames = pkgConf.overrides;
39
- if (pkgOvrNames) {
40
- for (const pkgOvrName of pkgOvrNames) {
41
- const rootOvr = confFileCont.overrides?.[pkgOvrName];
42
- if (rootOvr) {
43
- const ovrConf = this._getPkgConfigFromFileContent(confFileCont, rootOvr, isDev, opts);
44
- pkgConf = this._mergeObj(pkgConf, ovrConf);
45
- }
46
- }
47
- delete pkgConf.overrides;
48
- }
49
-
50
-
51
- // mode 처리
52
- const mode = isDev ? "dev" : "prod";
53
- if (pkgConf[mode] !== undefined) {
54
- const modeConf = this._getPkgConfigFromFileContent(confFileCont, pkgConf[mode], isDev, opts);
55
- pkgConf = this._mergeObj(pkgConf, modeConf);
56
- }
57
- delete pkgConf["dev"];
58
- delete pkgConf["prod"];
59
-
60
- // options
61
- if (opts && opts.length > 0) {
62
- const pkgOpts = Object.keys(pkgConf).filter((key) => key.startsWith("@") && opts.some((opt) => opt === key.slice(1)));
63
-
64
- for (const pkgOpt of pkgOpts) {
65
- const optConf = this._getPkgConfigFromFileContent(confFileCont, pkgConf[pkgOpt], isDev, opts);
66
- pkgConf = this._mergeObj(pkgConf, optConf);
67
- }
68
-
69
- for (const optKey of Object.keys(pkgConf).filter((item) => item.startsWith("@"))) {
70
- delete pkgConf[optKey];
71
- }
72
- }
73
-
74
- return pkgConf;
75
- }
76
-
77
- private static _mergeObj<A, B>(orig: A, target: B): A & B {
78
- return ObjectUtil.merge(orig, target, {
79
- arrayProcess: "replace",
80
- useDelTargetNull: true
81
- });
82
- }
83
- }
84
-
85
- interface ISdCliConfigFileContent {
86
- packages?: Record<string, TSdCliPackageConfigFileContent>;
87
- overrides?: Record<string, TSdCliPackageConfigFileContent>;
88
- extends?: string[];
89
- }
90
-
91
- type TSdCliPackageConfigFileContent =
92
- TSdCliPackageConfig
93
- & { overrides?: string[] }
94
- & Record<string, any>;
1
+ import { ISdCliConfig, TSdCliPackageConfig } from "../commons";
2
+ import { FsUtil } from "@simplysm/sd-core-node";
3
+ import { ObjectUtil } from "@simplysm/sd-core-common";
4
+ import path from "path";
5
+
6
+ export class SdCliConfigUtil {
7
+ public static async loadConfigAsync(confFilePath: string, isDev: boolean, opts?: string[]): Promise<ISdCliConfig> {
8
+ const confFileCont = await FsUtil.readJsonAsync(confFilePath);
9
+ let conf = this._getConfigFromFileContent(confFileCont, isDev, opts);
10
+
11
+ // extends
12
+ if (conf.extends) {
13
+ for (const extConfFilePath of conf.extends) {
14
+ const extConf = await this.loadConfigAsync(path.resolve(path.dirname(confFilePath), extConfFilePath), isDev, opts);
15
+ conf = this._mergeObj(extConf, conf);
16
+ }
17
+ }
18
+ delete conf["extends"];
19
+
20
+ return conf as ISdCliConfig;
21
+ }
22
+
23
+ private static _getConfigFromFileContent(confFileCont: ISdCliConfigFileContent, isDev: boolean, opts?: string[]): ISdCliConfigFileContent {
24
+ const conf = ObjectUtil.clone(confFileCont);
25
+
26
+ if (conf.packages) {
27
+ for (const pkgName of Object.keys(conf.packages)) {
28
+ conf.packages[pkgName] = this._getPkgConfigFromFileContent(conf, conf.packages[pkgName], isDev, opts);
29
+ }
30
+ }
31
+ return conf;
32
+ }
33
+
34
+ private static _getPkgConfigFromFileContent(confFileCont: ISdCliConfigFileContent, pkgConfFileCont: TSdCliPackageConfigFileContent, isDev: boolean, opts?: string[]): TSdCliPackageConfig {
35
+ let pkgConf = ObjectUtil.clone(pkgConfFileCont);
36
+
37
+ // override
38
+ const pkgOvrNames = pkgConf.overrides;
39
+ if (pkgOvrNames) {
40
+ for (const pkgOvrName of pkgOvrNames) {
41
+ const rootOvr = confFileCont.overrides?.[pkgOvrName];
42
+ if (rootOvr) {
43
+ const ovrConf = this._getPkgConfigFromFileContent(confFileCont, rootOvr, isDev, opts);
44
+ pkgConf = this._mergeObj(pkgConf, ovrConf);
45
+ }
46
+ }
47
+ delete pkgConf.overrides;
48
+ }
49
+
50
+
51
+ // mode 처리
52
+ const mode = isDev ? "dev" : "prod";
53
+ if (pkgConf[mode] !== undefined) {
54
+ const modeConf = this._getPkgConfigFromFileContent(confFileCont, pkgConf[mode], isDev, opts);
55
+ pkgConf = this._mergeObj(pkgConf, modeConf);
56
+ }
57
+ delete pkgConf["dev"];
58
+ delete pkgConf["prod"];
59
+
60
+ // options
61
+ if (opts && opts.length > 0) {
62
+ const pkgOpts = Object.keys(pkgConf).filter((key) => key.startsWith("@") && opts.some((opt) => opt === key.slice(1)));
63
+
64
+ for (const pkgOpt of pkgOpts) {
65
+ const optConf = this._getPkgConfigFromFileContent(confFileCont, pkgConf[pkgOpt], isDev, opts);
66
+ pkgConf = this._mergeObj(pkgConf, optConf);
67
+ }
68
+
69
+ for (const optKey of Object.keys(pkgConf).filter((item) => item.startsWith("@"))) {
70
+ delete pkgConf[optKey];
71
+ }
72
+ }
73
+
74
+ return pkgConf;
75
+ }
76
+
77
+ private static _mergeObj<A, B>(orig: A, target: B): A & B {
78
+ return ObjectUtil.merge(orig, target, {
79
+ arrayProcess: "replace",
80
+ useDelTargetNull: true
81
+ });
82
+ }
83
+ }
84
+
85
+ interface ISdCliConfigFileContent {
86
+ packages?: Record<string, TSdCliPackageConfigFileContent>;
87
+ overrides?: Record<string, TSdCliPackageConfigFileContent>;
88
+ extends?: string[];
89
+ }
90
+
91
+ type TSdCliPackageConfigFileContent =
92
+ TSdCliPackageConfig
93
+ & { overrides?: string[] }
94
+ & Record<string, any>;
@@ -1,16 +1,16 @@
1
- import { INpmConfig } from "../commons";
2
-
3
- export class SdCliNpmConfigUtil {
4
- public static getDependencies(npmConfig: INpmConfig): { defaults: string[]; optionals: string[] } {
5
- return {
6
- defaults: [
7
- ...Object.keys(npmConfig.dependencies ?? {}),
8
- ...Object.keys(npmConfig.peerDependencies ?? {}).filter((item) => !npmConfig.peerDependenciesMeta?.[item]?.optional)
9
- ].distinct(),
10
- optionals: [
11
- ...Object.keys(npmConfig.optionalDependencies ?? {}),
12
- ...Object.keys(npmConfig.peerDependencies ?? {}).filter((item) => npmConfig.peerDependenciesMeta?.[item]?.optional)
13
- ].distinct()
14
- };
15
- }
16
- }
1
+ import { INpmConfig } from "../commons";
2
+
3
+ export class SdCliNpmConfigUtil {
4
+ public static getDependencies(npmConfig: INpmConfig): { defaults: string[]; optionals: string[] } {
5
+ return {
6
+ defaults: [
7
+ ...Object.keys(npmConfig.dependencies ?? {}),
8
+ ...Object.keys(npmConfig.peerDependencies ?? {}).filter((item) => !npmConfig.peerDependenciesMeta?.[item]?.optional)
9
+ ].distinct(),
10
+ optionals: [
11
+ ...Object.keys(npmConfig.optionalDependencies ?? {}),
12
+ ...Object.keys(npmConfig.peerDependencies ?? {}).filter((item) => npmConfig.peerDependenciesMeta?.[item]?.optional)
13
+ ].distinct()
14
+ };
15
+ }
16
+ }
@@ -1 +0,0 @@
1
- export declare const fc_package_appicons: () => string;
@@ -1,6 +0,0 @@
1
- export const fc_package_appicons = () => /* language=ts */ `
2
-
3
- export const appIcons = {};
4
-
5
- `.trim();
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmNfcGFja2FnZV9hcHBpY29ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeS1wb2ludHMvZmlsZS9jbGllbnQvZmNfcGFja2FnZV9hcHBpY29ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxtQkFBbUIsR0FBRyxHQUFXLEVBQUUsQ0FBQyxpQkFBaUIsQ0FBQzs7OztDQUlsRSxDQUFDLElBQUksRUFBRSxDQUFDIn0=
@@ -1,5 +0,0 @@
1
- export const fc_package_appicons = (): string => /* language=ts */ `
2
-
3
- export const appIcons = {};
4
-
5
- `.trim();