Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
routes[routes.length - 3] = routes[routes.length - 3];
routes.splice(
routes.length - 2,
0,
routesTemplate
.replace(/{{routeName}}/g, changeCase.camelCase(routeName))
.replace(/{{RouteName}}/g, changeCase.pascalCase(routeName))
.replace(/\n$/, '')
);
fs.writeFileSync(
path.join(__dirname, `../../app/src/components/${routeName}View.vue`),
routeTemplate
.replace(/{{routeName}}/g, changeCase.camelCase(routeName))
.replace(/{{RouteName}}/g, changeCase.pascalCase(routeName))
)
fs.mkdirSync(path.join(__dirname, `../../app/src/components/${routeName}View`));
fs.writeFileSync(
path.join(__dirname, `../../app/src/components/${routeName}View/styles.css`),
''
);
fs.writeFileSync(
path.join(__dirname, '../../app/src/routes.js'),
routes.join('\n')
)
console.log(`\n\x1b[33m[vue]\x1b[0m route "${routeName}" has been created`)
console.log(' [ \n' + [
const copyTemplates = async (src, map, name) => {
const options = copyOptions(map)
await copy(`${androidSourcesPath}/${src}`, `${androidSourcesPath}/${packageCase(name)}`, options)
await copy(`${iosSourcesPath}/${src}`, `${iosSourcesPath}/${pascalCase(name)}`, options)
await copy(
`${typescriptSourcesPath}/${src}`,
`${typescriptSourcesPath}/${pascalCase(name)}`,
options
)
}
import path from 'path'
import nodeResolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import commonjs from 'rollup-plugin-commonjs'
import external from '@yelo/rollup-node-external'
import { terser } from 'rollup-plugin-terser'
import { pascalCase } from 'change-case'
const { PACKAGES_SRC_DIR, PACKAGES_OUT_DIR } = require('./getPackageNames')
const packageName = process.env.PACKAGE_NAME
const libraryName = pascalCase(packageName)
const input = `./${path.join(PACKAGES_SRC_DIR, 'index.js')}`
const outDir = path.join(PACKAGES_OUT_DIR, 'dist')
const getBabelOptions = ({ useESModules }) => ({
exclude: 'node_modules/**',
runtimeHelpers: true,
plugins: [['@babel/transform-runtime', { useESModules }]],
})
export default [
{
input,
output: {
file: `${outDir}/${libraryName}.umd.js`,
var getList = function(q,options) {
if (options){
if (options.pageSize){
options.pageSize = parseInt(options.pageSize);
}
if (options.pageNum){
options.pageNum = parseInt(options.pageNum);
}
if (options.sort && options.sort != "created"){
options.sort = changeCase.pascalCase(options.sort);
}
}
var defaults = {
pageNum:1,
pageSize:20,
sort:"created",
sortOrder:"DESC"
};
options = _.extend(defaults,options);
var startIndex = (options.pageNum-1) * options.pageSize;
var endIndex = startIndex + options.pageSize;
var query = q + " return p,ID(p),LABELS(p),i,ID(i)";
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify'
import createBanner from 'create-banner'
import changeCase from 'change-case'
import alias from 'rollup-plugin-alias'
import path from 'path'
const resolve = p => path.resolve(__dirname, p)
const pkg = require('./package')
const name = changeCase.pascalCase(pkg.name.replace('@hanyk/', ''))
const banner = createBanner({
data: {
name: `${name}.js`,
year: '2018-present'
}
})
export default {
input: 'src/index.js',
output: {
banner,
file: 'dist/index.js',
format: 'umd',
name: 'mcommon',
globals: {
'Sortable': 'Sortable'
}
export function traitNameForFragmentName(fragmentName: string) {
return pascalCase(fragmentName);
}
export function caseClassNameForInlineFragment(inlineFragment) {
return 'As' + pascalCase(String(inlineFragment.typeCondition));
}
export function structNameForInlineFragment(inlineFragment) {
return 'As' + pascalCase(String(inlineFragment.typeCondition));
}
export function structNameForFragmentName(fragmentName) {
return pascalCase(fragmentName);
}