@igniteui/angular-schematics 17.0.1310-beta.2 → 17.1.1310-beta.3

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.0.1310-beta.2",
3
+ "version": "17.1.1310-beta.3",
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.0.1310-beta.2",
26
- "@igniteui/cli-core": "~13.1.0-beta.2",
25
+ "@igniteui/angular-templates": "~17.1.1310-beta.3",
26
+ "@igniteui/cli-core": "~13.1.0-beta.3",
27
27
  "@schematics/angular": "~14.0.0",
28
28
  "rxjs": "^6.6.3"
29
29
  },
@@ -0,0 +1,4 @@
1
+ export interface Options {
2
+ [key: string]: any;
3
+ applyMigrations: boolean;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,11 @@
1
1
  {
2
2
  "$schema": "../../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
  "schematics": {
4
+ "migration-01": {
5
+ "version": "17.1.0",
6
+ "description": "Updates Ignite UI for Angular Schematics project from 17.0.x to 17.1.x",
7
+ "factory": "./update-1",
8
+ "schema": "./schema.json"
9
+ }
4
10
  }
5
11
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "igniteui-angular--schematics",
4
+ "title": "IgniteUI for Angular Schematics",
5
+ "type": "object",
6
+ "properties": {
7
+ "applyMigrations": {
8
+ "type": "boolean",
9
+ "description": "Apply migrations to the project.",
10
+ "default": true,
11
+ "x-prompt": "Would you like to apply automated migrations?"
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ import { Rule } from "@angular-devkit/schematics";
2
+ import { Options } from "../interfaces/options";
3
+ export default function (options: Options): Rule;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function default_1(options) {
4
+ return (host, context) => {
5
+ var _a;
6
+ if (!options.applyMigrations) {
7
+ return;
8
+ }
9
+ context.logger.info("Updating @igniteui/angular-schematics to 17.1.0");
10
+ const igConfig = "./igniteui-cli.json";
11
+ if (host.exists(igConfig)) {
12
+ const content = JSON.parse(host.read(igConfig).toString());
13
+ if (((_a = content === null || content === void 0 ? void 0 : content.project) === null || _a === void 0 ? void 0 : _a.projectType) === "igx-ts") {
14
+ content.project.projectType = "igx-ts-legacy";
15
+ host.overwrite(igConfig, JSON.stringify(content, null, 4));
16
+ }
17
+ }
18
+ };
19
+ }
20
+ exports.default = default_1;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const path = require("path");
13
+ const schematics_1 = require("@angular-devkit/schematics");
14
+ const testing_1 = require("@angular-devkit/schematics/testing");
15
+ describe("Update 17.1.0", () => {
16
+ let appTree;
17
+ const schematicRunner = new testing_1.SchematicTestRunner("ig-migrate", path.join(__dirname, "../migration-collection.json"));
18
+ beforeEach(() => {
19
+ appTree = new testing_1.UnitTestTree(new schematics_1.EmptyTree());
20
+ });
21
+ it("change projectType to legacy", (done) => __awaiter(void 0, void 0, void 0, function* () {
22
+ appTree.create("./igniteui-cli.json", `{
23
+ "igPackageRegistry": "https://packages.infragistics.com/npm/js-licensed/",
24
+ "customTemplates": [],
25
+ "skipGit": false,
26
+ "skipAnalytic": false,
27
+ "version": "13.0.1",
28
+ "project": {
29
+ "defaultPort": 4200,
30
+ "framework": "angular",
31
+ "projectType": "igx-ts",
32
+ "projectTemplate": "side-nav",
33
+ "theme": "Default",
34
+ "themePath": "node_modules/igniteui-angular/styles/igniteui-angular.css",
35
+ "isBundle": false,
36
+ "bundleFilePath": "",
37
+ "igniteuiSource": "",
38
+ "components": [],
39
+ "sourceFiles": [],
40
+ "isShowcase": false,
41
+ "version": ""
42
+ },
43
+ "build": {}
44
+ }
45
+ `);
46
+ const tree = yield schematicRunner.runSchematicAsync("migration-01", { applyMigrations: true }, appTree).toPromise();
47
+ expect(tree.readContent("./igniteui-cli.json"))
48
+ .toEqual(`{
49
+ "igPackageRegistry": "https://packages.infragistics.com/npm/js-licensed/",
50
+ "customTemplates": [],
51
+ "skipGit": false,
52
+ "skipAnalytic": false,
53
+ "version": "13.0.1",
54
+ "project": {
55
+ "defaultPort": 4200,
56
+ "framework": "angular",
57
+ "projectType": "igx-ts-legacy",
58
+ "projectTemplate": "side-nav",
59
+ "theme": "Default",
60
+ "themePath": "node_modules/igniteui-angular/styles/igniteui-angular.css",
61
+ "isBundle": false,
62
+ "bundleFilePath": "",
63
+ "igniteuiSource": "",
64
+ "components": [],
65
+ "sourceFiles": [],
66
+ "isShowcase": false,
67
+ "version": ""
68
+ },
69
+ "build": {}
70
+ }`);
71
+ done();
72
+ }));
73
+ });