Skip to content

Commit d19e098

Browse files
author
Lionel Bijaoui
committed
Merge branch 'v3' into v3_update
# Conflicts: # .travis.yml # dist/vfg-core.css # dist/vfg-core.js # dist/vfg.css # dist/vfg.js # package-lock.json # package.json # src/fields/core/fieldInput.vue # src/fields/core/fieldSubmit.vue # src/fields/core/fieldUpload.vue # src/fields/optional/fieldSwitch.vue # src/formGenerator.vue
2 parents d843625 + e21a0de commit d19e098

File tree

117 files changed

+17167
-10650
lines changed

Some content is hidden

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

117 files changed

+17167
-10650
lines changed

.babelrc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{
2-
"presets": ["es2015", "stage-2"],
3-
"plugins": ["transform-runtime", "lodash"],
4-
"comments": false
5-
}
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false,
7+
"useBuiltIns": "entry"
8+
}
9+
],
10+
"stage-2"
11+
],
12+
"plugins": ["transform-runtime", "lodash"],
13+
"env": {
14+
"test": {
15+
"plugins": ["istanbul"]
16+
}
17+
}
18+
}

.editorconfig

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

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/*.js
2+
build/*.js
3+
config/*.js
4+
!.eslintrc.js

.eslintrc.js

Lines changed: 26 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,27 @@
11
module.exports = {
2-
root: true,
3-
"env": {
4-
"browser": true,
5-
"commonjs": true,
6-
"es6": true,
7-
"jquery": false,
8-
"mocha": true
9-
},
10-
"extends": "eslint:recommended",
11-
"parserOptions": {
12-
"sourceType": "module",
13-
"ecmaVersion": 6,
14-
"ecmaFeatures": {
15-
"experimentalObjectRestSpread": true
16-
}
17-
},
18-
"plugins": [
19-
"html"
20-
],
21-
"rules": {
22-
"indent": [
23-
"warn",
24-
"tab",
25-
{ SwitchCase: 1 }
26-
],
27-
"quotes": [
28-
"warn",
29-
"double"
30-
],
31-
"semi": [
32-
"error",
33-
"always"
34-
],
35-
"no-var": [
36-
"error"
37-
],
38-
"no-console": [
39-
"off"
40-
],
41-
"no-unused-vars": [
42-
"warn"
43-
]
44-
}
45-
};
2+
root: true,
3+
parser: "vue-eslint-parser",
4+
parserOptions: {
5+
sourceType: "module",
6+
parser: "babel-eslint"
7+
},
8+
env: {
9+
browser: true,
10+
commonjs: true
11+
},
12+
globals: {
13+
process: true
14+
},
15+
extends: ["eslint:recommended", "plugin:vue/essential"],
16+
plugins: ["prettier"],
17+
rules: {
18+
indent: [1, "tab", { SwitchCase: 1 }],
19+
quotes: [1, "double", { allowTemplateLiterals: true }],
20+
semi: [2, "always"],
21+
"no-var": [2],
22+
"no-console": [0],
23+
"no-unused-vars": [1],
24+
"no-throw-literal": 0,
25+
eqeqeq: [2, "smart"]
26+
}
27+
};

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.DS_Store
22
node_modules/
3-
coverage/
43
docs/_book/
54
npm-debug.log
65
selenium-debug.log
76
test/unit/coverage
87
test/e2e/reports
98
stats.json
109
typings/
11-
typings.json
10+
typings.json

.jsbeautifyrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

build/utils.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
let path = require("path");
2+
let ExtractTextPlugin = require("extract-text-webpack-plugin");
3+
4+
exports.cssLoaders = function(options) {
5+
options = options || {};
6+
7+
let cssLoader = {
8+
loader: "css-loader",
9+
options: {
10+
minimize: process.env.NODE_ENV === "production",
11+
sourceMap: options.sourceMap
12+
}
13+
};
14+
15+
// generate loader string to be used with extract text plugin
16+
function generateLoaders(loader, loaderOptions) {
17+
let loaders = [cssLoader];
18+
if (loader) {
19+
loaders.push({
20+
loader: loader + "-loader",
21+
options: Object.assign({}, loaderOptions, {
22+
sourceMap: options.sourceMap
23+
})
24+
});
25+
}
26+
27+
// Extract CSS when that option is specified
28+
// (which is the case during production build)
29+
if (options.extract) {
30+
return ExtractTextPlugin.extract({
31+
use: loaders,
32+
fallback: "vue-style-loader"
33+
});
34+
} else {
35+
return ["vue-style-loader"].concat(loaders);
36+
}
37+
}
38+
39+
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
40+
return {
41+
css: generateLoaders(),
42+
postcss: generateLoaders(),
43+
less: generateLoaders("less"),
44+
sass: generateLoaders("sass", { indentedSyntax: true }),
45+
scss: generateLoaders("sass"),
46+
stylus: generateLoaders("stylus"),
47+
styl: generateLoaders("stylus")
48+
};
49+
};
50+
51+
// Generate loaders for standalone style files (outside of .vue)
52+
exports.styleLoaders = function(options) {
53+
let output = [];
54+
let loaders = exports.cssLoaders(options);
55+
for (let extension in loaders) {
56+
let loader = loaders[extension];
57+
output.push({
58+
test: new RegExp("\\." + extension + "$"),
59+
use: loader
60+
});
61+
}
62+
return output;
63+
};

build/vue-loader.conf.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let utils = require("./utils");
2+
let isProduction = process.env.NODE_ENV === "production";
3+
4+
module.exports = {
5+
esModule: false,
6+
loaders: utils.cssLoaders({
7+
sourceMap: false,
8+
extract: isProduction
9+
})
10+
};

build/webpack.build.config.js

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
const path = require("path");
2+
const webpack = require("webpack");
3+
const utils = require("./utils");
4+
const version = require("../package.json").version;
5+
const banner =
6+
"/**\n" +
7+
" * vue-form-generator v" +
8+
version +
9+
"\n" +
10+
" * https://github.com/icebob/vue-form-generator\n" +
11+
" * Released under the MIT License.\n" +
12+
" */\n";
13+
const ExtractTextPlugin = require("extract-text-webpack-plugin");
14+
const StatsPlugin = require("stats-webpack-plugin");
15+
const vueLoaderConfig = require("./vue-loader.conf");
16+
17+
let rules = [
18+
{
19+
test: /\.(js|vue)$/,
20+
loader: "eslint-loader",
21+
enforce: "pre",
22+
include: [path.resolve("src")],
23+
options: {
24+
formatter: require("eslint-friendly-formatter")
25+
}
26+
},
27+
{
28+
test: /\.vue$/,
29+
loader: "vue-loader",
30+
include: [path.resolve("src")],
31+
exclude: /node_modules/,
32+
options: vueLoaderConfig
33+
},
34+
{
35+
test: /\.js$/,
36+
loader: "babel-loader",
37+
include: [path.resolve("src")],
38+
exclude: /node_modules/
39+
},
40+
{
41+
test: /\.(woff2?|svg)$/,
42+
loader: "url-loader",
43+
include: [path.resolve("src")]
44+
},
45+
{
46+
test: /\.(ttf|eot)$/,
47+
loader: "url-loader",
48+
include: [path.resolve("src")]
49+
}
50+
];
51+
52+
let cssFileName;
53+
if (process.env.FULL_BUNDLE !== "false") {
54+
cssFileName = "vfg.css";
55+
} else {
56+
cssFileName = "vfg-core.css";
57+
}
58+
59+
module.exports = [
60+
{
61+
entry: "./src/index.js",
62+
output: {
63+
path: path.resolve("dist"),
64+
filename: "vfg.js",
65+
library: "VueFormGenerator",
66+
libraryTarget: "umd"
67+
},
68+
69+
plugins: [
70+
new webpack.DefinePlugin({
71+
"process.env": {
72+
NODE_ENV: JSON.stringify("production")
73+
}
74+
}),
75+
new webpack.optimize.UglifyJsPlugin({
76+
compress: {
77+
warnings: false
78+
}
79+
}),
80+
new webpack.BannerPlugin({
81+
banner,
82+
raw: true
83+
}),
84+
new ExtractTextPlugin(cssFileName, { allChunks: true }),
85+
new StatsPlugin("../stats.json", {
86+
chunkModules: true
87+
//exclude: [/node_modules[\\\/]react/]
88+
})
89+
],
90+
91+
module: {
92+
rules
93+
},
94+
95+
resolve: {
96+
aliasFields: ["browser"],
97+
extensions: [".js", ".vue", ".json"],
98+
alias: {
99+
vue$: "vue/dist/vue.esm.js",
100+
"@": path.resolve("src")
101+
}
102+
}
103+
}
104+
];

