Skip to content

Commit ea0fc79

Browse files
authored
Merge branch 'master' into dTsvetkov/fix-lint-warnings-summary-sorting
2 parents 32f8cef + ab8304f commit ea0fc79

File tree

92 files changed

+2341
-1902
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2341
-1902
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
uses: actions/checkout@v2
2424
- name: Use Node.js ${{ matrix.node-version }}
2525
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
2628
- name: Install packages
2729
run: npm ci
2830
- name: Lint

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
4+
5+
## 12.0.0
6+
7+
### Themes:
8+
- Breaking Changes:
9+
- `IgxButton` theme has been simplified. The number of theme params (`igx-button-theme`) has been reduced significantly and no longer includes prefixed parameters (`flat-*`, `raised-*`, etc.). See the migration guide to update existing button themes. Updates performed with `ng update` will migrate existing button themes but some additional tweaking may be required to account for the abscense of prefixed params.
10+
11+
## 11.1.1
12+
13+
### New Features
14+
- `IgxAutocomplete`
15+
- Exported the component instance in the template with the name `igxAutocomplete`.
16+
17+
```html
18+
<input type="text" [igxAutocomplete]="townsPanel" #autocompleteRef="igxAutocomplete"/>
19+
```
420
## 11.1.0
521

622
### New Features
@@ -132,6 +148,16 @@ All notable changes for each version of this project will be documented in this
132148
- `onRowExport` to `rowExporting`
133149
- `onExportEnded` to `exportEnded`
134150

151+
## 11.0.15
152+
153+
### New Features
154+
- `IgxAutocomplete`
155+
- Exported the component instance in the template with the name `igxAutocomplete`.
156+
157+
```html
158+
<input type="text" [igxAutocomplete]="townsPanel" #autocompleteRef="igxAutocomplete"/>
159+
```
160+
135161
## 11.0.4
136162

137163
### General
@@ -169,6 +195,16 @@ All notable changes for each version of this project will be documented in this
169195
- `IgxOverlay`
170196
- New functionality to automatically determine the correct animation that is needed when showing an overlay content. This is used with Auto Position strategy, where the `IgxOverlay` content is flipped, depending on the available space.
171197

198+
## 10.2.15
199+
200+
### New Features
201+
- `IgxAutocomplete`
202+
- Exported the component instance in the template with the name `igxAutocomplete`.
203+
204+
```html
205+
<input type="text" [igxAutocomplete]="townsPanel" #autocompleteRef="igxAutocomplete"/>
206+
```
207+
172208
## 10.2.0
173209

174210
### General

projects/igniteui-angular/migrations/common/UpdateChanges.spec.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,4 +768,76 @@ export class AppModule { }`);
768768
<igx-component newProp="leaveMeBe">STRING</igx-component>`);
769769
done();
770770
});
771+
772+
describe('Project loading', () => {
773+
it('should correctly load project files', () => {
774+
const tsFile = '/src/component.ts';
775+
const htmlFile = '/src/component.html';
776+
const scssFile = '/src/component.scss';
777+
const sassFile = '/src/component.sass';
778+
appTree.overwrite('/angular.json', JSON.stringify({
779+
projects: {
780+
testProj: {
781+
sourceRoot: '/src'
782+
}
783+
}
784+
}));
785+
appTree.create(tsFile, '');
786+
appTree.create(htmlFile, '');
787+
appTree.create(scssFile, '');
788+
appTree.create(sassFile, '');
789+
790+
// skip loading json config files
791+
spyOn(fs, 'existsSync').and.returnValue(false);
792+
793+
const update = new UnitUpdateChanges(__dirname, appTree);
794+
expect(update.tsFiles).toContain(tsFile);
795+
expect(update.templateFiles).toContain(htmlFile);
796+
expect(update.sassFiles).toContain(scssFile);
797+
expect(update.sassFiles).toContain(sassFile);
798+
});
799+
800+
it('should correctly load multiple and library project files', () => {
801+
const tsFile = 'component.ts';
802+
const htmlFile = 'component.html';
803+
const scssFile = 'component.scss';
804+
const sassFile = 'component.sass';
805+
const workspace = {
806+
projects: {
807+
testProj: {
808+
projectType: 'application',
809+
sourceRoot: 'src-one'
810+
},
811+
test2Proj: {
812+
projectType: 'application',
813+
sourceRoot: '/src-two'
814+
},
815+
libProj: {
816+
projectType: 'library',
817+
sourceRoot: 'src-lib'
818+
}
819+
}
820+
};
821+
appTree.overwrite('/angular.json', JSON.stringify(workspace));
822+
for (const projName of Object.keys(workspace.projects)) {
823+
const root = workspace.projects[projName].sourceRoot;
824+
appTree.create(path.posix.join(root, tsFile), '');
825+
appTree.create(path.posix.join(root, htmlFile), '');
826+
appTree.create(path.posix.join(root, scssFile), '');
827+
appTree.create(path.posix.join(root, sassFile), '');
828+
}
829+
830+
// skip loading json config files
831+
spyOn(fs, 'existsSync').and.returnValue(false);
832+
833+
const update = new UnitUpdateChanges(__dirname, appTree);
834+
for (const projName of Object.keys(workspace.projects)) {
835+
const root = workspace.projects[projName].sourceRoot;
836+
expect(update.tsFiles).toContain(path.posix.join(`/${root}`, tsFile));
837+
expect(update.templateFiles).toContain(path.posix.join(`/${root}`, htmlFile));
838+
expect(update.sassFiles).toContain(path.posix.join(`/${root}`, scssFile));
839+
expect(update.sassFiles).toContain(path.posix.join(`/${root}`, sassFile));
840+
}
841+
});
842+
});
771843
});

