Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

phonegap-template-vue-f7-blank

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phonegap-template-vue-f7-blank - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

.npmignore

2

package.json
{
"name": "phonegap-template-vue-f7-blank",
"version": "1.3.0",
"version": "1.4.0",
"description": "A blank PhoneGap template using Vue.js and Framework7",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,13 +12,11 @@ module.exports = {

mocha: true,
jasmine: true,
jasmine: true
},
// required to lint *.vue files
plugins: [
'html'
],
plugins: ['html'],
// check if imports actually resolve
'settings': {
settings: {
'import/resolver': {
'webpack': {
'config': `${__dirname}/build/webpack.base.conf.js`
webpack: {
config: `${__dirname}/build/webpack.base.conf.js`
}

@@ -28,7 +26,8 @@ }

// add your custom rules here
'rules': {
rules: {
'no-console': 0,
'space-before-function-paren': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
}
}
};

@@ -1,34 +0,45 @@

/* eslint-disable import/no-extraneous-dependencies, no-var, vars-on-top */
/* global env, rm, cp, mkdir */
'use strict'
require('./check-versions')()
// https://github.com/shelljs/shelljs
require('./check-versions')();
require('shelljs/global');
process.env.NODE_ENV = 'production'
env.NODE_ENV = 'production';
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const fs = require('fs')
const fixStaticPath = require('./fix-static-path');
var path = require('path');
var config = require('../config');
var ora = require('ora');
var webpack = require('webpack');
var webpackConfig = require('./webpack.prod.conf');
const spinner = ora('building for production...')
spinner.start()
var spinner = ora('building for production...');
spinner.start();
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory);
rm('-rf', assetsPath);
mkdir('-p', assetsPath);
cp('-R', 'static/*', assetsPath);
fixStaticPath();
webpack(webpackConfig, (err, stats) => {
spinner.stop();
if (err) throw err;
process.stdout.write(`${stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false,
})}\n`);
});
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})

@@ -1,30 +0,38 @@

/* eslint-disable import/no-extraneous-dependencies, global-require, no-var, vars-on-top */
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
var semver = require('semver');
var chalk = require('chalk');
var packageConfig = require('../package.json');
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
var exec = cmd => require('child_process').execSync(cmd).toString().trim();
var versionRequirements = [
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node,
},
{
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm,
},
];
versionRequirement: packageConfig.engines.npm
})
}
module.exports = () => {
var warnings = [];
for (var i = 0; i < versionRequirements.length; i++) { // eslint-disable-line no-plusplus
var mod = versionRequirements[i];
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(
`${mod.name}: ${chalk.red(mod.currentVersion)} should be ${chalk.green(mod.versionRequirement)}`
);
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}

@@ -34,12 +42,14 @@ }

if (warnings.length) {
console.log('');
console.log(chalk.yellow('To use this template, you must update following to modules:'));
console.log();
for (var i = 0; i < warnings.length; i++) { // eslint-disable-line no-plusplus
var warning = warnings[i];
console.log(` ${warning}`);
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log();
process.exit(1);
console.log()
process.exit(1)
}
};
}

@@ -1,62 +0,101 @@

/* eslint-disable import/no-extraneous-dependencies, no-var, vars-on-top */
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
var path = require('path');
var config = require('../config');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
exports.assetsPath = (_path) => {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory;
return path.posix.join(assetsSubDirectory, _path);
};
: config.dev.assetsSubDirectory
exports.cssLoaders = (options) => {
options = options || {}; // eslint-disable-line no-param-reassign
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders(loaders) {
var sourceLoader = loaders.map((loader) => {
var extraParamChar;
if (/\?/.test(loader)) {
loader = loader.replace(/\?/, '-loader?'); // eslint-disable-line no-param-reassign
extraParamChar = '&';
} else {
loader = `${loader}-loader`; // eslint-disable-line no-param-reassign
extraParamChar = '?';
}
return loader + (options.sourceMap ? `${extraParamChar}sourceMap` : '');
}).join('!');
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader);
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
return ['vue-style-loader', sourceLoader].join('!');
}
// http://vuejs.github.io/vue-loader/en/configurations/extract-css.html
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(['css']),
postcss: generateLoaders(['css']),
less: generateLoaders(['css', 'less']),
sass: generateLoaders(['css', 'sass?indentedSyntax']),
scss: generateLoaders(['css', 'sass']),
stylus: generateLoaders(['css', 'stylus']),
styl: generateLoaders(['css', 'stylus']),
};
};
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = (options) => {
var output = [];
var loaders = exports.cssLoaders(options);
for (var extension in loaders) { // eslint-disable-line guard-for-in, no-restricted-syntax
var loader = loaders[extension];
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp(`\\.${extension}$`),
loader,
});
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output;
};
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}

