@igniteui/angular-schematics 17.1.1310 → 17.1.1312

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igniteui/angular-schematics",
3
- "version": "17.1.1310",
3
+ "version": "17.1.1312",
4
4
  "description": "Ignite UI for Angular Schematics for ng new and ng generate",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,8 +22,8 @@
22
22
  "dependencies": {
23
23
  "@angular-devkit/core": "~14.0.0",
24
24
  "@angular-devkit/schematics": "~14.0.0",
25
- "@igniteui/angular-templates": "~17.1.1310",
26
- "@igniteui/cli-core": "~13.1.0",
25
+ "@igniteui/angular-templates": "~17.1.1312",
26
+ "@igniteui/cli-core": "~13.1.2",
27
27
  "@schematics/angular": "~14.0.0",
28
28
  "rxjs": "^6.6.3"
29
29
  },
@@ -48,7 +48,7 @@ function newProject(options) {
48
48
  throw new schematics_1.SchematicsException(`Folder "${options.name}" already exists!`);
49
49
  }
50
50
  const framework = templateManager.getFrameworkByName("angular");
51
- projLibrary = yield prompt.getProjectLibrary(framework);
51
+ projLibrary = yield prompt.getProjectLibraryByType(framework, options.type);
52
52
  if (!options.name || !prompt.nameIsValid(options.name)) {
53
53
  options.name = yield prompt.getUserInput({
54
54
  type: "input",
@@ -26,7 +26,7 @@ describe("Schematics ng-new", () => {
26
26
  const mockSession = {
27
27
  chooseActionLoop: spyOn(SchematicsPromptSession_1.SchematicsPromptSession.prototype, "chooseActionLoop")
28
28
  .and.returnValue(Promise.resolve(true)),
29
- getProjectLibrary: spyOn(SchematicsPromptSession_1.SchematicsPromptSession.prototype, "getProjectLibrary")
29
+ getProjectLibraryByType: spyOn(SchematicsPromptSession_1.SchematicsPromptSession.prototype, "getProjectLibraryByType")
30
30
  .and.returnValue((Promise.resolve(mockLibrary))),
31
31
  getProjectTemplate: spyOn(SchematicsPromptSession_1.SchematicsPromptSession.prototype, "getProjectTemplate")
32
32
  .and.returnValue(Promise.resolve(mockProject)),
@@ -100,7 +100,7 @@ describe("Schematics ng-new", () => {
100
100
  themes: ["custom"]
101
101
  };
102
102
  const mockSession = {
103
- getProjectLibrary: spyOn(SchematicsPromptSession_1.SchematicsPromptSession.prototype, "getProjectLibrary")
103
+ getProjectLibraryByType: spyOn(SchematicsPromptSession_1.SchematicsPromptSession.prototype, "getProjectLibraryByType")
104
104
  .and.returnValue((Promise.resolve(mockLibrary)))
105
105
  };
106
106
  const userAnswers = new Map();
@@ -12,4 +12,5 @@ export declare abstract class OptionsSchema {
12
12
  skipInstall: boolean;
13
13
  theme: string;
14
14
  template: string;
15
+ type: string;
15
16
  }
@@ -40,6 +40,12 @@
40
40
  "template": {
41
41
  "description": "Project template.",
42
42
  "type": "string"
43
+ },
44
+ "type": {
45
+ "description": "Project type.",
46
+ "type": "string",
47
+ "alias": "t",
48
+ "default": "igx-ts"
43
49
  }
44
50
  },
45
51
  "required": [
@@ -9,6 +9,7 @@ export declare class SchematicsPromptSession extends BasePromptSession {
9
9
  setContext(context: SchematicContext, tree: Tree, projectName: string): void;
10
10
  getUserInput(options: IUserInputOptions, withBackChoice?: boolean): Promise<string>;
11
11
  getProjectLibrary(framework: Framework): Promise<ProjectLibrary>;
12
+ getProjectLibraryByType(framework: Framework, type: string): Promise<ProjectLibrary>;
12
13
  getProjectTemplate(projectLibrary: ProjectLibrary): Promise<ProjectTemplate>;
13
14
  getTheme(projectLibrary: ProjectLibrary): Promise<string>;
14
15
  nameIsValid(name: string, checkFolder?: boolean): boolean;
@@ -39,6 +39,16 @@ class SchematicsPromptSession extends cli_core_1.BasePromptSession {
39
39
  return _super.getProjectLibrary.call(this, framework);
40
40
  });
41
41
  }
42
+ getProjectLibraryByType(framework, type) {
43
+ const _super = Object.create(null, {
44
+ getProjectLibrary: { get: () => super.getProjectLibrary }
45
+ });
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ type = type === "igx-ts" || type === "igx-ts-legacy" ? type : "igx-ts";
48
+ framework.projectLibraries = [framework.projectLibraries.find(lib => lib.projectType === type)];
49
+ return _super.getProjectLibrary.call(this, framework);
50
+ });
51
+ }
42
52
  getProjectTemplate(projectLibrary) {
43
53
  const _super = Object.create(null, {
44
54
  getProjectTemplate: { get: () => super.getProjectTemplate }