Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies #16

Merged
merged 2 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"esversion": 6
}
2 changes: 1 addition & 1 deletion dist/fl-interactive-form-es3.js.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dist/fl-interactive-form.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions gulp-tasks/extensions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/**
This file contains black magic. Don't overthink it.

In rollup configuration use it like this:

const extensions = require("./extensions")
rollup({
plugins: [
extensions({
extensions: [".jsx", ".foobar", ".etc"]
}),
]
});

Most of this file's code was taken from here: https://github.com/rollup/rollup/issues/1052
*/

const { basename, dirname, isAbsolute, resolve } = require("path");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'destructuring binding' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const fs = require("fs");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


function isFile(file) {
try {
return fs.statSync(file).isFile();
} catch (err) {
return false;
}
}

function addExtensionIfNecessary(file, extensions) {
try {
const name = basename(file);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

const files = fs.readdirSync(dirname(file));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


if (~files.indexOf(name) && isFile(file)) return file;
for (const ext of extensions) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'for of' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

if (~files.indexOf(`${name}${ext}`) && isFile(`${file}${ext}`)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

return `${file}${ext}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

}

// In case `file` is a folder name, we check if there is an
// index file in the folder
const indexPath = `${file}/index${ext}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
'template literal syntax' is only available in ES6 (use 'esversion: 6').

if (isFile(indexPath)) {
return indexPath;
}
}
} catch (err) {
// noop
}

return null;
}

module.exports = function extensions({ extensions }) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'destructuring binding' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

if (!extensions || !extensions.length) {
throw new Error(
`Must specify { extensions: [..] } as non-empty array!`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'template literal syntax' is only available in ES6 (use 'esversion: 6').

);
}

return {
name: "extensions",

resolveId(importee, importer) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'concise methods' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

// absolute paths are left untouched
if (isAbsolute(importee)) {
return addExtensionIfNecessary(resolve(importee), extensions);
}

// if this is the entry point, resolve against cwd
if (importer === undefined) {
return addExtensionIfNecessary(
resolve(process.cwd(), importee),
extensions
);
}

// external modules are skipped at this stage
if (importee[0] !== ".") return null;

return addExtensionIfNecessary(
resolve(dirname(importer), importee),
extensions
);
}
};
};
7 changes: 5 additions & 2 deletions gulp-tasks/transpile-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const nodeResolve = require('rollup-plugin-node-resolve');
const organiser = require('gulp-organiser');
const { curry } = require('lodash/fp');
const rename = require("gulp-rename");
const extensions = require("./extensions");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


const DEFAULT_CONFIG = {
sourceMap: true,
Expand All @@ -35,8 +36,10 @@ const DEFAULT_CONFIG = {
// Let's use AMD format to serve our files to the front-end
format: 'umd',
plugins: [
// Reslver to allow importing .jsx files
extensions({ extensions: [".jsx", ".js"] }),
// Import modules with jsnext:main
nodeResolve({ jsnext: true, main: true }),
nodeResolve({ jsnext: true, main: true }),
// Allow importing commonjs modules
commonjs(),
// Transpile our code to ES5
Expand All @@ -53,7 +56,7 @@ const DEFAULT_CONFIG = {
"regenerator": true
}]
],
presets: ['es2015-rollup', 'react'],
presets: [['env', { targets: { 'ie': 8 }, modules: false }], 'react'],
}),
// TODO: Change this from 'development' to 'production' during production
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/transpile-to-es3.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DEFAULT_CONFIG = {
exclude: 'node_modules/**',
babelrc: false,
plugins: ['lodash'],
presets: ['es2015-rollup', 'es2017'],
presets: [['env', { targets: { browsers: ['ie >= 7'] }, modules: false }], 'react'],
}),
],
};
Expand Down
93 changes: 44 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,60 +4,55 @@
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "gulp dev",
"demo": "gulp demo"
},
"author": "Lazamar @ FourLabs",
"license": "ISC",
"dependencies": {
"fl-form-builder": "^1.3.1",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"requirejs": "^2.3.2"
"fl-form-builder": "^1.4",
"react": "<16.0.0",
"react-dom": "<16.0.0",
"requirejs": "^2.3"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
"babel-core": "^6.9.1",
"babel-loader": "^6.2.4",
"babel-plugin-external-helpers-2": "^6.3.13",
"babel-plugin-lodash": "^3.2.9",
"babel-plugin-proxy": "^1.0.6",
"babel-plugin-syntax-jsx": "^6.8.0",
"babel-plugin-transform-async-to-generator": "^6.16.0",
"babel-plugin-transform-react-jsx": "^6.8.0",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-rollup": "^3.0.0",
"babel-preset-es2017": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.5.0",
"browser-sync": "^2.17.0",
"dep-linker": "^1.0.24",
"fl-assert": "^1.0.10",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-es3ify": "0.0.0",
"gulp-flatmap": "^1.0.0",
"gulp-organiser": "^1.0.6",
"gulp-postcss": "^6.1.1",
"gulp-rename": "^1.2.2",
"gulp-rollup": "^1.9.0",
"gulp-sass": "^2.3.1",
"gulp-sourcemaps": "^1.7.3",
"gulp-uglify": "^2.0.0",
"gulp-watch": "^4.3.6",
"lodash": "^4.16.4",
"microevent": "^1.0.0",
"path": "^0.12.7",
"react": "^15.1.0",
"react-dom": "^15.1.0",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^3.3.1",
"rollup-plugin-node-resolve": "^1.7.3",
"rollup-plugin-replace": "^1.1.1",
"rollup-stream": "^1.14.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
"autoprefixer": "^9.0",
"babel-core": "^6.26",
"babel-loader": "^7.1",
"babel-plugin-external-helpers": "^6.22",
"babel-plugin-lodash": "^3.3",
"babel-plugin-proxy": "^1.1",
"babel-plugin-syntax-jsx": "^6.18",
"babel-plugin-transform-async-to-generator": "^6.24",
"babel-plugin-transform-react-jsx": "^6.24",
"babel-plugin-transform-runtime": "^6.23",
"babel-polyfill": "^6.26",
"babel-preset-env": "^1.7",
"babel-preset-react": "^6.24",
"browser-sync": "^2.24",
"dep-linker": "^1.0",
"fl-assert": "^1.0",
"gulp": "^3.9",
"gulp-concat": "^2.6",
"gulp-es3ify": "0.0",
"gulp-flatmap": "^1.0",
"gulp-organiser": "^1.0",
"gulp-postcss": "^7.0",
"gulp-rename": "^1.4",
"gulp-rollup": "^2.16",
"gulp-sass": "^3.2",
"gulp-sourcemaps": "^1.12",
"gulp-uglify": "^3.0",
"gulp-watch": "^5.0",
"lodash": "^4.17",
"microevent": "^1.0",
"path": "^0.12",
"react": "<16.0.0",
"react-dom": "<16.0.0",
"rollup-plugin-babel": "^3.0",
"rollup-plugin-commonjs": "^8.2",
"rollup-plugin-node-resolve": "^3.3",
"rollup-plugin-replace": "^2.0",
"rollup-stream": "<1.24.0",
"vinyl-buffer": "^1.0",
"vinyl-source-stream": "^1.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading