@nanoforge-dev/schematics 2.1.2 → 2.1.4-beta.af6c1e0

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 (43) hide show
  1. package/dist/index.cjs +15 -46
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3 -1
  4. package/dist/index.d.cts.map +1 -0
  5. package/dist/index.d.ts +3 -1
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +10 -15
  8. package/dist/index.js.map +1 -1
  9. package/dist/libs/application/application.factory.d.ts +6 -13
  10. package/dist/libs/application/application.factory.d.ts.map +1 -0
  11. package/dist/libs/application/application.factory.js +49 -68
  12. package/dist/libs/application/application.factory.js.map +1 -1
  13. package/dist/libs/component/component.factory.d.ts +6 -6
  14. package/dist/libs/component/component.factory.d.ts.map +1 -0
  15. package/dist/libs/component/component.factory.js +32 -47
  16. package/dist/libs/component/component.factory.js.map +1 -1
  17. package/dist/libs/configuration/configuration.factory.d.ts +6 -7
  18. package/dist/libs/configuration/configuration.factory.d.ts.map +1 -0
  19. package/dist/libs/configuration/configuration.factory.js +91 -133
  20. package/dist/libs/configuration/configuration.factory.js.map +1 -1
  21. package/dist/libs/docker/docker.factory.d.ts +6 -4
  22. package/dist/libs/docker/docker.factory.d.ts.map +1 -0
  23. package/dist/libs/docker/docker.factory.js +17 -36
  24. package/dist/libs/docker/docker.factory.js.map +1 -1
  25. package/dist/libs/part-base/files/js/__nanoforgeFolder__/client.save.json +2 -2
  26. package/dist/libs/part-base/files/js/__nanoforgeFolder__/server.save.json +2 -2
  27. package/dist/libs/part-base/files/js/__part__/components/example.component.js +21 -27
  28. package/dist/libs/part-base/files/ts/__nanoforgeFolder__/client.save.json +2 -2
  29. package/dist/libs/part-base/files/ts/__nanoforgeFolder__/server.save.json +2 -2
  30. package/dist/libs/part-base/files/ts/__part__/components/example.component.ts +21 -27
  31. package/dist/libs/part-base/part-base.factory.d.ts +6 -7
  32. package/dist/libs/part-base/part-base.factory.d.ts.map +1 -0
  33. package/dist/libs/part-base/part-base.factory.js +30 -41
  34. package/dist/libs/part-base/part-base.factory.js.map +1 -1
  35. package/dist/libs/part-main/part-main.factory.d.ts +6 -9
  36. package/dist/libs/part-main/part-main.factory.d.ts.map +1 -0
  37. package/dist/libs/part-main/part-main.factory.js +225 -260
  38. package/dist/libs/part-main/part-main.factory.js.map +1 -1
  39. package/dist/libs/system/system.factory.d.ts +6 -6
  40. package/dist/libs/system/system.factory.d.ts.map +1 -0
  41. package/dist/libs/system/system.factory.js +32 -50
  42. package/dist/libs/system/system.factory.js.map +1 -1
  43. package/package.json +18 -18
package/dist/index.cjs CHANGED
@@ -1,48 +1,17 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/defaults.ts
3
+ const DEFAULT_APP_NAME = "nanoforge-app";
4
+ const DEFAULT_VERSION = "0.0.0";
5
+ const DEFAULT_AUTHOR = "";
6
+ const DEFAULT_DESCRIPTION = "";
7
+ const DEFAULT_LANGUAGE = "ts";
8
+ const DEFAULT_PACKAGE_MANAGER = "npm";
9
+ //#endregion
10
+ exports.DEFAULT_APP_NAME = DEFAULT_APP_NAME;
11
+ exports.DEFAULT_AUTHOR = DEFAULT_AUTHOR;
12
+ exports.DEFAULT_DESCRIPTION = DEFAULT_DESCRIPTION;
13
+ exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
14
+ exports.DEFAULT_PACKAGE_MANAGER = DEFAULT_PACKAGE_MANAGER;
15
+ exports.DEFAULT_VERSION = DEFAULT_VERSION;
19
16
 
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- DEFAULT_APP_NAME: () => DEFAULT_APP_NAME,
24
- DEFAULT_AUTHOR: () => DEFAULT_AUTHOR,
25
- DEFAULT_DESCRIPTION: () => DEFAULT_DESCRIPTION,
26
- DEFAULT_LANGUAGE: () => DEFAULT_LANGUAGE,
27
- DEFAULT_PACKAGE_MANAGER: () => DEFAULT_PACKAGE_MANAGER,
28
- DEFAULT_VERSION: () => DEFAULT_VERSION
29
- });
30
- module.exports = __toCommonJS(index_exports);
31
-
32
- // src/defaults.ts
33
- var DEFAULT_APP_NAME = "nanoforge-app";
34
- var DEFAULT_VERSION = "0.0.0";
35
- var DEFAULT_AUTHOR = "";
36
- var DEFAULT_DESCRIPTION = "";
37
- var DEFAULT_LANGUAGE = "ts";
38
- var DEFAULT_PACKAGE_MANAGER = "npm";
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- DEFAULT_APP_NAME,
42
- DEFAULT_AUTHOR,
43
- DEFAULT_DESCRIPTION,
44
- DEFAULT_LANGUAGE,
45
- DEFAULT_PACKAGE_MANAGER,
46
- DEFAULT_VERSION
47
- });
48
17
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/defaults.ts"],"sourcesContent":["export * from \"./defaults\";\n","export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AACzB,IAAM,0BAA0B;","names":[]}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";;AAAA,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAChC,MAAa,0BAA0B"}
package/dist/index.d.cts CHANGED
@@ -1,8 +1,10 @@
1
+ //#region src/defaults.d.ts
1
2
  declare const DEFAULT_APP_NAME = "nanoforge-app";