@@ -1,104 +0,90 @@

/* eslint-disable import/no-extraneous-dependencies, no-var, vars-on-top */
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
var path = require('path');
var config = require('../config');
var utils = require('./utils');
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
var projectRoot = path.resolve(__dirname, '../');
var env = process.env.NODE_ENV;
// check env & config/index.js to decide whether to enable CSS source maps for the
// various preprocessor loaders added to vue-loader at the end of this file
var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap);
var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap);
var useCssSourceMap = cssSourceMapDev || cssSourceMapProd;
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js',
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['', '.js', '.vue', '.json'],
fallback: [path.join(__dirname, '../node_modules')],
extensions: ['.js', '.vue', '.json'],
alias: {
vue$: 'vue/dist/vue.common.js',
src: path.resolve(__dirname, '../src'),
assets: path.resolve(__dirname, '../src/assets'),
components: path.resolve(__dirname, '../src/components'),
config: path.resolve(__dirname, '../src/config'),
},
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
resolveLoader: {
fallback: [path.join(__dirname, '../node_modules')],
},
module: {
preLoaders: [
rules: [
{
test: /\.vue$/,
loader: 'eslint',
include: [
path.join(projectRoot, 'src'),
],
exclude: /node_modules/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'eslint',
loader: 'babel-loader',
include: [
path.join(projectRoot, 'src'),
],
exclude: /node_modules/,
resolve('src'),
resolve('test'),
resolve('node_modules/webpack-dev-server/client'),
resolve('node_modules/framework7'),
resolve('node_modules/framework7-vue'),
resolve('node_modules/template7'),
resolve('node_modules/dom7'),
]
},
],
loaders: [
{
test: /\.vue$/,
loader: 'vue',
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.js$/,
loader: 'babel',
include: [
path.join(projectRoot, 'src'),
],
exclude: /node_modules/,
},
{
test: /\.json$/,
loader: 'json',
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url',
query: {
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]'),
},
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url',
query: {
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]'),
},
},
],
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
eslint: {
formatter: require('eslint-friendly-formatter'), // eslint-disable-line global-require
},
vue: {
loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }),
postcss: [
require('autoprefixer')({ // eslint-disable-line global-require
browsers: ['last 2 versions'],
}),
],
},
};
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}

@@ -1,38 +0,95 @@

/* eslint-disable import/no-extraneous-dependencies, no-var, vars-on-top */
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
var config = require('../config');
var webpack = require('webpack');
var merge = require('webpack-merge');
var utils = require('./utils');
var baseWebpackConfig = require('./webpack.base.conf');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var FriendlyErrors = require('friendly-errors-webpack-plugin');
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach((name) => {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]);
});
module.exports = merge(baseWebpackConfig, {
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }),
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// eval-source-map is faster for development
devtool: '#eval-source-map',
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env,
'process.env': require('../config/dev.env')
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
inject: true,
template: 'index.html',
inject: true
}),
new FriendlyErrors(),
],
});
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})

@@ -1,40 +0,60 @@

/* eslint-disable import/no-extraneous-dependencies, global-require, no-var, vars-on-top */
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
var path = require('path');
var config = require('../config');
var utils = require('./utils');
var webpack = require('webpack');
var merge = require('webpack-merge');
var baseWebpackConfig = require('./webpack.base.conf');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: config.build.env;
const env = require('../config/prod.env')
var webpackConfig = merge(baseWebpackConfig, {
const webpackConfig = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders({ sourceMap: config.build.productionSourceMap }),
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
vue: {
loaders: utils.cssLoaders({
sourceMap: config.build.productionSourceMap,
}),
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env,
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
new webpack.optimize.OccurrenceOrderPlugin(),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.

@@ -44,12 +64,9 @@ // you can customize output by editing /index.html

new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'src/index.html',
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: false,
removeAttributeQuotes: false,
keepClosingSlash: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:

@@ -59,9 +76,13 @@ // https://github.com/kangax/html-minifier#options-quick-reference

// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency',
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
// any required modules inside node_modules are extracted to vendor
minChunks: (module) => { // eslint-disable-line arrow-body-style
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (

@@ -73,4 +94,4 @@ module.resource &&

) === 0
);
},
)
}
}),