projects/igniteui-angular/migrations/common/UpdateChanges.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,15 +333,19 @@ export class UpdateChanges {
333333
for (const match of matches) {
334334
if (match.indexOf(change.name) !== -1) {
335335
const name = change.name.replace('$', '\\$');
336+
const replaceWith = change.replaceWith?.replace('$', '\\$');
336337
const reg = new RegExp(String.raw`^\s*${name}:`);
338+
const existing = new RegExp(String.raw`${replaceWith}:`);
337339
const opening = `${change.owner}(`;
338340
const closing = /\s*\);$/.exec(match).pop();
339341
const body = match.substr(opening.length, match.length - opening.length - closing.length);
340342

341343
let params = this.splitFunctionProps(body);
342344
params = params.reduce((arr, param) => {
343345
if (reg.test(param)) {
344-
if (!change.remove) {
346+
const duplicate = !!replaceWith && arr.some(p => existing.test(p));
347+
348+
if (!change.remove && !duplicate) {
345349
arr.push(param.replace(change.name, change.replaceWith));
346350
}
347351
} else {

projects/igniteui-angular/migrations/common/util.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { normalize } from '@angular-devkit/core';
22
import * as path from 'path';
33
import { SchematicContext, Tree } from '@angular-devkit/schematics';
4-
import { WorkspaceSchema, WorkspaceProject, ProjectType } from '@schematics/angular/utility/workspace-models';
4+
import { WorkspaceSchema, WorkspaceProject } from '@schematics/angular/utility/workspace-models';
55
import { execSync } from 'child_process';
66
import {
77
Attribute,
@@ -19,15 +19,12 @@ import { replaceMatch } from './tsUtils';
1919

2020
const configPaths = ['/.angular.json', '/angular.json'];
2121

22-
export const getProjectPaths = (config: WorkspaceSchema, appendPrefix = true): string[] => {
22+
export const getProjectPaths = (config: WorkspaceSchema): string[] => {
2323
const sourceDirs = [];
2424

2525
const projects = getProjects(config);
2626
for (const proj of projects) {
27-
let sourcePath = path.join('/', proj.sourceRoot);
28-
if (appendPrefix && (proj.prefix)) {
29-
sourcePath = path.join(sourcePath, proj.prefix);
30-
}
27+
const sourcePath = path.join('/', proj.sourceRoot);
3128
sourceDirs.push(normalize(sourcePath));
3229
}
3330
return sourceDirs;
@@ -43,16 +40,16 @@ export const getWorkspace = (host: Tree): WorkspaceSchema => {
4340
return null;
4441
};
4542

46-
export const getProjects = (config: WorkspaceSchema): WorkspaceProject<ProjectType.Application>[] => {
47-
const projects: WorkspaceProject<ProjectType.Application>[] = [];
43+
export const getProjects = (config: WorkspaceSchema): WorkspaceProject[] => {
44+
const projects: WorkspaceProject[] = [];
4845

4946
for (const projName of Object.keys(config.projects)) {
5047
const proj = config.projects[projName];
51-
if ((proj.projectType && proj.projectType !== ProjectType.Application) ||
52-
(proj.architect && proj.architect.e2e && !proj.architect.build)) {
48+
if ((proj.architect && proj.architect.e2e && !proj.architect.build)) {
49+
// skip old style e2e-only projects
5350
continue;
5451
}
55-
projects.push(proj as WorkspaceProject<ProjectType.Application>);
52+
projects.push(proj);
5653
}
5754
return projects;
5855
};

0 commit comments

Comments
 (0)