2
3
  declare const DEFAULT_VERSION = "0.0.0";
3
4
  declare const DEFAULT_AUTHOR = "";
4
5
  declare const DEFAULT_DESCRIPTION = "";
5
6
  declare const DEFAULT_LANGUAGE = "ts";
6
7
  declare const DEFAULT_PACKAGE_MANAGER = "npm";
7
-
8
+ //#endregion
8
9
  export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
10
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/defaults.ts"],"mappings":";cAAa,gBAAA;AAAA,cACA,eAAA;AAAA,cACA,cAAA;AAAA,cACA,mBAAA;AAAA,cACA,gBAAA;AAAA,cACA,uBAAA"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
+ //#region src/defaults.d.ts
1
2
  declare const DEFAULT_APP_NAME = "nanoforge-app";
2
3
  declare const DEFAULT_VERSION = "0.0.0";
3
4
  declare const DEFAULT_AUTHOR = "";
4
5
  declare const DEFAULT_DESCRIPTION = "";
5
6
  declare const DEFAULT_LANGUAGE = "ts";
6
7
  declare const DEFAULT_PACKAGE_MANAGER = "npm";
7
-
8
+ //#endregion
8
9
  export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/defaults.ts"],"mappings":";cAAa,gBAAA;AAAA,cACA,eAAA;AAAA,cACA,cAAA;AAAA,cACA,mBAAA;AAAA,cACA,gBAAA;AAAA,cACA,uBAAA"}
package/dist/index.js CHANGED
@@ -1,16 +1,11 @@
1
- // src/defaults.ts
2
- var DEFAULT_APP_NAME = "nanoforge-app";
3
- var DEFAULT_VERSION = "0.0.0";
4
- var DEFAULT_AUTHOR = "";
5
- var DEFAULT_DESCRIPTION = "";
6
- var DEFAULT_LANGUAGE = "ts";
7
- var DEFAULT_PACKAGE_MANAGER = "npm";
8
- export {
9
- DEFAULT_APP_NAME,
10
- DEFAULT_AUTHOR,
11
- DEFAULT_DESCRIPTION,
12
- DEFAULT_LANGUAGE,
13
- DEFAULT_PACKAGE_MANAGER,
14
- DEFAULT_VERSION
15
- };
1
+ //#region src/defaults.ts
2
+ const DEFAULT_APP_NAME = "nanoforge-app";
3
+ const DEFAULT_VERSION = "0.0.0";
4
+ const DEFAULT_AUTHOR = "";
5
+ const DEFAULT_DESCRIPTION = "";
6
+ const DEFAULT_LANGUAGE = "ts";
7
+ const DEFAULT_PACKAGE_MANAGER = "npm";
8
+ //#endregion
9
+ export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
10
+
16
11
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";AAAO,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AACzB,IAAM,0BAA0B;","names":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";AAAA,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAChC,MAAa,0BAA0B"}
@@ -1,62 +1,55 @@
1
- import { Rule } from '@angular-devkit/schematics';
1
+ import { Rule } from "@angular-devkit/schematics";
2
2
 
3
+ //#region src/libs/application/application.schema.d.ts
3
4
  interface ApplicationSchema {
4
5
  /**
5
6
  * NanoForge application name
6
7
  */
7
8
  name: string;
8
-
9
9
  /**
10
10
  * NanoForge application version
11
11
  */
12
12
  version?: string;
13
-
14
13
  /**
15
14
  * NanoForge application author
16
15
  */
17
16
  author?: string;
18
-
19
17
  /**
20
18
  * NanoForge application description
21
19
  */
22
20
  description?: string;
23
-
24
21
  /**
25
22
  * NanoForge application destination directory
26
23
  */
27
24
  directory?: string;
28
-
29
25
  /**
30
26
  * NanoForge Application language
31
27
  */
32
28
  language?: "js" | "ts";
33
-
34
29
  /**
35
30
  * With strict mode (TypeScript or JavaScript but only on compatible editor)
36
31
  */
37
32
  strict?: boolean;
38
-
39
33
  /**
40
34
  * Generate lint files
41
35
  */
42
36
  lint?: boolean;
43
-
44
37
  /**
45
38
  * The used package manager
46
39
  */
47
40
  packageManager?: "npm" | "yarn" | "pnpm" | "bun";
48
-
49
41
  /**
50
42
  * Configure a server for the application
51
43
  */
52
44
  server?: boolean;
53
-
54
45
  /**
55
46
  * Add editor dependencies
56
47
  */
57
48
  editor: boolean;
58
49
  }
59
-
50
+ //#endregion
51
+ //#region src/libs/application/application.factory.d.ts
60
52
  declare const main: (schema: ApplicationSchema) => Rule;
61
-
53
+ //#endregion
62
54
  export { main };
55
+ //# sourceMappingURL=application.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.factory.d.ts","names":["name","version","author","description","directory","language","strict","lint","packageManager","server","editor"],"sources":["../../../src/libs/application/application.schema.d.ts","../../../src/libs/application/application.factory.ts"],"mappings":";;;UAAiB,iBAAA;;;AAAjB;EAIEA,IAAAA;EAJgC;;;EAShCC,OAAAA;EAeAG;;;EAVAF,MAAAA;EAmCAO;;;EA9BAN,WAAAA;;;ACkCF;ED7BEC,SAAAA;ECmDD;;;ED9CCC,QAAAA;EC8CD;;;EDzCCC,MAAAA;;;;EAKAC,IAAAA;;;;EAKAC,cAAAA;;;;EAKAC,MAAAA;;;;EAKAC,MAAAA;AAAAA;;;cCDW,IAAA,GAAQ,MAAA,EAAQ,iBAAA,KAAoB,IAsBhD"}
@@ -1,72 +1,53 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/libs/application/application.factory.ts
5
1
  import { join, normalize, strings } from "@angular-devkit/core";
6
- import {
7
- apply,
8
- mergeWith,
9
- move,
10
- renameTemplateFiles,
11
- template,
12
- url
13
- } from "@angular-devkit/schematics";
2
+ import { apply, mergeWith, move, renameTemplateFiles, template, url } from "@angular-devkit/schematics";
14
3
  import { firstValueFrom } from "rxjs";
