Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit 3067bcc

Browse files
author
jimmyfortin
committed
chore(Full history squashed)
Signed-off-by: Jimmy Fortin <[email protected]>
0 parents  commit 3067bcc

32 files changed

+4403
-0
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": ["es2015"],
3+
"plugins": ["lodash", "transform-runtime"],
4+
"comments": false
5+
}

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const isDistribution = process.env.NODE_ENV === 'dist'
2+
3+
module.exports = {
4+
root: true,
5+
parser: 'babel-eslint',
6+
parserOptions: {
7+
sourceType: 'module'
8+
},
9+
env: {
10+
browser: true,
11+
jasmine: true
12+
},
13+
globals: {
14+
angular: true,
15+
inject: true
16+
},
17+
extends: 'standard',
18+
rules: {
19+
'arrow-parens': 0,
20+
'generator-star-spacing': 0
21+
},
22+
'no-console': isDistribution ? 2 : 0,
23+
'no-debugger': isDistribution ? 2 : 0
24+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
*.log

CONTRIBUTING.md

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Contributing to project ovh-documentation-toolkit
2+
3+
This project accepts contributions. In order to contribute, you should
4+
pay attention to a few things:
5+
6+
1. your code must follow the coding style rules
7+
2. your code must be documented
8+
3. your work must be signed (see below)
9+
4. you may contribute through GitHub Pull Requests
10+
11+
All contributions are welcome. However, keeping in mind the primary goal
12+
of this project, which is to provide a stylekit for the _OVH_ brand, we
13+
**strongly recommend** that you submit a RFC pull request or reach out
14+
to the [UX team on Gitter](https://gitter.im/ovh/ux) to discuss your
15+
proposal first.
16+
17+
# Coding style rules
18+
19+
* Use the [BEM CSS selector naming convention](https://en.bem.info/methodology/naming-convention/).
20+
* Lint your code with stylelint: `npm run lint`.
21+
* Test your build: `npm run build`.
22+
23+
# Submitting Modifications
24+
25+
The contributions should be submitted through Github Pull Requests and
26+
follow the DCO which is defined below.
27+
28+
# Licensing for new files
29+
30+
ovh-documentation-toolkit is licensed under a modified BSD-3-Clause license. Anything
31+
contributed to ovh-documentation-toolkit must be released under this license.
32+
33+
When introducing a new file into the project, please make sure it has a
34+
copyright header making clear under which license it's being released.
35+
36+
# Developer Certificate of Origin (DCO)
37+
38+
To improve tracking of contributions to this project we will use a
39+
process modeled on the modified DCO 1.1 and use a "sign-off" procedure
40+
on patches that are being emailed around or contributed in any other
41+
way.
42+
43+
The sign-off is a simple line at the end of the explanation for the
44+
patch, which certifies that you wrote it or otherwise have the right
45+
to pass it on as an open-source patch. The rules are pretty simple:
46+
if you can certify the below:
47+
48+
```
49+
By making a contribution to this project, I certify that:
50+
51+
(a) The contribution was created in whole or in part by me and I have
52+
the right to submit it under the open source license indicated in
53+
the file; or
54+
55+
(b) The contribution is based upon previous work that, to the best of
56+
my knowledge, is covered under an appropriate open source License
57+
and I have the right under that license to submit that work with
58+
modifications, whether created in whole or in part by me, under
59+
the same open source license (unless I am permitted to submit
60+
under a different license), as indicated in the file; or
61+
62+
(c) The contribution was provided directly to me by some other person
63+
who certified (a), (b) or (c) and I have not modified it.
64+
65+
(d) The contribution is made free of any other party's intellectual
66+
property claims or rights.
67+
68+
(e) I understand and agree that this project and the contribution are
69+
public and that a record of the contribution (including all
70+
personal information I submit with it, including my sign-off) is
71+
maintained indefinitely and may be redistributed consistent with
72+
this project or the open source license(s) involved.
73+
```
74+
75+
then you just add a line saying
76+
77+
```
78+
Signed-off-by: Random J Developer <[email protected]>
79+
```
80+
81+
using your real name (sorry, no pseudonyms or anonymous contributions.)
82+
83+
84+
# Setup your environment
85+
86+
Please refer to the [README](README.md).
87+
88+
## NPM
89+
90+
For those using npm instead of yarn here is a list of equivalences: <https://yarnpkg.com/en/docs/migrating-from-npm>
91+
92+
## Commits
93+
94+
All commits in this project must follow this specific message convention: <https://gist.github.com/stephenparish/9941e89d80e2bc58a153>

LICENSE

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright (c) 2013-2017, OVH SAS.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
* Neither the name of OVH SAS nor the
13+
names of its contributors may be used to endorse or promote products
14+
derived from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY OVH SAS AND CONTRIBUTORS ``AS IS'' AND ANY
17+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL OVH SAS AND CONTRIBUTORS BE LIABLE FOR ANY
20+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
![Project status alpha](https://img.shields.io/badge/status-alpha-blue.svg) [![Github tag](https://img.shields.io/github/tag/ovh-ux/ovh-documentation-toolkit.svg)]() ![Maintenance](https://img.shields.io/maintenance/yes/2017.svg) [![Chat on gitter](https://img.shields.io/gitter/room/ovh/ux.svg)](https://gitter.im/ovh/ux)
2+
3+
# OVH Documentation toolkit
4+
5+
This project provides some tools to quickly and simply build a documentation application based on AngularJS.
6+
7+
## Installation
8+
9+
```bash
10+
yarn add https://github.com/ovh-ux/ovh-documentation-toolkit.git
11+
```
12+
13+
## Usage
14+
15+
```javascript
16+
const app = angular
17+
.module('my-documentation-app', [
18+
'ovh-documentation-toolkit'
19+
])
20+
```
21+
22+
## Contribute
23+
24+
Please refer to [CONTRIBUTE](CONTRIBUTE.md).

build/webpack.base.config.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import LodashModuleReplacementPlugin from 'lodash-webpack-plugin'
2+
import formatter from 'eslint-friendly-formatter'
3+
import path from 'path'
4+
import webpack from 'webpack'
5+
6+
const exclude = [/node_modules/, /dist/]
7+
8+
export default {
9+
entry: {
10+
component: ['./src/app/index.js']
11+
},
12+
output: {
13+
path: path.resolve('.', 'dist'),
14+
filename: '[name].js',
15+
libraryTarget: 'umd'
16+
},
17+
resolve: {
18+
alias: {
19+
src: path.resolve('.', 'src'),
20+
build: path.resolve(__dirname)
21+
}
22+
},
23+
plugins: [
24+
new webpack.DefinePlugin({
25+
'process.env': process.env.NODE_ENV
26+
}),
27+
new webpack.NoEmitOnErrorsPlugin,
28+
new LodashModuleReplacementPlugin,
29+
new webpack.optimize.UglifyJsPlugin({
30+
compress: {
31+
warnings: false
32+
}
33+
})
34+
],
35+
module: {
36+
rules: [
37+
{ test: /\.js$/,
38+
enforce: 'pre',
39+
exclude,
40+
use: [
41+
{ loader: 'eslint-loader',
42+
options: {
43+
formatter
44+
} }
45+
] },
46+
{ test: /\.js$/,
47+
exclude,
48+
use: [
49+
'ng-annotate-loader',
50+
'babel-loader'
51+
] },
52+
{ test: /\.(html|svg)$/,
53+
exclude,
54+
use: [
55+
{ loader: 'html-loader',
56+
options: {
57+
interpolate: true,
58+
minimize: true
59+
} }
60+
] }
61+
]
62+
}
63+
}

build/webpack.config.babel.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import webpack from 'webpack'
2+
import merge from 'webpack-merge'
3+
import baseConfig from './webpack.base.config'
4+
5+
export default merge(baseConfig, {
6+
output: {
7+
filename: 'ovh-documentation-toolkit.js'
8+
},
9+
plugins: [
10+
new webpack.DefinePlugin({
11+
'process.env': process.env.NODE_ENV
12+
})
13+
]
14+
})

dist/ovh-documentation-toolkit.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "ovh-documentation-toolkit",
3+
"version": "0.1.0",
4+
"description": "An AngularJS documentation app foundation.",
5+
"license": "BSD-3-Clause",
6+
"main": "dist/ovh-documentation-toolkit.js",
7+
"module": "src/app/index.js",
8+
"url-loader": "^0.5.7",
9+
"scripts": {
10+
"build": "rimraf dist && webpack --progress --colors --hide-modules --config ./build/webpack.config.babel.js",
11+
"build:watch": "rimraf dist && webpack --progress --colors --hide-modules --config ./build/webpack.config.babel.js --watch"
12+
},
13+
"devDependencies": {
14+
"babel-cli": "~6.24.1",
15+
"babel-core": "~6.24.1",
16+
"babel-eslint": "~7.2.3",
17+
"babel-loader": "~7.0.0",
18+
"babel-plugin-lodash": "^3.2.11",
19+
"babel-plugin-transform-runtime": "~6.23.0",
20+
"babel-preset-es2015": "~6.24.1",
21+
"babel-register": "~6.24.1",
22+
"eslint": "~3.19.0",
23+
"eslint-config-standard": "~10.2.1",
24+
"eslint-friendly-formatter": "~3.0.0",
25+
"eslint-loader": "~1.7.1",
26+
"eslint-plugin-import": "^2.3.0",
27+
"eslint-plugin-node": "^5.0.0",
28+
"eslint-plugin-promise": "~3.5.0",
29+
"eslint-plugin-standard": "~3.0.1",
30+
"file-loader": "~0.11.2",
31+
"html-loader": "~0.4.4",
32+
"less": "~2.7.2",
33+
"less-loader": "~4.0.4",
34+
"lodash-webpack-plugin": "^0.11.4",
35+
"ng-annotate": "~1.2.1",
36+
"ng-annotate-loader": "~0.6.1",
37+
"postcss-loader": "~2.0.5",
38+
"rimraf": "~2.6.1",
39+
"style-loader": "~0.18.2",
40+
"url-loader": "~0.5.7",
41+
"webpack": "~2.6.1",
42+
"webpack-dev-middleware": "~1.10.2",
43+
"webpack-hot-middleware": "~2.18.0",
44+
"webpack-merge": "~4.1.0",
45+
"webpack-shell-plugin": "~0.5.0"
46+
},
47+
"dependencies": {
48+
"angular": "~1.6.1",
49+
"angular-ui-router": "~0.4.2",
50+
"lodash": "~4.17.4"
51+
}
52+
}

src/app/index.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Showcase from '../components/showcase/showcase.component'
2+
import VersionsProvider from '../components/versions/versions.provider'
3+
import Versions from '../components/versions/versions.component'
4+
import ThemesProvider from '../components/themes/themes.provider'
5+
import Themes from '../components/themes/themes.component'
6+
import ComponentStatusProvider from '../components/component-status/component-status.provider'
7+
import ComponentStatus from '../components/component-status/component-status.component'
8+
import StateHelpers from '../components/state-helpers/state-helpers.service'
9+
import rootRoutes from './index.routes'
10+
import redirectToInit from '../components/init/redirectTo.run'
11+
12+
const ovhDocumentationToolkitModule = angular
13+
.module('ovh-documentation-toolkit', [
14+
'ui.router'
15+
])
16+
.component('showcaseUi', Showcase)
17+
.service('StateHelpers', StateHelpers)
18+
.provider('Versions', VersionsProvider)
19+
.component('versionsSelector', Versions)
20+
.provider('Themes', ThemesProvider)
21+
.component('themesSelector', Themes)
22+
.provider('ComponentStatus', ComponentStatusProvider)
23+
.component('componentStatus', ComponentStatus)
24+
.config(rootRoutes)
25+
.run(redirectToInit)
26+
27+
export default ovhDocumentationToolkitModule

0 commit comments

Comments
 (0)