@abp/nx.generators 7.4.0-rc.2 → 7.4.0-rc.4

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/generators.json CHANGED
@@ -9,6 +9,11 @@
9
9
  "factory": "./src/generators/update-version/generator",
10
10
  "schema": "./src/generators/update-version/schema.json",
11
11
  "description": "update-version generator"
12
+ },
13
+ "change-theme": {
14
+ "factory": "./src/generators/change-theme/generator",
15
+ "schema": "./src/generators/change-theme/schema.json",
16
+ "description": "change-theme generator"
12
17
  }
13
18
  }
14
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abp/nx.generators",
3
- "version": "7.4.0-rc.2",
3
+ "version": "7.4.0-rc.4",
4
4
  "homepage": "https://abp.io",
5
5
  "generators": "./generators.json",
6
6
  "type": "commonjs",
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { ChangeThemeGeneratorSchema } from './schema';
3
+ export declare function changeThemeGenerator(host: Tree, schema: ChangeThemeGeneratorSchema): Promise<() => void>;
4
+ export default changeThemeGenerator;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.changeThemeGenerator = void 0;
4
+ const ngcli_adapter_1 = require("@nx/devkit/ngcli-adapter");
5
+ const theme_options_enum_1 = require("./theme-options.enum");
6
+ async function changeThemeGenerator(host, schema) {
7
+ const schematicPath = schema.localPath || '@abp/ng.schematics';
8
+ const runAngularLibrarySchematic = (0, ngcli_adapter_1.wrapAngularDevkitSchematic)(schema.localPath ? `${host.root}${schematicPath}` : schematicPath, 'change-theme');
9
+ await runAngularLibrarySchematic(host, {
10
+ ...schema,
11
+ });
12
+ return () => {
13
+ const destTheme = Object.values(theme_options_enum_1.ThemeOptionsEnum).find((theme, index) => index + 1 === schema.name);
14
+ console.log(`✅️ Switched to Theme ${destTheme}`);
15
+ };
16
+ }
17
+ exports.changeThemeGenerator = changeThemeGenerator;
18
+ exports.default = changeThemeGenerator;
19
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/generators/src/generators/change-theme/generator.ts"],"names":[],"mappings":";;;AACA,4DAAsE;AAEtE,6DAAwD;AAEjD,KAAK,UAAU,oBAAoB,CAAC,IAAU,EAAE,MAAkC;IACvF,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,IAAI,oBAAoB,CAAC;IAE/D,MAAM,0BAA0B,GAAG,IAAA,0CAA0B,EAC3D,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,aAAa,EAAE,CAAC,CAAC,CAAC,aAAa,EACjE,cAAc,CACf,CAAC;IAEF,MAAM,0BAA0B,CAAC,IAAI,EAAE;QACrC,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE;QACV,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,qCAAgB,CAAC,CAAC,IAAI,CACpD,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,MAAM,CAAC,IAAI,CAC5C,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,wBAAwB,SAAS,EAAE,CAAC,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC;AAlBD,oDAkBC;AAED,kBAAe,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './theme-options.enum';
2
+ export * from './schema';
3
+ export * from './generator';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./theme-options.enum"), exports);
5
+ tslib_1.__exportStar(require("./schema"), exports);
6
+ tslib_1.__exportStar(require("./generator"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/generators/src/generators/change-theme/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,mDAAyB;AACzB,sDAA4B"}
@@ -0,0 +1,5 @@
1
+ export interface ChangeThemeGeneratorSchema {
2
+ name: number;
3
+ targetOption: string;
4
+ localPath?: string;
5
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "SchematicsABPThemeChanger",
4
+ "title": "ABP Theme Style Generator API Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "description": "The name of theme will change.",
9
+ "type": "number",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "enum": [1, 2, 3, 4],
15
+ "x-prompt": {
16
+ "message": "Which theme would you like to use?",
17
+ "type": "list",
18
+ "items": [
19
+ { "value": 1, "label": "Basic" },
20
+ { "value": 2, "label": "Lepton" },
21
+ { "value": 3, "label": "LeptonXLite" },
22
+ { "value": 4, "label": "LeptonX" }
23
+ ]
24
+ }
25
+ },
26
+ "targetProject": {
27
+ "description": "The name of the project will change the style.The project type must be 'application'",
28
+ "type": "string",
29
+ "x-prompt": "Please enter the project name",
30
+ "$default": {
31
+ "$source": "argv",
32
+ "index": 1
33
+ }
34
+ },
35
+ "localPath": {
36
+ "description": "If set value schematics will work on given path",
37
+ "type": "string"
38
+ }
39
+ },
40
+ "required": ["name", "targetProject"]
41
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum ThemeOptionsEnum {
2
+ Basic = 1,
3
+ Lepton = 2,
4
+ LeptonXLite = 3,
5
+ LeptonX = 4
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // this enum create by https://raw.githubusercontent.com/abpframework/abp/rel-7.4/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Theme.cs
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ThemeOptionsEnum = void 0;
5
+ var ThemeOptionsEnum;
6
+ (function (ThemeOptionsEnum) {
7
+ ThemeOptionsEnum[ThemeOptionsEnum["Basic"] = 1] = "Basic";
8
+ ThemeOptionsEnum[ThemeOptionsEnum["Lepton"] = 2] = "Lepton";
9
+ ThemeOptionsEnum[ThemeOptionsEnum["LeptonXLite"] = 3] = "LeptonXLite";
10
+ ThemeOptionsEnum[ThemeOptionsEnum["LeptonX"] = 4] = "LeptonX";
11
+ })(ThemeOptionsEnum = exports.ThemeOptionsEnum || (exports.ThemeOptionsEnum = {}));
12
+ //# sourceMappingURL=theme-options.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-options.enum.js","sourceRoot":"","sources":["../../../../../../packages/generators/src/generators/change-theme/theme-options.enum.ts"],"names":[],"mappings":";AAAA,gKAAgK;;;AAEhK,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,yDAAS,CAAA;IACT,2DAAU,CAAA;IACV,qEAAe,CAAA;IACf,6DAAW,CAAA;AACb,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B"}
package/src/index.d.ts CHANGED
@@ -1 +1,3 @@
1
+ export * from './generators/change-theme';
1
2
  export * from './generators/generate-proxy';
3
+ export * from './generators/update-version';
package/src/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./generators/change-theme"), exports);
4
5
  tslib_1.__exportStar(require("./generators/generate-proxy"), exports);
6
+ tslib_1.__exportStar(require("./generators/update-version"), exports);
5
7
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/generators/src/index.ts"],"names":[],"mappings":";;;AAAA,sEAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/generators/src/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,sEAA4C;AAC5C,sEAA4C"}