@magic-xpa/cli 4.1000.0-dev4100.390 → 4.1000.0-dev4100.393
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/package.json +1 -1
- package/src/schematics/magic-utils/rules/magic-option.scheme.d.ts +1 -1
- package/src/schematics/magic-utils/rules/magic-option.scheme.js.map +1 -1
- package/src/schematics/magic-utils/rules/magic-option.scheme.ts +1 -1
- package/src/schematics/mg-generate-component/index.js +4 -4
- package/src/schematics/mg-generate-component/index.js.map +1 -1
- package/src/schematics/mg-generate-component/index.ts +4 -4
- package/src/schematics/mg-generate-component/schema.json +3 -2
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-option.scheme.js","sourceRoot":"","sources":["magic-option.scheme.ts"],"names":[],"mappings":"","sourcesContent":["export interface dependency{\n name : string;\n version : string;\n}\nexport interface MagicOptionScheme {\n // Magic properties\n path? : string;\n allowTesting? : boolean;\n theme? : string;\n component? : string;\n module? : string;\n loadOnDemand? : boolean;\n
|
|
1
|
+
{"version":3,"file":"magic-option.scheme.js","sourceRoot":"","sources":["magic-option.scheme.ts"],"names":[],"mappings":"","sourcesContent":["export interface dependency{\n name : string;\n version : string;\n}\nexport interface MagicOptionScheme {\n // Magic properties\n path? : string;\n allowTesting? : boolean;\n theme? : string;\n component? : string;\n module? : string;\n loadOnDemand? : boolean;\n containertype? : string;\n skipHelp? : boolean;\n // Angular Properties\n project? : string;\n dependencies? : dependency[];\n devDependencies? : dependency[];\n skipInstall? : boolean;\n skipPackageJson? : boolean;\n cliVersion? : string;\n angularVersion? : string;\n}\n"]}
|
|
@@ -19,18 +19,18 @@ function mgGenerateComponent(options) {
|
|
|
19
19
|
}
|
|
20
20
|
exports.mgGenerateComponent = mgGenerateComponent;
|
|
21
21
|
// To get the module name from the FormId
|
|
22
|
-
// In the case of
|
|
22
|
+
// In the case of containertype="Directory", consider root module.
|
|
23
23
|
// In all other cases gets the first string value till separator(/) from the formId.
|
|
24
24
|
function getModuleName(options) {
|
|
25
25
|
let moduleName = "";
|
|
26
|
-
if (options.
|
|
26
|
+
if (options.containertype && options.containertype !== "Directory")
|
|
27
27
|
moduleName = options.component.split('/')[0];
|
|
28
28
|
return moduleName;
|
|
29
29
|
}
|
|
30
30
|
// To get loadOnDemand flag for the module
|
|
31
|
-
// In the case of
|
|
31
|
+
// In the case of containertype == "LoadOnDemandModule", consider it as true
|
|
32
32
|
// In all other cases, consider it as false
|
|
33
33
|
function getLoadOnDemandFlagForModule(options) {
|
|
34
|
-
return options.
|
|
34
|
+
return options.containertype === "LoadOnDemandModule";
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,4FAAmF;AAEnF,8CAA0C;AAC1C,4FAA4F;AAE5F,SAAgB,mBAAmB,CAAC,OAAyB;IAE3D,IAAG,OAAO,CAAC,SAAS,IAAI,EAAE,EAAC;QACzB,IAAA,YAAK,EAAC,qCAAqC,CAAC,CAAC;QAC7C,OAAO,IAAA,kBAAK,EAAC,EAAE,CAAC,CAAC;KAClB;IAED,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,YAAY,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAE7D,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,4CAAiB,EAAE,OAAO,CAAC;QAC3B,IAAA,wDAA6B,EAAC,OAAO,EAAE,IAAI,EAAC,IAAI,CAAC;KAClD,CAAC,CAAC;AACL,CAAC;AAdD,kDAcC;AAED,yCAAyC;AACzC,kEAAkE;AAClE,oFAAoF;AACpF,SAAS,aAAa,CAAC,OAA0B;IAC/C,IAAI,UAAU,GAAU,EAAE,CAAC;IAC3B,IAAG,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,KAAK,WAAW;QAC/D,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,0CAA0C;AAC1C,4EAA4E;AAC5E,2CAA2C;AAC3C,SAAS,4BAA4B,CAAC,OAA0B;IAC7D,OAAO,OAAO,CAAC,aAAa,KAAK,oBAAoB,CAAC;AACzD,CAAC","sourcesContent":["import { chain, Rule, SchematicContext, Tree } from \"@angular-devkit/schematics\";\r\nimport { initMagicMetadata} from \"../magic-utils/rules/init-magic-metadata.rule\";\r\nimport { MagicOptionScheme } from \"../magic-utils/rules/magic-option.scheme\";\r\nimport {LogLn} from \"../magic-utils/Util\";\r\nimport {initAndGenComponentsForModule} from \"../magic-utils/rules/init-gen-components.rule\";\r\n\r\nexport function mgGenerateComponent(options:MagicOptionScheme): Rule {\r\n\r\n if(options.component == ''){\r\n LogLn('Component name should not be empty.');\r\n return chain([]);\r\n }\r\n\r\n options.module = getModuleName(options);\r\n options.loadOnDemand = getLoadOnDemandFlagForModule(options);\r\n\r\n return chain([\r\n initMagicMetadata (options),\r\n initAndGenComponentsForModule(options, true,true)\r\n ]);\r\n}\r\n\r\n// To get the module name from the FormId\r\n// In the case of
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,4FAAmF;AAEnF,8CAA0C;AAC1C,4FAA4F;AAE5F,SAAgB,mBAAmB,CAAC,OAAyB;IAE3D,IAAG,OAAO,CAAC,SAAS,IAAI,EAAE,EAAC;QACzB,IAAA,YAAK,EAAC,qCAAqC,CAAC,CAAC;QAC7C,OAAO,IAAA,kBAAK,EAAC,EAAE,CAAC,CAAC;KAClB;IAED,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,YAAY,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAE7D,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,4CAAiB,EAAE,OAAO,CAAC;QAC3B,IAAA,wDAA6B,EAAC,OAAO,EAAE,IAAI,EAAC,IAAI,CAAC;KAClD,CAAC,CAAC;AACL,CAAC;AAdD,kDAcC;AAED,yCAAyC;AACzC,kEAAkE;AAClE,oFAAoF;AACpF,SAAS,aAAa,CAAC,OAA0B;IAC/C,IAAI,UAAU,GAAU,EAAE,CAAC;IAC3B,IAAG,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,KAAK,WAAW;QAC/D,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,0CAA0C;AAC1C,4EAA4E;AAC5E,2CAA2C;AAC3C,SAAS,4BAA4B,CAAC,OAA0B;IAC7D,OAAO,OAAO,CAAC,aAAa,KAAK,oBAAoB,CAAC;AACzD,CAAC","sourcesContent":["import { chain, Rule, SchematicContext, Tree } from \"@angular-devkit/schematics\";\r\nimport { initMagicMetadata} from \"../magic-utils/rules/init-magic-metadata.rule\";\r\nimport { MagicOptionScheme } from \"../magic-utils/rules/magic-option.scheme\";\r\nimport {LogLn} from \"../magic-utils/Util\";\r\nimport {initAndGenComponentsForModule} from \"../magic-utils/rules/init-gen-components.rule\";\r\n\r\nexport function mgGenerateComponent(options:MagicOptionScheme): Rule {\r\n\r\n if(options.component == ''){\r\n LogLn('Component name should not be empty.');\r\n return chain([]);\r\n }\r\n\r\n options.module = getModuleName(options);\r\n options.loadOnDemand = getLoadOnDemandFlagForModule(options);\r\n\r\n return chain([\r\n initMagicMetadata (options),\r\n initAndGenComponentsForModule(options, true,true)\r\n ]);\r\n}\r\n\r\n// To get the module name from the FormId\r\n// In the case of containertype=\"Directory\", consider root module.\r\n// In all other cases gets the first string value till separator(/) from the formId.\r\nfunction getModuleName(options: MagicOptionScheme){\r\n let moduleName:string = \"\";\r\n if(options.containertype && options.containertype !== \"Directory\")\r\n moduleName = options.component.split('/')[0];\r\n return moduleName;\r\n}\r\n\r\n// To get loadOnDemand flag for the module\r\n// In the case of containertype == \"LoadOnDemandModule\", consider it as true\r\n// In all other cases, consider it as false\r\nfunction getLoadOnDemandFlagForModule(options: MagicOptionScheme){\r\n return options.containertype === \"LoadOnDemandModule\";\r\n}\r\n"]}
|
|
@@ -21,18 +21,18 @@ export function mgGenerateComponent(options:MagicOptionScheme): Rule {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// To get the module name from the FormId
|
|
24
|
-
// In the case of
|
|
24
|
+
// In the case of containertype="Directory", consider root module.
|
|
25
25
|
// In all other cases gets the first string value till separator(/) from the formId.
|
|
26
26
|
function getModuleName(options: MagicOptionScheme){
|
|
27
27
|
let moduleName:string = "";
|
|
28
|
-
if(options.
|
|
28
|
+
if(options.containertype && options.containertype !== "Directory")
|
|
29
29
|
moduleName = options.component.split('/')[0];
|
|
30
30
|
return moduleName;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// To get loadOnDemand flag for the module
|
|
34
|
-
// In the case of
|
|
34
|
+
// In the case of containertype == "LoadOnDemandModule", consider it as true
|
|
35
35
|
// In all other cases, consider it as false
|
|
36
36
|
function getLoadOnDemandFlagForModule(options: MagicOptionScheme){
|
|
37
|
-
return options.
|
|
37
|
+
return options.containertype === "LoadOnDemandModule";
|
|
38
38
|
}
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
"description": "is allow testing ",
|
|
25
25
|
"aliases" : ["a"]
|
|
26
26
|
},
|
|
27
|
-
"
|
|
27
|
+
"containertype": {
|
|
28
28
|
"type": "string",
|
|
29
|
-
"description": "The value of container type (EagerModule, Directory, LoadOnDemandModule, '')"
|
|
29
|
+
"description": "The value of container type (EagerModule, Directory, LoadOnDemandModule, '')",
|
|
30
|
+
"aliases" : ["ct"]
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
33
|
"required": []
|