All files / src cli.js

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176      1x                                         1x                                                                                                         1x                                                                                                                                                                                                    
import {bold, cyan, dim} from 'chalk';
import figures from 'figures';
 
export const descriptions = {
    project: `Scaffold a new Node.js project with ${bold.yellow('Babel')}, ${bold('ESLint')}, and ${bold.magenta('Jest')}`,
    app: `Scaffold a new ${bold('web application')} - basically a project with CSS, bundling, and stuff`,
    server: `Scaffold Node.js WebSocket, GraphQL, and HTTP(S) servers with an 80% solution for security "baked in"`,
    a11y: `Add automated ${bold('accessibility')} testing`,
    babel: `Use next generation JavaScript, ${bold('today!')}`,
    browsersync: `Time-saving ${bold('synchronised browser')} testing (demo your app with ${bold.yellow('live-reload')})`,
    cypress: `${bold('Test')} anything that runs in a ${bold('browser')} (including ${bold.yellow('visual regression testing')})`,
    electron: `Create a ${bold('native desktop application')} using web technologies`,
    esdoc: `Generate ${bold('documentation')} from your comments`,
    eslint: `Pluggable ${bold('linting')} utility for JavaScript and JSX`,
    jest: `Delightful JavaScript ${bold('Testing')} Framework with a focus on simplicity`,
    makefile: `Create a ${bold('Makefile')} from your package.json, like ${bold.magenta('magic!')}`,
    marionette: `${bold('Flexible Backbone framework')} with robust views and architecture solutions`,
    parcel: `${bold('Bundle')} your application (${bold.red('blazing')} fast with ${bold.white('zero configuration')})`,
    postcss: `Use ${bold('future CSS')}, never write vendor prefixes again, and much much more!`,
    react: `Build user interfaces with ${bold('components')} ${figures.arrowRight} learn once, write ${bold('anywhere')}`,
    reason: `Write functional ${bold('type safe')} code with ${bold.yellow('JavaScript')}-like syntax (works with ${bold('React')})`,
    rollup: `${bold('Bundle')} your assets (focused on ${bold('ES6')} modules and tree shaking - ${bold.white('best for libraries')})`,
    webpack: `${bold('Bundle')} your assets (with great support and a rich ecosystem)`
};
export const help = `
    ${dim.bold('Usage')}
 
        ${cyan('>')} tomo [commands] [terms] [options]
        
        ${cyan('>')} tomo version
 
        ${cyan('>')} tomo new app --use-react --use-parcel
        
        ${cyan('>')} tomo add
        
        ${cyan('>')} tomo add eslint --browser
 
 
    ${dim.bold('Commands')}
 
        new, add, remove, version, help
 
 
    ${dim.bold('Terms')}
 
        [new]
        project, app, server
 
        [add]
        a11y, babel, browsersync, cypress, electron, esdoc, eslint, jest,
        marionette, makefile, parcel, postcss, react, reason, rollup, webpack 
 
        [remove]
        a11y, browsersync, cypress, parcel, postcss, reason, rollup, webpack
 
 
    ${dim.bold('Options')}
 
        --assets-directory, -a  Directory for assets ${dim('[Default: ./assets]')}
        --browser, -b           Indicate tasks are intended for the browser ${dim('[Default: false]')}
        --ignore-warnings, -i   Ignore warning messages ${dim('[Default: false]')}
        --output-directory, -o  Directory for build targets ${dim('[Default: ./dist]')}
        --overwrite, -x         Copy files, even if they alrady exist ${dim('[Default: false]')}
        --port, -p              Configure port for workflow tasks that use it ${dim('[Default: 4669]')}
        --react-version         React version for ESLint configuration ${dim('[Default: "^17"]')}
        --skip-install, -s      Skip npm installations ${dim('[Default: false]')}
        --source-directory, -d  Directory for source code ${dim('[Default: ./src]')}
        --use-parcel, -P        Use Parcel instead of Webpack ${dim('[Default: false]')}
        --use-react, -r         Add React support to workflow ${dim('[Default: false]')}
        --use-rollup, -R        Use Rollup instead of Webpack ${dim('[Default: false]')}
        --use-snowpack, -S      Use Snowpack instead of Webpack ${dim('[Default: false]')}
        --version, -v           Print version
        --with-cesium, -c       Add CesiumJS to your project ${dim('[Default: false]')}
        --with-rust, -w         Add "Rust to WASM" support to your project ${dim('[Default: false]')}
        --debug, -D             Show debug data ${dim('[Default: false]')}
        --legacy-npm, -L        Do not install npm peer dependencies by default (use this option if your npm version is >=7)
`;
export const options = {
    help,
    flags: {
        version: {
            type: 'boolean',
            default: false,
            alias: 'v'
        },
        sourceDirectory: {
            type: 'string',
            default: './src',
            alias: 'd'
        },
        outputDirectory: {
            type: 'string',
            default: './dist',
            alias: 'o'
        },
        assetsDirectory: {
            type: 'string',
            default: './assets',
            alias: 'a'
        },
        useRollup: {
            type: 'boolean',
            default: false,
            alias: ['R', 'rollup']
        },
        useParcel: {
            type: 'boolean',
            default: false,
            alias: ['P', 'parcel']
        },
        useSnowpack: {
            type: 'boolean',
            default: false,
            alias: ['S', 'snowpack']
        },
        useReact: {
            type: 'boolean',
            default: false,
            alias: ['r', 'react']
        },
        reactVersion: {
            type: 'string',
            default: '^17'
        },
        withCesium: {
            type: 'boolean',
            default: false,
            alias: 'c'
        },
        withRust: {
            type: 'boolean',
            default: false,
            alias: 'w'
        },
        help: {
            type: 'boolean',
            default: false,
            alias: 'h'
        },
        ignoreWarnings: {
            type: 'boolean',
            default: false,
            alias: 'i'
        },
        skipInstall: {
            type: 'boolean',
            default: false,
            alias: 's'
        },
        browser: {
            type: 'boolean',
            default: false,
            alias: 'b'
        },
        port: {
            type: 'number',
            default: 4669,
            alias: 'p'
        },
        overwrite: {
            type: 'boolean',
            default: false,
            alias: 'x'
        },
        debug: {
            type: 'boolean',
            default: false,
            alias: 'D'
        },
        legacyNpm: {
            type: 'boolean',
            default: false,
            alias: ['L', 'legacy']
        }
    }
};