Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Toolchain
sgc
Commits
282fc6fe
Commit
282fc6fe
authored
Aug 30, 2018
by
Philipp Nowinski
Browse files
[TASK] cleanup
parent
7a757906
Changes
3
Hide whitespace changes
Inline
Side-by-side
__old/modules/lighthouse.js
deleted
100755 → 0
View file @
7a757906
'
use strict
'
;
const
exec
=
require
(
'
child_process
'
).
exec
,
settings
=
require
(
'
../../gulp/settings
'
),
chalk
=
require
(
'
chalk
'
);
console
.
log
(
`
${
chalk
.
bold
(
chalk
.
yellow
(
'
Heads up:
'
))}
${
chalk
.
yellow
(
'
this feature is still experimental!
'
)}
`
);
exec
(
`node ./sgc-core/node_modules/lighthouse/lighthouse-cli/index.js --chrome-flags="--ignore-certificate-errors"
${
settings
.
getConfig
().
browsersync
.
url
}
--view`
);
core/settings.js
View file @
282fc6fe
...
...
@@ -2,7 +2,7 @@
const
fs
=
require
(
'
fs
'
);
const
path
=
require
(
'
path
'
);
const
argv
=
require
(
'
yargs
'
)
.
argv
;
const
{
argv
}
=
require
(
'
yargs
'
);
/**
* This module is a global settings singleton
...
...
@@ -14,10 +14,10 @@ class Settings {
* Kick things off
*/
constructor
()
{
this
.
_config
=
this
.
get
Config
();
this
.
_config
=
Settings
.
parse
Config
();
this
.
_extensionPath
=
this
.
_config
.
directories
.
basePath
;
this
.
_webPath
=
this
.
_config
.
directories
.
webPath
;
this
.
_extension
=
this
.
_config
.
extensions
[
0
]
;
[
this
.
_extension
]
=
this
.
_config
.
extensions
;
this
.
_tasks
=
{
css
:
()
=>
{
return
require
(
'
./tasks/css
'
)},
js
:
()
=>
{
return
require
(
'
./tasks/js
'
)},
...
...
@@ -36,12 +36,12 @@ class Settings {
* @param {Boolean} _isWebPath indicates if the requested path is for web, or file system access
*/
getPath
(
_isWebPath
)
{
let
extensionName
=
(
typeof
argv
.
ext
!
==
'
undefined
'
)
?
argv
.
ext
:
this
.
_extension
;
return
typeof
isWebPath
!
==
'
undefined
'
?
path
.
join
(
this
.
_
web
Path
,
extensionName
)
:
path
.
join
(
this
.
_
extension
Path
,
extensionName
);
let
extensionName
=
(
typeof
argv
.
ext
=
==
'
undefined
'
)
?
this
.
_extension
:
argv
.
ext
;
return
typeof
_
isWebPath
=
==
'
undefined
'
?
path
.
join
(
this
.
_
extension
Path
,
extensionName
)
:
path
.
join
(
this
.
_
web
Path
,
extensionName
);
}
/**
...
...
@@ -56,7 +56,7 @@ class Settings {
/**
* Returns the sgc-config object
*/
get
Config
()
{
static
parse
Config
()
{
try
{
fs
.
statSync
(
'
./sgc-core/gulp/config.json
'
);
return
require
(
'
./config.json
'
);
...
...
@@ -71,6 +71,13 @@ class Settings {
get
tasks
()
{
return
this
.
_tasks
;
}
/**
* Returns the configuration object
*/
get
config
()
{
return
this
.
_config
;
}
}
const
instance
=
new
Settings
();
...
...
core/task.js
View file @
282fc6fe
...
...
@@ -16,7 +16,7 @@ module.exports = class task {
*/
constructor
()
{
this
.
_settings
=
settings
;
this
.
_config
=
this
.
_
settings
.
getC
onfig
()
;
this
.
_config
=
settings
.
c
onfig
;
this
.
_path
=
this
.
_settings
.
getPath
();
this
.
_logger
=
require
(
'
./logger
'
);
if
(
argv
.
prod
||
argv
.
production
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment