-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving things around and isolating build process
- Loading branch information
Showing
231 changed files
with
19,528 additions
and
8,148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,4 @@ | ||
node_modules/ | ||
dist/ | ||
docs/build/ | ||
.DS_Store |
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 @@ | ||
8.x |
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,5 @@ | ||
node_modules/ | ||
docs/ | ||
build/ | ||
dist/ | ||
.DS_Store |
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,3 @@ | ||
module.exports = function (grunt) { | ||
grunt.task.loadTasks('build/tasks'); | ||
}; |
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,33 @@ | ||
const commonPreset = { | ||
presets: [ | ||
require.resolve('babel-preset-react') | ||
], | ||
plugins: [ | ||
require.resolve('babel-plugin-add-module-exports'), | ||
|
||
// stage 3 | ||
require.resolve('babel-plugin-transform-async-generator-functions'), | ||
require.resolve('babel-plugin-transform-object-rest-spread'), | ||
|
||
// stage 2 | ||
require.resolve('babel-plugin-transform-class-properties') | ||
] | ||
} | ||
|
||
const babelWebpackPreset = { | ||
presets: [ | ||
[require.resolve('babel-preset-env'), { | ||
targets: { | ||
browsers: [ | ||
'last 2 versions', | ||
'> 5%', | ||
'Safari 7' // for PhantomJS support | ||
] | ||
}, | ||
useBuiltIns: true, | ||
}], | ||
commonPreset | ||
] | ||
} | ||
|
||
module.exports = babelWebpackPreset |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,11 @@ | ||
module.exports = { | ||
plugins: [ | ||
require('autoprefixer')({ | ||
browsers: [ | ||
'last 2 versions', | ||
'> 5%', | ||
'Safari 7' // for PhantomJS support | ||
] | ||
}) | ||
] | ||
}; |
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,36 @@ | ||
const os = require('os'); | ||
const platform = os.platform(); | ||
const isPlatformWindows = /^win/.test(platform); | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerTask('build', function () { | ||
const done = this.async(); | ||
|
||
const serverCmd = { | ||
cmd: isPlatformWindows ? '.\\node_modules\\.bin\\webpack.cmd' : './node_modules/.bin/webpack', | ||
args: [ | ||
'-p', | ||
'--config=docs/webpack.config.js' | ||
], | ||
opts: { stdio: 'inherit' } | ||
}; | ||
|
||
const uiFrameworkServerBuild = new Promise((resolve, reject) => { | ||
grunt.util.spawn(serverCmd, (error, result, code) => { | ||
if (error || code !== 0) { | ||
const message = result.stderr || result.stdout; | ||
|
||
grunt.log.error(message); | ||
|
||
return reject(); | ||
} | ||
|
||
grunt.log.writeln(result); | ||
|
||
resolve(); | ||
}); | ||
}); | ||
|
||
uiFrameworkServerBuild.then(done); | ||
}); | ||
}; |
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,41 @@ | ||
const sass = require('node-sass'); | ||
const postcss = require('postcss'); | ||
const postcssConfig = require('../postcss.config'); | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerTask('compileCss', function () { | ||
const done = this.async(); | ||
uiFrameworkCompile().then(done); | ||
|
||
function uiFrameworkCompile() { | ||
const compileTheme = name => { | ||
const src = `src/${name}.scss`; | ||
const dest = `dist/eui_${name}.css`; | ||
|
||
return new Promise(resolve => { | ||
sass.render({ | ||
file: src, | ||
}, function (error, result) { | ||
if (error) { | ||
grunt.log.error(error); | ||
} | ||
|
||
postcss([postcssConfig]) | ||
.process(result.css, { from: src, to: dest }) | ||
.then(result => { | ||
grunt.file.write(dest, result.css); | ||
|
||
if (result.map) { | ||
grunt.file.write(`${dest}.map`, result.map); | ||
} | ||
|
||
resolve(); | ||
}); | ||
}); | ||
}); | ||
}; | ||
|
||
return Promise.all([compileTheme('theme_light'), compileTheme('theme_dark')]); | ||
} | ||
}); | ||
}; |
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,78 @@ | ||
const os = require('os'); | ||
const chokidar = require('chokidar'); | ||
const { debounce } = require('lodash'); | ||
const platform = os.platform(); | ||
const isPlatformWindows = /^win/.test(platform); | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerTask('start', function () { | ||
const done = this.async(); | ||
|
||
Promise | ||
.all([ | ||
uiFrameworkWatch(), | ||
uiFrameworkServerStart() | ||
]) | ||
.then(done); | ||
|
||
function uiFrameworkWatch() { | ||
const debouncedCompile = debounce(() => { | ||
// Compile the SCSS in a separate process because node-sass throws a fatal error if it fails | ||
// to compile. | ||
grunt.util.spawn({ | ||
cmd: isPlatformWindows ? '.\\node_modules\\.bin\\grunt.cmd' : './node_modules/.bin/grunt', | ||
args: [ | ||
'compileCss', | ||
], | ||
}, (error, result) => { | ||
if (error) { | ||
grunt.log.error(result.stdout); | ||
} else { | ||
grunt.log.writeln(result); | ||
} | ||
}); | ||
}, 400, { leading: true }); | ||
|
||
return new Promise(() => { | ||
debouncedCompile(); | ||
|
||
chokidar.watch('src', { ignoreInitial: true }).on('all', (event, path) => { | ||
grunt.log.writeln(event, path); | ||
debouncedCompile(); | ||
}); | ||
}); | ||
} | ||
|
||
function uiFrameworkServerStart() { | ||
const serverCmd = { | ||
cmd: isPlatformWindows ? '.\\node_modules\\.bin\\webpack-dev-server.cmd' : './node_modules/.bin/webpack-dev-server', | ||
args: [ | ||
'--config=docs/webpack.config.js', | ||
'--inline', | ||
'--content-base=docs/build', | ||
'--host=0.0.0.0', | ||
'--port=8020', | ||
], | ||
opts: { stdio: 'inherit' } | ||
}; | ||
|
||
return new Promise((resolve, reject) => { | ||
grunt.util.spawn(serverCmd, (error, result, code) => { | ||
if (error || code !== 0) { | ||
const message = result.stderr || result.stdout; | ||
|
||
grunt.log.error(message); | ||
|
||
return reject(); | ||
} | ||
|
||
grunt.log.writeln(result); | ||
|
||
resolve(); | ||
}); | ||
|
||
}); | ||
} | ||
|
||
}); | ||
}; |
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 @@ | ||
export * from './src/components'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.