build/webpack.dev.config.js

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
const path = require("path");
2+
const webpack = require("webpack");
3+
const projectRoot = path.resolve(__dirname, "../");
4+
const vueLoaderConfig = require("./vue-loader.conf");
5+
6+
let rules = [
7+
{
8+
test: /\.(js|vue)$/,
9+
loader: "eslint-loader",
10+
enforce: "pre",
11+
include: [path.resolve("src"), path.resolve("dev")],
12+
options: {
13+
formatter: require("eslint-friendly-formatter")
14+
}
15+
},
16+
{
17+
test: /\.vue$/,
18+
loader: "vue-loader",
19+
include: [path.resolve("src"), path.resolve("dev")],
20+
exclude: /node_modules/,
21+
options: vueLoaderConfig
22+
},
23+
{
24+
test: /\.js$/,
25+
loader: "babel-loader",
26+
include: [path.resolve("src"), path.resolve("dev")],
27+
exclude: /node_modules/
28+
},
29+
{
30+
test: /\.(woff2?|svg)$/,
31+
loader: "url-loader",
32+
include: [path.resolve("src"), path.resolve("dev")]
33+
},
34+
{
35+
test: /\.(ttf|eot)$/,
36+
loader: "url-loader",
37+
include: [path.resolve("src"), path.resolve("dev")]
38+
}
39+
];
40+
41+
module.exports = {
42+
devtool: "source-map",
43+
devServer: {
44+
contentBase: [path.resolve("dev/projects")]
45+
},
46+
entry: {
47+
full: path.resolve("dev", "projects", "full", "main.js"),
48+
basic: path.resolve("dev", "projects", "basic", "main.js"),
49+
mselect: path.resolve("dev", "projects", "multiselect", "main.js"),
50+
grouping: path.resolve("dev", "projects", "grouping", "main.js"),
51+
checklist: path.resolve("dev", "projects", "checklist", "main.js"),
52+
picker: path.resolve("dev", "projects", "picker", "main.js")
53+
},
54+
55+
output: {
56+
path: path.resolve("dev/projects"),
57+
filename: "[name].js",
58+
publicPath: "/"
59+
},
60+
61+
plugins: [
62+
new webpack.DefinePlugin({
63+
"process.env": {
64+
NODE_ENV: JSON.stringify("development"),
65+
FULL_BUNDLE: true
66+
}
67+
})
68+
],
69+
70+
module: {
71+
rules
72+
},
73+
74+
resolve: {
75+
extensions: [".js", ".vue", ".json"],
76+
alias: {
77+
vue$: "vue/dist/vue.esm.js",
78+
"@": path.resolve("src")
79+
}
80+
}
81+
};

0 commit comments

Comments
 (0)