Skip to content

Commit

Permalink
wegue-oss#130 first stab at app restructure with app-starter dir
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed May 24, 2020
1 parent f8e8e02 commit b96e7ae
Show file tree
Hide file tree
Showing 26 changed files with 1,377 additions and 2,142 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Prerequisites: Node.js and npm need to be available on your system.
npm install
```

- Run the init script, which creates a base application for your project in `app/WguApp.vue` and a CSS file `app/css/app.css` to place custom styling for your project.
- Run the init-app script, which creates a base application (a copy of the `app-starter` dir) under `app/` to extend with custom components and resources (e.g. CSS styling) for your project.

``` bash
# initializes the Wegue app
Expand Down
5 changes: 3 additions & 2 deletions app/.gitignore → app-starter/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Ignore everything in this directory
*
#*
# Except this file
!.gitignore
#!.gitignore

17 changes: 17 additions & 0 deletions app-starter/WguApp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Created by init-app.js at Tue Mar 10 2020 16:02:41 GMT+0100 (GMT+01:00) -->
<template>
<wgu-app-tpl>
<!-- insert your app slots here -->
</wgu-app-tpl>
</template>

<script>
import WguAppTemplate from './WguAppTemplate.vue';
export default {
name: 'my-wgu-app',
components: {
'wgu-app-tpl': WguAppTemplate
}
// add Vue methods and hooks here
}
</script>
14 changes: 7 additions & 7 deletions src/WguAppTemplate.vue → app-starter/WguAppTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@

<script>
import Vue from 'vue'
import { WguEventBus } from './WguEventBus'
import OlMap from './components/ol/Map'
import { WguEventBus } from '../src/WguEventBus'
import OlMap from '../src/components/ol/Map'
import AppHeader from './components/AppHeader'
import AppFooter from './components/AppFooter'
import AppLogo from './components/AppLogo'
import MeasureWin from './components/measuretool/MeasureWin'
import LayerListWin from './components/layerlist/LayerListWin'
import InfoClickWin from './components/infoclick/InfoClickWin'
import MapLoadingStatus from './components/progress/MapLoadingStatus'
import AppLogo from '../src/components/AppLogo'
import MeasureWin from '../src/components/measuretool/MeasureWin'
import LayerListWin from '../src/components/layerlist/LayerListWin'
import InfoClickWin from '../src/components/infoclick/InfoClickWin'
import MapLoadingStatus from '../src/components/progress/MapLoadingStatus'
export default {
name: 'wgu-app-tpl',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
<script>
import Vue from 'vue'
import LayerListToggleButton from './layerlist/ToggleButton'
import HelpWinToggleButton from './helpwin/ToggleButton'
import MeasureToolToggleButton from './measuretool/ToggleButton'
import InfoClickButton from './infoclick/ToggleButton'
import ZoomToMaxExtentButton from './maxextentbutton/ZoomToMaxExtentButton'
import Geocoder from './geocoder/Geocoder'
import LayerListToggleButton from '../../src/components/layerlist/ToggleButton'
import HelpWinToggleButton from '../../src/components/helpwin/ToggleButton'
import MeasureToolToggleButton from '../../src/components/measuretool/ToggleButton'
import InfoClickButton from '../../src/components/infoclick/ToggleButton'
import ZoomToMaxExtentButton from '../../src/components/maxextentbutton/ZoomToMaxExtentButton'
import Geocoder from '../../src/components/geocoder/Geocoder'
export default {
name: 'wgu-app-header',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions app-starter/static/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Created by init-app.js at Thu Aug 08 2019 15:59:47 GMT+0200 (GMT+02:00) */
File renamed without changes.
File renamed without changes.
File renamed without changes
8 changes: 8 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Wegue App Dir
This directory will contain your Wegue Application.
By using the command `npm run init:app` this dir is populated with
the contents from the `starter-app` dir.

You can then place custom components under `components` here.
Static content like data, icons and css can be placed under static.
The default config file is `app-conf.json`.
6 changes: 6 additions & 0 deletions build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ app.use(hotMiddleware)
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))

console.log(config.dev.assetsPublicPath);
// assetsSubDirectory: 'static',
// assetsPublicPath: './',
var staticPath2 = path.posix.join(config.dev.assetsPublicPath, 'app/static')
app.use(staticPath2, express.static('./app/static'))

var uri = 'http://localhost:' + port

var _resolve
Expand Down
1 change: 1 addition & 0 deletions build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ exports.cssLoaders = function (options) {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
url: process.env.NODE_ENV !== 'production',
sourceMap: options.sourceMap
}
}
Expand Down
7 changes: 4 additions & 3 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ module.exports = {
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
extensions: ['*', '.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'APP': resolve('app'),
},
symlinks: false
},
Expand All @@ -33,7 +34,7 @@ module.exports = {
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
include: [resolve('app'), resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter')
}
Expand All @@ -46,7 +47,7 @@ module.exports = {
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/ol')],
include: [resolve('app'), resolve('src'), resolve('test'), resolve('node_modules/ol')],
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
Expand Down
9 changes: 5 additions & 4 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ var webpackConfig = merge(baseWebpackConfig, {
to: config.build.assetsSubDirectory,
ignore: ['.*']
},
// copy project- / app-specific static assets
// copy project- / app-specific static assets, overwrite
{
context: path.resolve(__dirname, '../app/static'),
from: "*",
to: config.build.assetsSubDirectory
from: path.resolve(__dirname, '../app/static'),
to: config.build.assetsSubDirectory,
force: true,
ignore: ['.*']
}
])
]
Expand Down
Loading

0 comments on commit b96e7ae

Please sign in to comment.