From 6622cb5c1442bcddce2df5f783256c88ae5267c3 Mon Sep 17 00:00:00 2001 From: Jack Compton Date: Thu, 28 May 2015 16:26:03 -0400 Subject: [PATCH] alterations for EADS Team process --- app/index.js | 8 ++------ app/templates/_README.md | 18 ------------------ app/templates/_bower.json | 19 ------------------- app/templates/_example.js | 4 ++++ app/templates/_index.html | 5 ----- app/templates/_package.json | 8 +++----- app/templates/_webpack.config.js | 8 +------- app/templates/bowerrc | 5 ----- app/templates/gitignore | 1 - test/test-app.js | 2 +- 10 files changed, 11 insertions(+), 67 deletions(-) delete mode 100644 app/templates/_bower.json create mode 100644 app/templates/_example.js delete mode 100644 app/templates/bowerrc diff --git a/app/index.js b/app/index.js index 891df9c..087c3ee 100644 --- a/app/index.js +++ b/app/index.js @@ -13,10 +13,6 @@ module.exports = yeoman.generators.Base.extend({ }, configuring: function () { - this.fs.copy( - this.templatePath('bowerrc'), - this.destinationPath('.bowerrc') - ); this.fs.copy( this.templatePath('editorconfig'), this.destinationPath('.editorconfig') @@ -39,8 +35,8 @@ module.exports = yeoman.generators.Base.extend({ { appname: this.appname, slug: this.slug, libname: this.libname } ); this.fs.copyTpl( - this.templatePath('_bower.json'), - this.destinationPath('bower.json'), + this.templatePath('_example.js'), + this.destinationPath('example.js'), { appname: this.appname, slug: this.slug, libname: this.libname } ); this.fs.copyTpl( diff --git a/app/templates/_README.md b/app/templates/_README.md index d788ca6..45f762f 100644 --- a/app/templates/_README.md +++ b/app/templates/_README.md @@ -1,23 +1,5 @@ # <%= appname %> -Get the AMD module located at `<%= slug %>.js` and include it in your project. - -Here is a sample integration: - -```js -require.config({ - paths: { - 'react': 'vendor/bower_components/react/react', - '<%= libname %>': '<%= slug %>' - } -}); - -require(['react', '<%= libname %>'], function(React, <%= libname %>) { - - React.render(React.createElement(<%= libname %>), document.getElementById('widget-container')); - -}); -``` ## Development diff --git a/app/templates/_bower.json b/app/templates/_bower.json deleted file mode 100644 index 5bf63cc..0000000 --- a/app/templates/_bower.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "<%= slug %>", - "version": "1.0.0", - "license": "MIT", - "author": "", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "spec", - "test", - "tests" - ], - "moduleType": [ - "amd", - "globals" - ] -} diff --git a/app/templates/_example.js b/app/templates/_example.js new file mode 100644 index 0000000..d956af4 --- /dev/null +++ b/app/templates/_example.js @@ -0,0 +1,4 @@ +var React = require('react/addons'); +var <%= libname %> = require('./lib/index.js'); + +React.render(React.createElement(<%= libname %>), document.getElementById('main')); \ No newline at end of file diff --git a/app/templates/_index.html b/app/templates/_index.html index 3a2998c..5cdc2fa 100644 --- a/app/templates/_index.html +++ b/app/templates/_index.html @@ -4,11 +4,6 @@
- - diff --git a/app/templates/_package.json b/app/templates/_package.json index add65ce..812fa61 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -1,17 +1,15 @@ { "name": "<%= slug %>", - "version": "1.0.0", + "version": "0.1.0", "description": "<%= appname %>", "scripts": { "test": "eslint lib/ spec/ && ./node_modules/karma/bin/karma start karma.conf.js", "watch-test": "./node_modules/karma/bin/karma start karma.conf.js --auto-watch --no-single-run", "build": "webpack -p", - "rename-css-bower-dependencies": "find bower_components -name '*.css' | sed -e 'p;s/.css$/.scss/' | xargs -n2 mv", - "dev": "webpack-dev-server --inline --hot", - "postinstall": "bower install" + "dev": "webpack-dev-server --inline --hot" }, + "main": "./lib/index.js", "author": "", - "license": "BSD", "keywords": [ "react", "reactjs", diff --git a/app/templates/_webpack.config.js b/app/templates/_webpack.config.js index e953860..ed2be83 100644 --- a/app/templates/_webpack.config.js +++ b/app/templates/_webpack.config.js @@ -4,7 +4,7 @@ var path = require('path'); module.exports = { context: path.join(__dirname), - entry: './lib/index.js', + entry: './example.js', output: { path: path.join(__dirname), @@ -13,18 +13,12 @@ module.exports = { library: '<%= libname %>' }, - externals: { - 'react': 'var React', - 'react/addons': 'var React' - }, - module: { loaders: [ { test: /\.scss$/, // Query parameters are passed to node-sass loader: 'style!css!sass?outputStyle=expanded&' + - 'includePaths[]=' + (path.resolve(__dirname, './bower_components')) + '&' + 'includePaths[]=' + (path.resolve(__dirname, './node_modules')) }, { diff --git a/app/templates/bowerrc b/app/templates/bowerrc deleted file mode 100644 index 26d82a6..0000000 --- a/app/templates/bowerrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "scripts": { - "postinstall": "npm run rename-css-bower-dependencies" - } -} diff --git a/app/templates/gitignore b/app/templates/gitignore index de0ebcf..f5d0c3d 100644 --- a/app/templates/gitignore +++ b/app/templates/gitignore @@ -1,4 +1,3 @@ node_modules -bower_components .DS_Store *.log diff --git a/test/test-app.js b/test/test-app.js index 5bc1318..bba49ff 100644 --- a/test/test-app.js +++ b/test/test-app.js @@ -18,7 +18,7 @@ describe('react-webpack-component:app', function () { it('creates files', function () { assert.file([ - 'bower.json', + 'example.js', 'package.json', '.editorconfig', '.jshintrc'