From 7321d9c92a7edd314bf40bee34628fe6429f65a9 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Thu, 25 Aug 2016 17:32:22 +0300 Subject: [PATCH] refactor(*): rename files and directories to bring in-line with modern best practices Partly addresses #334. --- README.md | 4 ++-- app/app.js | 2 +- app/{components => core}/version/interpolate-filter.js | 0 .../version/interpolate-filter.spec.js} | 0 app/{components => core}/version/version-directive.js | 0 .../version/version-directive.spec.js} | 0 app/{components => core}/version/version.js | 0 .../version_test.js => core/version/version.spec.js} | 0 app/index-async.html | 6 +++--- app/index.html | 6 +++--- app/view1/{view1_test.js => view1.spec.js} | 0 app/view2/{view2_test.js => view2.spec.js} | 0 karma.conf.js | 2 +- 13 files changed, 10 insertions(+), 10 deletions(-) rename app/{components => core}/version/interpolate-filter.js (100%) rename app/{components/version/interpolate-filter_test.js => core/version/interpolate-filter.spec.js} (100%) rename app/{components => core}/version/version-directive.js (100%) rename app/{components/version/version-directive_test.js => core/version/version-directive.spec.js} (100%) rename app/{components => core}/version/version.js (100%) rename app/{components/version/version_test.js => core/version/version.spec.js} (100%) rename app/view1/{view1_test.js => view1.spec.js} (100%) rename app/view2/{view2_test.js => view2.spec.js} (100%) diff --git a/README.md b/README.md index 9e59370c3c..300ed53a8f 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ Now browse to the app at `http://localhost:8000/index.html`. ## Directory Layout ``` -app/ --> all of the source files for the application +app/ --> all of the source files for the application app.css --> default stylesheet - components/ --> all app specific modules + core/ --> all app specific modules version/ --> version related components version.js --> version module declaration and basic "version" value service version_test.js --> "version" value service tests diff --git a/app/app.js b/app/app.js index 6ea2401bcd..3a0ca2557e 100644 --- a/app/app.js +++ b/app/app.js @@ -1,6 +1,6 @@ 'use strict'; -// Declare app level module which depends on views, and components +// Declare app level module which depends on views, and core components angular.module('myApp', [ 'ngRoute', 'myApp.view1', diff --git a/app/components/version/interpolate-filter.js b/app/core/version/interpolate-filter.js similarity index 100% rename from app/components/version/interpolate-filter.js rename to app/core/version/interpolate-filter.js diff --git a/app/components/version/interpolate-filter_test.js b/app/core/version/interpolate-filter.spec.js similarity index 100% rename from app/components/version/interpolate-filter_test.js rename to app/core/version/interpolate-filter.spec.js diff --git a/app/components/version/version-directive.js b/app/core/version/version-directive.js similarity index 100% rename from app/components/version/version-directive.js rename to app/core/version/version-directive.js diff --git a/app/components/version/version-directive_test.js b/app/core/version/version-directive.spec.js similarity index 100% rename from app/components/version/version-directive_test.js rename to app/core/version/version-directive.spec.js diff --git a/app/components/version/version.js b/app/core/version/version.js similarity index 100% rename from app/components/version/version.js rename to app/core/version/version.js diff --git a/app/components/version/version_test.js b/app/core/version/version.spec.js similarity index 100% rename from app/components/version/version_test.js rename to app/core/version/version.spec.js diff --git a/app/index-async.html b/app/index-async.html index 281254ed11..ee903b7dcc 100644 --- a/app/index-async.html +++ b/app/index-async.html @@ -33,9 +33,9 @@ 'app.js', 'view1/view1.js', 'view2/view2.js', - 'components/version/version.js', - 'components/version/version-directive.js', - 'components/version/interpolate-filter.js' + 'core/version/version.js', + 'core/version/version-directive.js', + 'core/version/interpolate-filter.js' ], function() { // when all is done, execute bootstrap angular application angular.bootstrap(document, ['myApp']); diff --git a/app/index.html b/app/index.html index ec9da03650..91c0b55126 100644 --- a/app/index.html +++ b/app/index.html @@ -36,8 +36,8 @@ - - - + + + diff --git a/app/view1/view1_test.js b/app/view1/view1.spec.js similarity index 100% rename from app/view1/view1_test.js rename to app/view1/view1.spec.js diff --git a/app/view2/view2_test.js b/app/view2/view2.spec.js similarity index 100% rename from app/view2/view2_test.js rename to app/view2/view2.spec.js diff --git a/karma.conf.js b/karma.conf.js index 7271e9fef8..eadf08bca3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -8,7 +8,7 @@ module.exports = function(config) { 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route.js', 'bower_components/angular-mocks/angular-mocks.js', - 'components/**/*.js', + 'core/**/*.js', 'view*/**/*.js' ],