@nanoforge-dev/schematics 2.2.1-beta.88f48da → 2.3.0

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 (138) hide show
  1. package/CHANGELOG.md +472 -0
  2. package/README.md +12 -15
  3. package/dist/collection.json +8 -23
  4. package/dist/index.cjs +21 -6
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +19 -7
  7. package/dist/index.d.cts.map +1 -1
  8. package/dist/index.d.ts +19 -7
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +17 -4
  11. package/dist/index.js.map +1 -1
  12. package/dist/libs/component/component.factory.d.ts +1 -3
  13. package/dist/libs/component/component.factory.d.ts.map +1 -1
  14. package/dist/libs/component/component.factory.js +2 -1
  15. package/dist/libs/component/component.factory.js.map +1 -1
  16. package/dist/libs/project/files/js/.dockerignore +5 -0
  17. package/dist/libs/project/files/js/Dockerfile +36 -0
  18. package/dist/libs/project/files/js/README.md +53 -0
  19. package/dist/libs/project/files/js/assets/__dot__gitkeep +0 -0
  20. package/dist/libs/project/files/js/jsconfig.json +36 -0
  21. package/dist/libs/project/files/js/nanoforge.config.js +10 -0
  22. package/dist/libs/project/files/js/package.json.template +24 -0
  23. package/dist/libs/project/files/js/pnpm-workspace.yaml.template +3 -0
  24. package/dist/libs/project/files/js/src/components/drawable-circle-2d.component.js +404 -0
  25. package/dist/libs/project/files/js/src/components/position-2d.component.js +42 -0
  26. package/dist/libs/project/files/js/src/main.js +43 -0
  27. package/dist/libs/project/files/js/src/systems/draw-2d.system.js +33 -0
  28. package/dist/libs/project/files/js/src/systems/move-2d.system.js +34 -0
  29. package/dist/libs/project/files/js/src/systems/position-sync.system.js +35 -0
  30. package/dist/libs/project/files/ts/.dockerignore +5 -0
  31. package/dist/libs/project/files/ts/Dockerfile +36 -0
  32. package/dist/libs/project/files/ts/README.md +53 -0
  33. package/dist/libs/project/files/ts/assets/__dot__gitkeep +0 -0
  34. package/dist/libs/project/files/ts/nanoforge.config.ts +5 -0
  35. package/dist/libs/project/files/ts/package.json.template +24 -0
  36. package/dist/libs/project/files/ts/pnpm-workspace.yaml.template +3 -0
  37. package/dist/libs/project/files/ts/src/components/drawable-circle-2d.component.ts +367 -0
  38. package/dist/libs/project/files/ts/src/components/position-2d.component.ts +35 -0
  39. package/dist/libs/project/files/ts/src/main.ts +39 -0
  40. package/dist/libs/project/files/ts/src/systems/draw-2d.system.ts +25 -0
  41. package/dist/libs/project/files/ts/src/systems/move-2d.system.ts +26 -0
  42. package/dist/libs/project/files/ts/src/systems/position-sync.system.ts +27 -0
  43. package/dist/libs/project/files/ts/tsconfig.json +42 -0
  44. package/dist/libs/project/project.factory.d.ts +64 -0
  45. package/dist/libs/project/project.factory.d.ts.map +1 -0
  46. package/dist/libs/project/project.factory.js +122 -0
  47. package/dist/libs/project/project.factory.js.map +1 -0
  48. package/dist/libs/project/schema.json +83 -0
  49. package/dist/libs/system/system.factory.d.ts +1 -3
  50. package/dist/libs/system/system.factory.d.ts.map +1 -1
  51. package/dist/libs/system/system.factory.js +2 -1
  52. package/dist/libs/system/system.factory.js.map +1 -1
  53. package/dist/libs/workspace/files/js/.dockerignore +5 -0
  54. package/dist/libs/workspace/files/js/Dockerfile +36 -0
  55. package/dist/libs/workspace/files/js/README.md +51 -0
  56. package/dist/libs/workspace/files/js/__dot__gitignore +137 -0
  57. package/dist/libs/{application → workspace}/files/js/jsconfig.json +1 -2
  58. package/dist/libs/workspace/files/js/nanoforge.config.js +6 -0
  59. package/dist/libs/workspace/files/js/package.json.template +19 -0
  60. package/dist/libs/workspace/files/js/pnpm-workspace.yaml.template +6 -0
  61. package/dist/libs/workspace/files/ts/.dockerignore +5 -0
  62. package/dist/libs/workspace/files/ts/Dockerfile +36 -0
  63. package/dist/libs/workspace/files/ts/README.md +51 -0
  64. package/dist/libs/workspace/files/ts/__dot__gitignore +134 -0
  65. package/dist/libs/workspace/files/ts/nanoforge.config.ts +6 -0
  66. package/dist/libs/workspace/files/ts/package.json.template +20 -0
  67. package/dist/libs/workspace/files/ts/pnpm-workspace.yaml.template +6 -0
  68. package/dist/libs/{application → workspace}/files/ts/tsconfig.json +1 -2
  69. package/dist/libs/workspace/schema.json +45 -0
  70. package/dist/libs/workspace/workspace.factory.d.ts +42 -0
  71. package/dist/libs/workspace/workspace.factory.d.ts.map +1 -0
  72. package/dist/libs/workspace/workspace.factory.js +116 -0
  73. package/dist/libs/workspace/workspace.factory.js.map +1 -0
  74. package/package.json +23 -21
  75. package/dist/libs/application/application.factory.d.ts +0 -59
  76. package/dist/libs/application/application.factory.d.ts.map +0 -1
  77. package/dist/libs/application/application.factory.js +0 -57
  78. package/dist/libs/application/application.factory.js.map +0 -1
  79. package/dist/libs/application/files/js/.prettierignore +0 -8
  80. package/dist/libs/application/files/js/README.md +0 -166
  81. package/dist/libs/application/files/js/eslint.config.js +0 -11
  82. package/dist/libs/application/files/js/package.json.template +0 -48
  83. package/dist/libs/application/files/js/pnpm-workspace.yaml.template +0 -3
  84. package/dist/libs/application/files/js/prettier.config.js +0 -6
  85. package/dist/libs/application/files/ts/.prettierignore +0 -8
  86. package/dist/libs/application/files/ts/README.md +0 -166
  87. package/dist/libs/application/files/ts/eslint.config.js +0 -15
  88. package/dist/libs/application/files/ts/package.json.template +0 -52
  89. package/dist/libs/application/files/ts/pnpm-workspace.yaml.template +0 -3
  90. package/dist/libs/application/files/ts/prettier.config.js +0 -6
  91. package/dist/libs/application/schema.json +0 -70
  92. package/dist/libs/configuration/configuration.factory.d.ts +0 -31
  93. package/dist/libs/configuration/configuration.factory.d.ts.map +0 -1
  94. package/dist/libs/configuration/configuration.factory.js +0 -97
  95. package/dist/libs/configuration/configuration.factory.js.map +0 -1
  96. package/dist/libs/configuration/files/nanoforge.config.json +0 -1
  97. package/dist/libs/configuration/schema.json +0 -34
  98. package/dist/libs/docker/docker.factory.d.ts +0 -19
  99. package/dist/libs/docker/docker.factory.d.ts.map +0 -1
  100. package/dist/libs/docker/docker.factory.js +0 -20
  101. package/dist/libs/docker/docker.factory.js.map +0 -1
  102. package/dist/libs/docker/files/.dockerignore +0 -1
  103. package/dist/libs/docker/files/Dockerfile +0 -25
  104. package/dist/libs/docker/schema.json +0 -19
  105. package/dist/libs/part-base/files/js/__nanoforgeFolder__/client.save.json +0 -77
  106. package/dist/libs/part-base/files/js/__nanoforgeFolder__/server.save.json +0 -49
  107. package/dist/libs/part-base/files/js/__part__/components/example.component.js +0 -72
  108. package/dist/libs/part-base/files/js/__part__/init/after-init.js +0 -12
  109. package/dist/libs/part-base/files/js/__part__/init/after-registry-init.js +0 -14
  110. package/dist/libs/part-base/files/js/__part__/init/after-run.js +0 -12
  111. package/dist/libs/part-base/files/js/__part__/init/before-init.js +0 -13
  112. package/dist/libs/part-base/files/js/__part__/init/before-registry-init.js +0 -14
  113. package/dist/libs/part-base/files/js/__part__/init/before-run.js +0 -12
  114. package/dist/libs/part-base/files/js/__part__/systems/example.system.js +0 -44
  115. package/dist/libs/part-base/files/ts/__nanoforgeFolder__/client.save.json +0 -77
  116. package/dist/libs/part-base/files/ts/__nanoforgeFolder__/server.save.json +0 -49
  117. package/dist/libs/part-base/files/ts/__part__/components/example.component.ts +0 -55
  118. package/dist/libs/part-base/files/ts/__part__/init/after-init.ts +0 -5
  119. package/dist/libs/part-base/files/ts/__part__/init/after-registry-init.ts +0 -6
  120. package/dist/libs/part-base/files/ts/__part__/init/after-run.ts +0 -5
  121. package/dist/libs/part-base/files/ts/__part__/init/before-init.ts +0 -5
  122. package/dist/libs/part-base/files/ts/__part__/init/before-registry-init.ts +0 -6
  123. package/dist/libs/part-base/files/ts/__part__/init/before-run.ts +0 -5
  124. package/dist/libs/part-base/files/ts/__part__/systems/example.system.ts +0 -31
  125. package/dist/libs/part-base/part-base.factory.d.ts +0 -31
  126. package/dist/libs/part-base/part-base.factory.d.ts.map +0 -1
  127. package/dist/libs/part-base/part-base.factory.js +0 -33
  128. package/dist/libs/part-base/part-base.factory.js.map +0 -1
  129. package/dist/libs/part-base/schema.json +0 -35
  130. package/dist/libs/part-main/part-main.factory.d.ts +0 -39
  131. package/dist/libs/part-main/part-main.factory.d.ts.map +0 -1
  132. package/dist/libs/part-main/part-main.factory.js +0 -252
  133. package/dist/libs/part-main/part-main.factory.js.map +0 -1
  134. package/dist/libs/part-main/schema.json +0 -43
  135. /package/dist/libs/{application → project}/files/js/__dot__gitignore +0 -0
  136. /package/dist/libs/{application → project}/files/ts/__dot__gitignore +0 -0
  137. /package/dist/libs/{application → workspace}/files/js/__dot__env +0 -0
  138. /package/dist/libs/{application → workspace}/files/ts/__dot__env +0 -0
package/dist/index.d.cts CHANGED
@@ -1,10 +1,22 @@
1
1
  //#region src/defaults.d.ts
2
- declare const DEFAULT_APP_NAME = "nanoforge-app";
3
- declare const DEFAULT_VERSION = "0.0.0";
4
- declare const DEFAULT_AUTHOR = "";
5
- declare const DEFAULT_DESCRIPTION = "";
6
- declare const DEFAULT_LANGUAGE = "ts";
7
- declare const DEFAULT_PACKAGE_MANAGER = "npm";
2
+ export declare const DEFAULT_APP_NAME = "nanoforge-app";
3
+ export declare const DEFAULT_LANGUAGE = "ts";
4
+ export declare const DEFAULT_PACKAGE_MANAGER = "npm";
5
+ export declare const DEFAULT_NANOFORGE_DEPENDENCY_VERSION = "^2";
6
+ export declare const DEFAULT_ENGINE_VERSION = "^2";
7
+ /** Fallback used when the registry lookup for `@nanoforge-dev/cli` fails. */
8
+ export declare const DEFAULT_CLI_DEPENDENCY_VERSION = "latest";
9
+ /**
10
+ * Fallback used when the registry lookup for `typescript` fails. A specific
11
+ * version, not a range — non-nanoforge packages are pinned exactly.
12
+ */
13
+ export declare const DEFAULT_TYPESCRIPT_VERSION = "6.0.3";
14
+ /**
15
+ * Mirrors pnpm's own `minimumReleaseAge` supply-chain protection: when
16
+ * resolving a pinned dependency version at generation time, only consider
17
+ * versions published at least this long ago, so a freshly (and potentially
18
+ * maliciously) published release isn't picked up immediately.
19
+ */
20
+ export declare const MIN_RELEASE_AGE_HOURS = 48;
8
21
  //#endregion
9
- export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
10
22
  //# sourceMappingURL=index.d.cts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/defaults.ts"],"mappings":";qBAAa;qBACA;qBACA;qBACA;qBACA;;qBAGA;;;;;qBAMA;;;;;;;qBAQA"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,22 @@
1
1
  //#region src/defaults.d.ts
2
- declare const DEFAULT_APP_NAME = "nanoforge-app";
3
- declare const DEFAULT_VERSION = "0.0.0";
4
- declare const DEFAULT_AUTHOR = "";
5
- declare const DEFAULT_DESCRIPTION = "";
6
- declare const DEFAULT_LANGUAGE = "ts";
7
- declare const DEFAULT_PACKAGE_MANAGER = "npm";
2
+ export declare const DEFAULT_APP_NAME = "nanoforge-app";
3
+ export declare const DEFAULT_LANGUAGE = "ts";
4
+ export declare const DEFAULT_PACKAGE_MANAGER = "npm";
5
+ export declare const DEFAULT_NANOFORGE_DEPENDENCY_VERSION = "^2";
6
+ export declare const DEFAULT_ENGINE_VERSION = "^2";
7
+ /** Fallback used when the registry lookup for `@nanoforge-dev/cli` fails. */
8
+ export declare const DEFAULT_CLI_DEPENDENCY_VERSION = "latest";
9
+ /**
10
+ * Fallback used when the registry lookup for `typescript` fails. A specific
11
+ * version, not a range — non-nanoforge packages are pinned exactly.
12
+ */
13
+ export declare const DEFAULT_TYPESCRIPT_VERSION = "6.0.3";
14
+ /**
15
+ * Mirrors pnpm's own `minimumReleaseAge` supply-chain protection: when
16
+ * resolving a pinned dependency version at generation time, only consider
17
+ * versions published at least this long ago, so a freshly (and potentially
18
+ * maliciously) published release isn't picked up immediately.
19
+ */
20
+ export declare const MIN_RELEASE_AGE_HOURS = 48;
8
21
  //#endregion
9
- export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
10
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/defaults.ts"],"mappings":";qBAAa;qBACA;qBACA;qBACA;qBACA;;qBAGA;;;;;qBAMA;;;;;;;qBAQA"}
package/dist/index.js CHANGED
@@ -1,11 +1,24 @@
1
1
  //#region src/defaults.ts
2
2
  const DEFAULT_APP_NAME = "nanoforge-app";
3
- const DEFAULT_VERSION = "0.0.0";
4
- const DEFAULT_AUTHOR = "";
5
- const DEFAULT_DESCRIPTION = "";
6
3
  const DEFAULT_LANGUAGE = "ts";
7
4
  const DEFAULT_PACKAGE_MANAGER = "npm";
5
+ const DEFAULT_NANOFORGE_DEPENDENCY_VERSION = "^2";
6
+ const DEFAULT_ENGINE_VERSION = "^2";
7
+ /** Fallback used when the registry lookup for `@nanoforge-dev/cli` fails. */
8
+ const DEFAULT_CLI_DEPENDENCY_VERSION = "latest";
9
+ /**
10
+ * Fallback used when the registry lookup for `typescript` fails. A specific
11
+ * version, not a range — non-nanoforge packages are pinned exactly.
12
+ */
13
+ const DEFAULT_TYPESCRIPT_VERSION = "6.0.3";
14
+ /**
15
+ * Mirrors pnpm's own `minimumReleaseAge` supply-chain protection: when
16
+ * resolving a pinned dependency version at generation time, only consider
17
+ * versions published at least this long ago, so a freshly (and potentially
18
+ * maliciously) published release isn't picked up immediately.
19
+ */
20
+ const MIN_RELEASE_AGE_HOURS = 48;
8
21
  //#endregion
9
- export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
22
+ export { DEFAULT_APP_NAME, DEFAULT_CLI_DEPENDENCY_VERSION, DEFAULT_ENGINE_VERSION, DEFAULT_LANGUAGE, DEFAULT_NANOFORGE_DEPENDENCY_VERSION, DEFAULT_PACKAGE_MANAGER, DEFAULT_TYPESCRIPT_VERSION, MIN_RELEASE_AGE_HOURS };
10
23
 
11
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
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
+ {"version":3,"file":"index.js","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\nexport const DEFAULT_NANOFORGE_DEPENDENCY_VERSION = \"^2\";\nexport const DEFAULT_ENGINE_VERSION = \"^2\";\n\n/** Fallback used when the registry lookup for `@nanoforge-dev/cli` fails. */\nexport const DEFAULT_CLI_DEPENDENCY_VERSION = \"latest\";\n\n/**\n * Fallback used when the registry lookup for `typescript` fails. A specific\n * version, not a range — non-nanoforge packages are pinned exactly.\n */\nexport const DEFAULT_TYPESCRIPT_VERSION = \"6.0.3\";\n\n/**\n * Mirrors pnpm's own `minimumReleaseAge` supply-chain protection: when\n * resolving a pinned dependency version at generation time, only consider\n * versions published at least this long ago, so a freshly (and potentially\n * maliciously) published release isn't picked up immediately.\n */\nexport const MIN_RELEASE_AGE_HOURS = 48;\n"],"mappings":";AAAA,MAAa,mBAAmB;AAChC,MAAa,mBAAmB;AAChC,MAAa,0BAA0B;AACvC,MAAa,uCAAuC;AACpD,MAAa,yBAAyB;;AAGtC,MAAa,iCAAiC;;;;;AAM9C,MAAa,6BAA6B;;;;;;;AAQ1C,MAAa,wBAAwB"}
@@ -1,5 +1,4 @@
1
1
  import { Rule } from "@angular-devkit/schematics";
2
-
3
2
  //#region src/libs/component/component.schema.d.ts