15
-
16
- // src/defaults.ts
17
- var DEFAULT_APP_NAME = "nanoforge-app";
18
- var DEFAULT_VERSION = "0.0.0";
19
- var DEFAULT_AUTHOR = "";
20
- var DEFAULT_DESCRIPTION = "";
21
- var DEFAULT_LANGUAGE = "ts";
22
- var DEFAULT_PACKAGE_MANAGER = "npm";
23
-
24
- // src/libs/application/application.factory.ts
25
- var transform = /* @__PURE__ */ __name((schema) => {
26
- return {
27
- name: schema.name ?? DEFAULT_APP_NAME,
28
- version: schema.version ?? DEFAULT_VERSION,
29
- author: schema.author ?? DEFAULT_AUTHOR,
30
- description: schema.description ?? DEFAULT_DESCRIPTION,
31
- language: schema.language ?? DEFAULT_LANGUAGE,
32
- strict: schema.strict ?? true,
33
- lint: schema.lint ?? true,
34
- packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,
35
- server: schema.server ?? false,
36
- editor: schema.editor ?? false
37
- };
38
- }, "transform");
39
- var generate = /* @__PURE__ */ __name((options, path) => {
40
- return apply(url(join("./files", options.language)), [
41
- template({
42
- ...strings,
43
- ...options
44
- }),
45
- renameTemplateFiles(),
46
- move(normalize(path))
47
- ]);
48
- }, "generate");
49
- var main = /* @__PURE__ */ __name((schema) => {
50
- const options = transform(schema);
51
- const path = schema.directory ?? options.name;
52
- return async (baseTree, context) => {
53
- let tree = await mergeWith(generate(options, path))(baseTree, context);
54
- if (!tree) return tree;
55
- if (!("delete" in tree)) {
56
- if (typeof tree === "function") return tree;
57
- tree = await firstValueFrom(tree);
58
- }
59
- if (!options.lint) {
60
- const basePath = join("/", path);
61
- tree.delete(join(basePath, "eslint.config.js"));
62
- tree.delete(join(basePath, "prettier.config.js"));
63
- tree.delete(join(basePath, ".prettierignore"));
64
- if (options.language === "js") tree.delete(join(basePath, "jsconfig.json"));
65
- }
66
- return tree;
67
- };
68
- }, "main");
69
- export {
70
- main
4
+ //#endregion
5
+ //#region src/libs/application/application.factory.ts
6
+ const transform = (schema) => {
7
+ return {
8
+ name: schema.name ?? "nanoforge-app",
9
+ version: schema.version ?? "0.0.0",
10
+ author: schema.author ?? "",
11
+ description: schema.description ?? "",
12
+ language: schema.language ?? "ts",
13
+ strict: schema.strict ?? true,
14
+ lint: schema.lint ?? true,
15
+ packageManager: schema.packageManager ?? "npm",
16
+ server: schema.server ?? false,
17
+ editor: schema.editor ?? false
18
+ };
71
19
  };
20
+ const generate = (options, path) => {
21
+ return apply(url(join("./files", options.language)), [
22
+ template({
23
+ ...strings,
24
+ ...options
25
+ }),
26
+ renameTemplateFiles(),
27
+ move(normalize(path))
28
+ ]);
29
+ };
30
+ const main = (schema) => {
31
+ const options = transform(schema);
32
+ const path = schema.directory ?? options.name;
33
+ return async (baseTree, context) => {
34
+ let tree = await mergeWith(generate(options, path))(baseTree, context);
35
+ if (!tree) return tree;
36
+ if (!("delete" in tree)) {
37
+ if (typeof tree === "function") return tree;
38
+ tree = await firstValueFrom(tree);
39
+ }
40
+ if (!options.lint) {
41
+ const basePath = join("/", path);
42
+ tree.delete(join(basePath, "eslint.config.js"));
43
+ tree.delete(join(basePath, "prettier.config.js"));
44
+ tree.delete(join(basePath, ".prettierignore"));
45
+ if (options.language === "js") tree.delete(join(basePath, "jsconfig.json"));
46
+ }
47
+ return tree;
48
+ };
49
+ };
50
+ //#endregion
51
+ export { main };
52
+
72
53
  //# sourceMappingURL=application.factory.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/libs/application/application.factory.ts","../../../src/defaults.ts"],"sourcesContent":["import { type Path, join, normalize, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type SchematicContext,\n type Source,\n type Tree,\n apply,\n mergeWith,\n move,\n renameTemplateFiles,\n template,\n url,\n} from \"@angular-devkit/schematics\";\nimport { firstValueFrom } from \"rxjs\";\n\nimport {\n DEFAULT_APP_NAME,\n DEFAULT_AUTHOR,\n DEFAULT_DESCRIPTION,\n DEFAULT_LANGUAGE,\n DEFAULT_PACKAGE_MANAGER,\n DEFAULT_VERSION,\n} from \"~/defaults\";\n\nimport { type ApplicationOptions } from \"./application.options\";\nimport { type ApplicationSchema } from \"./application.schema\";\n\nconst transform = (schema: ApplicationSchema): ApplicationOptions => {\n return {\n name: schema.name ?? DEFAULT_APP_NAME,\n version: schema.version ?? DEFAULT_VERSION,\n author: schema.author ?? DEFAULT_AUTHOR,\n description: schema.description ?? DEFAULT_DESCRIPTION,\n language: schema.language ?? DEFAULT_LANGUAGE,\n strict: schema.strict ?? true,\n lint: schema.lint ?? true,\n packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,\n server: schema.server ?? false,\n editor: schema.editor ?? false,\n };\n};\n\nconst generate = (options: ApplicationOptions, path: string): Source => {\n return apply(url(join(\"./files\" as Path, options.language)), [\n template({\n ...strings,\n ...options,\n }),\n renameTemplateFiles(),\n move(normalize(path)),\n ]);\n};\n\nexport const main = (schema: ApplicationSchema): Rule => {\n const options = transform(schema);\n const path = schema.directory ?? options.name;\n\n return async (baseTree: Tree, context: SchematicContext) => {\n let tree = await mergeWith(generate(options, path))(baseTree, context);\n if (!tree) return tree;\n if (!(\"delete\" in tree)) {\n if (typeof tree === \"function\") return tree;\n tree = await firstValueFrom(tree);\n }\n\n if (!options.lint) {\n const basePath = join(\"/\" as Path, path);\n tree.delete(join(basePath, \"eslint.config.js\"));\n tree.delete(join(basePath, \"prettier.config.js\"));\n tree.delete(join(basePath, \".prettierignore\"));\n if (options.language === \"js\") tree.delete(join(basePath, \"jsconfig.json\"));\n }\n\n return tree;\n };\n};\n","export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";;;;AAAA,SAAoB,MAAM,WAAW,eAAe;AACpD;AAAA,EAKE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;;;ACbxB,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AACzB,IAAM,0BAA0B;;;ADsBvC,IAAM,YAAY,wBAAC,WAAkD;AACnE,SAAO;AAAA,IACL,MAAM,OAAO,QAAQ;AAAA,IACrB,SAAS,OAAO,WAAW;AAAA,IAC3B,QAAQ,OAAO,UAAU;AAAA,IACzB,aAAa,OAAO,eAAe;AAAA,IACnC,UAAU,OAAO,YAAY;AAAA,IAC7B,QAAQ,OAAO,UAAU;AAAA,IACzB,MAAM,OAAO,QAAQ;AAAA,IACrB,gBAAgB,OAAO,kBAAkB;AAAA,IACzC,QAAQ,OAAO,UAAU;AAAA,IACzB,QAAQ,OAAO,UAAU;AAAA,EAC3B;AACF,GAbkB;AAelB,IAAM,WAAW,wBAAC,SAA6B,SAAyB;AACtE,SAAO,MAAM,IAAI,KAAK,WAAmB,QAAQ,QAAQ,CAAC,GAAG;AAAA,IAC3D,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAC;AAAA,IACD,oBAAoB;AAAA,IACpB,KAAK,UAAU,IAAI,CAAC;AAAA,EACtB,CAAC;AACH,GATiB;AAWV,IAAM,OAAO,wBAAC,WAAoC;AACvD,QAAM,UAAU,UAAU,MAAM;AAChC,QAAM,OAAO,OAAO,aAAa,QAAQ;AAEzC,SAAO,OAAO,UAAgB,YAA8B;AAC1D,QAAI,OAAO,MAAM,UAAU,SAAS,SAAS,IAAI,CAAC,EAAE,UAAU,OAAO;AACrE,QAAI,CAAC,KAAM,QAAO;AAClB,QAAI,EAAE,YAAY,OAAO;AACvB,UAAI,OAAO,SAAS,WAAY,QAAO;AACvC,aAAO,MAAM,eAAe,IAAI;AAAA,IAClC;AAEA,QAAI,CAAC,QAAQ,MAAM;AACjB,YAAM,WAAW,KAAK,KAAa,IAAI;AACvC,WAAK,OAAO,KAAK,UAAU,kBAAkB,CAAC;AAC9C,WAAK,OAAO,KAAK,UAAU,oBAAoB,CAAC;AAChD,WAAK,OAAO,KAAK,UAAU,iBAAiB,CAAC;AAC7C,UAAI,QAAQ,aAAa,KAAM,MAAK,OAAO,KAAK,UAAU,eAAe,CAAC;AAAA,IAC5E;AAEA,WAAO;AAAA,EACT;AACF,GAtBoB;","names":[]}
1
+ {"version":3,"file":"application.factory.js","names":[],"sources":["../../../src/defaults.ts","../../../src/libs/application/application.factory.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n","import { type Path, join, normalize, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type SchematicContext,\n type Source,\n type Tree,\n apply,\n mergeWith,\n move,\n renameTemplateFiles,\n template,\n url,\n} from \"@angular-devkit/schematics\";\nimport { firstValueFrom } from \"rxjs\";\n\nimport {\n DEFAULT_APP_NAME,\n DEFAULT_AUTHOR,\n DEFAULT_DESCRIPTION,\n DEFAULT_LANGUAGE,\n DEFAULT_PACKAGE_MANAGER,\n DEFAULT_VERSION,\n} from \"~/defaults\";\n\nimport { type ApplicationOptions } from \"./application.options\";\nimport { type ApplicationSchema } from \"./application.schema\";\n\nconst transform = (schema: ApplicationSchema): ApplicationOptions => {\n return {\n name: schema.name ?? DEFAULT_APP_NAME,\n version: schema.version ?? DEFAULT_VERSION,\n author: schema.author ?? DEFAULT_AUTHOR,\n description: schema.description ?? DEFAULT_DESCRIPTION,\n language: schema.language ?? DEFAULT_LANGUAGE,\n strict: schema.strict ?? true,\n lint: schema.lint ?? true,\n packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,\n server: schema.server ?? false,\n editor: schema.editor ?? false,\n };\n};\n\nconst generate = (options: ApplicationOptions, path: string): Source => {\n return apply(url(join(\"./files\" as Path, options.language)), [\n template({\n ...strings,\n ...options,\n }),\n renameTemplateFiles(),\n move(normalize(path)),\n ]);\n};\n\nexport const main = (schema: ApplicationSchema): Rule => {\n const options = transform(schema);\n const path = schema.directory ?? options.name;\n\n return async (baseTree: Tree, context: SchematicContext) => {\n let tree = await mergeWith(generate(options, path))(baseTree, context);\n if (!tree) return tree;\n if (!(\"delete\" in tree)) {\n if (typeof tree === \"function\") return tree;\n tree = await firstValueFrom(tree);\n }\n\n if (!options.lint) {\n const basePath = join(\"/\" as Path, path);\n tree.delete(join(basePath, \"eslint.config.js\"));\n tree.delete(join(basePath, \"prettier.config.js\"));\n tree.delete(join(basePath, \".prettierignore\"));\n if (options.language === \"js\") tree.delete(join(basePath, \"jsconfig.json\"));\n }\n\n return tree;\n };\n};\n"],"mappings":";;;;;AC2BA,MAAM,aAAa,WAAkD;CACnE,OAAO;EACL,MAAM,OAAO,QAAA;EACb,SAAS,OAAO,WAAA;EAChB,QAAQ,OAAO,UAAA;EACf,aAAa,OAAO,eAAA;EACpB,UAAU,OAAO,YAAA;EACjB,QAAQ,OAAO,UAAU;EACzB,MAAM,OAAO,QAAQ;EACrB,gBAAgB,OAAO,kBAAA;EACvB,QAAQ,OAAO,UAAU;EACzB,QAAQ,OAAO,UAAU;CAC3B;AACF;AAEA,MAAM,YAAY,SAA6B,SAAyB;CACtE,OAAO,MAAM,IAAI,KAAK,WAAmB,QAAQ,QAAQ,CAAC,GAAG;EAC3D,SAAS;GACP,GAAG;GACH,GAAG;EACL,CAAC;EACD,oBAAoB;EACpB,KAAK,UAAU,IAAI,CAAC;CACtB,CAAC;AACH;AAEA,MAAa,QAAQ,WAAoC;CACvD,MAAM,UAAU,UAAU,MAAM;CAChC,MAAM,OAAO,OAAO,aAAa,QAAQ;CAEzC,OAAO,OAAO,UAAgB,YAA8B;EAC1D,IAAI,OAAO,MAAM,UAAU,SAAS,SAAS,IAAI,CAAC,EAAE,UAAU,OAAO;EACrE,IAAI,CAAC,MAAM,OAAO;EAClB,IAAI,EAAE,YAAY,OAAO;GACvB,IAAI,OAAO,SAAS,YAAY,OAAO;GACvC,OAAO,MAAM,eAAe,IAAI;EAClC;EAEA,IAAI,CAAC,QAAQ,MAAM;GACjB,MAAM,WAAW,KAAK,KAAa,IAAI;GACvC,KAAK,OAAO,KAAK,UAAU,kBAAkB,CAAC;GAC9C,KAAK,OAAO,KAAK,UAAU,oBAAoB,CAAC;GAChD,KAAK,OAAO,KAAK,UAAU,iBAAiB,CAAC;GAC7C,IAAI,QAAQ,aAAa,MAAM,KAAK,OAAO,KAAK,UAAU,eAAe,CAAC;EAC5E;EAEA,OAAO;CACT;AACF"}
@@ -1,27 +1,27 @@
1
- import { Rule } from '@angular-devkit/schematics';
1
+ import { Rule } from "@angular-devkit/schematics";
2
2
 
3
+ //#region src/libs/component/component.schema.d.ts
3
4
  interface ComponentSchema {
4
5
  /**
5
6
  * Component destination directory
6
7
  */
7
8
  name: string;
8
-
9
9
  /**
10
10
  * Component destination directory
11
11
  */
12
12
  directory: string;
13
-
14
13
  /**
15
14
  * The part of the application to generate
16
15
  */
17
16
  part: "client" | "server";
18
-
19
17
  /**
20
18
  * NanoForge Application language
21
19
  */
22
20
  language: "js" | "ts";
23
21
  }
24
-
22
+ //#endregion
23
+ //#region src/libs/component/component.factory.d.ts
25
24
  declare const main: (schema: ComponentSchema) => Rule;
26
-
25
+ //#endregion
27
26
  export { main };
27
+ //# sourceMappingURL=component.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.factory.d.ts","names":["name","directory","part","language"],"sources":["../../../src/libs/component/component.schema.d.ts","../../../src/libs/component/component.factory.ts"],"mappings":";;;UAAiB,eAAA;;;AAAjB;EAIEA,IAAAA;EAJ8B;;;EAS9BC,SAAAA;EAUQ;AAAA;;EALRC,IAAAA;ECsBF;;;EDjBEC,QAAAA;AAAAA;;;cCiBW,IAAA,GAAQ,MAAA,EAAQ,eAAA,KAAkB,IAI9C"}
@@ -1,50 +1,35 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/libs/component/component.factory.ts
5
1
  import { join, normalize, strings } from "@angular-devkit/core";
6
- import {
7
- apply,
8
- mergeWith,
9
- move,
10
- template,
11
- url
12
- } from "@angular-devkit/schematics";
13
-
14
- // src/utils/formatting.ts
15
- var toWords = /* @__PURE__ */ __name((str) => {
16
- return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().split(/\s+/).filter(Boolean);
17
- }, "toWords");
18
- var toKebabCase = /* @__PURE__ */ __name((str) => {
19
- return toWords(str).map((word) => word.toLowerCase()).join("-");
20
- }, "toKebabCase");
21
- var toPascalCase = /* @__PURE__ */ __name((str) => {
22
- return toWords(str).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
23
- }, "toPascalCase");
24
-
25
- // src/libs/component/component.factory.ts
26
- var transform = /* @__PURE__ */ __name((schema) => {
27
- return {
28
- part: schema.part,
29
- className: toPascalCase(schema.name),
30
- fileName: toKebabCase(schema.name)
31
- };
32
- }, "transform");
33
- var generate = /* @__PURE__ */ __name((options, path, language) => {
34
- const rules = [
35
- template({
36
- ...strings,
37
- ...options
38
- }),
39
- move(normalize(path))
40
- ];
41
- return apply(url(join("./files", language)), rules);
42
- }, "generate");
43
- var main = /* @__PURE__ */ __name((schema) => {
44
- const options = transform(schema);
45
- return mergeWith(generate(options, schema.directory, schema.language));
46
- }, "main");
47
- export {
48
- main
2
+ import { apply, mergeWith, move, template, url } from "@angular-devkit/schematics";
3
+ //#region src/utils/formatting.ts
4
+ const toWords = (str) => {
5
+ return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().split(/\s+/).filter(Boolean);
6
+ };
7
+ const toKebabCase = (str) => {
8
+ return toWords(str).map((word) => word.toLowerCase()).join("-");
9
+ };
10
+ const toPascalCase = (str) => {
11
+ return toWords(str).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
49
12
  };
13
+ //#endregion
14
+ //#region src/libs/component/component.factory.ts
15
+ const transform = (schema) => {
16
+ return {
17
+ part: schema.part,
18
+ className: toPascalCase(schema.name),
19
+ fileName: toKebabCase(schema.name)
20
+ };
21
+ };
22
+ const generate = (options, path, language) => {
23
+ const rules = [template({
24
+ ...strings,
25
+ ...options
26
+ }), move(normalize(path))];
27
+ return apply(url(join("./files", language)), rules);
28
+ };
29
+ const main = (schema) => {
30
+ return mergeWith(generate(transform(schema), schema.directory, schema.language));
31
+ };
32
+ //#endregion
33
+ export { main };
34
+
50
35
  //# sourceMappingURL=component.factory.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/libs/component/component.factory.ts","../../../src/utils/formatting.ts"],"sourcesContent":["import { type Path, join, normalize, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type Source,\n apply,\n mergeWith,\n move,\n template,\n url,\n} from \"@angular-devkit/schematics\";\n\nimport { toKebabCase, toPascalCase } from \"@utils/formatting\";\n\nimport { type ComponentOptions } from \"./component.options\";\nimport { type ComponentSchema } from \"./component.schema\";\n\nconst transform = (schema: ComponentSchema): ComponentOptions => {\n return {\n part: schema.part,\n className: toPascalCase(schema.name),\n fileName: toKebabCase(schema.name),\n };\n};\n\nconst generate = (options: ComponentOptions, path: string, language: \"ts\" | \"js\"): Source => {\n const rules = [\n template({\n ...strings,\n ...options,\n }),\n move(normalize(path)),\n ];\n\n return apply(url(join(\"./files\" as Path, language)), rules);\n};\n\nexport const main = (schema: ComponentSchema): Rule => {\n const options = transform(schema);\n\n return mergeWith(generate(options, schema.directory, schema.language));\n};\n","const toWords = (str: string): string[] => {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .replace(/([A-Z]+)([A-Z][a-z])/g, \"$1 $2\")\n .replace(/[-_]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n};\n\nexport const toKebabCase = (str: string): string => {\n return toWords(str)\n .map((word) => word.toLowerCase())\n .join(\"-\");\n};\n\nexport const toPascalCase = (str: string): string => {\n return toWords(str)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\"\");\n};\n\nexport const toCamelCase = (str: string): string => {\n const words = toWords(str);\n return words\n .map((word, i) =>\n i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(),\n )\n .join(\"\");\n};\n"],"mappings":";;;;AAAA,SAAoB,MAAM,WAAW,eAAe;AACpD;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACTP,IAAM,UAAU,wBAAC,QAA0B;AACzC,SAAO,IACJ,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,yBAAyB,OAAO,EACxC,QAAQ,UAAU,GAAG,EACrB,KAAK,EACL,MAAM,KAAK,EACX,OAAO,OAAO;AACnB,GARgB;AAUT,IAAM,cAAc,wBAAC,QAAwB;AAClD,SAAO,QAAQ,GAAG,EACf,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAChC,KAAK,GAAG;AACb,GAJ2B;AAMpB,IAAM,eAAe,wBAAC,QAAwB;AACnD,SAAO,QAAQ,GAAG,EACf,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,EACxE,KAAK,EAAE;AACZ,GAJ4B;;;ADA5B,IAAM,YAAY,wBAAC,WAA8C;AAC/D,SAAO;AAAA,IACL,MAAM,OAAO;AAAA,IACb,WAAW,aAAa,OAAO,IAAI;AAAA,IACnC,UAAU,YAAY,OAAO,IAAI;AAAA,EACnC;AACF,GANkB;AAQlB,IAAM,WAAW,wBAAC,SAA2B,MAAc,aAAkC;AAC3F,QAAM,QAAQ;AAAA,IACZ,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAC;AAAA,IACD,KAAK,UAAU,IAAI,CAAC;AAAA,EACtB;AAEA,SAAO,MAAM,IAAI,KAAK,WAAmB,QAAQ,CAAC,GAAG,KAAK;AAC5D,GAViB;AAYV,IAAM,OAAO,wBAAC,WAAkC;AACrD,QAAM,UAAU,UAAU,MAAM;AAEhC,SAAO,UAAU,SAAS,SAAS,OAAO,WAAW,OAAO,QAAQ,CAAC;AACvE,GAJoB;","names":[]}
1
+ {"version":3,"file":"component.factory.js","names":[],"sources":["../../../src/utils/formatting.ts","../../../src/libs/component/component.factory.ts"],"sourcesContent":["const toWords = (str: string): string[] => {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .replace(/([A-Z]+)([A-Z][a-z])/g, \"$1 $2\")\n .replace(/[-_]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n};\n\nexport const toKebabCase = (str: string): string => {\n return toWords(str)\n .map((word) => word.toLowerCase())\n .join(\"-\");\n};\n\nexport const toPascalCase = (str: string): string => {\n return toWords(str)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\"\");\n};\n\nexport const toCamelCase = (str: string): string => {\n const words = toWords(str);\n return words\n .map((word, i) =>\n i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(),\n )\n .join(\"\");\n};\n","import { type Path, join, normalize, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type Source,\n apply,\n mergeWith,\n move,\n template,\n url,\n} from \"@angular-devkit/schematics\";\n\nimport { toKebabCase, toPascalCase } from \"@utils/formatting\";\n\nimport { type ComponentOptions } from \"./component.options\";\nimport { type ComponentSchema } from \"./component.schema\";\n\nconst transform = (schema: ComponentSchema): ComponentOptions => {\n return {\n part: schema.part,\n className: toPascalCase(schema.name),\n fileName: toKebabCase(schema.name),\n };\n};\n\nconst generate = (options: ComponentOptions, path: string, language: \"ts\" | \"js\"): Source => {\n const rules = [\n template({\n ...strings,\n ...options,\n }),\n move(normalize(path)),\n ];\n\n return apply(url(join(\"./files\" as Path, language)), rules);\n};\n\nexport const main = (schema: ComponentSchema): Rule => {\n const options = transform(schema);\n\n return mergeWith(generate(options, schema.directory, schema.language));\n};\n"],"mappings":";;;AAAA,MAAM,WAAW,QAA0B;CACzC,OAAO,IACJ,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,yBAAyB,OAAO,EACxC,QAAQ,UAAU,GAAG,EACrB,KAAK,EACL,MAAM,KAAK,EACX,OAAO,OAAO;AACnB;AAEA,MAAa,eAAe,QAAwB;CAClD,OAAO,QAAQ,GAAG,EACf,KAAK,SAAS,KAAK,YAAY,CAAC,EAChC,KAAK,GAAG;AACb;AAEA,MAAa,gBAAgB,QAAwB;CACnD,OAAO,QAAQ,GAAG,EACf,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,EACxE,KAAK,EAAE;AACZ;;;ACJA,MAAM,aAAa,WAA8C;CAC/D,OAAO;EACL,MAAM,OAAO;EACb,WAAW,aAAa,OAAO,IAAI;EACnC,UAAU,YAAY,OAAO,IAAI;CACnC;AACF;AAEA,MAAM,YAAY,SAA2B,MAAc,aAAkC;CAC3F,MAAM,QAAQ,CACZ,SAAS;EACP,GAAG;EACH,GAAG;CACL,CAAC,GACD,KAAK,UAAU,IAAI,CAAC,CACtB;CAEA,OAAO,MAAM,IAAI,KAAK,WAAmB,QAAQ,CAAC,GAAG,KAAK;AAC5D;AAEA,MAAa,QAAQ,WAAkC;CAGrD,OAAO,UAAU,SAFD,UAAU,MAEA,GAAS,OAAO,WAAW,OAAO,QAAQ,CAAC;AACvE"}
@@ -1,32 +1,31 @@
1
- import { Rule } from '@angular-devkit/schematics';
1
+ import { Rule } from "@angular-devkit/schematics";
2
2
 
3
+ //#region src/libs/configuration/configuration.schema.d.ts
3
4
  interface ConfigurationSchema {
4
5
  /**
5
6
  * The name of the application
6
7
  */
7
8
  name: string;
8
-
9
9
  /**
10
10
  * NanoForge application destination directory
11
11
  */
12
12
  directory: string;
13
-
14
13
  /**
15
14
  * Configure a server for the application
16
15
  */
17
16
  server: boolean;
18
-
19
17
  /**
20
18
  * NanoForge Application language
21
19
  */
22
20
  language: "js" | "ts";
23
-
24
21
  /**
25
22
  * Add init functions to the application
26
23
  */
27
24
  initFunctions: boolean;
28
25
  }
29
-
26
+ //#endregion
27
+ //#region src/libs/configuration/configuration.factory.d.ts
30
28
  declare const main: (schema: ConfigurationSchema) => Rule;
31
-
29
+ //#endregion
32
30
  export { main };
31
+ //# sourceMappingURL=configuration.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.factory.d.ts","names":["name","directory","server","language","initFunctions"],"sources":["../../../src/libs/configuration/configuration.schema.d.ts","../../../src/libs/configuration/configuration.factory.ts"],"mappings":";;;UAAiB,mBAAA;;;AAAjB;EAIEA,IAAAA;EAJkC;;;EASlCC,SAAAA;EAeAG;;AAAa;EAVbF,MAAAA;;ACkEF;;ED7DEC,QAAAA;EC6D2B;;;EDxD3BC,aAAAA;AAAAA;;;cCwDW,IAAA,GAAQ,MAAA,EAAQ,mBAAA,KAAsB,IAUlD"}