autofront 2.0.8 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -5
  2. package/index.js +11 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -71,10 +71,6 @@ These ones are automatically built by [Gulp Useref](https://www.npmjs.com/packa
71
71
 
72
72
  One of these should to be named "app", ideally the main one.
73
73
 
74
- ### Domains
75
-
76
- At least it should be defined the local one. See [the proper section](#domains-1).
77
-
78
74
  ## Usage
79
75
 
80
76
  ### Tasks
@@ -89,7 +85,7 @@ Mainly the Gulp ones are the following:
89
85
 
90
86
  Running Gulp command, an additional parameter can be included (e.g.: `gulp --dev` or `gulp build --pro`) to indicate the domain of connection path. Defaults to `--local`.
91
87
 
92
- These domain URLs must to appear in `package.json` listed in the property `domains` (optionally also `domainsAliases`, to assign domain name for each alias).
88
+ These domain URLs would be searched in `package.json` listed in the property `domains` (optionally also `domainAliases`, to assign domain name for each alias).
93
89
 
94
90
  And, to capture the selected URL, put `{{AUTOFRONT_DOMAIN}}` where it would be located in your source code.
95
91
 
package/index.js CHANGED
@@ -35,16 +35,20 @@ const nl = '\n',
35
35
 
36
36
  gulp.task('check', () => {
37
37
  const pckg = require('../../package.json'),
38
- domainAliases = pckg.domainAliases;
38
+ domains = pckg.domains;
39
39
  var domainIndex = args[0]||'local';
40
- if (domainAliases) {
41
- const alias = domainAliases[domainIndex];
42
- if (alias)
43
- domainIndex = alias;
40
+ if (domains) {
41
+ const domainAliases = pckg.domainAliases;
42
+ if (domainAliases) {
43
+ const alias = domainAliases[domainIndex];
44
+ if (alias)
45
+ domainIndex = alias;
46
+ }
47
+ domain = domains[domainIndex];
44
48
  }
45
- domain = pckg.domains[domainIndex];
49
+ const isMatched = domain!==undefined;
46
50
  return gulp.src(paths.src)
47
- .pipe(domain?$.notify('Matching domain: "'+domainIndex+'".'):process.exit());
51
+ .pipe($.notify(isMatched?'Matching domain: "'+domainIndex+'".':'No domain matched.'));
48
52
  });
49
53
 
50
54
  gulp.task('del', () => delFolder(paths.tmp));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autofront",
3
- "version": "2.0.8",
3
+ "version": "2.1.0",
4
4
  "description": "Gulp settings for front-end projects.",
5
5
  "main": "index.js",
6
6
  "scripts": {