Skip to content

Commit 6bbb2e3

Browse files
committed
Moving things around and isolating build process
1 parent 52636ec commit 6bbb2e3

File tree

231 files changed

+19528
-8148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+19528
-8148
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
docs/build/
4+
.DS_Store

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.x

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
docs/
3+
build/
4+
dist/
5+
.DS_Store

Gruntfile.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function (grunt) {
2+
grunt.task.loadTasks('build/tasks');
3+
};

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# Kibana UI Framework
1+
# Elastic UI Framework
22

3-
> The Kibana UI Framework is a collection of React UI components for quickly building user interfaces
4-
> for Kibana. Not using React? No problem! You can still use the CSS behind each component.
3+
> The Elastic UI Framework is a collection of React UI components for quickly building user interfaces
4+
> for Elastic. Not using React? No problem! You can still use the CSS behind each component.
55
66
## Using the Framework
77

88
### Documentation
99

10-
Compile the CSS with `./node_modules/grunt/bin/grunt uiFramework:compileCss` (OS X) or
11-
`.\node_modules\grunt\bin\grunt uiFramework:compileCss` (Windows).
10+
Compile the CSS with `npm run compileCss`.
1211

13-
You can view interactive documentation by running `npm run uiFramework:start` and then visiting
12+
You can view interactive documentation by running `npm run start` and then visiting
1413
[http://localhost:8020/](http://localhost:8020/). This will also start watching the SCSS files, and will recompile the CSS
1514
automatically for you when you make changes.
1615

@@ -25,18 +24,18 @@ See the documentation in [`scripts/jest.js`](../scripts/jest.js) for more option
2524

2625
There are four steps to creating a new component:
2726

28-
1. Create the SCSS for the component in `ui_framework/src/components`.
27+
1. Create the SCSS for the component in `src/components`.
2928
2. Create the React portion of the component.
3029
3. Write tests.
31-
4. Document it with examples in `ui_framework/doc_site`.
30+
4. Document it with examples in `docs`.
3231

3332
You can do this using Yeoman (the easy way), or you can do it manually (the hard way).
3433

3534
### Using Yeoman
3635

3736
#### Create a new component
3837

39-
From the command line, run `npm run uiFramework:createComponent`.
38+
From the command line, run `npm run createComponent`.
4039

4140
First, you'll be prompted for what kind of component to create:
4241

@@ -77,23 +76,23 @@ and re-export the generated JS and SCSS files.
7776

7877
#### Create component SCSS
7978

80-
1. Create a directory for your component in `ui_framework/src/components`.
79+
1. Create a directory for your component in `src/components`.
8180
2. In this directory, create `_{component name}.scss`.
8281
3. _Optional:_ Create any other components that should be [logically-grouped](#logically-grouped-components)
8382
in this directory.
8483
4. Create an `_index.scss` file in this directory that import all of the new component SCSS files
8584
you created.
86-
5. Import the `_index.scss` file into `ui_framework/src/components/index.scss`.
85+
5. Import the `_index.scss` file into `src/components/index.scss`.
8786

88-
This makes your styles available to Kibana and the UI Framework documentation.
87+
This makes your styles available to Elastic and the UI Framework documentation.
8988

9089
#### Create the React component
9190

9291
1. Create the React component(s) in the same directory as the related SCSS file(s).
9392
2. Export these components from an `index.js` file.
94-
3. Re-export these components from `ui_framework/src/components/index.js`.
93+
3. Re-export these components from `src/components/index.js`.
9594

96-
This makes your React component available for import into Kibana.
95+
This makes your React component available for import into Elastic.
9796

9897
#### Test the component
9998

@@ -107,11 +106,11 @@ To see how well the components have been covered by tests, you can run
107106

108107
#### Document the component with examples
109108

110-
1. Create a directory for your example in `ui_framework/doc_site/src/views`. Name it the name of the
109+
1. Create a directory for your example in `docs/src/views`. Name it the name of the
111110
component.
112111
2. Create a `{component name}_example.js` file inside the directory. You'll use this file to define
113112
the different examples for your component.
114-
3. Add the route to this file in `ui_framework/doc_site/src/services/routes/Routes.js`.
113+
3. Add the route to this file in `docs/src/services/routes/Routes.js`.
115114
4. In the `{component name}_example.js` file you created, define examples which demonstrate the component and describe
116115
its role from a UI perspective.
117116

@@ -127,7 +126,7 @@ content.
127126

128127
You can use the same Yeoman generator referenced above to create documentation.
129128

130-
From the command line, run `npm run uiFramework:documentComponent`.
129+
From the command line, run `npm run documentComponent`.
131130

132131
First, you'll be prompted for what kind of documentation to create:
133132

build/babel-webpack-preset.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const commonPreset = {
2+
presets: [
3+
require.resolve('babel-preset-react')
4+
],
5+
plugins: [
6+
require.resolve('babel-plugin-add-module-exports'),
7+
8+
// stage 3
9+
require.resolve('babel-plugin-transform-async-generator-functions'),
10+
require.resolve('babel-plugin-transform-object-rest-spread'),
11+
12+
// stage 2
13+
require.resolve('babel-plugin-transform-class-properties')
14+
]
15+
}
16+
17+
const babelWebpackPreset = {
18+
presets: [
19+
[require.resolve('babel-preset-env'), {
20+
targets: {
21+
browsers: [
22+
'last 2 versions',
23+
'> 5%',
24+
'Safari 7' // for PhantomJS support
25+
]
26+
},
27+
useBuiltIns: true,
28+
}],
29+
commonPreset
30+
]
31+
}
32+
33+
module.exports = babelWebpackPreset
File renamed without changes.

generator-kui/component/index.js renamed to build/generator-kui/component/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = class extends Generator {
1818
message: `Where do you want to create this component's files?`,
1919
type: 'input',
2020
name: 'path',
21-
default: 'ui_framework/src/components',
21+
default: 'src/components',
2222
store: true,
2323
}, {
2424
message: 'Does it need its own directory?',

0 commit comments

Comments
 (0)