diff --git a/addon/ng2/blueprints/component/index.js b/addon/ng2/blueprints/component/index.js index 6e81ce1c77f2..7f8758026328 100644 --- a/addon/ng2/blueprints/component/index.js +++ b/addon/ng2/blueprints/component/index.js @@ -115,20 +115,7 @@ module.exports = { } if (!options.flat) { - var filePath = path.join(this.project.ngConfig.defaults.sourceDir, 'system-config.ts'); - var barrelUrl = this.appDir.replace(/\\/g, '/'); - if (barrelUrl[0] === '/') { - barrelUrl = barrelUrl.substr(1); - } - - return addBarrelRegistration(this, this.generatePath) - .then(() => { - return this.insertIntoFile( - filePath, - ` '${barrelUrl}',`, - { before: ' /** @cli-barrel */' } - ); - }); + return addBarrelRegistration(this, this.generatePath); } else { return addBarrelRegistration( this, diff --git a/addon/ng2/blueprints/ng2/files/__path__/system-config.ts b/addon/ng2/blueprints/ng2/files/__path__/system-config.ts deleted file mode 100644 index 55e4ac712886..000000000000 --- a/addon/ng2/blueprints/ng2/files/__path__/system-config.ts +++ /dev/null @@ -1,60 +0,0 @@ -// SystemJS configuration file, see links for more information -// https://github.com/systemjs/systemjs -// https://github.com/systemjs/systemjs/blob/master/docs/config-api.md - -/*********************************************************************************************** - * User Configuration. - **********************************************************************************************/ -/** Map relative paths to URLs. */ -const map: any = { -}; - -/** User packages configuration. */ -const packages: any = { -}; - -//////////////////////////////////////////////////////////////////////////////////////////////// -/*********************************************************************************************** - * Everything underneath this line is managed by the CLI. - **********************************************************************************************/ -const barrels: string[] = [ - // Angular specific barrels. - '@angular/core', - '@angular/common', - '@angular/compiler', - '@angular/forms', - '@angular/http', - '@angular/router', - '@angular/platform-browser', - '@angular/platform-browser-dynamic',<% if(isMobile) { %> - '@angular/app-shell',<% } %> - - // Thirdparty barrels. - 'rxjs', - - // App specific barrels. - 'app', - 'app/shared', - /** @cli-barrel */ -]; - -const cliSystemConfigPackages: any = {}; -barrels.forEach((barrelName: string) => { - cliSystemConfigPackages[barrelName] = { main: 'index' }; -}); - -/** Type declaration for ambient System. */ -declare var System: any; - -// Apply the CLI SystemJS configuration. -System.config({ - map: { - '@angular': 'vendor/@angular', - 'rxjs': 'vendor/rxjs', - 'main': 'main.js' - }, - packages: cliSystemConfigPackages -}); - -// Apply the user's configuration. -System.config({ map, packages }); diff --git a/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js b/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js deleted file mode 100644 index b62ba72ff17a..000000000000 --- a/addon/ng2/blueprints/ng2/files/config/karma-test-shim.js +++ /dev/null @@ -1,56 +0,0 @@ -// Test shim for Karma, needed to load files via SystemJS - -/*global jasmine, __karma__, window*/ -Error.stackTraceLimit = Infinity; -jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; - -__karma__.loaded = function () { -}; - -var distPath = '/base/dist/'; -var appPaths = ['app']; //Add all valid source code folders here - -function isJsFile(path) { - return path.slice(-3) == '.js'; -} - -function isSpecFile(path) { - return path.slice(-8) == '.spec.js'; -} - -function isAppFile(path) { - return isJsFile(path) && appPaths.some(function(appPath) { - var fullAppPath = distPath + appPath + '/'; - return path.substr(0, fullAppPath.length) == fullAppPath; - }); -} - -var allSpecFiles = Object.keys(window.__karma__.files) - .filter(isSpecFile) - .filter(isAppFile); - -// Load our SystemJS configuration. -System.config({ - baseURL: distPath -}); - -System.import('system-config.js').then(function() { - // Load and configure the TestComponentBuilder. - return Promise.all([ - System.import('@angular/core/testing'), - System.import('@angular/platform-browser-dynamic/testing') - ]).then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; - - testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, - testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); - }); -}).then(function() { - // Finally, load all spec files. - // This will run the tests directly. - return Promise.all( - allSpecFiles.map(function (moduleName) { - return System.import(moduleName); - })); -}).then(__karma__.start, __karma__.error); diff --git a/addon/ng2/blueprints/ng2/files/package.json b/addon/ng2/blueprints/ng2/files/package.json index f3027ebe6b7e..bc6179cced14 100644 --- a/addon/ng2/blueprints/ng2/files/package.json +++ b/addon/ng2/blueprints/ng2/files/package.json @@ -23,7 +23,6 @@ "@angular/router": "3.0.0-beta.2", "core-js": "^2.4.0", "rxjs": "5.0.0-beta.6", - "systemjs": "0.19.26", "ts-helpers": "^1.1.1", "zone.js": "0.6.12" }, diff --git a/package.json b/package.json index a93ccae5ae3d..0e7e62a39c39 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,6 @@ "stylus": "^0.54.5", "stylus-loader": "^2.1.0", "symlink-or-copy": "^1.0.3", - "systemjs-builder": "0.15.17", "ts-helpers": "^1.1.1", "ts-loader": "^0.8.2", "tslint": "^3.11.0", diff --git a/tests/acceptance/generate-component.spec.js b/tests/acceptance/generate-component.spec.js index a0b126e9cba7..f25005165cbe 100644 --- a/tests/acceptance/generate-component.spec.js +++ b/tests/acceptance/generate-component.spec.js @@ -178,15 +178,4 @@ describe('Acceptance: ng generate component', function () { expect(existsSync(testPath)).to.equal(false); }); }); - - it('ng generate component my-comp --dry-run does not register a barrel in system-config.ts', () => { - var configPath = path.join(root, 'tmp', 'foo', 'src', 'system-config.ts'); - var unmodifiedFile = fs.readFileSync(configPath, 'utf8'); - - return ng(['generate', 'component', 'my-comp', '--dry-run']).then(() => { - var afterGenerateFile = fs.readFileSync(configPath, 'utf8'); - - expect(afterGenerateFile).to.equal(unmodifiedFile); - }); - }); });