Skip to content

Commit

Permalink
fix(@schematics/angular): change entry file name of the library schem…
Browse files Browse the repository at this point in the history
…atic according to the kebab-case convention
  • Loading branch information
wKoza authored and vikerman committed Mar 11, 2019
1 parent 1cbc206 commit 4a1e9f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/schematics/angular/library/index_spec.ts
Expand Up @@ -25,7 +25,7 @@ describe('Library Schematic', () => {
);
const defaultOptions: GenerateLibrarySchema = {
name: 'foo',
entryFile: 'my_index',
entryFile: 'my-index',
skipPackageJson: false,
skipTsConfig: false,
skipInstall: false,
Expand All @@ -51,7 +51,7 @@ describe('Library Schematic', () => {
'/projects/foo/README.md',
'/projects/foo/tslint.json',
'/projects/foo/src/test.ts',
'/projects/foo/src/my_index.ts',
'/projects/foo/src/my-index.ts',
'/projects/foo/src/lib/foo.module.ts',
'/projects/foo/src/lib/foo.component.spec.ts',
'/projects/foo/src/lib/foo.component.ts',
Expand Down Expand Up @@ -89,15 +89,15 @@ describe('Library Schematic', () => {
const tree = schematicRunner.runSchematic('library', defaultOptions, workspaceTree);
const fileContent = getJsonFileContent(tree, '/projects/foo/ng-package.json');
expect(fileContent.lib).toBeDefined();
expect(fileContent.lib.entryFile).toEqual('src/my_index.ts');
expect(fileContent.lib.entryFile).toEqual('src/my-index.ts');
expect(fileContent.dest).toEqual('../../dist/foo');
});

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

it(`should add library to workspace`, () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/schematics/angular/library/schema.json
Expand Up @@ -19,7 +19,7 @@
"type": "string",
"format": "path",
"description": "The path at which to create the library's public API file, relative to the workspace root.",
"default": "public_api"
"default": "public-api"
},
"prefix": {
"type": "string",
Expand Down
Expand Up @@ -2,6 +2,6 @@
"$schema": "../../../../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/lib",
"lib": {
"entryFile": "src/public_api.ts"
"entryFile": "src/public-api.ts"
}
}

0 comments on commit 4a1e9f9

Please sign in to comment.