mirror of https://github.com/interlegis/sapl.git
3 changed files with 0 additions and 262 deletions
@ -1,57 +0,0 @@ |
|||||
{ |
|
||||
"name": "sapl-frontend", |
|
||||
"version": "0.1.0", |
|
||||
"private": true, |
|
||||
"scripts": { |
|
||||
"serve": "vue-cli-service serve", |
|
||||
"build": "vue-cli-service build", |
|
||||
"lint": "vue-cli-service lint" |
|
||||
}, |
|
||||
"dependencies": { |
|
||||
"@fortawesome/fontawesome-free": "^5.13.0", |
|
||||
"axios": "^0.19.2", |
|
||||
"axios-progress-bar": "^1.2.0", |
|
||||
"bootstrap": "^4.4.1", |
|
||||
"bootstrap-vue": "^2.12.0", |
|
||||
"diff": "^4.0.1", |
|
||||
"dotenv": "^6.2.0", |
|
||||
"exports-loader": "^0.7.0", |
|
||||
"imports-loader": "^0.8.0", |
|
||||
"jquery": "^3.5.1", |
|
||||
"jquery-mask-plugin": "^1.14.16", |
|
||||
"jquery-ui-themes": "^1.12.0", |
|
||||
"lodash": "^4.17.15", |
|
||||
"moment": "^2.24.0", |
|
||||
"moment-locales-webpack-plugin": "^1.1.2", |
|
||||
"popper.js": "^1.16.1", |
|
||||
"serialize-javascript": "^3.1.0", |
|
||||
"terser": "^4.6.11", |
|
||||
"tinymce": "^4.9.9", |
|
||||
"tinymce-light-skin": "^1.3.1", |
|
||||
"vue": "^2.6.11", |
|
||||
"webpack": "^4.43.0", |
|
||||
"webpack-jquery-ui": "^2.0.1", |
|
||||
"websocket-extensions": "^0.1.4" |
|
||||
}, |
|
||||
"devDependencies": { |
|
||||
"@vue/cli-plugin-babel": "^4.3.1", |
|
||||
"@vue/cli-plugin-eslint": "^4.3.1", |
|
||||
"@vue/cli-service": "^4.3.1", |
|
||||
"babel-eslint": "^10.1.0", |
|
||||
"compression-webpack-plugin": "^3.1.0", |
|
||||
"css-loader": "^3.5.2", |
|
||||
"eslint": "^6.8.0", |
|
||||
"eslint-config-standard": "^14.1.1", |
|
||||
"eslint-friendly-formatter": "^4.0.1", |
|
||||
"eslint-loader": "^4.0.0", |
|
||||
"eslint-plugin-import": "^2.20.2", |
|
||||
"eslint-plugin-node": "^11.1.0", |
|
||||
"eslint-plugin-promise": "^4.2.1", |
|
||||
"eslint-plugin-standard": "^4.0.1", |
|
||||
"eslint-plugin-vue": "^6.2.2", |
|
||||
"node-sass": "^4.13.1", |
|
||||
"sass-loader": "^8.0.2", |
|
||||
"vue-template-compiler": "^2.6.11", |
|
||||
"webpack-bundle-tracker": "^0.4.3" |
|
||||
} |
|
||||
} |
|
||||
@ -1,64 +0,0 @@ |
|||||
#!/bin/bash |
|
||||
|
|
||||
verifica_git() { |
|
||||
if [[ ! -d ".git" ]]; then |
|
||||
echo -e "\033[31mERRO\033[0m Diretório atual não é um repositório git!" |
|
||||
exit 1 |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
verifica_diretorio() { |
|
||||
DIR=$(pwd | rev | cut -d'/' -f1 | rev) |
|
||||
|
|
||||
if [[ "$DIR" != "$1" ]]; then |
|
||||
echo -e "\033[31mERRO\033[0m Diretório atual não é o \033[1m$1\033[0m!" |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
verifica_git |
|
||||
} |
|
||||
|
|
||||
retorna_branch() { |
|
||||
# shellcheck disable=SC2155 |
|
||||
local branch=$(git branch | grep '^*' | cut -d ' ' -f2) |
|
||||
if [[ -z "$branch" ]]; then |
|
||||
echo -e "\033[31mERRO\033[0m Não foi possivel configurar a variável \033[1m$1\033[0m!" |
|
||||
exit 1 |
|
||||
else |
|
||||
echo "$branch" |
|
||||
fi |
|
||||
} |
|
||||
|
|
||||
if [[ ! (( "$1" == "build" ) || ( "$1" == "serve" )) ]]; then |
|
||||
echo -e "\033[31mERRO\033[0m Parâmetro inválido!" |
|
||||
echo -e " Coloque \033[1mbuild\033[0m ou \033[1mserve\033[0m." |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
verifica_diretorio "sapl-frontend" |
|
||||
|
|
||||
BRANCH_FRONTEND="$(retorna_branch "BRANCH_FRONTEND")" |
|
||||
|
|
||||
# shellcheck disable=SC2164 |
|
||||
cd ../sapl > /dev/null 2>&1 |
|
||||
if [[ ! $? -eq 0 ]]; then |
|
||||
echo "\033[31mERRO\033[0m Os diretórios \033[1msapl\033[0m e \033[1msapl-frontend\033[0m devem ter o mesmo diretório raiz." |
|
||||
exit 1 |
|
||||
fi |
|
||||
|
|
||||
verifica_diretorio "sapl" |
|
||||
|
|
||||
BRANCH_BACKEND="$(retorna_branch "BRANCH_BACKEND")" |
|
||||
|
|
||||
cd ../sapl-frontend > /dev/null 2>&1 |
|
||||
|
|
||||
if [[ "$BRANCH_FRONTEND" == "$BRANCH_BACKEND" ]]; then |
|
||||
echo -e "\033[33mEXECUTANDO\033[0m \033[1myarn run $1\033[1m." |
|
||||
yarn run "$1" |
|
||||
echo -e "\033[32mSUCESSO\033[0m $1 realizado com sucesso." |
|
||||
else |
|
||||
echo -e "\033[31mERRO\033[0m $1 não realizada porque as branchs dos dois repositórios são diferentes." |
|
||||
echo -e " Branch do Frontend: \033[1m$BRANCH_FRONTEND\033[0m" |
|
||||
echo -e " Branch do Backend: \033[1m$BRANCH_BACKEND\033[0m" |
|
||||
echo -e " Para que a operação seja feita, coloque os dois repositórios na mesma branch." |
|
||||
fi |
|
||||
@ -1,141 +0,0 @@ |
|||||
const path = require('path') |
|
||||
const each = require('lodash/fp/each') |
|
||||
|
|
||||
const MomentLocalesPlugin = require('moment-locales-webpack-plugin') |
|
||||
const BundleTrackerPlugin = require('webpack-bundle-tracker') |
|
||||
const CompressionPlugin = require('compression-webpack-plugin') |
|
||||
|
|
||||
class RelativeBundleTrackerPlugin extends BundleTrackerPlugin { |
|
||||
convertPathChunks (chunks) { |
|
||||
each(each(chunk => { |
|
||||
chunk.path = path.relative(this.options.path, chunk.path) |
|
||||
}))(chunks) |
|
||||
} |
|
||||
|
|
||||
writeOutput (compiler, contents) { |
|
||||
if (contents.status === 'done') { |
|
||||
this.convertPathChunks(contents.chunks) |
|
||||
} |
|
||||
super.writeOutput(compiler, contents) |
|
||||
} |
|
||||
} |
|
||||
// module.exports = RelativeBundleTrackerPlugin
|
|
||||
|
|
||||
const dotenv = require('dotenv') |
|
||||
dotenv.config({ |
|
||||
path: '../sapl/.env' |
|
||||
}) |
|
||||
|
|
||||
var FRONTEND_CUSTOM = process.env.FRONTEND_CUSTOM === undefined ? false : process.env.FRONTEND_CUSTOM === 'True' |
|
||||
|
|
||||
var HOST_NAME = 'localhost' |
|
||||
|
|
||||
module.exports = { |
|
||||
runtimeCompiler: true, |
|
||||
publicPath: process.env.NODE_ENV === 'production' ? '/static/sapl/frontend' : `http://${HOST_NAME}:8080/`, |
|
||||
outputDir: FRONTEND_CUSTOM ? 'dist' : '../sapl/static/sapl/frontend', |
|
||||
|
|
||||
chainWebpack: config => { |
|
||||
config.plugins.delete('html') |
|
||||
config.plugins.delete('preload') |
|
||||
config.plugins.delete('prefetch') |
|
||||
|
|
||||
config |
|
||||
.plugin('RelativeBundleTrackerPlugin') |
|
||||
.use(RelativeBundleTrackerPlugin, [{ |
|
||||
path: '.', |
|
||||
filename: FRONTEND_CUSTOM ? './webpack-stats.json' : '../sapl/webpack-stats.json' |
|
||||
}]) |
|
||||
|
|
||||
config |
|
||||
.plugin('MomentLocalesPlugin') |
|
||||
.use(MomentLocalesPlugin, [{ |
|
||||
localesToKeep: ['pt-BR'] |
|
||||
}]) |
|
||||
|
|
||||
if (process.env.NODE_ENV === 'production') { |
|
||||
config.optimization.minimizer('terser').tap((args) => { |
|
||||
args[0].terserOptions.compress.drop_console = true |
|
||||
args[0].extractComments = true |
|
||||
args[0].cache = true |
|
||||
return args |
|
||||
}) |
|
||||
|
|
||||
config |
|
||||
.plugin('CompressionPlugin') |
|
||||
.use(CompressionPlugin, [{ |
|
||||
}]) |
|
||||
} else { |
|
||||
config |
|
||||
.devtool('source-map') |
|
||||
} |
|
||||
|
|
||||
config.resolve.alias |
|
||||
.set('__STATIC__', 'static') |
|
||||
|
|
||||
config.module |
|
||||
.rule('vue') |
|
||||
.use('vue-loader') |
|
||||
.loader('vue-loader') |
|
||||
.tap(options => { |
|
||||
options.transformAssetUrls = { |
|
||||
img: 'src', |
|
||||
image: 'xlink:href', |
|
||||
'b-img': 'src', |
|
||||
'b-img-lazy': ['src', 'blank-src'], |
|
||||
'b-card': 'img-src', |
|
||||
'b-card-img': 'img-src', |
|
||||
'b-carousel-slide': 'img-src', |
|
||||
'b-embed': 'src' |
|
||||
} |
|
||||
|
|
||||
return options |
|
||||
}) |
|
||||
|
|
||||
config.devServer |
|
||||
.public('') |
|
||||
.port(8080) |
|
||||
.hot(true) |
|
||||
.watchOptions({ |
|
||||
poll: true |
|
||||
}) |
|
||||
.watchContentBase(true) |
|
||||
.https(false) |
|
||||
.headers({ |
|
||||
'Access-Control-Allow-Origin': '*' |
|
||||
}) |
|
||||
.contentBase([ |
|
||||
path.join(__dirname, 'public'), |
|
||||
path.join(__dirname, 'src', 'assets') |
|
||||
]) |
|
||||
|
|
||||
config |
|
||||
.plugin('provide') |
|
||||
.use(require('webpack/lib/ProvidePlugin'), [{ |
|
||||
$: 'jquery', |
|
||||
jquery: 'jquery', |
|
||||
'window.jQuery': 'jquery', |
|
||||
jQuery: 'jquery', |
|
||||
_: 'lodash' |
|
||||
}]) |
|
||||
|
|
||||
config.entryPoints.delete('app') |
|
||||
|
|
||||
config |
|
||||
.entry('global') |
|
||||
.add('./src/__global/main.js') |
|
||||
.end() |
|
||||
|
|
||||
config.entry('compilacao') |
|
||||
.add('./src/__apps/compilacao/main.js') |
|
||||
.end() |
|
||||
|
|
||||
config.entry('painel') |
|
||||
.add('./src/__apps/painel/main.js') |
|
||||
.end() |
|
||||
|
|
||||
config.entry('parlamentar') |
|
||||
.add('./src/__apps/parlamentar/main.js') |
|
||||
.end() |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue