Skip to content

Commit fac4d8d

Browse files
filipesilvamhevery
authored andcommitted
build(common): specify explicit locales dir in package.json (angular#21016)
PR Close angular#21016
1 parent 170885c commit fac4d8d

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

integration/i18n/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"scripts": {
2525
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
2626
"closure": "java -jar node_modules/google-closure-compiler/compiler.jar --flagfile closure.conf",
27-
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first",
27+
"test": "ngc && yarn run closure && concurrently \"yarn run serve\" \"yarn run protractor\" --kill-others --success first && npm run test-locale-folder",
28+
"test-locale-folder": "node test-locale-folder.js",
2829
"serve": "lite-server -c e2e/browser.config.json",
2930
"preprotractor": "tsc -p e2e",
3031
"protractor": "protractor e2e/protractor.config.js"
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const packageJson = require('@angular/common/package.json');
5+
const localesFolder = packageJson['locales'];
6+
if (!localesFolder) {
7+
throw new Error(`@angular/common/package.json does not contain 'locales' entry.`)
8+
}
9+
const enLocalePath = `@angular/common/${localesFolder}/en`;
10+
try {
11+
require.resolve(enLocalePath);
12+
} catch (err) {
13+
throw new Error(`@angular/common does not contain 'en' locale in ${enLocalePath}.`)
14+
}

packages/common/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dependencies": {
1212
"tslib": "^1.7.1"
1313
},
14+
"locales": "locales",
1415
"peerDependencies": {
1516
"rxjs": "^5.5.0",
1617
"@angular/core": "0.0.0-PLACEHOLDER"

0 commit comments

Comments
 (0)