Skip to content
This repository was archived by the owner on Apr 5, 2021. It is now read-only.

Commit db5be9c

Browse files
authored
Merge pull request #31 from A-Tokyo/development
Development
2 parents fa8f5a7 + b7374d6 commit db5be9c

File tree

16 files changed

+255
-21
lines changed

16 files changed

+255
-21
lines changed

generators/app/prompts.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@
190190
"module": null
191191
}
192192
},
193+
{
194+
"type": "confirm",
195+
"name": "normalize",
196+
"message": "Would you like to include normalize-css - A css library that makes browsers render all elements more consistently and in line with modern standards.",
197+
"default": true
198+
},
193199
{
194200
"type": "confirm",
195201
"name": "lodash",

generators/app/src/files.js

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function (AngularATGenerator) {
1414
});
1515
if(this.props.extraDeps){
1616
this.props.extraDeps.forEach(function(elm){
17-
if(elm.dependancy === 'at-flex-grid'){
17+
if(elm.dependency === 'at-flex-grid'){
1818
that.props.styles.atFlex = true;
1919
}
2020
});
@@ -112,6 +112,10 @@ module.exports = function (AngularATGenerator) {
112112
this
113113
);
114114

115+
this.fs.copy(
116+
this.templatePath('_src/_app/_index.components.js'),
117+
this.destinationPath(this.destinationRoot()+'/src/app/index.components.js')
118+
);
115119
this.fs.copyTpl(
116120
this.templatePath('_src/_app/_index.bootstrap.js'),
117121
this.destinationPath(this.destinationRoot()+'/src/app/index.bootstrap.js'),
@@ -122,28 +126,40 @@ module.exports = function (AngularATGenerator) {
122126
this.destinationPath(this.destinationRoot()+'/src/app/index.module.js'),
123127
this
124128
);
125-
this.fs.copy(
126-
this.templatePath('_src/_app/_index.components.js'),
127-
this.destinationPath(this.destinationRoot()+'/src/app/index.components.js')
128-
);
129-
this.fs.copy(
130-
this.templatePath('_src/_app/_index.config.js'),
131-
this.destinationPath(this.destinationRoot()+'/src/app/index.config.js')
132-
);
133129
this.fs.copyTpl(
134130
this.templatePath('_src/_app/_index.routes.js'),
135131
this.destinationPath(this.destinationRoot()+'/src/app/index.routes.js'),
136132
this
137133
);
138-
this.fs.copy(
139-
this.templatePath('_src/_app/_index.run.js'),
140-
this.destinationPath(this.destinationRoot()+'/src/app/index.run.js')
141-
);
142134
this.fs.copyTpl(
143135
this.templatePath('_src/_app/_index.vendor.js'),
144136
this.destinationPath(this.destinationRoot()+'/src/app/index.vendor.js'),
145137
this
146138
);
139+
if(!this.options.dreidev){
140+
this.fs.copyTpl(
141+
this.templatePath('_src/_app/_index.config.js'),
142+
this.destinationPath(this.destinationRoot()+'/src/app/index.config.js'),
143+
this
144+
);
145+
this.fs.copyTpl(
146+
this.templatePath('_src/_app/_index.run.js'),
147+
this.destinationPath(this.destinationRoot()+'/src/app/index.run.js'),
148+
this
149+
);
150+
}else{
151+
this.fs.copyTpl(
152+
this.templatePath('_dreidev/_src/_app/_index.config.js'),
153+
this.destinationPath(this.destinationRoot()+'/src/app/index.config.js'),
154+
this
155+
);
156+
this.fs.copyTpl(
157+
this.templatePath('_dreidev/_src/_app/_index.run.js'),
158+
this.destinationPath(this.destinationRoot()+'/src/app/index.run.js'),
159+
this
160+
);
161+
}
162+
147163

148164
this.fs.copy(
149165
this.templatePath('_src/_app/_core/_core.module.js'),
@@ -164,7 +180,7 @@ module.exports = function (AngularATGenerator) {
164180
// Dreidev option files
165181
if (this.options.dreidev) {
166182
this.fs.copyTpl(
167-
this.templatePath('_src/_assets/_styles/_sass/_variables.css'),
183+
this.templatePath('_src/_assets/_styles/_sass/_variables.scss'),
168184
this.destinationPath(this.destinationRoot()+'/src/assets/styles/sass/variables.scss'),
169185
this
170186
);
@@ -173,6 +189,22 @@ module.exports = function (AngularATGenerator) {
173189
this.destinationPath(this.destinationRoot()+'/src/assets/styles/sass/mixins.scss'),
174190
this
175191
);
192+
this.fs.copyTpl(
193+
this.templatePath('_src/_assets/_styles/_sass/_dreidev-reset.scss'),
194+
this.destinationPath(this.destinationRoot()+'/src/assets/styles/sass/dreidev-reset.scss'),
195+
this
196+
);
197+
this.fs.copy(
198+
this.templatePath('_dreidev/_src/_tpl-index.ejs'),
199+
this.destinationPath(this.destinationRoot()+'/src/tpl-index.ejs')
200+
);
201+
}
202+
203+
if (this.props.angularModules){
204+
this.fs.copy(
205+
this.templatePath('_src/_assets/_js/_translate.js'),
206+
this.destinationPath(this.destinationRoot()+'/src/assets/js/translate.js')
207+
);
176208
}
177209

178210
};

generators/app/src/install.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ module.exports = function (AngularATGenerator) {
2323
deps.push("moment");
2424
}
2525

26+
if (this.props.normalize) {
27+
deps.push("normalize-css");
28+
}
29+
2630
if (this.props.styles.material) {
2731
deps.push("material-icons");
2832
}

generators/app/src/prompts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = function(AngularATGenerator) {
4242
return;
4343
} else if (this.options.dreidev) {
4444
this.props = _.merge(this.props, getDreidevProps());
45-
this.props.extraDeps = [{dependancy: 'at-flex-grid'}];
45+
this.props.extraDeps = [{dependency: "at-flex-grid"}];
4646
return;
4747
} else {
4848
let done = this.async();

generators/app/templates/_README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ Run a sub-generator:
3737
### Tips:
3838
- To keep the SASS/SCSS clean and modular use [BEM Syntax](http://css-tricks.com/bem-101/)
3939
- To keep the git repository's branch model modular and scalable use [git flow](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
40+
<% if (options.dreidev) { %>
41+
42+
#### Organization: [DREIDEV](http://dreidev.com)
43+
<% } %>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import * as translation from '../assets/js/translate.js';
2+
3+
function config($logProvider, $authProvider, localStorageServiceProvider, $translateProvider, $mdThemingProvider) {
4+
'ngInject';
5+
6+
// local storage configuration
7+
localStorageServiceProvider.setPrefix('');
8+
// fallback in case localStorage was not supported
9+
localStorageServiceProvider.setStorageCookie(300, '/', true);
10+
11+
// translation configuration
12+
$translateProvider.translations('en', translation.en);
13+
$translateProvider.preferredLanguage('en');
14+
$translateProvider.useSanitizeValueStrategy('sanitizeParameters');
15+
16+
// authentication configuretion
17+
$authProvider.signupUrl = '/api/rest-auth/registration/';
18+
$authProvider.loginUrl = '/api/auth/login';
19+
20+
// anglar material theme
21+
22+
// Extend a palette with primary colors.
23+
const primaryPalette = $mdThemingProvider.extendPalette('indigo', {
24+
// '400': '',
25+
// '500': '',
26+
// '600': '',
27+
// '700': '',
28+
// '800': '',
29+
// '900': ''
30+
});
31+
// Extend a palette with accent colors.
32+
const accentPalette = $mdThemingProvider.extendPalette('pink', {
33+
// 'A100': '',
34+
// 'A200': '',
35+
// 'A300': '',
36+
// 'A400': ''
37+
});
38+
39+
// Register the new color palette map
40+
$mdThemingProvider.definePalette('<%= props.appName %>Primary', primaryPalette);
41+
$mdThemingProvider.definePalette('<%= props.appName %>Accent', accentPalette);
42+
43+
// Use that taskArabia themes for the primary and accent intentions
44+
$mdThemingProvider.theme('default')
45+
.primaryPalette('<%= props.appName %>Primary')
46+
.accentPalette('<%= props.appName %>Accent')
47+
.warnPalette('red');
48+
49+
// Enable log
50+
$logProvider.debugEnabled(true);
51+
}
52+
53+
export default config;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function runBlock($log) {
2+
'ngInject';
3+
4+
//Console greeting sentences.
5+
console.log("%cCareful, this is a tool intended for developers.", "color: #1985A3; font-size: x-large; font-weight: bold;");
6+
console.log("%cPasting commands here may cause your data to be stolen by attackers.", "color: black; font-size: medium;");
7+
console.log("%cIf you're a fellow web devloper, have your fun. -DREIDEV", "color: black; font-size: small; font-style: italic;");
8+
9+
$log.debug('Hello from run block!');
10+
}
11+
12+
export default runBlock;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>dreidevApp</title>
5+
<meta charset="utf-8">
6+
<meta name="author" content="DREIDEV">
7+
<meta name="description" content="">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
9+
<base href="/">
10+
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
11+
<!-- LINKING STYLE SHEETS -->
12+
<% for(var i=0; i < htmlWebpackPlugin.files.css; i++) { %>
13+
<link href="<%= htmlWebpackPlugin.files.css[i] %>" rel="stylesheet">
14+
<% } %>
15+
<!-- LINKING JS FILES -->
16+
<% for(var i=0; i < htmlWebpackPlugin.files.chunks; i++) { %>
17+
<script src="<%= htmlWebpackPlugin.files.chunks[i].entry %>" defer></script>
18+
<% } %>
19+
</head>
20+
<body>
21+
<!--[if lt IE 10]>
22+
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
23+
<![endif]-->
24+
<div class="site-wrapper">
25+
<main ui-view></main>
26+
</div>
27+
</body>
28+
</html>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
function config($logProvider) {
1+
function config($logProvider<%if (options.dreidev) {%>, $authProvider, localStorageServiceProvider, $translateProvider, $mdThemingProvider<%}%>) {
22
'ngInject';
33

44
// Enable log
55
$logProvider.debugEnabled(true);
6-
76
}
87

98
export default config;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exports.en = {
2+
3+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*!
2+
* Author: Ahmed Tokyo
3+
* tokyo@dreidev.com
4+
* https://www.dreidev.com
5+
*/
6+
* {
7+
box-sizing: border-box;
8+
}
9+
10+
*:after,
11+
*:before {
12+
box-sizing: border-box;
13+
}
14+
15+
// Body reset
16+
html {
17+
-webkit-tap-highlight-color: rgba(0,0,0,0);
18+
overflow: auto;
19+
}
20+
21+
body {
22+
font-size: $font-size-base;
23+
line-height: $line-height-base;
24+
color: $text-color-default;
25+
box-sizing: border-box;
26+
counter-reset: item;
27+
text-rendering: geometricPrecision;
28+
-webkit-font-smoothing: antialiased;
29+
-moz-osx-font-smoothing: grayscale;
30+
overflow: auto;
31+
}
32+
33+
// Reset fonts for relevant elements
34+
button,
35+
input,
36+
select,
37+
textarea {
38+
font-family: inherit;
39+
font-size: inherit;
40+
line-height: inherit;
41+
}
42+
// Horizontal rules
43+
hr {
44+
margin-top: $line-height-computed;
45+
margin-bottom: $line-height-computed;
46+
border: 0;
47+
border-top: 1px solid $hr-color-border;
48+
}

generators/app/templates/_src/_assets/_styles/_sass/_index.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
<% if (props.normalize) { %>@import '~normalize-css/normalize.css';<%}%>
12
<% if (props.bootstrapSass) { %>
23
$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
34
@import '~bootstrap-sass/assets/stylesheets/_bootstrap.scss';<% } %><% if (props.styles.material) { %>
45
@import '~angular-material/angular-material.scss';
56
@import '~material-icons/css/material-icons.css';
6-
<% } %>
7-
@import './fonts.scss';
7+
<% } %><% if (options.dreidev) { %>
8+
@import './variables.scss';
9+
@import './mixins.scss';
10+
@import './dreidev-reset.scss';
11+
<%}%>
12+
<% if (props.styles.atFlex) { %>@import '~at-flex-grid/src/scss/at-flex-grid.scss';
13+
<% } %>@import './fonts.scss';
814
@import './main.scss';
915
// Add style imports above
1016

generators/app/templates/_src/_assets/_styles/_sass/_variables.css

Whitespace-only changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Primary color palette
2+
// $primary-color-400: ;
3+
// $primary-color-500: ;
4+
// $primary-color-800: ;
5+
6+
// Accent color palette
7+
// $accent-color-A100: ;
8+
// $accent-color-A200: ;
9+
// $accent-color-A300: ;
10+
// $accent-color-A400: ;
11+
12+
// Warn color palette
13+
// $warn-color-400: ;
14+
15+
// Static colors
16+
$text-color-default: black;
17+
// $modal-backdrop-bg: ;
18+
$hr-color-border: #EEEEEE !default;
19+
20+
// Default configurations
21+
$border-radius-primary: 7px;
22+
$hidden-outline: rgba(0,0,0,0);
23+
24+
// Default spacings
25+
$content-spacing-y-primary: 50px;
26+
27+
// Font sizes
28+
$font-size-base: 14px !default; //** Unit-less `line-height` for use in components like buttons.
29+
30+
// line height
31+
$line-height-base: 1.428571429 !default; // 20/14
32+
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
33+
$line-height-computed: floor(($font-size-base * $line-height-base)) !default; // ~20px
34+
35+
// Font stacks
36+
$font-stack-fallback: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; //Add Main style variables above
37+
$font-stack-regular: 'RegularFontHere', $font-stack-fallback;
38+
39+
//Add style variables above

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-at-angular",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Yeoman angular application generator thet uses Webpack, SASS, UI router, Karma and Jasmine for testing, and auto generated docs.",
55
"homepage": "http://a-tokyo.github.io/generator-at-angular/",
66
"author": {

test/app-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('at-angular --dreidev', function() {
5353

5454
it('should create the expected dreidev angular application files', function(done) {
5555
const dreidevExpectedAngularAppFiles = expectedAngularAppFiles.concat(
56-
['src/assets/styles/sass/variables.scss', 'src/assets/styles/sass/mixins.scss']
56+
['src/assets/js/translate.js', 'src/assets/styles/sass/dreidev-reset.scss', 'src/assets/styles/sass/variables.scss', 'src/assets/styles/sass/mixins.scss']
5757
);
5858
assert.file(dreidevExpectedAngularAppFiles);
5959
done();

0 commit comments

Comments
 (0)