Skip to content

Commit 3da4358

Browse files
committed
init
0 parents  commit 3da4358

Some content is hidden

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

71 files changed

+19425
-0
lines changed

.babelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
10+
],
11+
"plugins": ["transform-vue-jsx", "transform-runtime"]
12+
}

.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+
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

.eslintignore

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

.eslintrc.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// https://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
parserOptions: {
6+
parser: 'babel-eslint'
7+
},
8+
env: {
9+
browser: true,
10+
},
11+
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
12+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
13+
extends: ['plugin:vue/essential', 'airbnb-base'],
14+
// required to lint *.vue files
15+
plugins: [
16+
'vue'
17+
],
18+
// check if imports actually resolve
19+
settings: {
20+
'import/resolver': {
21+
webpack: {
22+
config: 'build/webpack.base.conf.js'
23+
}
24+
}
25+
},
26+
// add your custom rules here
27+
rules: {
28+
// don't require .vue extension when importing
29+
'import/extensions': ['error', 'always', {
30+
js: 'never',
31+
vue: 'never'
32+
}],
33+
// disallow reassignment of function parameters
34+
// disallow parameter object manipulation except for specific exclusions
35+
'no-param-reassign': ['error', {
36+
props: true,
37+
ignorePropertyModificationsFor: [
38+
'state', // for vuex state
39+
'acc', // for reduce accumulators
40+
'e' // for e.returnvalue
41+
]
42+
}],
43+
// allow optionalDependencies
44+
'import/no-extraneous-dependencies': ['error', {
45+
optionalDependencies: ['test/unit/index.js']
46+
}],
47+
// allow debugger during development
48+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
49+
}
50+
}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.DS_Store
2+
node_modules/
3+
/dist/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Editor directories and files
9+
.idea
10+
.vscode
11+
*.suo
12+
*.ntvs*
13+
*.njsproj
14+
*.sln

.npmignore

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

.postcssrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
"postcss-import": {},
6+
"postcss-url": {},
7+
// to edit target browsers: use "browserslist" field in package.json
8+
"autoprefixer": {}
9+
}
10+
}

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# laravel-file-manager
2+
3+
> File manager for Laravel - front side on Vue.js
4+
5+
> Backend - Laravel 5 package - [alexusmai/laravel-file-manager](https://github.com/alexusmai/laravel-file-manager)
6+
7+
![Laravel File Manager](https://raw.github.com/alexusmai/vue-laravel-file-manager/master/src/assets/laravel-file-manager.gif?raw=true)
8+
9+
## Installation
10+
11+
### NPM
12+
```
13+
$ npm install laravel-file-manager --save
14+
```
15+
16+
## Usage
17+
18+
**IF** your App using Vuex store
19+
20+
```
21+
import FileManager from 'laravel-file-manager'
22+
import store from './path-to-your-store/store' // your Vuex store
23+
24+
Vue.use(FileManager, {store})
25+
```
26+
27+
**ELSE** you need create new vuex instance
28+
29+
```
30+
import Vue from 'vue';
31+
import Vuex from 'vuex';
32+
import FileManager from 'laravel-file-manager'
33+
34+
Vue.use(Vuex);
35+
36+
// create Vuex store, if you don't have it
37+
const store = new Vuex.Store();
38+
39+
Vue.use(FileManager, {store});
40+
```
41+
42+
`The application store module will be registered under the name 'fm'`
43+
44+
Now vue component is registered and you can use it in your app
45+
```
46+
<file-manager></file-manager>
47+
```
48+
49+
Don't forget add a csrf token to head block in your Laravel view and add bootstrap 4 and fontawesome 5 styles
50+
```
51+
<!-- CSRF Token -->
52+
<meta name="csrf-token" content="{{ csrf_token() }}">
53+
<!-- Example -->
54+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css">
55+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
56+
```
57+
58+
Warning! Package use axios (Promise) - use babel-polyfill for ie11

build/build.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict'
2+
require('./check-versions')()
3+
4+
process.env.NODE_ENV = 'production'
5+
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.prod.conf')
13+
14+
const spinner = ora('building for production...')
15+
spinner.start()
16+
17+
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18+
if (err) throw err
19+
webpack(webpackConfig, (err, stats) => {
20+
spinner.stop()
21+
if (err) throw err
22+
process.stdout.write(stats.toString({
23+
colors: true,
24+
modules: false,
25+
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26+
chunks: false,
27+
chunkModules: false
28+
}) + '\n\n')
29+
30+
if (stats.hasErrors()) {
31+
console.log(chalk.red(' Build failed with errors.\n'))
32+
process.exit(1)
33+
}
34+
35+
console.log(chalk.cyan(' Build complete.\n'))
36+
console.log(chalk.yellow(
37+
' Tip: built files are meant to be served over an HTTP server.\n' +
38+
' Opening index.html over file:// won\'t work.\n'
39+
))
40+
})
41+
})

build/check-versions.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
'use strict'
2+
const chalk = require('chalk')
3+
const semver = require('semver')
4+
const packageConfig = require('../package.json')
5+
const shell = require('shelljs')
6+
7+
function exec (cmd) {
8+
return require('child_process').execSync(cmd).toString().trim()
9+
}
10+
11+
const versionRequirements = [
12+
{
13+
name: 'node',
14+
currentVersion: semver.clean(process.version),
15+
versionRequirement: packageConfig.engines.node
16+
}
17+
]
18+
19+
if (shell.which('npm')) {
20+
versionRequirements.push({
21+
name: 'npm',
22+
currentVersion: exec('npm --version'),
23+
versionRequirement: packageConfig.engines.npm
24+
})
25+
}
26+
27+
module.exports = function () {
28+
const warnings = []
29+
30+
for (let i = 0; i < versionRequirements.length; i++) {
31+
const mod = versionRequirements[i]
32+
33+
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34+
warnings.push(mod.name + ': ' +
35+
chalk.red(mod.currentVersion) + ' should be ' +
36+
chalk.green(mod.versionRequirement)
37+
)
38+
}
39+
}
40+
41+
if (warnings.length) {
42+
console.log('')
43+
console.log(chalk.yellow('To use this template, you must update following to modules:'))
44+
console.log()
45+
46+
for (let i = 0; i < warnings.length; i++) {
47+
const warning = warnings[i]
48+
console.log(' ' + warning)
49+
}
50+
51+
console.log()
52+
process.exit(1)
53+
}
54+
}

build/package.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict'
2+
require('./check-versions')()
3+
4+
process.env.NODE_ENV = 'production'
5+
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.package.conf')
13+
14+
const spinner = ora('building package...')
15+
spinner.start()
16+
17+
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18+
if (err) throw err
19+
webpack(webpackConfig, (err, stats) => {
20+
spinner.stop()
21+
if (err) throw err
22+
process.stdout.write(stats.toString({
23+
colors: true,
24+
modules: false,
25+
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26+
chunks: false,
27+
chunkModules: false
28+
}) + '\n\n')
29+
30+
if (stats.hasErrors()) {
31+
console.log(chalk.red(' Build failed with errors.\n'))
32+
process.exit(1)
33+
}
34+
35+
console.log(chalk.cyan(' Build complete.\n'))
36+
console.log(chalk.yellow(
37+
' Tip: built files are meant to be served over an HTTP server.\n' +
38+
' Opening index.html over file:// won\'t work.\n'
39+
))
40+
})
41+
})

0 commit comments

Comments
 (0)