@nanoforge-dev/schematics 0.0.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.
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "application": {
5
+ "factory": "./lib/application/application.factory#main",
6
+ "description": "Create a NanoForge Base application.",
7
+ "schema": "./lib/application/schema.json"
8
+ },
9
+ "configuration": {
10
+ "factory": "./lib/configuration/configuration.factory#main",
11
+ "description": "Create a NanoForge Configuration.",
12
+ "schema": "./lib/configuration/schema.json"
13
+ }
14
+ }
15
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1,80 @@
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);
19
+
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_CONFIG: () => DEFAULT_CONFIG,
26
+ DEFAULT_DESCRIPTION: () => DEFAULT_DESCRIPTION,
27
+ DEFAULT_LANGUAGE: () => DEFAULT_LANGUAGE,
28
+ DEFAULT_PACKAGE_MANAGER: () => DEFAULT_PACKAGE_MANAGER,
29
+ DEFAULT_SERVER_CONFIG: () => DEFAULT_SERVER_CONFIG,
30
+ DEFAULT_VERSION: () => DEFAULT_VERSION,
31
+ test: () => test
32
+ });
33
+ module.exports = __toCommonJS(index_exports);
34
+
35
+ // src/utils/index.ts
36
+ var test = 0;
37
+
38
+ // src/defaults.ts
39
+ var DEFAULT_APP_NAME = "nanoforge-app";
40
+ var DEFAULT_VERSION = "0.0.0";
41
+ var DEFAULT_AUTHOR = "";
42
+ var DEFAULT_DESCRIPTION = "";
43
+ var DEFAULT_LANGUAGE = "ts";
44
+ var DEFAULT_PACKAGE_MANAGER = "npm";
45
+ var DEFAULT_CONFIG = {
46
+ client: {
47
+ build: {
48
+ entryFile: "client/main.ts",
49
+ outDir: ".nanoforge/client"
50
+ },
51
+ runtime: {
52
+ dir: ".nanoforge/client"
53
+ }
54
+ }
55
+ };
56
+ var DEFAULT_SERVER_CONFIG = {
57
+ server: {
58
+ enable: true,
59
+ build: {
60
+ entryFile: "server/main.ts",
61
+ outDir: ".nanoforge/server"
62
+ },
63
+ runtime: {
64
+ dir: ".nanoforge/server"
65
+ }
66
+ }
67
+ };
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ DEFAULT_APP_NAME,
71
+ DEFAULT_AUTHOR,
72
+ DEFAULT_CONFIG,
73
+ DEFAULT_DESCRIPTION,
74
+ DEFAULT_LANGUAGE,
75
+ DEFAULT_PACKAGE_MANAGER,
76
+ DEFAULT_SERVER_CONFIG,
77
+ DEFAULT_VERSION,
78
+ test
79
+ });
80
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/index.ts","../src/defaults.ts"],"sourcesContent":["export * from \"./utils\";\nexport * from \"./defaults\";\n","export const test = 0;\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\";\nexport const DEFAULT_CONFIG = {\n client: {\n build: {\n entryFile: \"client/main.ts\",\n outDir: \".nanoforge/client\",\n },\n runtime: {\n dir: \".nanoforge/client\",\n },\n },\n};\nexport const DEFAULT_SERVER_CONFIG = {\n server: {\n enable: true,\n build: {\n entryFile: \"server/main.ts\",\n outDir: \".nanoforge/server\",\n },\n runtime: {\n dir: \".nanoforge/server\",\n },\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,OAAO;;;ACAb,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AACzB,IAAM,0BAA0B;AAChC,IAAM,iBAAiB;AAAA,EAC5B,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF;AACO,IAAM,wBAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,33 @@
1
+ declare const test = 0;
2
+
3
+ declare const DEFAULT_APP_NAME = "nanoforge-app";
4
+ declare const DEFAULT_VERSION = "0.0.0";
5
+ declare const DEFAULT_AUTHOR = "";
6
+ declare const DEFAULT_DESCRIPTION = "";
7
+ declare const DEFAULT_LANGUAGE = "ts";
8
+ declare const DEFAULT_PACKAGE_MANAGER = "npm";
9
+ declare const DEFAULT_CONFIG: {
10
+ client: {
11
+ build: {
12
+ entryFile: string;
13
+ outDir: string;
14
+ };
15
+ runtime: {
16
+ dir: string;
17
+ };
18
+ };
19
+ };
20
+ declare const DEFAULT_SERVER_CONFIG: {
21
+ server: {
22
+ enable: boolean;
23
+ build: {
24
+ entryFile: string;
25
+ outDir: string;
26
+ };
27
+ runtime: {
28
+ dir: string;
29
+ };
30
+ };
31
+ };
32
+
33
+ export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_CONFIG, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_SERVER_CONFIG, DEFAULT_VERSION, test };
@@ -0,0 +1,33 @@
1
+ declare const test = 0;
2
+
3
+ declare const DEFAULT_APP_NAME = "nanoforge-app";
4
+ declare const DEFAULT_VERSION = "0.0.0";
5
+ declare const DEFAULT_AUTHOR = "";
6
+ declare const DEFAULT_DESCRIPTION = "";
7
+ declare const DEFAULT_LANGUAGE = "ts";
8
+ declare const DEFAULT_PACKAGE_MANAGER = "npm";
9
+ declare const DEFAULT_CONFIG: {
10
+ client: {
11
+ build: {
12
+ entryFile: string;
13
+ outDir: string;
14
+ };
15
+ runtime: {
16
+ dir: string;
17
+ };
18
+ };
19
+ };
20
+ declare const DEFAULT_SERVER_CONFIG: {
21
+ server: {
22
+ enable: boolean;
23
+ build: {
24
+ entryFile: string;
25
+ outDir: string;
26
+ };
27
+ runtime: {
28
+ dir: string;
29
+ };
30
+ };
31
+ };
32
+
33
+ export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_CONFIG, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_SERVER_CONFIG, DEFAULT_VERSION, test };
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
1
+ // src/utils/index.ts
2
+ var test = 0;
3
+
4
+ // src/defaults.ts
5
+ var DEFAULT_APP_NAME = "nanoforge-app";
6
+ var DEFAULT_VERSION = "0.0.0";
7
+ var DEFAULT_AUTHOR = "";
8
+ var DEFAULT_DESCRIPTION = "";
9
+ var DEFAULT_LANGUAGE = "ts";
10
+ var DEFAULT_PACKAGE_MANAGER = "npm";
11
+ var DEFAULT_CONFIG = {
12
+ client: {
13
+ build: {
14
+ entryFile: "client/main.ts",
15
+ outDir: ".nanoforge/client"
16
+ },
17
+ runtime: {
18
+ dir: ".nanoforge/client"
19
+ }
20
+ }
21
+ };
22
+ var DEFAULT_SERVER_CONFIG = {
23
+ server: {
24
+ enable: true,
25
+ build: {
26
+ entryFile: "server/main.ts",
27
+ outDir: ".nanoforge/server"
28
+ },
29
+ runtime: {
30
+ dir: ".nanoforge/server"
31
+ }
32
+ }
33
+ };
34
+ export {
35
+ DEFAULT_APP_NAME,
36
+ DEFAULT_AUTHOR,
37
+ DEFAULT_CONFIG,
38
+ DEFAULT_DESCRIPTION,
39
+ DEFAULT_LANGUAGE,
40
+ DEFAULT_PACKAGE_MANAGER,
41
+ DEFAULT_SERVER_CONFIG,
42
+ DEFAULT_VERSION,
43
+ test
44
+ };
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/index.ts","../src/defaults.ts"],"sourcesContent":["export const test = 0;\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\";\nexport const DEFAULT_CONFIG = {\n client: {\n build: {\n entryFile: \"client/main.ts\",\n outDir: \".nanoforge/client\",\n },\n runtime: {\n dir: \".nanoforge/client\",\n },\n },\n};\nexport const DEFAULT_SERVER_CONFIG = {\n server: {\n enable: true,\n build: {\n entryFile: \"server/main.ts\",\n outDir: \".nanoforge/server\",\n },\n runtime: {\n dir: \".nanoforge/server\",\n },\n },\n};\n"],"mappings":";AAAO,IAAM,OAAO;;;ACAb,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AACzB,IAAM,0BAA0B;AAChC,IAAM,iBAAiB;AAAA,EAC5B,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF;AACO,IAAM,wBAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,52 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+
3
+ interface ApplicationSchema {
4
+ /**
5
+ * NanoForge application name
6
+ */
7
+ name: string;
8
+
9
+ /**
10
+ * NanoForge application version
11
+ */
12
+ version?: string;
13
+
14
+ /**
15
+ * NanoForge application author
16
+ */
17
+ author?: string;
18
+
19
+ /**
20
+ * NanoForge application description
21
+ */
22
+ description?: string;
23
+
24
+ /**
25
+ * NanoForge application destination directory
26
+ */
27
+ directory?: string;
28
+
29
+ /**
30
+ * NanoForge Application language
31
+ */
32
+ language?: "js" | "ts";
33
+
34
+ /**
35
+ * With strict mode (TypeScript or JavaScript but only on compatible editor)
36
+ */
37
+ strict?: boolean;
38
+
39
+ /**
40
+ * The used package manager
41
+ */
42
+ packageManager?: "npm" | "yarn" | "pnpm" | "bun";
43
+
44
+ /**
45
+ * NanoForge included production dependencies (comma separated values)
46
+ */
47
+ dependencies?: string;
48
+ }
49
+
50
+ declare const main: (schema: ApplicationSchema) => Rule;
51
+
52
+ export { main };
@@ -0,0 +1,70 @@
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
+ import { join, 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 toKebabCase = /* @__PURE__ */ __name((str) => {
16
+ return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
17
+ }, "toKebabCase");
18
+
19
+ // src/utils/name.ts
20
+ import { basename, parse } from "path";
21
+ var resolvePackageName = /* @__PURE__ */ __name((path) => {
22
+ const { base: baseFilename, dir: dirname } = parse(path);
23
+ if (baseFilename === ".") {
24
+ return basename(process.cwd());
25
+ }
26
+ if (dirname.match(/^@[^\s]/)) {
27
+ return `${dirname}/${baseFilename}`;
28
+ }
29
+ return baseFilename;
30
+ }, "resolvePackageName");
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
+
40
+ // src/libs/application/application.factory.ts
41
+ var transform = /* @__PURE__ */ __name((schema) => {
42
+ const name = resolvePackageName(toKebabCase(schema.name?.toString() ?? DEFAULT_APP_NAME));
43
+ return {
44
+ name,
45
+ version: schema.version ?? DEFAULT_VERSION,
46
+ author: schema.author ?? DEFAULT_AUTHOR,
47
+ description: schema.description ?? DEFAULT_DESCRIPTION,
48
+ language: schema.language ?? DEFAULT_LANGUAGE,
49
+ strict: schema.strict ?? true,
50
+ packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,
51
+ dependencies: schema.dependencies ?? ""
52
+ };
53
+ }, "transform");
54
+ var generate = /* @__PURE__ */ __name((options, path) => {
55
+ return apply(url(join("./files", options.language)), [
56
+ template({
57
+ ...strings,
58
+ ...options
59
+ }),
60
+ move(path)
61
+ ]);
62
+ }, "generate");
63
+ var main = /* @__PURE__ */ __name((schema) => {
64
+ const options = transform(schema);
65
+ return mergeWith(generate(options, schema.directory ?? options.name));
66
+ }, "main");
67
+ export {
68
+ main
69
+ };
70
+ //# sourceMappingURL=application.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/libs/application/application.factory.ts","../../../src/utils/formatting.ts","../../../src/utils/name.ts","../../../src/defaults.ts"],"sourcesContent":["import { type Path, join, 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 } from \"@utils/formatting\";\nimport { resolvePackageName } from \"@utils/name\";\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 const name = resolvePackageName(toKebabCase(schema.name?.toString() ?? DEFAULT_APP_NAME));\n\n return {\n 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 packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,\n dependencies: schema.dependencies ?? \"\",\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 move(path),\n ]);\n};\n\nexport const main = (schema: ApplicationSchema): Rule => {\n const options = transform(schema);\n\n return mergeWith(generate(options, schema.directory ?? options.name));\n};\n","export const toKebabCase = (str: string): string => {\n return str\n .replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, \"-\")\n .toLowerCase();\n};\n","import { basename, parse } from \"path\";\n\nexport const resolvePackageName = (path: string): string => {\n const { base: baseFilename, dir: dirname } = parse(path);\n if (baseFilename === \".\") {\n return basename(process.cwd());\n }\n if (dirname.match(/^@[^\\s]/)) {\n return `${dirname}/${baseFilename}`;\n }\n return baseFilename;\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\";\nexport const DEFAULT_CONFIG = {\n client: {\n build: {\n entryFile: \"client/main.ts\",\n outDir: \".nanoforge/client\",\n },\n runtime: {\n dir: \".nanoforge/client\",\n },\n },\n};\nexport const DEFAULT_SERVER_CONFIG = {\n server: {\n enable: true,\n build: {\n entryFile: \"server/main.ts\",\n outDir: \".nanoforge/server\",\n },\n runtime: {\n dir: \".nanoforge/server\",\n },\n },\n};\n"],"mappings":";;;;AAAA,SAAoB,MAAM,eAAe;AACzC;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACTA,IAAM,cAAc,wBAAC,QAAwB;AAClD,SAAO,IACJ,QAAQ,gCAAgC,OAAO,EAC/C,QAAQ,WAAW,GAAG,EACtB,YAAY;AACjB,GAL2B;;;ACA3B,SAAS,UAAU,aAAa;AAEzB,IAAM,qBAAqB,wBAAC,SAAyB;AAC1D,QAAM,EAAE,MAAM,cAAc,KAAK,QAAQ,IAAI,MAAM,IAAI;AACvD,MAAI,iBAAiB,KAAK;AACxB,WAAO,SAAS,QAAQ,IAAI,CAAC;AAAA,EAC/B;AACA,MAAI,QAAQ,MAAM,SAAS,GAAG;AAC5B,WAAO,GAAG,OAAO,IAAI,YAAY;AAAA,EACnC;AACA,SAAO;AACT,GATkC;;;ACF3B,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;AACxB,IAAM,iBAAiB;AACvB,IAAM,sBAAsB;AAC5B,IAAM,mBAAmB;AACzB,IAAM,0BAA0B;;;AHqBvC,IAAM,YAAY,wBAAC,WAAkD;AACnE,QAAM,OAAO,mBAAmB,YAAY,OAAO,MAAM,SAAS,KAAK,gBAAgB,CAAC;AAExF,SAAO;AAAA,IACL;AAAA,IACA,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,gBAAgB,OAAO,kBAAkB;AAAA,IACzC,cAAc,OAAO,gBAAgB;AAAA,EACvC;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,KAAK,IAAI;AAAA,EACX,CAAC;AACH,GARiB;AAUV,IAAM,OAAO,wBAAC,WAAoC;AACvD,QAAM,UAAU,UAAU,MAAM;AAEhC,SAAO,UAAU,SAAS,SAAS,OAAO,aAAa,QAAQ,IAAI,CAAC;AACtE,GAJoB;","names":[]}
@@ -0,0 +1 @@
1
+ # <%= name %>
@@ -0,0 +1,11 @@
1
+ import pluginJs from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import globals from "globals";
4
+
5
+ export default [
6
+ { files: ["{client,server}/**/*.{js}"] },
7
+ { languageOptions: { globals: globals.node } },
8
+
9
+ pluginJs.configs.recommended,
10
+ eslintConfigPrettier,
11
+ ];
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/jsconfig.json",
3
+ "compilerOptions": {
4
+ "allowUnreachableCode": <%= !strict %>,
5
+ "allowUnusedLabels": <%= !strict %>,
6
+ "exactOptionalPropertyTypes": <%= strict %>,
7
+ "noFallthroughCasesInSwitch": <%= strict %>,
8
+ "noImplicitOverride": <%= strict %>,
9
+ "noImplicitReturns": <%= strict %>,
10
+ "noPropertyAccessFromIndexSignature": <%= !strict %>,
11
+ "noUncheckedIndexedAccess": <%= strict %>,
12
+ "noUnusedLocals": <%= strict %>,
13
+ "noUnusedParameters": <%= strict %>,
14
+
15
+ "allowArbitraryExtensions": false,
16
+ "allowImportingTsExtensions": false,
17
+ "module": "ESNext",
18
+ "moduleResolution": "Bundler",
19
+ "resolveJsonModule": true,
20
+ "resolvePackageJsonExports": true,
21
+ "resolvePackageJsonImports": true,
22
+
23
+ "allowSyntheticDefaultImports": true,
24
+ "esModuleInterop": false,
25
+ "forceConsistentCasingInFileNames": true,
26
+ "isolatedModules": true,
27
+
28
+ "experimentalDecorators": true,
29
+ "lib": ["ESNext", "esnext.disposable"],
30
+ "target": "ESNext",
31
+ "useDefineForClassFields": true
32
+ },
33
+ "include": ["client/**/*.js", "server/**/*.js"],
34
+ "exclude": ["node_modules", ".nanoforge"]
35
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "<%= name %>",
3
+ "version": "<%= version %>",
4
+ "description": "<%= description %>",
5
+ "author": "<%= author %>",
6
+ "scripts": {
7
+ "build": "nf build",
8
+ "start": "nf start",
9
+ "lint": "prettier --check . && eslint --format=pretty \"{client,server}/**/*.js\"",
10
+ "format": "prettier --write . && eslint --fix --format=pretty \"{client,server}/**/*.js\""
11
+ },
12
+ "dependencies": {},
13
+ "devDependencies": {
14
+ "@eslint/js": "^9.39.0",
15
+ "@nanoforge-dev/cli": "^0.0.1",
16
+ "eslint": "^9.39.0",
17
+ "eslint-config-prettier": "^10.1.8",
18
+ "eslint-plugin-prettier": "^5.5.4",
19
+ "globals": "^16.5.0",
20
+ "lint-staged": "^16.2.6",
21
+ "prettier": "^3.6.2"
22
+ },
23
+ "private": true,
24
+ "lint-staged": {
25
+ "**/*.js": [
26
+ "prettier --write"
27
+ ],
28
+ "{client,server}/**/*.js": [
29
+ "eslint --fix"
30
+ ]
31
+ }
32
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ useTabs: false,
3
+ singleQuote: false,
4
+ trailingComma: "all",
5
+ printWidth: 100,
6
+ };
@@ -0,0 +1 @@
1
+ # <%= name %>
@@ -0,0 +1,15 @@
1
+ import pluginJs from "@eslint/js";
2
+ import eslintConfigPrettier from "eslint-config-prettier";
3
+ import globals from "globals";
4
+ import tseslint from "typescript-eslint";
5
+
6
+ export default [
7
+ { files: ["{client,server}/**/*.{ts}"] },
8
+ { languageOptions: { globals: globals.node } },
9
+
10
+ pluginJs.configs.recommended,
11
+ ...tseslint.configs.recommended,
12
+ ...tseslint.configs.strict,
13
+ eslintConfigPrettier,
14
+ { ignores: ["**/*.js", "**/*.d.ts"] },
15
+ ];
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "<%= name %>",
3
+ "version": "<%= version %>",
4
+ "description": "<%= description %>",
5
+ "author": "<%= author %>",
6
+ "scripts": {
7
+ "build": "nf build",
8
+ "start": "nf start",
9
+ "lint": "prettier --check . && eslint --format=pretty \"{client,server}/**/*.ts\"",
10
+ "format": "prettier --write . && eslint --fix --format=pretty \"{client,server}/**/*.ts\""
11
+ },
12
+ "dependencies": {},
13
+ "devDependencies": {
14
+ "@eslint/js": "^9.39.0",
15
+ "@nanoforge-dev/cli": "^0.0.1",
16
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
17
+ "@typescript-eslint/parser": "^8.46.2",
18
+ "eslint": "^9.39.0",
19
+ "eslint-config-prettier": "^10.1.8",
20
+ "eslint-plugin-prettier": "^5.5.4",
21
+ "globals": "^16.5.0",
22
+ "lint-staged": "^16.2.6",
23
+ "prettier": "^3.6.2",
24
+ "typescript": "^5.9.3",
25
+ "typescript-eslint": "^8.46.2"
26
+ },
27
+ "private": true,
28
+ "lint-staged": {
29
+ "**/*.ts": [
30
+ "prettier --write"
31
+ ],
32
+ "{client,server}/**/*.ts": [
33
+ "eslint --fix"
34
+ ]
35
+ }
36
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ useTabs: false,
3
+ singleQuote: false,
4
+ trailingComma: "all",
5
+ printWidth: 100,
6
+ };
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig.json",
3
+ // Mapped from https://www.typescriptlang.org/tsconfig
4
+ "compilerOptions": {
5
+ // Type Checking
6
+ "allowUnreachableCode": <%= !strict %>,
7
+ "allowUnusedLabels": <%= !strict %>,
8
+ "exactOptionalPropertyTypes": <%= strict %>,
9
+ "noFallthroughCasesInSwitch": <%= strict %>,
10
+ "noImplicitOverride": <%= strict %>,
11
+ "noImplicitReturns": <%= strict %>,
12
+ "noPropertyAccessFromIndexSignature": <%= !strict %>,
13
+ "noUncheckedIndexedAccess": <%= strict %>,
14
+ "noUnusedLocals": <%= strict %>,
15
+ "noUnusedParameters": <%= strict %>,
16
+ "strict": <%= strict %>,
17
+
18
+ // Modules
19
+ "allowArbitraryExtensions": false,
20
+ "allowImportingTsExtensions": false,
21
+ "module": "ESNext",
22
+ "moduleResolution": "Bundler",
23
+ "resolveJsonModule": true,
24
+ "resolvePackageJsonExports": true,
25
+ "resolvePackageJsonImports": true,
26
+
27
+ // Interop Constraints
28
+ "allowSyntheticDefaultImports": true,
29
+ "esModuleInterop": false,
30
+ "forceConsistentCasingInFileNames": true,
31
+ "isolatedModules": true,
32
+
33
+ // Language and Environment
34
+ "experimentalDecorators": true,
35
+ "lib": ["ESNext", "esnext.disposable"],
36
+ "target": "ESNext",
37
+ "useDefineForClassFields": true,
38
+ },
39
+ "include": ["client/**/*.ts", "server/**/*.ts"],
40
+ "exclude": ["node_modules", ".nanoforge"]
41
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "SchematicsNanoForgeBaseApplication",
4
+ "title": "NanoForge Base Application Options Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "The name of the application",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use for the new project ?"
15
+ },
16
+ "version": {
17
+ "type": "string",
18
+ "description": "NanoForge application version",
19
+ "default": "0.0.0"
20
+ },
21
+ "author": {
22
+ "type": "string",
23
+ "description": "NanoForge application author",
24
+ "default": ""
25
+ },
26
+ "description": {
27
+ "type": "string",
28
+ "description": "NanoForge application description",
29
+ "default": ""
30
+ },
31
+ "directory": {
32
+ "type": "string",
33
+ "description": "NanoForge application destination directory"
34
+ },
35
+ "language": {
36
+ "type": "string",
37
+ "enum": ["ts", "js"],
38
+ "description": "NanoForge application language",
39
+ "default": "ts"
40
+ },
41
+ "strict": {
42
+ "type": "boolean",
43
+ "description": "With strict mode (TypeScript or JavaScript but only on compatible editor)",
44
+ "default": true
45
+ },
46
+ "packageManager": {
47
+ "type": "string",
48
+ "enum": ["npm", "yarn", "pnpm", "bun"],
49
+ "description": "NanoForge application package manager",
50
+ "default": "npm"
51
+ }
52
+ },
53
+ "required": ["name"]
54
+ }
@@ -0,0 +1,86 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+
3
+ interface BuildConfigurationSchema {
4
+ /**
5
+ * Entry file of the application
6
+ */
7
+ entryFile?: string;
8
+
9
+ /**
10
+ * Output directory of the application
11
+ */
12
+ outDir?: string;
13
+ }
14
+
15
+ interface RunConfigurationSchema {
16
+ /**
17
+ * Directory of the application
18
+ */
19
+ dir?: string;
20
+ }
21
+
22
+ interface ConfigurationSchema {
23
+ /**
24
+ * The name of the application
25
+ */
26
+ name: string;
27
+
28
+ /**
29
+ * NanoForge application destination directory
30
+ */
31
+ directory?: string;
32
+
33
+ /**
34
+ * Client configuration
35
+ */
36
+ client?: {
37
+ /**
38
+ * Client port
39
+ */
40
+ port?: string;
41
+
42
+ /**
43
+ * Game exposure port
44
+ */
45
+ gameExposurePort?: string;
46
+
47
+ /**
48
+ * Build configuration
49
+ */
50
+ build?: BuildConfigurationSchema;
51
+
52
+ /**
53
+ * Runtime configuration
54
+ */
55
+ runtime?: RunConfigurationSchema;
56
+ };
57
+
58
+ /**
59
+ * Server configuration
60
+ */
61
+ server?: {
62
+ /**
63
+ * Enable server configuration
64
+ */
65
+ enable?: boolean;
66
+
67
+ /**
68
+ * Server port
69
+ */
70
+ port?: string;
71
+
72
+ /**
73
+ * Build configuration
74
+ */
75
+ build?: BuildConfigurationSchema;
76
+
77
+ /**
78
+ * Runtime configuration
79
+ */
80
+ runtime?: RunConfigurationSchema;
81
+ };
82
+ }
83
+
84
+ declare const main: (schema: ConfigurationSchema) => Rule;
85
+
86
+ export { main };
@@ -0,0 +1,168 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/libs/configuration/configuration.factory.ts
5
+ import { join as join2, strings } from "@angular-devkit/core";
6
+ import {
7
+ apply,
8
+ branchAndMerge,
9
+ chain,
10
+ mergeWith,
11
+ move,
12
+ template,
13
+ url
14
+ } from "@angular-devkit/schematics";
15
+
16
+ // src/utils/object.ts
17
+ var isObject = /* @__PURE__ */ __name((item) => {
18
+ return item && typeof item === "object" && !Array.isArray(item);
19
+ }, "isObject");
20
+ var deepMerge = /* @__PURE__ */ __name((target, ...sources) => {
21
+ if (!sources.length) return target;
22
+ const source = sources.shift();
23
+ if (isObject(target) && isObject(source)) {
24
+ for (const key in source) {
25
+ if (isObject(source[key])) {
26
+ if (!target[key]) Object.assign(target, { [key]: {} });
27
+ deepMerge(target[key], source[key]);
28
+ } else {
29
+ Object.assign(target, { [key]: source[key] });
30
+ }
31
+ }
32
+ }
33
+ return deepMerge(target, ...sources);
34
+ }, "deepMerge");
35
+
36
+ // src/defaults.ts
37
+ var DEFAULT_APP_NAME = "nanoforge-app";
38
+ var DEFAULT_CONFIG = {
39
+ client: {
40
+ build: {
41
+ entryFile: "client/main.ts",
42
+ outDir: ".nanoforge/client"
43
+ },
44
+ runtime: {
45
+ dir: ".nanoforge/client"
46
+ }
47
+ }
48
+ };
49
+ var DEFAULT_SERVER_CONFIG = {
50
+ server: {
51
+ enable: true,
52
+ build: {
53
+ entryFile: "server/main.ts",
54
+ outDir: ".nanoforge/server"
55
+ },
56
+ runtime: {
57
+ dir: ".nanoforge/server"
58
+ }
59
+ }
60
+ };
61
+
62
+ // src/utils/config/config.declarator.ts
63
+ var ConfigDeclarator = class {
64
+ static {
65
+ __name(this, "ConfigDeclarator");
66
+ }
67
+ declare(baseContent, options) {
68
+ const content = JSON.parse(baseContent);
69
+ const hasServer = content.server?.enable ?? options.server?.enable ?? false;
70
+ return JSON.stringify(
71
+ deepMerge(
72
+ DEFAULT_CONFIG,
73
+ hasServer ? DEFAULT_SERVER_CONFIG : void 0,
74
+ baseContent,
75
+ options
76
+ ),
77
+ null,
78
+ 2
79
+ );
80
+ }
81
+ };
82
+
83
+ // src/utils/config/config.finder.ts
84
+ import { join } from "@angular-devkit/core";
85
+ var ConfigFinder = class {
86
+ constructor(tree) {
87
+ this.tree = tree;
88
+ }
89
+ static {
90
+ __name(this, "ConfigFinder");
91
+ }
92
+ find(path) {
93
+ const dir = this.tree.getDir(path);
94
+ return this.findIn(dir);
95
+ }
96
+ /**
97
+ * Recursively searches for the module file in the given directory.
98
+ *
99
+ * @param directory - The directory to search in.
100
+ * @returns The path to the module file, or null if not found.
101
+ */
102
+ findIn(directory) {
103
+ if (!directory) {
104
+ return null;
105
+ }
106
+ const moduleFilename = directory.subfiles.find(
107
+ (filename) => /^nanoforge.config.json$/.test(filename)
108
+ );
109
+ return moduleFilename !== void 0 ? join(directory.path, moduleFilename.valueOf()) : this.findIn(directory.parent);
110
+ }
111
+ };
112
+
113
+ // src/utils/formatting.ts
114
+ var toKebabCase = /* @__PURE__ */ __name((str) => {
115
+ return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
116
+ }, "toKebabCase");
117
+
118
+ // src/utils/name.ts
119
+ import { basename, parse } from "path";
120
+ var resolvePackageName = /* @__PURE__ */ __name((path) => {
121
+ const { base: baseFilename, dir: dirname } = parse(path);
122
+ if (baseFilename === ".") {
123
+ return basename(process.cwd());
124
+ }
125
+ if (dirname.match(/^@[^\s]/)) {
126
+ return `${dirname}/${baseFilename}`;
127
+ }
128
+ return baseFilename;
129
+ }, "resolvePackageName");
130
+
131
+ // src/libs/configuration/configuration.factory.ts
132
+ var transform = /* @__PURE__ */ __name((schema) => {
133
+ return {
134
+ client: schema.client,
135
+ server: schema.server
136
+ };
137
+ }, "transform");
138
+ var generate = /* @__PURE__ */ __name((options, path) => {
139
+ return apply(url(join2("./files")), [
140
+ template({
141
+ ...strings,
142
+ ...options
143
+ }),
144
+ move(path)
145
+ ]);
146
+ }, "generate");
147
+ var addConfiguration = /* @__PURE__ */ __name((options, path) => {
148
+ return (tree) => {
149
+ const config = new ConfigFinder(tree).find(path);
150
+ if (!config) return tree;
151
+ const content = tree.read(config)?.toString();
152
+ const declarator = new ConfigDeclarator();
153
+ if (!content) return tree;
154
+ tree.overwrite(config, declarator.declare(content, options));
155
+ return tree;
156
+ };
157
+ }, "addConfiguration");
158
+ var main = /* @__PURE__ */ __name((schema) => {
159
+ const options = transform(schema);
160
+ const directory = schema.directory ?? resolvePackageName(toKebabCase(schema.name?.toString() ?? DEFAULT_APP_NAME));
161
+ return branchAndMerge(
162
+ chain([mergeWith(generate(options, directory)), addConfiguration(options, directory)])
163
+ );
164
+ }, "main");
165
+ export {
166
+ main
167
+ };
168
+ //# sourceMappingURL=configuration.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/libs/configuration/configuration.factory.ts","../../../src/utils/object.ts","../../../src/defaults.ts","../../../src/utils/config/config.declarator.ts","../../../src/utils/config/config.finder.ts","../../../src/utils/formatting.ts","../../../src/utils/name.ts"],"sourcesContent":["import { type Path, join, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type Source,\n type Tree,\n apply,\n branchAndMerge,\n chain,\n mergeWith,\n move,\n template,\n url,\n} from \"@angular-devkit/schematics\";\n\nimport { ConfigDeclarator } from \"@utils/config/config.declarator\";\nimport { ConfigFinder } from \"@utils/config/config.finder\";\nimport { toKebabCase } from \"@utils/formatting\";\nimport { resolvePackageName } from \"@utils/name\";\n\nimport { DEFAULT_APP_NAME } from \"~/defaults\";\n\nimport { type ConfigurationOptions } from \"./configuration.options\";\nimport { type ConfigurationSchema } from \"./configuration.schema\";\n\nconst transform = (schema: ConfigurationSchema): ConfigurationOptions => {\n return {\n client: schema.client,\n server: schema.server,\n };\n};\n\nconst generate = (options: ConfigurationOptions, path: string): Source => {\n return apply(url(join(\"./files\" as Path)), [\n template({\n ...strings,\n ...options,\n }),\n move(path),\n ]);\n};\n\nconst addConfiguration = (options: ConfigurationOptions, path: Path) => {\n return (tree: Tree) => {\n const config = new ConfigFinder(tree).find(path);\n if (!config) return tree;\n\n const content = tree.read(config)?.toString();\n const declarator = new ConfigDeclarator();\n\n if (!content) return tree;\n\n tree.overwrite(config, declarator.declare(content, options));\n return tree;\n };\n};\n\nexport const main = (schema: ConfigurationSchema): Rule => {\n const options = transform(schema);\n const directory =\n schema.directory ??\n resolvePackageName(toKebabCase(schema.name?.toString() ?? DEFAULT_APP_NAME));\n\n return branchAndMerge(\n chain([mergeWith(generate(options, directory)), addConfiguration(options, directory as Path)]),\n );\n};\n","export const isObject = (item: any) => {\n return item && typeof item === \"object\" && !Array.isArray(item);\n};\n\nexport const deepMerge = (target: any, ...sources: [any, ...any[]]): any => {\n if (!sources.length) return target;\n const source = sources.shift();\n\n if (isObject(target) && isObject(source)) {\n for (const key in source) {\n if (isObject(source[key])) {\n if (!target[key]) Object.assign(target, { [key]: {} });\n deepMerge(target[key], source[key]);\n } else {\n Object.assign(target, { [key]: source[key] });\n }\n }\n }\n\n return deepMerge(target, ...sources);\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\";\nexport const DEFAULT_CONFIG = {\n client: {\n build: {\n entryFile: \"client/main.ts\",\n outDir: \".nanoforge/client\",\n },\n runtime: {\n dir: \".nanoforge/client\",\n },\n },\n};\nexport const DEFAULT_SERVER_CONFIG = {\n server: {\n enable: true,\n build: {\n entryFile: \"server/main.ts\",\n outDir: \".nanoforge/server\",\n },\n runtime: {\n dir: \".nanoforge/server\",\n },\n },\n};\n","import { type Config } from \"@utils/config/config.type\";\nimport { deepMerge } from \"@utils/object\";\nimport { type DeepPartial } from \"@utils/type\";\n\nimport { DEFAULT_CONFIG, DEFAULT_SERVER_CONFIG } from \"~/defaults\";\n\nexport class ConfigDeclarator {\n public declare(baseContent: string, options: DeepPartial<Config>): string {\n const content = JSON.parse(baseContent);\n const hasServer = content.server?.enable ?? options.server?.enable ?? false;\n return JSON.stringify(\n deepMerge(\n DEFAULT_CONFIG,\n hasServer ? DEFAULT_SERVER_CONFIG : undefined,\n baseContent,\n options,\n ),\n null,\n 2,\n );\n }\n}\n","import { type Path, join } from \"@angular-devkit/core\";\nimport { type DirEntry, type Tree } from \"@angular-devkit/schematics\";\n\nexport interface FindOptions {\n path: Path;\n}\n\nexport class ConfigFinder {\n constructor(private tree: Tree) {}\n\n public find(path: Path): Path | null {\n const dir = this.tree.getDir(path);\n return this.findIn(dir);\n }\n\n /**\n * Recursively searches for the module file in the given directory.\n *\n * @param directory - The directory to search in.\n * @returns The path to the module file, or null if not found.\n */\n private findIn(directory: DirEntry | null): Path | null {\n if (!directory) {\n return null;\n }\n const moduleFilename = directory.subfiles.find((filename) =>\n /^nanoforge.config.json$/.test(filename),\n );\n return moduleFilename !== undefined\n ? join(directory.path, moduleFilename.valueOf())\n : this.findIn(directory.parent);\n }\n}\n","export const toKebabCase = (str: string): string => {\n return str\n .replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, \"-\")\n .toLowerCase();\n};\n","import { basename, parse } from \"path\";\n\nexport const resolvePackageName = (path: string): string => {\n const { base: baseFilename, dir: dirname } = parse(path);\n if (baseFilename === \".\") {\n return basename(process.cwd());\n }\n if (dirname.match(/^@[^\\s]/)) {\n return `${dirname}/${baseFilename}`;\n }\n return baseFilename;\n};\n"],"mappings":";;;;AAAA,SAAoB,QAAAA,OAAM,eAAe;AACzC;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACZA,IAAM,WAAW,wBAAC,SAAc;AACrC,SAAO,QAAQ,OAAO,SAAS,YAAY,CAAC,MAAM,QAAQ,IAAI;AAChE,GAFwB;AAIjB,IAAM,YAAY,wBAAC,WAAgB,YAAkC;AAC1E,MAAI,CAAC,QAAQ,OAAQ,QAAO;AAC5B,QAAM,SAAS,QAAQ,MAAM;AAE7B,MAAI,SAAS,MAAM,KAAK,SAAS,MAAM,GAAG;AACxC,eAAW,OAAO,QAAQ;AACxB,UAAI,SAAS,OAAO,GAAG,CAAC,GAAG;AACzB,YAAI,CAAC,OAAO,GAAG,EAAG,QAAO,OAAO,QAAQ,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;AACrD,kBAAU,OAAO,GAAG,GAAG,OAAO,GAAG,CAAC;AAAA,MACpC,OAAO;AACL,eAAO,OAAO,QAAQ,EAAE,CAAC,GAAG,GAAG,OAAO,GAAG,EAAE,CAAC;AAAA,MAC9C;AAAA,IACF;AAAA,EACF;AAEA,SAAO,UAAU,QAAQ,GAAG,OAAO;AACrC,GAhByB;;;ACJlB,IAAM,mBAAmB;AAMzB,IAAM,iBAAiB;AAAA,EAC5B,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF;AACO,IAAM,wBAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,IACA,SAAS;AAAA,MACP,KAAK;AAAA,IACP;AAAA,EACF;AACF;;;ACtBO,IAAM,mBAAN,MAAuB;AAAA,EAN9B,OAM8B;AAAA;AAAA;AAAA,EACrB,QAAQ,aAAqB,SAAsC;AACxE,UAAM,UAAU,KAAK,MAAM,WAAW;AACtC,UAAM,YAAY,QAAQ,QAAQ,UAAU,QAAQ,QAAQ,UAAU;AACtE,WAAO,KAAK;AAAA,MACV;AAAA,QACE;AAAA,QACA,YAAY,wBAAwB;AAAA,QACpC;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;;;ACrBA,SAAoB,YAAY;AAOzB,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,MAAY;AAAZ;AAAA,EAAa;AAAA,EARnC,OAO0B;AAAA;AAAA;AAAA,EAGjB,KAAK,MAAyB;AACnC,UAAM,MAAM,KAAK,KAAK,OAAO,IAAI;AACjC,WAAO,KAAK,OAAO,GAAG;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQQ,OAAO,WAAyC;AACtD,QAAI,CAAC,WAAW;AACd,aAAO;AAAA,IACT;AACA,UAAM,iBAAiB,UAAU,SAAS;AAAA,MAAK,CAAC,aAC9C,0BAA0B,KAAK,QAAQ;AAAA,IACzC;AACA,WAAO,mBAAmB,SACtB,KAAK,UAAU,MAAM,eAAe,QAAQ,CAAC,IAC7C,KAAK,OAAO,UAAU,MAAM;AAAA,EAClC;AACF;;;AChCO,IAAM,cAAc,wBAAC,QAAwB;AAClD,SAAO,IACJ,QAAQ,gCAAgC,OAAO,EAC/C,QAAQ,WAAW,GAAG,EACtB,YAAY;AACjB,GAL2B;;;ACA3B,SAAS,UAAU,aAAa;AAEzB,IAAM,qBAAqB,wBAAC,SAAyB;AAC1D,QAAM,EAAE,MAAM,cAAc,KAAK,QAAQ,IAAI,MAAM,IAAI;AACvD,MAAI,iBAAiB,KAAK;AACxB,WAAO,SAAS,QAAQ,IAAI,CAAC;AAAA,EAC/B;AACA,MAAI,QAAQ,MAAM,SAAS,GAAG;AAC5B,WAAO,GAAG,OAAO,IAAI,YAAY;AAAA,EACnC;AACA,SAAO;AACT,GATkC;;;ANsBlC,IAAM,YAAY,wBAAC,WAAsD;AACvE,SAAO;AAAA,IACL,QAAQ,OAAO;AAAA,IACf,QAAQ,OAAO;AAAA,EACjB;AACF,GALkB;AAOlB,IAAM,WAAW,wBAAC,SAA+B,SAAyB;AACxE,SAAO,MAAM,IAAIC,MAAK,SAAiB,CAAC,GAAG;AAAA,IACzC,SAAS;AAAA,MACP,GAAG;AAAA,MACH,GAAG;AAAA,IACL,CAAC;AAAA,IACD,KAAK,IAAI;AAAA,EACX,CAAC;AACH,GARiB;AAUjB,IAAM,mBAAmB,wBAAC,SAA+B,SAAe;AACtE,SAAO,CAAC,SAAe;AACrB,UAAM,SAAS,IAAI,aAAa,IAAI,EAAE,KAAK,IAAI;AAC/C,QAAI,CAAC,OAAQ,QAAO;AAEpB,UAAM,UAAU,KAAK,KAAK,MAAM,GAAG,SAAS;AAC5C,UAAM,aAAa,IAAI,iBAAiB;AAExC,QAAI,CAAC,QAAS,QAAO;AAErB,SAAK,UAAU,QAAQ,WAAW,QAAQ,SAAS,OAAO,CAAC;AAC3D,WAAO;AAAA,EACT;AACF,GAbyB;AAelB,IAAM,OAAO,wBAAC,WAAsC;AACzD,QAAM,UAAU,UAAU,MAAM;AAChC,QAAM,YACJ,OAAO,aACP,mBAAmB,YAAY,OAAO,MAAM,SAAS,KAAK,gBAAgB,CAAC;AAE7E,SAAO;AAAA,IACL,MAAM,CAAC,UAAU,SAAS,SAAS,SAAS,CAAC,GAAG,iBAAiB,SAAS,SAAiB,CAAC,CAAC;AAAA,EAC/F;AACF,GAToB;","names":["join","join"]}
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "SchematicsNanoForgeConfiguration",
4
+ "title": "NanoForge Base Application Options Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "The name of the application",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use for the new project ?"
15
+ },
16
+ "directory": {
17
+ "type": "string",
18
+ "description": "NanoForge application destination directory"
19
+ },
20
+ "client": {
21
+ "type": "object",
22
+ "description": "Client configuration",
23
+ "properties": {
24
+ "port": {
25
+ "type": "string",
26
+ "description": "Client port"
27
+ },
28
+ "gameExposurePort": {
29
+ "type": "string",
30
+ "description": "Game exposure port"
31
+ },
32
+ "build": {
33
+ "type": "object",
34
+ "description": "Build configuration",
35
+ "properties": {
36
+ "entryFile": {
37
+ "type": "string",
38
+ "description": "Entry file of the application"
39
+ },
40
+ "outDir": {
41
+ "type": "string",
42
+ "description": "Output directory of the application"
43
+ }
44
+ }
45
+ },
46
+ "runtime": {
47
+ "type": "object",
48
+ "description": "Runtime configuration",
49
+ "properties": {
50
+ "dir": {
51
+ "type": "string",
52
+ "description": "Directory of the application"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ },
58
+ "server": {
59
+ "type": "object",
60
+ "description": "Server configuration",
61
+ "properties": {
62
+ "enable": {
63
+ "type": "boolean",
64
+ "description": "Enable server configuration"
65
+ },
66
+ "port": {
67
+ "type": "string",
68
+ "description": "Server port"
69
+ },
70
+ "build": {
71
+ "type": "object",
72
+ "description": "Build configuration",
73
+ "properties": {
74
+ "entryFile": {
75
+ "type": "string",
76
+ "description": "Entry file of the application"
77
+ },
78
+ "outDir": {
79
+ "type": "string",
80
+ "description": "Output directory of the application"
81
+ }
82
+ }
83
+ },
84
+ "runtime": {
85
+ "type": "object",
86
+ "description": "Runtime configuration",
87
+ "properties": {
88
+ "dir": {
89
+ "type": "string",
90
+ "description": "Directory of the application"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ "required": ["name"]
98
+ }
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/package.json",
3
+ "name": "@nanoforge-dev/schematics",
4
+ "version": "0.0.1",
5
+ "description": "NanoForge Schematics",
6
+ "keywords": [
7
+ "nanoforge",
8
+ "game",
9
+ "schematics"
10
+ ],
11
+ "homepage": "https://github.com/NanoForge-dev/schematics#readme",
12
+ "bugs": "https://github.com/NanoForge-dev/schematics/issues",
13
+ "license": "MIT",
14
+ "contributors": [
15
+ "Bill <timothe.jacquot@epitech.eu>",
16
+ "Exelo <exelo.corp@gmail.com>",
17
+ "Fexkoser <martin.fillon@epitech.eu>",
18
+ "Tchips <leo.outmizguine@epitech.eu>"
19
+ ],
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "main": "./dist/index.js",
24
+ "module": "./dist/index.mjs",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "require": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "import": {
33
+ "types": "./dist/index.d.mts",
34
+ "default": "./dist/index.mjs"
35
+ }
36
+ }
37
+ },
38
+ "type": "module",
39
+ "directories": {
40
+ "lib": "src"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/NanoForge-dev/schematics.git"
45
+ },
46
+ "funding": "",
47
+ "dependencies": {
48
+ "@angular-devkit/core": "^21.0.0",
49
+ "@angular-devkit/schematics": "^21.0.0"
50
+ },
51
+ "devDependencies": {
52
+ "@commitlint/cli": "^20.1.0",
53
+ "@commitlint/config-conventional": "^20.0.0",
54
+ "@eslint/js": "^9.39.0",
55
+ "@favware/cliff-jumper": "^6.0.0",
56
+ "@trivago/prettier-plugin-sort-imports": "^5.2.2",
57
+ "@types/node": "^24.10.1",
58
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
59
+ "@typescript-eslint/parser": "^8.46.2",
60
+ "cpx2": "^8.0.0",
61
+ "eslint": "^9.39.0",
62
+ "eslint-config-prettier": "^10.1.8",
63
+ "eslint-formatter-pretty": "^7.0.0",
64
+ "eslint-plugin-prettier": "^5.5.4",
65
+ "globals": "^16.5.0",
66
+ "husky": "^9.1.7",
67
+ "lint-staged": "^16.2.6",
68
+ "prettier": "^3.6.2",
69
+ "taze": "^19.9.0",
70
+ "tsup": "^8.5.1",
71
+ "typescript": "^5.9.3",
72
+ "typescript-eslint": "^8.46.2"
73
+ },
74
+ "engines": {
75
+ "node": "24.11.0"
76
+ },
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "lint-staged": {
81
+ "**/*.ts": [
82
+ "prettier --write"
83
+ ],
84
+ "src/**/*.ts": [
85
+ "eslint --fix"
86
+ ]
87
+ },
88
+ "scripts": {
89
+ "build": "tsc --noEmit && tsup",
90
+ "postbuild": "pnpm run copy:collection && pnpm run copy:lib",
91
+ "copy:collection": "cpx src/collection.json dist && cpx 'src/libs/**/schema.json' dist/libs",
92
+ "copy:lib": "cpx 'src/libs/**/files/**/*' dist/libs",
93
+ "lint": "prettier --check . && eslint --format=pretty src",
94
+ "format": "prettier --write . && eslint --fix --format=pretty src",
95
+ "changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r . --include-path '.'",
96
+ "release": "cliff-jumper"
97
+ }
98
+ }