@@ -81,9 +102,27 @@ // extract webpack runtime and module manifest to its own file in order to

name: 'manifest',
chunks: ['vendor'],
minChunks: Infinity
}),
],
});
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin');
const CompressionWebpackPlugin = require('compression-webpack-plugin')

@@ -94,9 +133,18 @@ webpackConfig.plugins.push(

algorithm: 'gzip',
test: new RegExp(`\\.(${config.build.productionGzipExtensions.join('|')})$`),
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8,
minRatio: 0.8
})
);
)
}
module.exports = webpackConfig;
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig

@@ -1,8 +0,7 @@

/* eslint-disable import/no-extraneous-dependencies, no-var, vars-on-top */
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
var merge = require('webpack-merge');
var prodEnv = require('./prod.env');
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
});
NODE_ENV: '"development"'
})

@@ -1,14 +0,56 @@

/* eslint-disable import/no-extraneous-dependencies, global-require, no-var, vars-on-top */
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path');
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
env: require('./prod.env'),
// Template for index.html
index: path.resolve(__dirname, '../www/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../www'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
assetsPublicPath: '',
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as

@@ -20,16 +62,9 @@ // Surge or Netlify already gzip all static assets for you.

productionGzipExtensions: ['js', 'css'],
},
dev: {
env: require('./dev.env'),
port: 8080,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false,
},
};
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}

@@ -0,3 +1,4 @@

'use strict'
module.exports = {
NODE_ENV: '"production"',
};
NODE_ENV: '"production"'
}

