Skip to content

Commit 4a1e9f9

Browse files
wKozavikerman
authored and
vikerman
committed
fix(@schematics/angular): change entry file name of the library schematic according to the kebab-case convention
1 parent 1cbc206 commit 4a1e9f9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/schematics/angular/library/index_spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Library Schematic', () => {
2525
);
2626
const defaultOptions: GenerateLibrarySchema = {
2727
name: 'foo',
28-
entryFile: 'my_index',
28+
entryFile: 'my-index',
2929
skipPackageJson: false,
3030
skipTsConfig: false,
3131
skipInstall: false,
@@ -51,7 +51,7 @@ describe('Library Schematic', () => {
5151
'/projects/foo/README.md',
5252
'/projects/foo/tslint.json',
5353
'/projects/foo/src/test.ts',
54-
'/projects/foo/src/my_index.ts',
54+
'/projects/foo/src/my-index.ts',
5555
'/projects/foo/src/lib/foo.module.ts',
5656
'/projects/foo/src/lib/foo.component.spec.ts',
5757
'/projects/foo/src/lib/foo.component.ts',
@@ -89,15 +89,15 @@ describe('Library Schematic', () => {
8989
const tree = schematicRunner.runSchematic('library', defaultOptions, workspaceTree);
9090
const fileContent = getJsonFileContent(tree, '/projects/foo/ng-package.json');
9191
expect(fileContent.lib).toBeDefined();
92-
expect(fileContent.lib.entryFile).toEqual('src/my_index.ts');
92+
expect(fileContent.lib.entryFile).toEqual('src/my-index.ts');
9393
expect(fileContent.dest).toEqual('../../dist/foo');
9494
});
9595

9696
it('should use default value for baseDir and entryFile', () => {
9797
const tree = schematicRunner.runSchematic('library', {
9898
name: 'foobar',
9999
}, workspaceTree);
100-
expect(tree.files).toContain('/projects/foobar/src/public_api.ts');
100+
expect(tree.files).toContain('/projects/foobar/src/public-api.ts');
101101
});
102102

103103
it(`should add library to workspace`, () => {

packages/schematics/angular/library/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"type": "string",
2020
"format": "path",
2121
"description": "The path at which to create the library's public API file, relative to the workspace root.",
22-
"default": "public_api"
22+
"default": "public-api"
2323
},
2424
"prefix": {
2525
"type": "string",

tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/ng-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"$schema": "../../../../../../node_modules/ng-packagr/ng-package.schema.json",
33
"dest": "../../dist/lib",
44
"lib": {
5-
"entryFile": "src/public_api.ts"
5+
"entryFile": "src/public-api.ts"
66
}
77
}

0 commit comments

Comments
 (0)