Skip to content

Commit 796fc66

Browse files
robwormaldrkirov
authored andcommitted
chore(build): rename .es6 files to .js
Change es6 source files in npm distribution to use .js extensions. Closes angular#2447
1 parent 6cafaba commit 796fc66

File tree

7 files changed

+11
-15
lines changed

7 files changed

+11
-15
lines changed

docs/dgeni-package/services/tsParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function tsParser(createCompilerHost, log) {
99
// During migration from Traceur, there is a mix of `.ts`, `.es6` and `.js` (atScript)
1010
// files in the project and the TypeScript compiler only looks for `.ts` files when trying
1111
// to load imports.
12-
extensions: ['.ts', '.js', '.es6'],
12+
extensions: ['.ts', '.js'],
1313

1414
// The options for the TS compiler
1515
options: {

gulpfile.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ gulp.task('build/checkCircularDependencies', function (done) {
223223
var dependencyObject = madge(CONFIG.dest.js.dev.es6, {
224224
format: 'es6',
225225
paths: [CONFIG.dest.js.dev.es6],
226-
extensions: ['.js', '.es6'],
226+
extensions: ['.js'],
227227
onParseFile: function(data) {
228228
data.src = data.src.replace(/import \* as/g, "//import * as");
229229
}
@@ -708,7 +708,7 @@ gulp.task('!build.js.cjs', function() {
708708

709709
var bundleConfig = {
710710
paths: {
711-
"*": "dist/js/prod/es6/*.es6",
711+
"*": "dist/js/prod/es6/*.js",
712712
"rx": "node_modules/rx/dist/rx.js"
713713
},
714714
meta: {
@@ -747,7 +747,7 @@ gulp.task('bundle.js.dev', ['build.js.dev'], function() {
747747
var devBundleConfig = merge(true, bundleConfig);
748748
devBundleConfig.paths =
749749
merge(true, devBundleConfig.paths, {
750-
"*": "dist/js/dev/es6/*.es6"
750+
"*": "dist/js/dev/es6/*.js"
751751
});
752752
return bundler.bundle(
753753
devBundleConfig,
@@ -760,7 +760,7 @@ gulp.task('router.bundle.js.dev', ['build.js.dev'], function() {
760760
var devBundleConfig = merge(true, bundleConfig);
761761
devBundleConfig.paths =
762762
merge(true, devBundleConfig.paths, {
763-
"*": "dist/js/dev/es6/*.es6"
763+
"*": "dist/js/dev/es6/*.js"
764764
});
765765
return bundler.bundle(
766766
devBundleConfig,
@@ -778,7 +778,7 @@ gulp.task('bundle.js.sfx.dev', ['build.js.dev'], function() {
778778
var devBundleConfig = merge(true, bundleConfig);
779779
devBundleConfig.paths =
780780
merge(true, devBundleConfig.paths, {
781-
'*': 'dist/js/dev/es6/*.es6'
781+
'*': 'dist/js/dev/es6/*.js'
782782
});
783783
return bundler.bundle(
784784
devBundleConfig,

modules/examples/e2e_test/sourcemap/sourcemap_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('sourcemaps', function() {
3434

3535
var originalPosition = decoder.originalPositionFor({line: errorLine, column: errorColumn});
3636

37-
var finalMapData = fs.readFileSync('dist/js/prod/es6/examples/src/sourcemap/index.es6.map');
37+
var finalMapData = fs.readFileSync('dist/js/prod/es6/examples/src/sourcemap/index.js.map');
3838
var finalDecoder = new sourceMap.SourceMapConsumer(JSON.parse(finalMapData));
3939

4040
var finalPosition = finalDecoder.originalPositionFor(originalPosition);

modules/rtts_assert/README.js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A run-time type assertion library for JavaScript.
44
Designed to be used with [Traceur](https://github.com/google/traceur-compiler).
55

6-
All sources are in ES6 format and have the suffix `.es6`. They don't depend on any runtime
6+
All sources are in ES6 format. They don't depend on any runtime
77
and can be used by any modern ES6 -> ES5 transpiler.
88

99
As a convenience, we provide you with `es5build.js`, a script to transpile the sources into es5

tools/broccoli/traceur/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let xtend = require('xtend');
1313
class DiffingTraceurCompiler implements DiffingBroccoliPlugin {
1414
constructor(public inputPath: string, public cachePath: string, public options) {}
1515

16-
static includeExtensions = ['.js', '.es6', '.cjs'];
16+
static includeExtensions = ['.js', '.cjs'];
1717

1818
rebuild(treeDiff: DiffResult) {
1919
treeDiff.addedPaths.concat(treeDiff.changedPaths)

tools/broccoli/trees/browser_tree.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = function makeBrowserTree(options, destinationPath) {
6464

6565
// Use Traceur to transpile *.js sources to ES6
6666
var traceurTree = transpileWithTraceur(modulesTree, {
67-
destExtension: '.es6',
67+
destExtension: '.js',
6868
destSourceMapExtension: '.map',
6969
traceurOptions: {
7070
sourceMaps: true,
@@ -93,7 +93,6 @@ module.exports = function makeBrowserTree(options, destinationPath) {
9393
sourceRoot: '.',
9494
target: 'ES6'
9595
});
96-
typescriptTree = stew.rename(typescriptTree, '.js', '.es6');
9796

9897
var es6Tree = mergeTrees([traceurTree, typescriptTree]);
9998

tools/build/es5build.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@ if (!module.parent) {
4646
}
4747

4848
function run(config) {
49-
var src = ['!node_modules', '!node_modules/**', './**/*.es6'];
49+
var src = ['!node_modules', '!node_modules/**', './**/*.js'];
5050
return gulp.src(src, {cwd: config.src})
51-
.pipe(rename(function(file) {
52-
file.extname = file.extname.replace('.es6', '.js');
53-
}))
5451
// TODO(tbosch): Using sourcemaps.init({loadMaps:true}) does not combine
5552
// the sourcemaps correctly!
5653
.pipe(sourcemaps.init())

0 commit comments

Comments
 (0)