This repository has been archived by the owner on Jul 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from spryker/develop
Version 2.0.0
Showing
14 changed files
with
395 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/** | ||
* This file is part of Antelope frontend automation tool | ||
* (c) Spryker Systems GmbH | ||
* For full copyright and license information, please view the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const cwd = process.cwd(); | ||
|
||
module.exports = { | ||
getDefault: () => { | ||
return { | ||
antelope: {}, | ||
context: cwd | ||
}; | ||
}, | ||
legacy: { | ||
yves: (entryPoints, manifests) => { | ||
let path = require('path'); | ||
let context = require('../context'); | ||
let loadersPaths = process.mainModule.paths.concat([path.join(cwd, './node_modules')]); | ||
let rootPaths = [ | ||
cwd, | ||
path.join(cwd, './node_modules') | ||
]; | ||
|
||
let config = { | ||
antelope: {}, | ||
context: cwd, | ||
entry: entryPoints, | ||
resolve: { | ||
root: rootPaths | ||
}, | ||
resolveLoader: { | ||
root: loadersPaths | ||
}, | ||
watchOptions: { | ||
aggregateTimeout: 300, | ||
poll: 1000 | ||
}, | ||
plugins: [], | ||
progress: true, | ||
failOnError: false, | ||
debug: context.has('debug'), | ||
watch: context.has('watch') | ||
}; | ||
|
||
return config; | ||
}, | ||
zed: (entryPoints, manifests) => { | ||
let path = require('path'); | ||
let R = require('ramda'); | ||
let globby = require('globby'); | ||
let webpack = require('webpack'); | ||
let ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
let context = require('../context'); | ||
let anchor = globby.sync([ | ||
'**/spryker-zed-gui-commons.entry.js' | ||
], { | ||
cwd: cwd, | ||
nocase: true | ||
}); | ||
let guiPath = path.join(cwd, anchor[0], '../../../../'); | ||
let bundlesPath = path.join(guiPath, '../'); | ||
let loadersPaths = process.mainModule.paths.concat([path.join(cwd, './node_modules')]); | ||
let rootPaths = [ | ||
path.join(cwd, './node_modules'), | ||
bundlesPath | ||
].concat(R.map((manifest) => { | ||
return path.join(path.dirname(manifest), './node_modules'); | ||
}, R.keys(manifests))); | ||
|
||
let config = { | ||
antelope: {}, | ||
context: cwd, | ||
entry: entryPoints, | ||
resolve: { | ||
root: rootPaths, | ||
alias: { | ||
ZedGui: `${path.basename(guiPath)}/assets/Zed/js/modules/commons` | ||
} | ||
}, | ||
resolveLoader: { | ||
root: loadersPaths | ||
}, | ||
output: { | ||
path: path.join(cwd, './public/Zed'), | ||
filename: 'assets/js/[name].js' | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.css\??(\d*\w*=?\.?)+$/i, | ||
loader: ExtractTextPlugin.extract('style', 'css') | ||
}, { | ||
test: /\.scss$/i, | ||
loader: ExtractTextPlugin.extract('style', 'css!resolve-url!sass?sourceMap') | ||
}, { | ||
test: /\.(ttf|woff2?|eot)\??(\d*\w*=?\.?)+$/i, | ||
loader: 'file?name=/assets/fonts/[name].[ext]' | ||
}, { | ||
test: /\.(jpe?g|png|gif|svg)\??(\d*\w*=?\.?)+$/i, | ||
loader: 'file?name=/assets/img/[name].[ext]' | ||
}] | ||
}, | ||
sassLoader: { | ||
includePaths: loadersPaths | ||
}, | ||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin('spryker-zed-gui-commons', 'assets/js/spryker-zed-gui-commons.js'), | ||
new webpack.ProvidePlugin({ | ||
$: 'jquery', | ||
jQuery: 'jquery', | ||
|
||
// legacy provider | ||
SprykerAjax: 'Gui/assets/Zed/js/modules/legacy/SprykerAjax', | ||
SprykerAjaxCallbacks: 'Gui/assets/Zed/js/modules/legacy/SprykerAjaxCallbacks', | ||
SprykerAlert: 'Gui/assets/Zed/js/modules/legacy/SprykerAlert' | ||
}), | ||
new ExtractTextPlugin('assets/css/[name].css', { | ||
allChunks: true | ||
}), | ||
new webpack.DefinePlugin({ | ||
PRODUCTION: context.has('production'), | ||
WATCH: context.has('watch'), | ||
'require.specified': 'require.resolve' | ||
}) | ||
], | ||
watchOptions: { | ||
aggregateTimeout: 300, | ||
poll: 1000 | ||
}, | ||
progress: true, | ||
failOnError: false, | ||
devtool: 'sourceMap', | ||
debug: context.has('debug'), | ||
watch: context.has('watch') | ||
}; | ||
|
||
if (context.has('production')) { | ||
config.plugins = config.plugins.concat([ | ||
new webpack.optimize.UglifyJsPlugin({ | ||
comments: false, | ||
sourceMap: context.has('debug'), | ||
compress: { | ||
warnings: context.has('debug') | ||
}, | ||
mangle: { | ||
except: ['$', 'exports', 'require'] | ||
} | ||
}) | ||
]); | ||
} | ||
|
||
return config; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* This file is part of Antelope frontend automation tool | ||
* (c) Spryker Systems GmbH | ||
* For full copyright and license information, please view the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const path = require('path'); | ||
const globby = require('globby'); | ||
const semver = require('semver'); | ||
const errors = require('../errors'); | ||
const pkg = require('../../package'); | ||
const cwd = process.cwd(); | ||
|
||
function checkCompatibility() { | ||
let composer = {}; | ||
let isCompatible = false; | ||
let manifests = globby.sync([ | ||
'**/gui/composer.json' | ||
], { | ||
cwd: cwd, | ||
nocase: true | ||
}); | ||
|
||
if (manifests.length === 1) { | ||
composer = require(path.join(cwd, manifests[0])); | ||
isCompatible = semver.satisfies(pkg.version, composer.antelope || '0'); | ||
} | ||
|
||
return { | ||
isCompatible: isCompatible, | ||
version: pkg.version, | ||
range: composer.antelope || 'unknown' | ||
}; | ||
} | ||
|
||
module.exports = { | ||
run: () => { | ||
return new Promise((resolve, reject) => { | ||
let results = checkCompatibility(); | ||
|
||
console.log('\nVersion test'.bold.gray); | ||
console.log('Check compatibilty with Spryker GUI bundle'.gray); | ||
console.log('|'.gray); | ||
console.log('| Version'.gray, results.version.cyan, '-> Range'.gray, results.range.cyan); | ||
|
||
if (results.isCompatible) { | ||
console.log('|'.gray, 'This version is'.gray, 'compatible'.green); | ||
return resolve(); | ||
} else { | ||
console.error('|'.gray, 'This version is'.gray, 'not compatible'.red); | ||
return reject(errors.enrich(new Error('Update this tool targeting a version within the required range'), 'version test')); | ||
} | ||
}); | ||
}, | ||
print: () => { | ||
let results = checkCompatibility(); | ||
console.log('version:'.gray, results.version.cyan); | ||
console.log('range:'.gray, results.range.cyan); | ||
console.log('compatible:'.gray, results.isCompatible ? 'true'.green : 'false'.red); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters