npm install
npm start
npm run build
npm run lint
To customize vue cli configuration, modify the file vue.config
.
See configuration reference for more information.
See components reference for more information.
See CSS documentation here.
.
├── plop
├── public
├── scripts
├── src
├── .browserslistrc
├── .dockerignore
├── .editorconfig
├── .env
├── .env.dev
├── .env.prod
├── .eslintrc.js
├── .gitignore
├── Dockerfile
├── README.md
├── babel.config.js
├── jsconfig.json
├── package-lock.json
├── package.json
└── vue.config.js
The main structure of the project is divided into several parts:
Tool to create new elements in the project. Currently:
- Component
- View
- Store
- Service
- Layer
- Mixin
Public folder, this folder is excluded from all webpack loaders except html-loaded
to index.html
and it is copy into root build
path.
Currently there are files for pwa (img/icons and robots), they should remove them if pwa is not used.
Scripting tools to run by node.
Script to update the current project with the specific (lasted by default) version of boilerplate. To execute it
npm run update:boilerplate
Folder with the app code.
src
├── app-shell
├── assets
├── components
├── directives
├── filters
├── layers
├── mixins
├── mocked
├── services
├── store
├── styles
├── utils
├── views
├── main.js
├── registerServiceWorker.js
└── router.js
Main component, all the app is encapsulated in it.
All icons must be in assets/icons
Folder with all components shared.
- common
- map-component
Currently:
- click-outside
- portal
Deprecated: This feature is deprecated, in new versions it will be replaced
Currently:
- numberFormat
- round
All generic layers and abstract classes.
Currently:
- layer (mapbox abstract layer)
Every layer has an id defined in constant
.
The new layer structure allows defining a specific layer for each case. Avoid using a configuration json and layers generics.
Currently:
- style: Style allows write scss variables in templates
Api for mock data.
Folder with all api calls, authService, cache and layerService.
Currently there are two auth:
- Oauth with Carto (default)
- Login JWT
Para cambiarlos, modificar el export en el fichero src/services/authService/index.js
.
Modules de vuex and root if necessary.
Folder with global styles, theme, variables, mixins, etc.
- checkIE: Return if the browser is IE10, IE11 or Edge12.
- copyClipboard: Compatibility with IE11 and Safari.
- debounce.
- disableVueObserver: Disable reactivity of Vue for a data variable.
- matchString: Return if the value match in a string or in an array of string. Available a callback for complex array.
- vuex: Vuex utils out of box to use without Vue instance.
Every view can have its own components or sub-views or layers with this structure recursively (components and layers only must be in first level):
views
├── view
│ ├── components
│ ├── layers
│ ├── views
│ ├── View.vue
│ ├── view.html
│ └── view.scss
Instance main where Vue is instanced. In this file there are several logic functions:
- Error functions: catch the error of Vue or window.
- Register global components: global components in
components/common/global
. - Airship ignore element: all components started with
as-
are ignored by Vue. - Login: to set the login preferences in every instance before the Vue instance is created.
- registerServiceWorker: by default is disabled. See public no pwa.
All app routes.
You can specify env variables by placing the following files in your project root:
.env # loaded in all cases
.env.local # loaded in all cases, ignored by git
.env.[mode] # only loaded in specified mode
.env.[mode].local # only loaded in specified mode, ignored by git
The order is very important, the specific mode has the highest priority.
Vue SFC files must have the next structure:
/* template import */
<template src="./template.html"></template>
/* style import */
<style scoped lang="scss" src="./template.scss"></style>
<script>
export default {
...
}
</script>
Script part must have the next order for it property.
- name
- mixins
- router life cycle
- directives
- filters
- components
- provide
- inject
- props
- data
- computed
- life cycle
- methods
- render
The markers should be in te correct folder before execute the docker. src/assets/markers
. The result will be save into src/assets/sprite
.
docker run -it --rm --name icons-generator -v $PWD:/usr/src/app geographica/spritezero-cli