@nanoforge-dev/schematics 2.2.1 → 2.3.1
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/CHANGELOG.md +474 -0
- package/README.md +12 -15
- package/dist/collection.json +8 -23
- package/dist/index.cjs +21 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +19 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/libs/component/component.factory.d.ts +1 -3
- package/dist/libs/component/component.factory.d.ts.map +1 -1
- package/dist/libs/component/component.factory.js +2 -1
- package/dist/libs/component/component.factory.js.map +1 -1
- package/dist/libs/project/files/js/.dockerignore +5 -0
- package/dist/libs/project/files/js/Dockerfile +36 -0
- package/dist/libs/project/files/js/README.md +53 -0
- package/dist/libs/project/files/js/assets/__dot__gitkeep +0 -0
- package/dist/libs/project/files/js/jsconfig.json +36 -0
- package/dist/libs/project/files/js/nanoforge.config.js +10 -0
- package/dist/libs/project/files/js/package.json.template +29 -0
- package/dist/libs/project/files/js/pnpm-workspace.yaml.template +3 -0
- package/dist/libs/project/files/js/src/components/drawable-circle-2d.component.js +404 -0
- package/dist/libs/project/files/js/src/components/position-2d.component.js +42 -0
- package/dist/libs/project/files/js/src/main.js +43 -0
- package/dist/libs/project/files/js/src/systems/draw-2d.system.js +33 -0
- package/dist/libs/project/files/js/src/systems/move-2d.system.js +34 -0
- package/dist/libs/project/files/js/src/systems/position-sync.system.js +35 -0
- package/dist/libs/project/files/ts/.dockerignore +5 -0
- package/dist/libs/project/files/ts/Dockerfile +36 -0
- package/dist/libs/project/files/ts/README.md +53 -0
- package/dist/libs/project/files/ts/assets/__dot__gitkeep +0 -0
- package/dist/libs/project/files/ts/nanoforge.config.ts +5 -0
- package/dist/libs/project/files/ts/package.json.template +29 -0
- package/dist/libs/project/files/ts/pnpm-workspace.yaml.template +3 -0
- package/dist/libs/project/files/ts/src/components/drawable-circle-2d.component.ts +367 -0
- package/dist/libs/project/files/ts/src/components/position-2d.component.ts +35 -0
- package/dist/libs/project/files/ts/src/main.ts +40 -0
- package/dist/libs/project/files/ts/src/systems/draw-2d.system.ts +25 -0
- package/dist/libs/project/files/ts/src/systems/move-2d.system.ts +26 -0
- package/dist/libs/project/files/ts/src/systems/position-sync.system.ts +27 -0
- package/dist/libs/project/files/ts/tsconfig.json +42 -0
- package/dist/libs/project/project.factory.d.ts +64 -0
- package/dist/libs/project/project.factory.d.ts.map +1 -0
- package/dist/libs/project/project.factory.js +127 -0
- package/dist/libs/project/project.factory.js.map +1 -0
- package/dist/libs/project/schema.json +83 -0
- package/dist/libs/system/system.factory.d.ts +1 -3
- package/dist/libs/system/system.factory.d.ts.map +1 -1
- package/dist/libs/system/system.factory.js +2 -1
- package/dist/libs/system/system.factory.js.map +1 -1
- package/dist/libs/workspace/files/js/.dockerignore +5 -0
- package/dist/libs/workspace/files/js/Dockerfile +36 -0
- package/dist/libs/workspace/files/js/README.md +51 -0
- package/dist/libs/workspace/files/js/__dot__gitignore +137 -0
- package/dist/libs/{application → workspace}/files/js/jsconfig.json +1 -2
- package/dist/libs/workspace/files/js/nanoforge.config.js +6 -0
- package/dist/libs/workspace/files/js/package.json.template +19 -0
- package/dist/libs/workspace/files/js/pnpm-workspace.yaml.template +6 -0
- package/dist/libs/workspace/files/ts/.dockerignore +5 -0
- package/dist/libs/workspace/files/ts/Dockerfile +36 -0
- package/dist/libs/workspace/files/ts/README.md +51 -0
- package/dist/libs/workspace/files/ts/__dot__gitignore +134 -0
- package/dist/libs/workspace/files/ts/nanoforge.config.ts +6 -0
- package/dist/libs/workspace/files/ts/package.json.template +20 -0
- package/dist/libs/workspace/files/ts/pnpm-workspace.yaml.template +6 -0
- package/dist/libs/{application → workspace}/files/ts/tsconfig.json +1 -2
- package/dist/libs/workspace/schema.json +45 -0
- package/dist/libs/workspace/workspace.factory.d.ts +42 -0
- package/dist/libs/workspace/workspace.factory.d.ts.map +1 -0
- package/dist/libs/workspace/workspace.factory.js +116 -0
- package/dist/libs/workspace/workspace.factory.js.map +1 -0
- package/package.json +23 -21
- package/dist/libs/application/application.factory.d.ts +0 -59
- package/dist/libs/application/application.factory.d.ts.map +0 -1
- package/dist/libs/application/application.factory.js +0 -57
- package/dist/libs/application/application.factory.js.map +0 -1
- package/dist/libs/application/files/js/.prettierignore +0 -8
- package/dist/libs/application/files/js/README.md +0 -166
- package/dist/libs/application/files/js/eslint.config.js +0 -11
- package/dist/libs/application/files/js/package.json.template +0 -48
- package/dist/libs/application/files/js/pnpm-workspace.yaml.template +0 -3
- package/dist/libs/application/files/js/prettier.config.js +0 -6
- package/dist/libs/application/files/ts/.prettierignore +0 -8
- package/dist/libs/application/files/ts/README.md +0 -166
- package/dist/libs/application/files/ts/eslint.config.js +0 -15
- package/dist/libs/application/files/ts/package.json.template +0 -52
- package/dist/libs/application/files/ts/pnpm-workspace.yaml.template +0 -3
- package/dist/libs/application/files/ts/prettier.config.js +0 -6
- package/dist/libs/application/schema.json +0 -70
- package/dist/libs/configuration/configuration.factory.d.ts +0 -31
- package/dist/libs/configuration/configuration.factory.d.ts.map +0 -1
- package/dist/libs/configuration/configuration.factory.js +0 -97
- package/dist/libs/configuration/configuration.factory.js.map +0 -1
- package/dist/libs/configuration/files/nanoforge.config.json +0 -1
- package/dist/libs/configuration/schema.json +0 -34
- package/dist/libs/docker/docker.factory.d.ts +0 -19
- package/dist/libs/docker/docker.factory.d.ts.map +0 -1
- package/dist/libs/docker/docker.factory.js +0 -20
- package/dist/libs/docker/docker.factory.js.map +0 -1
- package/dist/libs/docker/files/.dockerignore +0 -1
- package/dist/libs/docker/files/Dockerfile +0 -25
- package/dist/libs/docker/schema.json +0 -19
- package/dist/libs/part-base/files/js/__nanoforgeFolder__/client.save.json +0 -77
- package/dist/libs/part-base/files/js/__nanoforgeFolder__/server.save.json +0 -49
- package/dist/libs/part-base/files/js/__part__/components/example.component.js +0 -72
- package/dist/libs/part-base/files/js/__part__/init/after-init.js +0 -12
- package/dist/libs/part-base/files/js/__part__/init/after-registry-init.js +0 -14
- package/dist/libs/part-base/files/js/__part__/init/after-run.js +0 -12
- package/dist/libs/part-base/files/js/__part__/init/before-init.js +0 -13
- package/dist/libs/part-base/files/js/__part__/init/before-registry-init.js +0 -14
- package/dist/libs/part-base/files/js/__part__/init/before-run.js +0 -12
- package/dist/libs/part-base/files/js/__part__/systems/example.system.js +0 -44
- package/dist/libs/part-base/files/ts/__nanoforgeFolder__/client.save.json +0 -77
- package/dist/libs/part-base/files/ts/__nanoforgeFolder__/server.save.json +0 -49
- package/dist/libs/part-base/files/ts/__part__/components/example.component.ts +0 -55
- package/dist/libs/part-base/files/ts/__part__/init/after-init.ts +0 -5
- package/dist/libs/part-base/files/ts/__part__/init/after-registry-init.ts +0 -6
- package/dist/libs/part-base/files/ts/__part__/init/after-run.ts +0 -5
- package/dist/libs/part-base/files/ts/__part__/init/before-init.ts +0 -5
- package/dist/libs/part-base/files/ts/__part__/init/before-registry-init.ts +0 -6
- package/dist/libs/part-base/files/ts/__part__/init/before-run.ts +0 -5
- package/dist/libs/part-base/files/ts/__part__/systems/example.system.ts +0 -31
- package/dist/libs/part-base/part-base.factory.d.ts +0 -31
- package/dist/libs/part-base/part-base.factory.d.ts.map +0 -1
- package/dist/libs/part-base/part-base.factory.js +0 -33
- package/dist/libs/part-base/part-base.factory.js.map +0 -1
- package/dist/libs/part-base/schema.json +0 -35
- package/dist/libs/part-main/part-main.factory.d.ts +0 -39
- package/dist/libs/part-main/part-main.factory.d.ts.map +0 -1
- package/dist/libs/part-main/part-main.factory.js +0 -252
- package/dist/libs/part-main/part-main.factory.js.map +0 -1
- package/dist/libs/part-main/schema.json +0 -43
- /package/dist/libs/{application → project}/files/js/__dot__gitignore +0 -0
- /package/dist/libs/{application → project}/files/ts/__dot__gitignore +0 -0
- /package/dist/libs/{application → workspace}/files/js/__dot__env +0 -0
- /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
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
|
|
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
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/defaults.ts"],"mappings":";
|
|
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
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/defaults.ts"],"mappings":";
|
|
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,
|
|
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
|
|
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":[
|
|
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
|
-
|
|
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;
|
|
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,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
|
|
File without changes
|
|
@@ -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,29 @@
|
|
|
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/asset": "<%= engineVersion %>",
|
|
14
|
+
"@nanoforge-dev/cli": "<%= cliVersion %>",
|
|
15
|
+
"@nanoforge-dev/common": "<%= engineVersion %>",
|
|
16
|
+
"@nanoforge-dev/core": "<%= engineVersion %>",
|
|
17
|
+
"@nanoforge-dev/config": "<%= engineVersion %>",
|
|
18
|
+
"@nanoforge-dev/ecs": "<%= ecsVersion %>"<% if (part === "client") { %>,
|
|
19
|
+
"@nanoforge-dev/env": "<%= engineVersion %>",
|
|
20
|
+
"@nanoforge-dev/graphics-2d": "<%= graphics2dVersion %>",
|
|
21
|
+
"@nanoforge-dev/input": "<%= inputVersion %>",
|
|
22
|
+
"@nanoforge-dev/network": "<%= networkVersion %>"<% } %>
|
|
23
|
+
},<% if (packageManager === "npm" && allowBuilds.length > 0) { %>
|
|
24
|
+
"allowScripts": {<% allowBuilds.forEach(function (pkg, i) { %>
|
|
25
|
+
"<%= pkg %>": true<% if (i < allowBuilds.length - 1) { %>,<% } %><% }); %>
|
|
26
|
+
},<% } %><% if (packageManager === "bun" && allowBuilds.length > 0) { %>
|
|
27
|
+
"trustedDependencies": [<% allowBuilds.forEach(function (pkg, i) { %>"<%= pkg %>"<% if (i < allowBuilds.length - 1) { %>, <% } %><% }); %>],<% } %>
|
|
28
|
+
"private": true
|
|
29
|
+
}
|