diff --git a/example/project/app/App.tsx b/example/project/app/App.tsx index 77c9f88a..54a355dd 100644 --- a/example/project/app/App.tsx +++ b/example/project/app/App.tsx @@ -3,8 +3,8 @@ import { Formik } from 'formik'; import PageHeader from '@availity/page-header'; import { Container, Card } from 'reactstrap'; import * as yup from 'yup'; -import Form from '@/components/Form'; -import chain from '@/chain'; +import Form from './components/Form'; +import chain from './chain'; const App: React.SFC<{}> = () => ( diff --git a/packages/workflow/README.md b/packages/workflow/README.md index 39589a4a..235a085e 100644 --- a/packages/workflow/README.md +++ b/packages/workflow/README.md @@ -1,18 +1,21 @@ # CLI ## Table of Contents -* [NPM](#npm) -* [Commands](#commands) - * [help](#help) - * [start](#start) - * [lint](#lint) - * [build](#build) - * [release](#release) - * [profile](#profile) - * [test](#test) + +- [NPM](#npm) +- [Commands](#commands) + - [help](#help) + - [start](#start) + - [lint](#lint) + - [build](#build) + - [release](#release) + - [profile](#profile) + - [test](#test) ## NPM + > NPM requires `--` between the command and options + ```bash npm run -- ``` @@ -20,77 +23,101 @@ npm run -- ## Commands ### `help` + Show help menu for all CLI options. ### `init ` #### Positionals -`projectName` Required. The name of the project you want to create. + +`projectName` Required. The name of the project you want to create. #### Options -- `--version`, `-v`: Specify which version of the plugin project you want. [default: "latest"] -- `--current-dir`, `-c`: If you want the project to be created in the current directory -- `--template`, `-t`: The template you want to initialize the projec with + +- `--version`, `-v`: Specify which version of the plugin project you want. [default: "latest"] +- `--current-dir`, `-c`: If you want the project to be created in the current directory +- `--template`, `-t`: The template you want to initialize the projec with + #### Examples -- `npx @availity/workflow init my-package-name` -- `npx @availity/workflow init my-package-name --template https://github.com/Availity/availity-starter-angular` -- `npx @availity/workflow init my-package-name --version 4.0.0-alpha.4` + +- `npx @availity/workflow init my-package-name` +- `npx @availity/workflow init my-package-name --template https://github.com/Availity/availity-starter-angular` +- `npx @availity/workflow init my-package-name --version 4.0.0-alpha.4` ### `start` -Start the development server and watches for file changes. Hot-reloading is enabled for React projects. Angular projects hot reload CSS only. + +Start the development server and watches for file changes. Hot-reloading is enabled for React projects. Angular projects hot reload CSS only. #### options ##### `--dry-run` + Start the development server using production settings. **Example:** `npm start -- --dry-run` ### `lint` + Lint project files using EsLint. #### options ##### `--include` + Include additional glob patterns for linting. ##### `--ignore-git-untracked` + Ignore files that are not indexed by git. ##### `--disable-linter` + Disable linter when creating bundles for production or staging. ### `build` -- Cleans up `/dist` folder -- Bundles project assets into the `/dist` folder + +- Cleans up `/dist` folder +- Bundles project assets into the `/dist` folder ### `release` -- Prompts the user for a version -- Cleans up `/dist` folder -- Bundles project assets into the `/dist` folder -- Tags the version in Git + +- Prompts the user for a version +- Cleans up `/dist` folder +- Bundles project assets into the `/dist` folder +- Tags the version in Git + +#### `--no-optimize` + +-Bundles javascript assets without minifying + +`npm run production --no-optimize` #### NODE_ENV ##### `production` + Minifies the javascript assets. ##### `staging` + No minification is done on javascript assets #### options ##### `--dry-run` -- Disables committing files to git -- Disables creating a git tag + +- Disables committing files to git +- Disables creating a git tag Skipped tasks will print a message in the console + ```bash ℹ [ Dry Run ] Skipping version bump ``` ### `profile` -Analyze Webpack bundles and find what is contributing their sizes. This command generates an html graphical chart that automatically opens in the browser as well as a text summary report in the console. + +Analyze Webpack bundles and find what is contributing their sizes. This command generates an html graphical chart that automatically opens in the browser as well as a text summary report in the console. ``` › Webpack profile: @@ -114,14 +141,15 @@ css-loader: 2.14 KB (0.157%) : 11.71 KB (0.859%) ``` - ### `test` -Run the tests for your project. The behavior of the test are determined by the plugin used in the workflow engine. The engine supports `@availity/workflow-plugin-react` (Jest) and `@availity/workflow-plugin-angular` (Karma and Chrome|Firefox|IE) plugins. + +Run the tests for your project. The behavior of the test are determined by the plugin used in the workflow engine. The engine supports `@availity/workflow-plugin-react` (Jest) and `@availity/workflow-plugin-angular` (Karma and Chrome|Firefox|IE) plugins. #### options ##### `--coverage` -Indicates that test coverage information should be collected and reported in the output. React project leverage the `--coverage` option from Jest. Angular projects use Instanbul to collect coverage metrics. Angular projects output coverage statistics to the console as well as html files in the `{workspaces}/coverage` folder. + +Indicates that test coverage information should be collected and reported in the output. React project leverage the `--coverage` option from Jest. Angular projects use Instanbul to collect coverage metrics. Angular projects output coverage statistics to the console as well as html files in the `{workspaces}/coverage` folder. ```bash › Started testing @@ -137,17 +165,13 @@ Lines : 27.23% ( 7955/29217 ) ``` ### `about` -Awesomeness. +Awesomeness. ## Disclaimer Open source software components distributed or made available in the Availity Materials are licensed to Company under the terms of the applicable open source license agreements, which may be found in text files included in the Availity Materials. ## License -[MIT](../../LICENSE) - - - - +[MIT](../../LICENSE) diff --git a/packages/workflow/index.js b/packages/workflow/index.js index e14e333a..ba8ae85a 100755 --- a/packages/workflow/index.js +++ b/packages/workflow/index.js @@ -1,6 +1,7 @@ #!/usr/bin/env node if (process.env.NODE_ENV === 'staging') { - process.env.NODE_ENV = 'development'; + process.argv.push('--no-optimize'); + process.env.NODE_ENV = 'production'; } const yargs = require('yargs'); const chalk = require('chalk'); diff --git a/packages/workflow/scripts/release.js b/packages/workflow/scripts/release.js index da7b2802..f34c8b7f 100644 --- a/packages/workflow/scripts/release.js +++ b/packages/workflow/scripts/release.js @@ -15,8 +15,7 @@ async function release({ settings }) { await version.tag(); Logger.success('Finished releasing'); } catch (error) { - Logger.failed(`Failed releasing: -${error} + Logger.failed(`Failed releasing - fix errors and retry. `); throw error; } diff --git a/packages/workflow/settings/index.js b/packages/workflow/settings/index.js index 88ef18c4..d8024173 100644 --- a/packages/workflow/settings/index.js +++ b/packages/workflow/settings/index.js @@ -18,7 +18,6 @@ const Joi = require('@hapi/joi'); function argv() { return yargs.argv; } - function stringify(obj) { each(obj, (value, key) => { if (isString(value)) { @@ -313,7 +312,7 @@ const settings = { }, isStaging() { - return this.environment() === 'staging'; + return this.environment() === 'production' && process.argv.includes('--no-optimize'); }, isIntegration() { @@ -345,7 +344,7 @@ const settings = { }, isProduction() { - return argv().production || this.environment() === 'production'; + return (argv().production || this.environment() === 'production') && !process.argv.includes('--no-optimize'); }, isDistribution() {