4
3
  interface ComponentSchema {
5
4
  /**
@@ -21,7 +20,6 @@ interface ComponentSchema {
21
20
  }
22
21
  //#endregion
23
22
  //#region src/libs/component/component.factory.d.ts
24
- declare const main: (schema: ComponentSchema) => Rule;
23
+ export declare const main: (schema: ComponentSchema) => Rule;
25
24
  //#endregion
26
- export { main };
27
25
  //# sourceMappingURL=component.factory.d.ts.map
@@ -1 +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
+ {"version":3,"file":"component.factory.d.ts","names":[],"sources":["../../../src/libs/component/component.schema.d.ts","../../../src/libs/component/component.factory.ts"],"mappings":";;UAAiB;;;;EAIf;;;;EAKA;;;;EAKA;;;;EAKA;;;;qBCiBW,OAAQ,QAAQ,oBAAkB"}
@@ -27,7 +27,8 @@ const generate = (options, path, language) => {
27
27
  return apply(url(join("./files", language)), rules);
28
28
  };
29
29
  const main = (schema) => {
30
- return mergeWith(generate(transform(schema), schema.directory, schema.language));
30
+ const options = transform(schema);
31
+ return mergeWith(generate(options, schema.directory, schema.language));
31
32
  };
32
33
  //#endregion
33
34
  export { main };
@@ -1 +1 @@
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,CAAC,CACnC,QAAQ,yBAAyB,OAAO,CAAC,CACzC,QAAQ,UAAU,GAAG,CAAC,CACtB,KAAK,CAAC,CACN,MAAM,KAAK,CAAC,CACZ,OAAO,OAAO;AACnB;AAEA,MAAa,eAAe,QAAwB;CAClD,OAAO,QAAQ,GAAG,CAAC,CAChB,KAAK,SAAS,KAAK,YAAY,CAAC,CAAC,CACjC,KAAK,GAAG;AACb;AAEA,MAAa,gBAAgB,QAAwB;CACnD,OAAO,QAAQ,GAAG,CAAC,CAChB,KAAK,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CACzE,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
+ {"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,CAAC,CACnC,QAAQ,yBAAyB,OAAO,CAAC,CACzC,QAAQ,UAAU,GAAG,CAAC,CACtB,KAAK,CAAC,CACN,MAAM,KAAK,CAAC,CACZ,OAAO,OAAO;AACnB;AAEA,MAAa,eAAe,QAAwB;CAClD,OAAO,QAAQ,GAAG,CAAC,CAChB,KAAK,SAAS,KAAK,YAAY,CAAC,CAAC,CACjC,KAAK,GAAG;AACb;AAEA,MAAa,gBAAgB,QAAwB;CACnD,OAAO,QAAQ,GAAG,CAAC,CAChB,KAAK,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CACzE,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;CACrD,MAAM,UAAU,UAAU,MAAM;CAEhC,OAAO,UAAU,SAAS,SAAS,OAAO,WAAW,OAAO,QAAQ,CAAC;AACvE"}
@@ -0,0 +1,5 @@
1
+ node_modules/
2
+ dist/
3
+ .nanoforge/
4
+ .git/
5
+ .env
@@ -0,0 +1,36 @@
1
+ <% if (packageManager === "bun") { %>FROM oven/bun:1.3 AS base
2
+ <% } else if (packageManager === "pnpm") { %>FROM ghcr.io/pnpm/pnpm:12 AS base
3
+ RUN pnpm runtime set node 26 -g
4
+ <% } else { %>FROM node:26-slim AS base
5
+ <% } %><% if (packageManager === "yarn") { %>
6
+ RUN npm install -g yarn
7
+ <% } %>
8
+ WORKDIR /app
9
+
10
+ FROM base AS deps
11
+
12
+ <% if (packageManager === "npm") { %>COPY package.json package-lock.json ./
13
+ RUN npm ci
14
+ <% } else if (packageManager === "yarn") { %>COPY package.json yarn.lock ./
15
+ RUN yarn install --frozen-lockfile
16
+ <% } else if (packageManager === "pnpm") { %>COPY package.json pnpm-lock.yaml ./
17
+ RUN pnpm install --frozen-lockfile
18
+ <% } else { %>COPY package.json bun.lock ./
19
+ RUN bun install --frozen-lockfile
20
+ <% } %>
21
+ FROM deps AS build
22
+ COPY . .
23
+ RUN <%= packageManager %> run build
24
+
25
+ <% if (packageManager === "bun") { %>FROM oven/bun:1.3-slim<% } else { %>FROM base<% } %>
26
+ WORKDIR /app
27
+
28
+ COPY --from=build /app/node_modules ./node_modules
29
+ COPY --from=build /app/dist ./dist
30
+ COPY --from=build /app/package.json ./
31
+ COPY --from=build /app/nanoforge.config.js ./
32
+ <% if (part === "server") { %>
33
+ <% } %><% if (packageManager !== "pnpm") { %>
34
+ USER <% if (packageManager === "bun") { %>bun<% } else { %>node<% } %>
35
+ <% } %><% if (part === "client") { %>EXPOSE 3000
36
+ <% } %>CMD ["<%= packageManager %>", "run", "start"]
@@ -0,0 +1,53 @@
1
+ # <%= packageName %>
2
+
3
+ A [NanoForge](https://nanoforge.eu) <%= part %> app.
4
+ <% if (!workspace) { %>
5
+ ## Prerequisites
6
+
7
+ - Node.js and <%= packageManager %>
8
+ - The [NanoForge CLI](https://www.npmjs.com/package/@nanoforge-dev/cli): `npm install -g @nanoforge-dev/cli`
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ <%= packageManager %> install
14
+ ```
15
+ <% } %>
16
+ ## Development
17
+
18
+ ```bash
19
+ nf dev
20
+ ```
21
+
22
+ `nf dev` serves the game and watches your files, so changes are picked up as you work.
23
+
24
+ ## Build & start
25
+
26
+ ```bash
27
+ nf build
28
+ nf start
29
+ ```
30
+
31
+ `nf build` compiles this <%= part %> for production, and `nf start` serves the build.
32
+ <% if (editor) { %>
33
+ This app was generated with editor support. Launch it with:
34
+
35
+ ```bash
36
+ nf editor .
37
+ ```
38
+ <% } %><% if (docker) { %>
39
+ A `Dockerfile` is also included to containerize the built app for deployment.
40
+ <% } %>
41
+ ## CLI reference
42
+
43
+ | Command | Description |
44
+ | ------------- | ---------------------------------- |
45
+ | `nf dev` | Develop with hot reload |
46
+ | `nf build` | Build for production |
47
+ | `nf start` | Run a built app |<% if (editor) { %>
48
+ | `nf editor` | Launch the visual editor |<% } %>
49
+
50
+ ## More info
51
+
52
+ - [Documentation](https://docs.nanoforge.eu) - CLI commands, configuration, and guides
53
+ - [nanoforge.eu](https://nanoforge.eu) - learn more about NanoForge
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/jsconfig.json",<% if (workspace) { %>
3
+ "extends": "../../jsconfig.json",<% } else { %>
4
+ "compilerOptions": {
5
+ "allowUnreachableCode": <%= !strict %>,
6
+ "allowUnusedLabels": <%= !strict %>,
7
+ "exactOptionalPropertyTypes": <%= strict %>,
8
+ "noFallthroughCasesInSwitch": <%= strict %>,
9
+ "noImplicitOverride": <%= strict %>,
10
+ "noImplicitReturns": <%= strict %>,
11
+ "noPropertyAccessFromIndexSignature": <%= !strict %>,
12
+ "noUncheckedIndexedAccess": <%= strict %>,
13
+ "noUnusedLocals": <%= strict %>,
14
+ "noUnusedParameters": <%= strict %>,
15
+
16
+ "allowArbitraryExtensions": false,
17
+ "allowImportingTsExtensions": false,
18
+ "module": "ESNext",
19
+ "moduleResolution": "Bundler",
20
+ "resolveJsonModule": true,
21
+ "resolvePackageJsonExports": true,
22
+ "resolvePackageJsonImports": true,
23
+
24
+ "allowSyntheticDefaultImports": true,
25
+ "esModuleInterop": false,
26
+ "forceConsistentCasingInFileNames": true,
27
+ "isolatedModules": true,
28
+
29
+ "experimentalDecorators": true,
30
+ "lib": ["ESNext", "esnext.disposable", "DOM"],
31
+ "target": "ESNext",
32
+ "useDefineForClassFields": true
33
+ },<% } %>
34
+ "include": ["src"],
35
+ "exclude": ["node_modules", ".nanoforge", "dist"]
36
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "nanoforge/config";
2
+
3
+ export default defineConfig({
4
+ type: "<%= part %>",
5
+ entryFile: "src/main.js",
6
+ editor: {
7
+ entryFile: "src/main.js",
8
+ },
9
+ language: "js",
10
+ });
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "<%= packageName %>",
4
+ "scripts": {
5
+ "dev": "nf dev",
6
+ "build": "nf build",
7
+ "start": "nf start"
8
+ },<% if (part === "server") { %>
9
+ "dependencies": {
10
+ "@nanoforge-dev/network": "<%= networkVersion %>"
11
+ },<% } %>
12
+ "devDependencies": {
13
+ "@nanoforge-dev/ecs": "<%= ecsVersion %>",<% if (part === "client") { %>
14
+ "@nanoforge-dev/graphics-2d": "<%= graphics2dVersion %>",
15
+ "@nanoforge-dev/input": "<%= inputVersion %>",
16
+ "@nanoforge-dev/network": "<%= networkVersion %>",<% } %>
17
+ "nanoforge": "<%= nanoforgeVersion %>"
18
+ },<% if (packageManager === "npm" && allowBuilds.length > 0) { %>
19
+ "allowScripts": {<% allowBuilds.forEach(function (pkg, i) { %>
20
+ "<%= pkg %>": true<% if (i < allowBuilds.length - 1) { %>,<% } %><% }); %>
21
+ },<% } %><% if (packageManager === "bun" && allowBuilds.length > 0) { %>
22
+ "trustedDependencies": [<% allowBuilds.forEach(function (pkg, i) { %>"<%= pkg %>"<% if (i < allowBuilds.length - 1) { %>, <% } %><% }); %>],<% } %>
23
+ "private": true
24
+ }
@@ -0,0 +1,3 @@
1
+ <% if (allowBuilds.length > 0) { %>allowBuilds:<% allowBuilds.forEach(function (pkg) { %>
2
+ <%= pkg %>: true<% }); %>
3
+ <% } %>