Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/bazel/test/ng_package/common_package.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ import * as shx from 'shelljs';
shx.cd(path.join(process.env['TEST_SRCDIR'], 'angular', 'packages', 'common', 'npm_package'));

describe('@angular/common ng_package', () => {
it('should have the locales files', () => {

@alan-agius4 alan-agius4 Apr 3, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is giving false positives :(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could make up for this mistake by writing a tslint or tsetse.info check so no one ever falls in this hole again. "the compiler could have caught it" is my mantra

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much Alex, I’d give it a shoot and try to create a tsetse rule

describe('should have the locales files', () => {
it('/locales', () => {
const files = shx.ls('-R', 'locales').stdout.split('\n');
const files = shx.ls('locales').stdout.split('\n');
expect(files.some(n => n.endsWith('.d.ts'))).toBe(true, `.d.ts files don't exist`);
expect(files.some(n => n.endsWith('.js'))).toBe(true, `.js files don't exist`);
expect(files.some(n => n.endsWith('.js.map'))).toBe(true, `.js.map files don't exist`);
});
it('/locales/extra', () => {
const files = shx.ls('-R', 'locales/extra').stdout.split('\n');
const files = shx.ls('locales/extra').stdout.split('\n');
expect(files.some(n => n.endsWith('.d.ts'))).toBe(true, `.d.ts files don't exist`);
expect(files.some(n => n.endsWith('.js'))).toBe(true, `.js files don't exist`);
expect(files.some(n => n.endsWith('.js.map'))).toBe(true, `.js.map files don't exist`);
});
});

Expand Down
4 changes: 1 addition & 3 deletions packages/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ ng_package(
"//packages/common/http/testing:package.json",
"//packages/common/testing:package.json",
],
data = [
"//packages/common/locales",
],
entry_point = "packages/common/index.js",
packages = ["//packages/common/locales:package"],
tags = ["release-with-framework"],
deps = [
"//packages/common",
Expand Down
7 changes: 6 additions & 1 deletion packages/common/locales/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "ts_library")
load("//tools:defaults.bzl", "ts_library", "npm_package")

ts_library(
name = "locales",
Expand All @@ -10,3 +10,8 @@ ts_library(
),
module_name = "@angular/common/locales",
)

npm_package(
name = "package",
deps = [":locales"],
)