@nanoforge-dev/schematics 2.1.2 → 2.1.4-beta.af6c1e0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +15 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -15
- package/dist/index.js.map +1 -1
- package/dist/libs/application/application.factory.d.ts +6 -13
- package/dist/libs/application/application.factory.d.ts.map +1 -0
- package/dist/libs/application/application.factory.js +49 -68
- package/dist/libs/application/application.factory.js.map +1 -1
- package/dist/libs/component/component.factory.d.ts +6 -6
- package/dist/libs/component/component.factory.d.ts.map +1 -0
- package/dist/libs/component/component.factory.js +32 -47
- package/dist/libs/component/component.factory.js.map +1 -1
- package/dist/libs/configuration/configuration.factory.d.ts +6 -7
- package/dist/libs/configuration/configuration.factory.d.ts.map +1 -0
- package/dist/libs/configuration/configuration.factory.js +91 -133
- package/dist/libs/configuration/configuration.factory.js.map +1 -1
- package/dist/libs/docker/docker.factory.d.ts +6 -4
- package/dist/libs/docker/docker.factory.d.ts.map +1 -0
- package/dist/libs/docker/docker.factory.js +17 -36
- package/dist/libs/docker/docker.factory.js.map +1 -1
- package/dist/libs/part-base/files/js/__nanoforgeFolder__/client.save.json +2 -2
- package/dist/libs/part-base/files/js/__nanoforgeFolder__/server.save.json +2 -2
- package/dist/libs/part-base/files/js/__part__/components/example.component.js +21 -27
- package/dist/libs/part-base/files/ts/__nanoforgeFolder__/client.save.json +2 -2
- package/dist/libs/part-base/files/ts/__nanoforgeFolder__/server.save.json +2 -2
- package/dist/libs/part-base/files/ts/__part__/components/example.component.ts +21 -27
- package/dist/libs/part-base/part-base.factory.d.ts +6 -7
- package/dist/libs/part-base/part-base.factory.d.ts.map +1 -0
- package/dist/libs/part-base/part-base.factory.js +30 -41
- package/dist/libs/part-base/part-base.factory.js.map +1 -1
- package/dist/libs/part-main/part-main.factory.d.ts +6 -9
- package/dist/libs/part-main/part-main.factory.d.ts.map +1 -0
- package/dist/libs/part-main/part-main.factory.js +225 -260
- package/dist/libs/part-main/part-main.factory.js.map +1 -1
- package/dist/libs/system/system.factory.d.ts +6 -6
- package/dist/libs/system/system.factory.d.ts.map +1 -0
- package/dist/libs/system/system.factory.js +32 -50
- package/dist/libs/system/system.factory.js.map +1 -1
- package/package.json +18 -18
package/dist/index.cjs
CHANGED
|
@@ -1,48 +1,17 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/defaults.ts
|
|
3
|
+
const DEFAULT_APP_NAME = "nanoforge-app";
|
|
4
|
+
const DEFAULT_VERSION = "0.0.0";
|
|
5
|
+
const DEFAULT_AUTHOR = "";
|
|
6
|
+
const DEFAULT_DESCRIPTION = "";
|
|
7
|
+
const DEFAULT_LANGUAGE = "ts";
|
|
8
|
+
const DEFAULT_PACKAGE_MANAGER = "npm";
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.DEFAULT_APP_NAME = DEFAULT_APP_NAME;
|
|
11
|
+
exports.DEFAULT_AUTHOR = DEFAULT_AUTHOR;
|
|
12
|
+
exports.DEFAULT_DESCRIPTION = DEFAULT_DESCRIPTION;
|
|
13
|
+
exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
|
|
14
|
+
exports.DEFAULT_PACKAGE_MANAGER = DEFAULT_PACKAGE_MANAGER;
|
|
15
|
+
exports.DEFAULT_VERSION = DEFAULT_VERSION;
|
|
19
16
|
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
DEFAULT_APP_NAME: () => DEFAULT_APP_NAME,
|
|
24
|
-
DEFAULT_AUTHOR: () => DEFAULT_AUTHOR,
|
|
25
|
-
DEFAULT_DESCRIPTION: () => DEFAULT_DESCRIPTION,
|
|
26
|
-
DEFAULT_LANGUAGE: () => DEFAULT_LANGUAGE,
|
|
27
|
-
DEFAULT_PACKAGE_MANAGER: () => DEFAULT_PACKAGE_MANAGER,
|
|
28
|
-
DEFAULT_VERSION: () => DEFAULT_VERSION
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(index_exports);
|
|
31
|
-
|
|
32
|
-
// src/defaults.ts
|
|
33
|
-
var DEFAULT_APP_NAME = "nanoforge-app";
|
|
34
|
-
var DEFAULT_VERSION = "0.0.0";
|
|
35
|
-
var DEFAULT_AUTHOR = "";
|
|
36
|
-
var DEFAULT_DESCRIPTION = "";
|
|
37
|
-
var DEFAULT_LANGUAGE = "ts";
|
|
38
|
-
var DEFAULT_PACKAGE_MANAGER = "npm";
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
DEFAULT_APP_NAME,
|
|
42
|
-
DEFAULT_AUTHOR,
|
|
43
|
-
DEFAULT_DESCRIPTION,
|
|
44
|
-
DEFAULT_LANGUAGE,
|
|
45
|
-
DEFAULT_PACKAGE_MANAGER,
|
|
46
|
-
DEFAULT_VERSION
|
|
47
|
-
});
|
|
48
17
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";;AAAA,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAChC,MAAa,0BAA0B"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
//#region src/defaults.d.ts
|
|
1
2
|
declare const DEFAULT_APP_NAME = "nanoforge-app";
|
|
2
3
|
declare const DEFAULT_VERSION = "0.0.0";
|
|
3
4
|
declare const DEFAULT_AUTHOR = "";
|
|
4
5
|
declare const DEFAULT_DESCRIPTION = "";
|
|
5
6
|
declare const DEFAULT_LANGUAGE = "ts";
|
|
6
7
|
declare const DEFAULT_PACKAGE_MANAGER = "npm";
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
8
9
|
export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
|
|
10
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/defaults.ts"],"mappings":";cAAa,gBAAA;AAAA,cACA,eAAA;AAAA,cACA,cAAA;AAAA,cACA,mBAAA;AAAA,cACA,gBAAA;AAAA,cACA,uBAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
//#region src/defaults.d.ts
|
|
1
2
|
declare const DEFAULT_APP_NAME = "nanoforge-app";
|
|
2
3
|
declare const DEFAULT_VERSION = "0.0.0";
|
|
3
4
|
declare const DEFAULT_AUTHOR = "";
|
|
4
5
|
declare const DEFAULT_DESCRIPTION = "";
|
|
5
6
|
declare const DEFAULT_LANGUAGE = "ts";
|
|
6
7
|
declare const DEFAULT_PACKAGE_MANAGER = "npm";
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
8
9
|
export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/defaults.ts"],"mappings":";cAAa,gBAAA;AAAA,cACA,eAAA;AAAA,cACA,cAAA;AAAA,cACA,mBAAA;AAAA,cACA,gBAAA;AAAA,cACA,uBAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
DEFAULT_DESCRIPTION,
|
|
12
|
-
DEFAULT_LANGUAGE,
|
|
13
|
-
DEFAULT_PACKAGE_MANAGER,
|
|
14
|
-
DEFAULT_VERSION
|
|
15
|
-
};
|
|
1
|
+
//#region src/defaults.ts
|
|
2
|
+
const DEFAULT_APP_NAME = "nanoforge-app";
|
|
3
|
+
const DEFAULT_VERSION = "0.0.0";
|
|
4
|
+
const DEFAULT_AUTHOR = "";
|
|
5
|
+
const DEFAULT_DESCRIPTION = "";
|
|
6
|
+
const DEFAULT_LANGUAGE = "ts";
|
|
7
|
+
const DEFAULT_PACKAGE_MANAGER = "npm";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DEFAULT_APP_NAME, DEFAULT_AUTHOR, DEFAULT_DESCRIPTION, DEFAULT_LANGUAGE, DEFAULT_PACKAGE_MANAGER, DEFAULT_VERSION };
|
|
10
|
+
|
|
16
11
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n"],"mappings":";AAAA,MAAa,mBAAmB;AAChC,MAAa,kBAAkB;AAC/B,MAAa,iBAAiB;AAC9B,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAChC,MAAa,0BAA0B"}
|
|
@@ -1,62 +1,55 @@
|
|
|
1
|
-
import { Rule } from
|
|
1
|
+
import { Rule } from "@angular-devkit/schematics";
|
|
2
2
|
|
|
3
|
+
//#region src/libs/application/application.schema.d.ts
|
|
3
4
|
interface ApplicationSchema {
|
|
4
5
|
/**
|
|
5
6
|
* NanoForge application name
|
|
6
7
|
*/
|
|
7
8
|
name: string;
|
|
8
|
-
|
|
9
9
|
/**
|
|
10
10
|
* NanoForge application version
|
|
11
11
|
*/
|
|
12
12
|
version?: string;
|
|
13
|
-
|
|
14
13
|
/**
|
|
15
14
|
* NanoForge application author
|
|
16
15
|
*/
|
|
17
16
|
author?: string;
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
18
|
* NanoForge application description
|
|
21
19
|
*/
|
|
22
20
|
description?: string;
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* NanoForge application destination directory
|
|
26
23
|
*/
|
|
27
24
|
directory?: string;
|
|
28
|
-
|
|
29
25
|
/**
|
|
30
26
|
* NanoForge Application language
|
|
31
27
|
*/
|
|
32
28
|
language?: "js" | "ts";
|
|
33
|
-
|
|
34
29
|
/**
|
|
35
30
|
* With strict mode (TypeScript or JavaScript but only on compatible editor)
|
|
36
31
|
*/
|
|
37
32
|
strict?: boolean;
|
|
38
|
-
|
|
39
33
|
/**
|
|
40
34
|
* Generate lint files
|
|
41
35
|
*/
|
|
42
36
|
lint?: boolean;
|
|
43
|
-
|
|
44
37
|
/**
|
|
45
38
|
* The used package manager
|
|
46
39
|
*/
|
|
47
40
|
packageManager?: "npm" | "yarn" | "pnpm" | "bun";
|
|
48
|
-
|
|
49
41
|
/**
|
|
50
42
|
* Configure a server for the application
|
|
51
43
|
*/
|
|
52
44
|
server?: boolean;
|
|
53
|
-
|
|
54
45
|
/**
|
|
55
46
|
* Add editor dependencies
|
|
56
47
|
*/
|
|
57
48
|
editor: boolean;
|
|
58
49
|
}
|
|
59
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/libs/application/application.factory.d.ts
|
|
60
52
|
declare const main: (schema: ApplicationSchema) => Rule;
|
|
61
|
-
|
|
53
|
+
//#endregion
|
|
62
54
|
export { main };
|
|
55
|
+
//# sourceMappingURL=application.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.factory.d.ts","names":["name","version","author","description","directory","language","strict","lint","packageManager","server","editor"],"sources":["../../../src/libs/application/application.schema.d.ts","../../../src/libs/application/application.factory.ts"],"mappings":";;;UAAiB,iBAAA;;;AAAjB;EAIEA,IAAAA;EAJgC;;;EAShCC,OAAAA;EAeAG;;;EAVAF,MAAAA;EAmCAO;;;EA9BAN,WAAAA;;;ACkCF;ED7BEC,SAAAA;ECmDD;;;ED9CCC,QAAAA;EC8CD;;;EDzCCC,MAAAA;;;;EAKAC,IAAAA;;;;EAKAC,cAAAA;;;;EAKAC,MAAAA;;;;EAKAC,MAAAA;AAAAA;;;cCDW,IAAA,GAAQ,MAAA,EAAQ,iBAAA,KAAoB,IAsBhD"}
|
|
@@ -1,72 +1,53 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/libs/application/application.factory.ts
|
|
5
1
|
import { join, normalize, strings } from "@angular-devkit/core";
|
|
6
|
-
import {
|
|
7
|
-
apply,
|
|
8
|
-
mergeWith,
|
|
9
|
-
move,
|
|
10
|
-
renameTemplateFiles,
|
|
11
|
-
template,
|
|
12
|
-
url
|
|
13
|
-
} from "@angular-devkit/schematics";
|
|
2
|
+
import { apply, mergeWith, move, renameTemplateFiles, template, url } from "@angular-devkit/schematics";
|
|
14
3
|
import { firstValueFrom } from "rxjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
description: schema.description ?? DEFAULT_DESCRIPTION,
|
|
31
|
-
language: schema.language ?? DEFAULT_LANGUAGE,
|
|
32
|
-
strict: schema.strict ?? true,
|
|
33
|
-
lint: schema.lint ?? true,
|
|
34
|
-
packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,
|
|
35
|
-
server: schema.server ?? false,
|
|
36
|
-
editor: schema.editor ?? false
|
|
37
|
-
};
|
|
38
|
-
}, "transform");
|
|
39
|
-
var generate = /* @__PURE__ */ __name((options, path) => {
|
|
40
|
-
return apply(url(join("./files", options.language)), [
|
|
41
|
-
template({
|
|
42
|
-
...strings,
|
|
43
|
-
...options
|
|
44
|
-
}),
|
|
45
|
-
renameTemplateFiles(),
|
|
46
|
-
move(normalize(path))
|
|
47
|
-
]);
|
|
48
|
-
}, "generate");
|
|
49
|
-
var main = /* @__PURE__ */ __name((schema) => {
|
|
50
|
-
const options = transform(schema);
|
|
51
|
-
const path = schema.directory ?? options.name;
|
|
52
|
-
return async (baseTree, context) => {
|
|
53
|
-
let tree = await mergeWith(generate(options, path))(baseTree, context);
|
|
54
|
-
if (!tree) return tree;
|
|
55
|
-
if (!("delete" in tree)) {
|
|
56
|
-
if (typeof tree === "function") return tree;
|
|
57
|
-
tree = await firstValueFrom(tree);
|
|
58
|
-
}
|
|
59
|
-
if (!options.lint) {
|
|
60
|
-
const basePath = join("/", path);
|
|
61
|
-
tree.delete(join(basePath, "eslint.config.js"));
|
|
62
|
-
tree.delete(join(basePath, "prettier.config.js"));
|
|
63
|
-
tree.delete(join(basePath, ".prettierignore"));
|
|
64
|
-
if (options.language === "js") tree.delete(join(basePath, "jsconfig.json"));
|
|
65
|
-
}
|
|
66
|
-
return tree;
|
|
67
|
-
};
|
|
68
|
-
}, "main");
|
|
69
|
-
export {
|
|
70
|
-
main
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/libs/application/application.factory.ts
|
|
6
|
+
const transform = (schema) => {
|
|
7
|
+
return {
|
|
8
|
+
name: schema.name ?? "nanoforge-app",
|
|
9
|
+
version: schema.version ?? "0.0.0",
|
|
10
|
+
author: schema.author ?? "",
|
|
11
|
+
description: schema.description ?? "",
|
|
12
|
+
language: schema.language ?? "ts",
|
|
13
|
+
strict: schema.strict ?? true,
|
|
14
|
+
lint: schema.lint ?? true,
|
|
15
|
+
packageManager: schema.packageManager ?? "npm",
|
|
16
|
+
server: schema.server ?? false,
|
|
17
|
+
editor: schema.editor ?? false
|
|
18
|
+
};
|
|
71
19
|
};
|
|
20
|
+
const generate = (options, path) => {
|
|
21
|
+
return apply(url(join("./files", options.language)), [
|
|
22
|
+
template({
|
|
23
|
+
...strings,
|
|
24
|
+
...options
|
|
25
|
+
}),
|
|
26
|
+
renameTemplateFiles(),
|
|
27
|
+
move(normalize(path))
|
|
28
|
+
]);
|
|
29
|
+
};
|
|
30
|
+
const main = (schema) => {
|
|
31
|
+
const options = transform(schema);
|
|
32
|
+
const path = schema.directory ?? options.name;
|
|
33
|
+
return async (baseTree, context) => {
|
|
34
|
+
let tree = await mergeWith(generate(options, path))(baseTree, context);
|
|
35
|
+
if (!tree) return tree;
|
|
36
|
+
if (!("delete" in tree)) {
|
|
37
|
+
if (typeof tree === "function") return tree;
|
|
38
|
+
tree = await firstValueFrom(tree);
|
|
39
|
+
}
|
|
40
|
+
if (!options.lint) {
|
|
41
|
+
const basePath = join("/", path);
|
|
42
|
+
tree.delete(join(basePath, "eslint.config.js"));
|
|
43
|
+
tree.delete(join(basePath, "prettier.config.js"));
|
|
44
|
+
tree.delete(join(basePath, ".prettierignore"));
|
|
45
|
+
if (options.language === "js") tree.delete(join(basePath, "jsconfig.json"));
|
|
46
|
+
}
|
|
47
|
+
return tree;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { main };
|
|
52
|
+
|
|
72
53
|
//# sourceMappingURL=application.factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"application.factory.js","names":[],"sources":["../../../src/defaults.ts","../../../src/libs/application/application.factory.ts"],"sourcesContent":["export const DEFAULT_APP_NAME = \"nanoforge-app\";\nexport const DEFAULT_VERSION = \"0.0.0\";\nexport const DEFAULT_AUTHOR = \"\";\nexport const DEFAULT_DESCRIPTION = \"\";\nexport const DEFAULT_LANGUAGE = \"ts\";\nexport const DEFAULT_PACKAGE_MANAGER = \"npm\";\n","import { type Path, join, normalize, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type SchematicContext,\n type Source,\n type Tree,\n apply,\n mergeWith,\n move,\n renameTemplateFiles,\n template,\n url,\n} from \"@angular-devkit/schematics\";\nimport { firstValueFrom } from \"rxjs\";\n\nimport {\n DEFAULT_APP_NAME,\n DEFAULT_AUTHOR,\n DEFAULT_DESCRIPTION,\n DEFAULT_LANGUAGE,\n DEFAULT_PACKAGE_MANAGER,\n DEFAULT_VERSION,\n} from \"~/defaults\";\n\nimport { type ApplicationOptions } from \"./application.options\";\nimport { type ApplicationSchema } from \"./application.schema\";\n\nconst transform = (schema: ApplicationSchema): ApplicationOptions => {\n return {\n name: schema.name ?? DEFAULT_APP_NAME,\n version: schema.version ?? DEFAULT_VERSION,\n author: schema.author ?? DEFAULT_AUTHOR,\n description: schema.description ?? DEFAULT_DESCRIPTION,\n language: schema.language ?? DEFAULT_LANGUAGE,\n strict: schema.strict ?? true,\n lint: schema.lint ?? true,\n packageManager: schema.packageManager ?? DEFAULT_PACKAGE_MANAGER,\n server: schema.server ?? false,\n editor: schema.editor ?? false,\n };\n};\n\nconst generate = (options: ApplicationOptions, path: string): Source => {\n return apply(url(join(\"./files\" as Path, options.language)), [\n template({\n ...strings,\n ...options,\n }),\n renameTemplateFiles(),\n move(normalize(path)),\n ]);\n};\n\nexport const main = (schema: ApplicationSchema): Rule => {\n const options = transform(schema);\n const path = schema.directory ?? options.name;\n\n return async (baseTree: Tree, context: SchematicContext) => {\n let tree = await mergeWith(generate(options, path))(baseTree, context);\n if (!tree) return tree;\n if (!(\"delete\" in tree)) {\n if (typeof tree === \"function\") return tree;\n tree = await firstValueFrom(tree);\n }\n\n if (!options.lint) {\n const basePath = join(\"/\" as Path, path);\n tree.delete(join(basePath, \"eslint.config.js\"));\n tree.delete(join(basePath, \"prettier.config.js\"));\n tree.delete(join(basePath, \".prettierignore\"));\n if (options.language === \"js\") tree.delete(join(basePath, \"jsconfig.json\"));\n }\n\n return tree;\n };\n};\n"],"mappings":";;;;;AC2BA,MAAM,aAAa,WAAkD;CACnE,OAAO;EACL,MAAM,OAAO,QAAA;EACb,SAAS,OAAO,WAAA;EAChB,QAAQ,OAAO,UAAA;EACf,aAAa,OAAO,eAAA;EACpB,UAAU,OAAO,YAAA;EACjB,QAAQ,OAAO,UAAU;EACzB,MAAM,OAAO,QAAQ;EACrB,gBAAgB,OAAO,kBAAA;EACvB,QAAQ,OAAO,UAAU;EACzB,QAAQ,OAAO,UAAU;CAC3B;AACF;AAEA,MAAM,YAAY,SAA6B,SAAyB;CACtE,OAAO,MAAM,IAAI,KAAK,WAAmB,QAAQ,QAAQ,CAAC,GAAG;EAC3D,SAAS;GACP,GAAG;GACH,GAAG;EACL,CAAC;EACD,oBAAoB;EACpB,KAAK,UAAU,IAAI,CAAC;CACtB,CAAC;AACH;AAEA,MAAa,QAAQ,WAAoC;CACvD,MAAM,UAAU,UAAU,MAAM;CAChC,MAAM,OAAO,OAAO,aAAa,QAAQ;CAEzC,OAAO,OAAO,UAAgB,YAA8B;EAC1D,IAAI,OAAO,MAAM,UAAU,SAAS,SAAS,IAAI,CAAC,EAAE,UAAU,OAAO;EACrE,IAAI,CAAC,MAAM,OAAO;EAClB,IAAI,EAAE,YAAY,OAAO;GACvB,IAAI,OAAO,SAAS,YAAY,OAAO;GACvC,OAAO,MAAM,eAAe,IAAI;EAClC;EAEA,IAAI,CAAC,QAAQ,MAAM;GACjB,MAAM,WAAW,KAAK,KAAa,IAAI;GACvC,KAAK,OAAO,KAAK,UAAU,kBAAkB,CAAC;GAC9C,KAAK,OAAO,KAAK,UAAU,oBAAoB,CAAC;GAChD,KAAK,OAAO,KAAK,UAAU,iBAAiB,CAAC;GAC7C,IAAI,QAAQ,aAAa,MAAM,KAAK,OAAO,KAAK,UAAU,eAAe,CAAC;EAC5E;EAEA,OAAO;CACT;AACF"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Rule } from
|
|
1
|
+
import { Rule } from "@angular-devkit/schematics";
|
|
2
2
|
|
|
3
|
+
//#region src/libs/component/component.schema.d.ts
|
|
3
4
|
interface ComponentSchema {
|
|
4
5
|
/**
|
|
5
6
|
* Component destination directory
|
|
6
7
|
*/
|
|
7
8
|
name: string;
|
|
8
|
-
|
|
9
9
|
/**
|
|
10
10
|
* Component destination directory
|
|
11
11
|
*/
|
|
12
12
|
directory: string;
|
|
13
|
-
|
|
14
13
|
/**
|
|
15
14
|
* The part of the application to generate
|
|
16
15
|
*/
|
|
17
16
|
part: "client" | "server";
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
18
|
* NanoForge Application language
|
|
21
19
|
*/
|
|
22
20
|
language: "js" | "ts";
|
|
23
21
|
}
|
|
24
|
-
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/libs/component/component.factory.d.ts
|
|
25
24
|
declare const main: (schema: ComponentSchema) => Rule;
|
|
26
|
-
|
|
25
|
+
//#endregion
|
|
27
26
|
export { main };
|
|
27
|
+
//# sourceMappingURL=component.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.factory.d.ts","names":["name","directory","part","language"],"sources":["../../../src/libs/component/component.schema.d.ts","../../../src/libs/component/component.factory.ts"],"mappings":";;;UAAiB,eAAA;;;AAAjB;EAIEA,IAAAA;EAJ8B;;;EAS9BC,SAAAA;EAUQ;AAAA;;EALRC,IAAAA;ECsBF;;;EDjBEC,QAAAA;AAAAA;;;cCiBW,IAAA,GAAQ,MAAA,EAAQ,eAAA,KAAkB,IAI9C"}
|
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/libs/component/component.factory.ts
|
|
5
1
|
import { join, normalize, strings } from "@angular-devkit/core";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
17
|
-
}, "toWords");
|
|
18
|
-
var toKebabCase = /* @__PURE__ */ __name((str) => {
|
|
19
|
-
return toWords(str).map((word) => word.toLowerCase()).join("-");
|
|
20
|
-
}, "toKebabCase");
|
|
21
|
-
var toPascalCase = /* @__PURE__ */ __name((str) => {
|
|
22
|
-
return toWords(str).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
|
|
23
|
-
}, "toPascalCase");
|
|
24
|
-
|
|
25
|
-
// src/libs/component/component.factory.ts
|
|
26
|
-
var transform = /* @__PURE__ */ __name((schema) => {
|
|
27
|
-
return {
|
|
28
|
-
part: schema.part,
|
|
29
|
-
className: toPascalCase(schema.name),
|
|
30
|
-
fileName: toKebabCase(schema.name)
|
|
31
|
-
};
|
|
32
|
-
}, "transform");
|
|
33
|
-
var generate = /* @__PURE__ */ __name((options, path, language) => {
|
|
34
|
-
const rules = [
|
|
35
|
-
template({
|
|
36
|
-
...strings,
|
|
37
|
-
...options
|
|
38
|
-
}),
|
|
39
|
-
move(normalize(path))
|
|
40
|
-
];
|
|
41
|
-
return apply(url(join("./files", language)), rules);
|
|
42
|
-
}, "generate");
|
|
43
|
-
var main = /* @__PURE__ */ __name((schema) => {
|
|
44
|
-
const options = transform(schema);
|
|
45
|
-
return mergeWith(generate(options, schema.directory, schema.language));
|
|
46
|
-
}, "main");
|
|
47
|
-
export {
|
|
48
|
-
main
|
|
2
|
+
import { apply, mergeWith, move, template, url } from "@angular-devkit/schematics";
|
|
3
|
+
//#region src/utils/formatting.ts
|
|
4
|
+
const toWords = (str) => {
|
|
5
|
+
return str.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
6
|
+
};
|
|
7
|
+
const toKebabCase = (str) => {
|
|
8
|
+
return toWords(str).map((word) => word.toLowerCase()).join("-");
|
|
9
|
+
};
|
|
10
|
+
const toPascalCase = (str) => {
|
|
11
|
+
return toWords(str).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
|
|
49
12
|
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/libs/component/component.factory.ts
|
|
15
|
+
const transform = (schema) => {
|
|
16
|
+
return {
|
|
17
|
+
part: schema.part,
|
|
18
|
+
className: toPascalCase(schema.name),
|
|
19
|
+
fileName: toKebabCase(schema.name)
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const generate = (options, path, language) => {
|
|
23
|
+
const rules = [template({
|
|
24
|
+
...strings,
|
|
25
|
+
...options
|
|
26
|
+
}), move(normalize(path))];
|
|
27
|
+
return apply(url(join("./files", language)), rules);
|
|
28
|
+
};
|
|
29
|
+
const main = (schema) => {
|
|
30
|
+
return mergeWith(generate(transform(schema), schema.directory, schema.language));
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { main };
|
|
34
|
+
|
|
50
35
|
//# sourceMappingURL=component.factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"component.factory.js","names":[],"sources":["../../../src/utils/formatting.ts","../../../src/libs/component/component.factory.ts"],"sourcesContent":["const toWords = (str: string): string[] => {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .replace(/([A-Z]+)([A-Z][a-z])/g, \"$1 $2\")\n .replace(/[-_]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n};\n\nexport const toKebabCase = (str: string): string => {\n return toWords(str)\n .map((word) => word.toLowerCase())\n .join(\"-\");\n};\n\nexport const toPascalCase = (str: string): string => {\n return toWords(str)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\"\");\n};\n\nexport const toCamelCase = (str: string): string => {\n const words = toWords(str);\n return words\n .map((word, i) =>\n i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(),\n )\n .join(\"\");\n};\n","import { type Path, join, normalize, strings } from \"@angular-devkit/core\";\nimport {\n type Rule,\n type Source,\n apply,\n mergeWith,\n move,\n template,\n url,\n} from \"@angular-devkit/schematics\";\n\nimport { toKebabCase, toPascalCase } from \"@utils/formatting\";\n\nimport { type ComponentOptions } from \"./component.options\";\nimport { type ComponentSchema } from \"./component.schema\";\n\nconst transform = (schema: ComponentSchema): ComponentOptions => {\n return {\n part: schema.part,\n className: toPascalCase(schema.name),\n fileName: toKebabCase(schema.name),\n };\n};\n\nconst generate = (options: ComponentOptions, path: string, language: \"ts\" | \"js\"): Source => {\n const rules = [\n template({\n ...strings,\n ...options,\n }),\n move(normalize(path)),\n ];\n\n return apply(url(join(\"./files\" as Path, language)), rules);\n};\n\nexport const main = (schema: ComponentSchema): Rule => {\n const options = transform(schema);\n\n return mergeWith(generate(options, schema.directory, schema.language));\n};\n"],"mappings":";;;AAAA,MAAM,WAAW,QAA0B;CACzC,OAAO,IACJ,QAAQ,mBAAmB,OAAO,EAClC,QAAQ,yBAAyB,OAAO,EACxC,QAAQ,UAAU,GAAG,EACrB,KAAK,EACL,MAAM,KAAK,EACX,OAAO,OAAO;AACnB;AAEA,MAAa,eAAe,QAAwB;CAClD,OAAO,QAAQ,GAAG,EACf,KAAK,SAAS,KAAK,YAAY,CAAC,EAChC,KAAK,GAAG;AACb;AAEA,MAAa,gBAAgB,QAAwB;CACnD,OAAO,QAAQ,GAAG,EACf,KAAK,SAAS,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,EACxE,KAAK,EAAE;AACZ;;;ACJA,MAAM,aAAa,WAA8C;CAC/D,OAAO;EACL,MAAM,OAAO;EACb,WAAW,aAAa,OAAO,IAAI;EACnC,UAAU,YAAY,OAAO,IAAI;CACnC;AACF;AAEA,MAAM,YAAY,SAA2B,MAAc,aAAkC;CAC3F,MAAM,QAAQ,CACZ,SAAS;EACP,GAAG;EACH,GAAG;CACL,CAAC,GACD,KAAK,UAAU,IAAI,CAAC,CACtB;CAEA,OAAO,MAAM,IAAI,KAAK,WAAmB,QAAQ,CAAC,GAAG,KAAK;AAC5D;AAEA,MAAa,QAAQ,WAAkC;CAGrD,OAAO,UAAU,SAFD,UAAU,MAEA,GAAS,OAAO,WAAW,OAAO,QAAQ,CAAC;AACvE"}
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import { Rule } from
|
|
1
|
+
import { Rule } from "@angular-devkit/schematics";
|
|
2
2
|
|
|
3
|
+
//#region src/libs/configuration/configuration.schema.d.ts
|
|
3
4
|
interface ConfigurationSchema {
|
|
4
5
|
/**
|
|
5
6
|
* The name of the application
|
|
6
7
|
*/
|
|
7
8
|
name: string;
|
|
8
|
-
|
|
9
9
|
/**
|
|
10
10
|
* NanoForge application destination directory
|
|
11
11
|
*/
|
|
12
12
|
directory: string;
|
|
13
|
-
|
|
14
13
|
/**
|
|
15
14
|
* Configure a server for the application
|
|
16
15
|
*/
|
|
17
16
|
server: boolean;
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
18
|
* NanoForge Application language
|
|
21
19
|
*/
|
|
22
20
|
language: "js" | "ts";
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* Add init functions to the application
|
|
26
23
|
*/
|
|
27
24
|
initFunctions: boolean;
|
|
28
25
|
}
|
|
29
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/libs/configuration/configuration.factory.d.ts
|
|
30
28
|
declare const main: (schema: ConfigurationSchema) => Rule;
|
|
31
|
-
|
|
29
|
+
//#endregion
|
|
32
30
|
export { main };
|
|
31
|
+
//# sourceMappingURL=configuration.factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.factory.d.ts","names":["name","directory","server","language","initFunctions"],"sources":["../../../src/libs/configuration/configuration.schema.d.ts","../../../src/libs/configuration/configuration.factory.ts"],"mappings":";;;UAAiB,mBAAA;;;AAAjB;EAIEA,IAAAA;EAJkC;;;EASlCC,SAAAA;EAeAG;;AAAa;EAVbF,MAAAA;;ACkEF;;ED7DEC,QAAAA;EC6D2B;;;EDxD3BC,aAAAA;AAAAA;;;cCwDW,IAAA,GAAQ,MAAA,EAAQ,mBAAA,KAAsB,IAUlD"}
|