Skip to content

Commit 1f9a1be

Browse files
author
HuHai
committed
修改文件配置
1 parent b009e3a commit 1f9a1be

28 files changed

+141
-148
lines changed

angular.json

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,11 @@
2020
"outputPath": "dist/neun-angular",
2121
"index": "src/index.html",
2222
"main": "src/main.ts",
23-
"polyfills": [
24-
"zone.js"
25-
],
23+
"polyfills": ["zone.js"],
2624
"tsConfig": "tsconfig.app.json",
2725
"inlineStyleLanguage": "scss",
28-
"assets": [
29-
"src/favicon.ico",
30-
"src/assets"
31-
],
32-
"styles": [
33-
"src/styles.scss"
34-
],
26+
"assets": ["src/favicon.ico", "src/assets"],
27+
"styles": ["src/styles.scss"],
3528
"scripts": []
3629
},
3730
"configurations": {
@@ -82,53 +75,47 @@
8275
"test": {
8376
"builder": "@angular-devkit/build-angular:karma",
8477
"options": {
85-
"polyfills": [
86-
"zone.js",
87-
"zone.js/testing"
88-
],
78+
"polyfills": ["zone.js", "zone.js/testing"],
8979
"tsConfig": "tsconfig.spec.json",
9080
"inlineStyleLanguage": "scss",
91-
"assets": [
92-
"src/favicon.ico",
93-
"src/assets"
94-
],
95-
"styles": [
96-
"src/styles.scss"
97-
],
81+
"assets": ["src/favicon.ico", "src/assets"],
82+
"styles": ["src/styles.scss"],
9883
"scripts": []
9984
}
10085
}
10186
}
10287
},
10388
"ng-neun": {
10489
"projectType": "library",
105-
"root": "projects/ng-neun",
106-
"sourceRoot": "projects/ng-neun/src",
90+
"schematics": {
91+
"@schematics/angular:component": {
92+
"style": "scss"
93+
}
94+
},
95+
"root": "ng-neun",
96+
"sourceRoot": "ng-neun",
10797
"prefix": "ne",
10898
"architect": {
10999
"build": {
110100
"builder": "@angular-devkit/build-angular:ng-packagr",
111101
"options": {
112-
"project": "projects/ng-neun/ng-package.json"
102+
"project": "ng-neun/ng-package.json"
113103
},
114104
"configurations": {
115105
"production": {
116-
"tsConfig": "projects/ng-neun/tsconfig.lib.prod.json"
106+
"tsConfig": "ng-neun/tsconfig.lib.prod.json"
117107
},
118108
"development": {
119-
"tsConfig": "projects/ng-neun/tsconfig.lib.json"
109+
"tsConfig": "ng-neun/tsconfig.lib.json"
120110
}
121111
},
122112
"defaultConfiguration": "production"
123113
},
124114
"test": {
125115
"builder": "@angular-devkit/build-angular:karma",
126116
"options": {
127-
"tsConfig": "projects/ng-neun/tsconfig.spec.json",
128-
"polyfills": [
129-
"zone.js",
130-
"zone.js/testing"
131-
]
117+
"tsConfig": "ng-neun/tsconfig.spec.json",
118+
"polyfills": ["zone.js", "zone.js/testing"]
132119
}
133120
}
134121
}
File renamed without changes.

ng-neun/button/button.component.css

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>button works!</p>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { NeButtonComponent } from './button.component';
4+
5+
describe('ButtonComponent', () => {
6+
let component: NeButtonComponent;
7+
let fixture: ComponentFixture<NeButtonComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
declarations: [NeButtonComponent],
12+
}).compileComponents();
13+
14+
fixture = TestBed.createComponent(NeButtonComponent);
15+
component = fixture.componentInstance;
16+
fixture.detectChanges();
17+
});
18+
19+
it('should create', () => {
20+
expect(component).toBeTruthy();
21+
});
22+
});

ng-neun/button/button.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'ne-button',
5+
templateUrl: './button.component.html',
6+
styleUrls: ['./button.component.css'],
7+
})
8+
export class NeButtonComponent implements OnInit {
9+
constructor() {}
10+
11+
ngOnInit(): void {}
12+
}

ng-neun/button/button.module.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { NeButtonComponent } from './button.component';
4+
5+
@NgModule({
6+
declarations: [NeButtonComponent],
7+
imports: [CommonModule],
8+
exports: [NeButtonComponent],
9+
})
10+
export class NeButtonModule {}

ng-neun/button/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './public-api';

ng-neun/button/ng-package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"lib": {
3+
"entryFile": "public-api.ts"
4+
}
5+
}

ng-neun/button/public-api.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Public API Surface of Button
3+
*/
4+
export * from './button.component';
5+
export * from './button.module';

0 commit comments

Comments
 (0)