Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dd414d1

Browse files
author
shuvohabib
committed
Add initial files for Navigation tab
0 parents commit dd414d1

Some content is hidden

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

47 files changed

+7108
-0
lines changed

‎.DS_Store

6 KB
Binary file not shown.

‎.babelrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"presets": [
3+
"es2015",
4+
"stage-2"
5+
],
6+
"plugins": [
7+
"transform-runtime",
8+
"transform-vue-jsx"
9+
],
10+
"comments": false,
11+
"env": {
12+
"test": {
13+
"plugins": [
14+
"istanbul"
15+
]
16+
}
17+
}
18+
}

‎.eslintignore

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

‎.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
root: true,
3+
parser: 'babel-eslint',
4+
parserOptions: {
5+
sourceType: 'module'
6+
},
7+
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
8+
extends: 'standard',
9+
// required to lint *.vue files
10+
plugins: [
11+
'html'
12+
],
13+
// add your custom rules here
14+
'rules': {
15+
// allow paren-less arrow functions
16+
'arrow-parens': 0,
17+
// allow async-await
18+
'generator-star-spacing': 0,
19+
// allow debugger during development
20+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
21+
}
22+
};

‎.gitignore

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

‎README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Navigation Tab with both plain VUE and Vue + Redux
2+
3+
> A Vue.js project
4+
5+
## Vue jsx
6+
https://github.com/vuejs/babel-plugin-transform-vue-jsx
7+
8+
## Redux Vue
9+
https://github.com/nadimtuhin/redux-vue
10+
11+
## Build Setup
12+
13+
``` bash
14+
# install dependencies
15+
npm install
16+
17+
# serve with hot reload at localhost:8080
18+
npm run dev
19+
20+
# build for production with minification
21+
npm run build
22+
23+
# run unit tests
24+
npm run unit
25+
26+
# run e2e tests
27+
npm run e2e
28+
29+
# run all tests
30+
npm test
31+
```
32+
33+
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

‎build/build.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// https://github.com/shelljs/shelljs
2+
require('./check-versions')()
3+
require('shelljs/global')
4+
env.NODE_ENV = 'production'
5+
6+
var path = require('path')
7+
var config = require('../config')
8+
var ora = require('ora')
9+
var webpack = require('webpack')
10+
var webpackConfig = require('./webpack.prod.conf')
11+
12+
console.log(
13+
' Tip:\n' +
14+
' Built files are meant to be served over an HTTP server.\n' +
15+
' Opening index.html over file:// won\'t work.\n'
16+
)
17+
18+
var spinner = ora('building for production...')
19+
spinner.start()
20+
21+
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
22+
rm('-rf', assetsPath)
23+
mkdir('-p', assetsPath)
24+
cp('-R', 'static/*', assetsPath)
25+
26+
webpack(webpackConfig, function (err, stats) {
27+
spinner.stop()
28+
if (err) throw err
29+
process.stdout.write(stats.toString({
30+
colors: true,
31+
modules: false,
32+
children: false,
33+
chunks: false,
34+
chunkModules: false
35+
}) + '\n')
36+
})

‎build/check-versions.js

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

‎build/dev-client.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
require('eventsource-polyfill')
3+
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4+
5+
hotClient.subscribe(function (event) {
6+
if (event.action === 'reload') {
7+
window.location.reload()
8+
}
9+
})

‎build/dev-server.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
require('./check-versions')()
2+
var config = require('../config')
3+
if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
4+
var path = require('path')
5+
var express = require('express')
6+
var webpack = require('webpack')
7+
var opn = require('opn')
8+
var proxyMiddleware = require('http-proxy-middleware')
9+
var webpackConfig = process.env.NODE_ENV === 'testing'
10+
? require('./webpack.prod.conf')
11+
: require('./webpack.dev.conf')
12+
13+
// default port where dev server listens for incoming traffic
14+
var port = process.env.PORT || config.dev.port
15+
// Define HTTP proxies to your custom API backend
16+
// https://github.com/chimurai/http-proxy-middleware
17+
var proxyTable = config.dev.proxyTable
18+
19+
var app = express()
20+
var compiler = webpack(webpackConfig)
21+
22+
var devMiddleware = require('webpack-dev-middleware')(compiler, {
23+
publicPath: webpackConfig.output.publicPath,
24+
quiet: true
25+
})
26+
27+
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
28+
log: () => {}
29+
})
30+
// force page reload when html-webpack-plugin template changes
31+
compiler.plugin('compilation', function (compilation) {
32+
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
33+
hotMiddleware.publish({ action: 'reload' })
34+
cb()
35+
})
36+
})
37+
38+
// proxy api requests
39+
Object.keys(proxyTable).forEach(function (context) {
40+
var options = proxyTable[context]
41+
if (typeof options === 'string') {
42+
options = { target: options }
43+
}
44+
app.use(proxyMiddleware(context, options))
45+
})
46+
47+
// handle fallback for HTML5 history API
48+
app.use(require('connect-history-api-fallback')())
49+
50+
// serve webpack bundle output
51+
app.use(devMiddleware)
52+
53+
// enable hot-reload and state-preserving
54+
// compilation error display
55+
app.use(hotMiddleware)
56+
57+
// serve pure static assets
58+
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
59+
app.use(staticPath, express.static('./static'))
60+
61+
var uri = 'http://localhost:' + port
62+
63+
devMiddleware.waitUntilValid(function () {
64+
console.log('> Listening at ' + uri + '\n')
65+
})
66+
67+
module.exports = app.listen(port, function (err) {
68+
if (err) {
69+
console.log(err)
70+
return
71+
}
72+
73+
// when env is testing, don't need open it
74+
if (process.env.NODE_ENV !== 'testing') {
75+
opn(uri)
76+
}
77+
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /