Skip to content

Commit

Permalink
build: remove custom-webpack (#8553)
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperLife1119 authored May 31, 2024
1 parent c6e7bd7 commit 710e20e
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 73 deletions.
6 changes: 2 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,9 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-builders/custom-webpack:karma",
"builder": "@angular-devkit/build-angular:karma",
"options": {
"customWebpackConfig": {
"path": "custom-webpack-spec.config.js"
},
"inlineStyleLanguage": "less",
"fileReplacements": [
{
"replace": "components/core/environments/environment.ts",
Expand Down
17 changes: 10 additions & 7 deletions components/anchor/anchor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable */
// eslint-disable
import { fakeAsync, tick, TestBed, ComponentFixture } from '@angular/core/testing';
import { Component, DebugElement, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NzScrollService } from 'ng-zorro-antd/core/services';
import { NzAnchorModule } from './anchor.module';
import { NzAnchorComponent } from './anchor.component';
import { NzDirectionVHType } from 'ng-zorro-antd/core/types';
import { NzAnchorComponent } from './anchor.component';
import { NzAnchorModule } from './anchor.module';

const throttleTime = 51;

Expand Down Expand Up @@ -350,7 +350,10 @@ describe('anchor', () => {
<h2 id="basic-target"></h2>
</div>
`,
styleUrls: ['./style/patch.less']
styles: `
@import '../style/testing.less';
@import './style/patch.less';
`
})
export class TestComponent {
@ViewChild(NzAnchorComponent, { static: false }) comp!: NzAnchorComponent;
Expand All @@ -362,7 +365,7 @@ export class TestComponent {
nzContainer: any = null;
nzCurrentAnchor?: string;
nzDirection: NzDirectionVHType = 'vertical';
_click() {}
_change() {}
_scroll() {}
_click() { }
_change() { }
_scroll() { }
}
7 changes: 5 additions & 2 deletions components/avatar/avatar.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, DebugElement, ViewChild } from '@angular/core';
import { ComponentFixture, fakeAsync, flush, TestBed, tick } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, flush, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { createFakeEvent } from 'ng-zorro-antd/core/testing';
Expand Down Expand Up @@ -297,7 +297,10 @@ function getScaleFromCSSTransform(transform: string): number {
[nzAlt]="nzAlt"
></nz-avatar>
`,
styleUrls: ['./style/index.less']
styles: `
@import '../style/testing.less';
@import './style/index.less';
`
})
class TestAvatarComponent {
@ViewChild('comp', { static: false }) comp!: NzAvatarComponent;
Expand Down
3 changes: 3 additions & 0 deletions components/style/testing.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This file is only used to set the @root-entry-name variable in a test environment.

@import './default.less';
7 changes: 5 additions & 2 deletions components/table/src/testing/table.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BidiModule, Dir } from '@angular/cdk/bidi';
import { Component, DebugElement, Injector, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, tick, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';

import { NzI18nService } from 'ng-zorro-antd/i18n';
Expand Down Expand Up @@ -431,7 +431,10 @@ interface ScrollTestDataItem {
</div>
`,
encapsulation: ViewEncapsulation.None,
styleUrls: ['../../../style/entry.less']
styles: `
@import '../../../style/testing.less';
@import '../../../style/entry.less';
`
})
export class NzTestTableScrollComponent implements OnInit {
@ViewChild(NzTableComponent, { static: false }) nzTableComponent!: NzTableComponent<ScrollTestDataItem>;
Expand Down
6 changes: 5 additions & 1 deletion components/tabs/tabset.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,11 @@ class DynamicTabsTestComponent {
</div>
`,
encapsulation: ViewEncapsulation.None,
styleUrls: ['../style/entry.less', './style/entry.less']
styles: `
@import '../style/testing.less';
@import '../style/entry.less';
@import './style/entry.less';
`
})
class ScrollableTabsTestComponent {
selectedIndex = 0;
Expand Down
26 changes: 21 additions & 5 deletions components/time-picker/time-picker-panel.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApplicationRef, Component, DebugElement, NO_ERRORS_SCHEMA, ViewChild, ViewEncapsulation } from '@angular/core';
import { ComponentFixture, fakeAsync, flush, TestBed, tick, waitForAsync } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, flush, tick, waitForAsync } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';

Expand Down Expand Up @@ -367,7 +367,11 @@ describe('time-picker-panel', () => {
[nzHourStep]="hourStep"
></nz-time-picker-panel>
`,
styleUrls: ['../style/index.less', './style/index.less'],
styles: `
@import '../style/testing.less';
@import '../style/index.less';
@import './style/index.less';
`,
imports: [NzTimePickerPanelComponent, FormsModule],
standalone: true
})
Expand Down Expand Up @@ -398,7 +402,11 @@ export class NzTestTimePanelComponent {
[nzHourStep]="hourStep"
></nz-time-picker-panel>
`,
styleUrls: ['../style/index.less', './style/index.less'],
styles: `
@import '../style/testing.less';
@import '../style/index.less';
@import './style/index.less';
`,
imports: [NzTimePickerPanelComponent, FormsModule],
standalone: true
})
Expand Down Expand Up @@ -444,7 +452,11 @@ export class NzTestTimePanelDisabledComponent {
[format]="format"
></nz-time-picker-panel>
`,
styleUrls: ['../style/index.less', './style/index.less'],
styles: `
@import '../style/testing.less';
@import '../style/index.less';
@import './style/index.less';
`,
imports: [NzTimePickerPanelComponent, FormsModule],
standalone: true
})
Expand All @@ -468,7 +480,11 @@ export class NzTest12HourTimePanelComponent {
[nzHideDisabledOptions]="false"
></nz-time-picker-panel>
`,
styleUrls: ['../style/index.less', './style/index.less'],
styles: `
@import '../style/testing.less';
@import '../style/index.less';
@import './style/index.less';
`,
imports: [NzTimePickerPanelComponent, FormsModule],
standalone: true
})
Expand Down
7 changes: 5 additions & 2 deletions components/transfer/transfer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ViewChild,
ViewEncapsulation
} from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
Expand Down Expand Up @@ -562,7 +562,10 @@ describe('transfer', () => {
<p id="transfer-footer">footer</p>
</ng-template>
`,
styleUrls: ['./style/index.less'],
styles: `
@import '../style/testing.less';
@import './style/index.less';
`,
encapsulation: ViewEncapsulation.None
})
class TestTransferComponent implements OnInit {
Expand Down
14 changes: 0 additions & 14 deletions custom-webpack-spec.config.js

This file was deleted.

35 changes: 0 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"ngx-quicklink": "^0.4.2"
},
"devDependencies": {
"@angular-builders/custom-webpack": "17.0.2",
"@angular-devkit/build-angular": "^17.3.0",
"@angular-devkit/core": "^17.3.0",
"@angular-devkit/schematics": "^17.3.0",
Expand Down

0 comments on commit 710e20e

Please sign in to comment.