@@ -7,3 +7,4 @@ {

"scripts": {
"dev": "node build/dev-server.js",
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js",

@@ -18,28 +19,31 @@ "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",

"cordova-run-ios": "npm run build && cordova run ios",
"cordova-run-android": "npm run build && cordova run android"
"cordova-run-android": "npm run build && cordova run android",
"copy-fonts": "cpy node_modules/framework7-icons/fonts/*.* src/fonts && cpy node_modules/material-design-icons/iconfont/*.{eot,ttf,woff,woff2} src/fonts",
"postinstall": "npm run copy-fonts"
},
"dependencies": {
"babel-polyfill": "^6.23.0",
"framework7": "^1.6.4",
"framework7-vue": "^0.9.2",
"vue": "^2.5.3"
"framework7": "^2.0.7",
"framework7-icons": "^0.8.9",
"framework7-vue": "^2.0.7",
"material-design-icons": "^3.0.1",
"vue": "^2.5.2"
},
"devDependencies": {
"autoprefixer": "^6.4.0",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-plugin-istanbul": "^4.1.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-register": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"chai": "^3.5.0",
"chalk": "^1.1.3",
"chalk": "^2.0.1",
"chromedriver": "^2.21.2",
"compression-webpack-plugin": "^0.3.2",
"connect-history-api-fallback": "^1.1.0",
"cross-env": "^3.1.3",
"cross-spawn": "^4.0.2",
"css-loader": "^0.25.0",
"copy-webpack-plugin": "^4.0.1",
"cpy-cli": "^1.0.1",
"cross-env": "^5.1.3",
"css-loader": "^0.28.0",
"eslint": "^3.7.1",

@@ -56,16 +60,11 @@ "eslint-config-semistandard": "^8.0.0",

"eslint-plugin-standard": "^2.1.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"friendly-errors-webpack-plugin": "^1.1.2",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.17.2",
"inject-loader": "^2.0.1",
"json-loader": "^0.5.4",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.2.0",

@@ -75,26 +74,39 @@ "karma-sourcemap-loader": "^0.3.7",

"karma-webpack": "^1.7.0",
"lolex": "^1.4.0",
"mocha": "^3.1.0",
"nightwatch": "^0.9.8",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"opn": "^4.0.2",
"ora": "^0.3.0",
"ora": "^1.2.0",
"phantomjs-prebuilt": "^2.1.3",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"selenium-server": "2.53.1",
"semver": "^5.3.0",
"shelljs": "^0.7.4",
"shelljs": "^0.7.6",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"url-loader": "^0.5.7",
"vue-loader": "^10.0.0",
"vue-style-loader": "^1.0.0",
"vue-template-compiler": "^2.5.3",
"webpack": "^1.13.2",
"webpack-dev-middleware": "^1.8.3",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-hot-middleware": "^2.12.2",
"webpack-merge": "^0.14.1"
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 4.0.0",
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

@@ -1,54 +0,38 @@

import 'babel-polyfill';
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
/* eslint-disable no-unused-vars */
// Import Vue
import Vue from 'vue';
// Import F7
/* eslint-disable no-unused-vars */
import Framework7 from 'framework7';
import Framework7 from 'framework7/dist/framework7.esm.bundle.js';
// Import F7 Vue Plugin
import Framework7Vue from 'framework7-vue';
import Framework7Vue from 'framework7-vue/dist/framework7-vue.esm.bundle.js';
// Import Routes
import Routes from './routes';
// Import F7 Styles
import Framework7Styles from 'framework7/dist/css/framework7.css';
// Import App
import App from './App';
// Import Icons and App Custom Styles
import IconsStyles from './css/icons.css';
import AppStyles from './css/app.css';
// Set up some useful globals
window.isMaterial = !window.Framework7.prototype.device.ios;
window.isiOS = window.Framework7.prototype.device.ios;
// Import Routes
import Routes from './routes.js';
// Import F7 iOS Theme Styles
/* eslint-disable global-require */
if (window.isiOS) {
const Framework7Theme =
require('framework7/dist/css/framework7.ios.min.css');
const Framework7ThemeColors =
require('framework7/dist/css/framework7.ios.colors.min.css');
} else {
/* OR for Material Theme: */
const Framework7ThemeMaterial =
require('framework7/dist/css/framework7.material.min.css');
const Framework7ThemeColorsMaterial =
require('framework7/dist/css/framework7.material.colors.min.css');
}
// Import App Component
import App from './app';
// Init F7 Vue Plugin
Vue.use(Framework7Vue);
Vue.use(Framework7Vue, Framework7);
// Init App
new Vue({ // eslint-disable-line no-new
const baseApp = new Vue({
el: '#app',
template: '<app />',
template: '<app/>',
// Init Framework7 by passing parameters here
framework7: {
root: '#app',
material: window.isMaterial,
routes: Routes,
animateNavBackIcon: window.isiOS,
pushState: true,
pushStateNoAnimation: true
id: 'io.framework7.testapp', // App bundle ID
name: 'Framework7', // App name
theme: 'auto', // Automatic theme detection
// App routes
routes: Routes
},

@@ -55,0 +39,0 @@ // Register App Component

@@ -1,2 +0,3 @@

import Home from './components/pages/Home';
import HomePage from './pages/home.vue';
import NotFoundPage from './pages/not-found.vue';

@@ -6,8 +7,8 @@ export default [

path: '/',
component: Home
component: HomePage
},
{
path: '/home/',
component: Home
path: '(.*)',
component: NotFoundPage
}
];

@@ -5,3 +5,3 @@ // For authoring Nightwatch tests, see

module.exports = {
'main view': (browser) => {
'main view': browser => {
// automatically uses dev Server port from /config.index.js

@@ -17,3 +17,3 @@ // default: http://localhost:8080

},
'nav bar': (browser) => {
'nav bar': browser => {
const devServer = browser.globals.devServerURL;

@@ -23,6 +23,6 @@

.url(devServer)
.waitForElementVisible('.navbar-inner .center', 5000)
.assert.containsText('.navbar-inner .center', 'Home');
.waitForElementVisible('.navbar-inner .title', 5000)
.assert.containsText('.navbar-inner .title', 'Home');
},
'content block title': (browser) => {
'content block title': browser => {
const devServer = browser.globals.devServerURL;

@@ -32,7 +32,7 @@

.url(devServer)
.waitForElementVisible('.page-content .content-block-title', 5000)
.assert.containsText('.page-content .content-block-title', 'Hello World')
.waitForElementVisible('.page-content .block-title', 5000)
.assert.containsText('.page-content .block-title', 'Hello World')
.end();
},
'content block': (browser) => {
'content block': browser => {
const devServer = browser.globals.devServerURL;

@@ -42,6 +42,9 @@

.url(devServer)
.waitForElementVisible('.page-content .content-block', 5000)
.assert.containsText('.page-content .content-block', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio est aliquam officiis quaerat placeat, cum explicabo magni soluta totam maxime autem minima accusamus eos suscipit dignissimos corporis modi voluptatum fugiat!')
.waitForElementVisible('.page-content .block', 5000)
.assert.containsText(
'.page-content .block',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio est aliquam officiis quaerat placeat, cum explicabo magni soluta totam maxime autem minima accusamus eos suscipit dignissimos corporis modi voluptatum fugiat!'
)
.end();
}
};

@@ -14,3 +14,3 @@ /* eslint-disable import/no-extraneous-dependencies */

// you want coverage for.
const srcContext = require.context('src', true, /^\.\/(?!main(\.js)?$)/);
const srcContext = require.context('@', true, /^\.\/(?!main(\.js)?$)/);
srcContext.keys().forEach(srcContext);

@@ -1,3 +0,1 @@

/* eslint-disable import/no-extraneous-dependencies */
// This is a karma config file. For more details see

@@ -8,41 +6,5 @@ // http://karma-runner.github.io/0.13/config/configuration-file.html

var path = require('path');
var merge = require('webpack-merge');
var baseConfig = require('../../build/webpack.base.conf');
var utils = require('../../build/utils');
var webpack = require('webpack');
var webpackConfig = require('../../build/webpack.test.conf');
var projectRoot = path.resolve(__dirname, '../../');
var webpackConfig = merge(baseConfig, {
// use inline sourcemap for karma-sourcemap-loader
module: {
loaders: utils.styleLoaders(),
},
devtool: '#inline-source-map',
vue: {
loaders: {
js: 'babel-loader',
},
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../../config/test.env'), // eslint-disable-line global-require
}),
],
});
// no need for app entry during tests
delete webpackConfig.entry;
// Use babel for test files too
webpackConfig.module.loaders.some((loader) => {
if (/^babel(-loader)?$/.test(loader.loader)) {
loader.include.push(path.resolve(projectRoot, 'test/unit'));
return true;
}
return false;
});
module.exports = (config) => {
module.exports = function karmaConfig (config) {
config.set({

@@ -54,11 +16,11 @@ // to run in additional browsers:

browsers: ['PhantomJS'],
frameworks: ['mocha', 'sinon-chai'],
frameworks: ['mocha', 'sinon-chai', 'phantomjs-shim'],
reporters: ['spec', 'coverage'],
files: ['./index.js'],
preprocessors: {
'./index.js': ['webpack', 'sourcemap'],
'./index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
webpackMiddleware: {
noInfo: true,
noInfo: true
},

@@ -69,6 +31,6 @@ coverageReporter: {

{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' },
],
},
{ type: 'text-summary' }
]
}
});
};
/* eslint-disable no-unused-vars */
import Vue from 'vue';
// Import F7
import Framework7 from 'framework7';
import Framework7 from 'framework7/dist/framework7.esm.bundle.js';
// Import F7 Vue Plugin
import Framework7Vue from 'framework7-vue';
import Framework7Vue from 'framework7-vue/dist/framework7-vue.esm.bundle.js';
import App from 'src/App';
// Import F7 Styles
import Framework7Styles from 'framework7/dist/css/framework7.css';
import App from '@/app';
let vm;
// Init F7 Vue Plugin
Vue.use(Framework7Vue);
Vue.use(Framework7Vue, Framework7);
describe('App.vue', () => {
beforeEach(() => {
vm = new Vue({ // eslint-disable-line no-new
vm = new Vue({
// eslint-disable-line no-new
el: document.createElement('div'),

@@ -21,0 +26,0 @@ render: h => h(App),

@@ -1,12 +0,18 @@

import Vue from 'vue'; // eslint-disable-line no-unused-vars
/* eslint-disable no-unused-vars */
import Vue from 'vue';
// Import F7
import Framework7 from 'framework7'; // eslint-disable-line no-unused-vars
import Framework7 from 'framework7/dist/framework7.esm.bundle.js';
// Import F7 Vue Plugin
import Framework7Vue from 'framework7-vue';
import Framework7Vue from 'framework7-vue/dist/framework7-vue.esm.bundle.js';
import Home from 'src/components/pages/Home';
// Import F7 Styles
import Framework7Styles from 'framework7/dist/css/framework7.css';
import Home from '@/pages/home';
// Init F7 Vue Plugin
Vue.use(Framework7Vue);
Vue.use(Framework7Vue, Framework7);

@@ -17,3 +23,4 @@ let vm;

beforeEach(() => {
vm = new Vue({ // eslint-disable-line no-new
vm = new Vue({
// eslint-disable-line no-new
el: document.createElement('div'),

@@ -40,6 +47,7 @@ render: h => h(Home),

it('should have a content-block-title that displays `data().title`', () => {
expect(vm.$el.querySelector('.content-block-title').textContent)
.to.equal(Home.data().title);
expect(vm.$el.querySelector('.block-title').textContent).to.equal(
Home.data().title
);
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc