![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenanceโdevelopers should switch to Vite or other modern alternatives.
@rexlabs/plz-cli
Advanced tools
CLI toolkit for frontend web dev at rexlabs, enabling you to:
The latest version of plz comes with webpack 4, babel 7, jest 24 and storybook 5, as well as everything needed to support React 16.8 ๐
"Oh geez, another front dev tool" ... wrong!
This is a kit of tools - it says so in the first sentence. It is ๐ฏ gud.
Frontend development is filled to the brim with open source tools like webpack, babel, jest and storybook. As great as they are, they're difficult to configure, don't play nice together, and each new tool introduces learning curves. Boo.
Rather than we all struggling through the pains of configuration setup and maintenance, in each app and package we build @ rexlabs, we invest all that tooling focus into plz
. It can sit in front of these tools, with a bunch of sane default configurations and hacks, to then be consistently employed in our projects. Devs are given the opportunity to forget about tooling woes, freeing their minds for better tasks. What a pleasant experience!
create-react-app
?CRA, or more specifically react-scripts, is an amazing toolkit and one of the starters of this trend we're now seeing. However, it is (for very good reasons) very opinionated when it comes to the ability to customise it. We needed something a little bit more flexible, since every app after all is different and will have different requirements to certain extends.
Also, we wanted a toolkit that would allow us to build all kinds of projects, not just apps. Since we heavily invest in building centralised components and solutions in form of npm libraries, we were looking for a toolkit that could sit on top of any form of project. This is exactly what plz
does ๐
Even though he's not working at rexlabs anymore, Lochlan Bunn still deserves a massive shout out here. Not only did he create plz
in the first place, he also drove its adaption, educating everone about the concepts, motivations and benefits. Without his work this library and the work that we do thanks to it would not be the same ๐
# Install plz globally to use it for bootstrapping new projects
npm i -g @rexlabs/plz-cli
plz <command> [options]
# ...or use npx
npx @rexlabs/plz-cli <command> [options]
$ plz --help
Commands:
plz build Bundles a project for distribution.
plz clean Removes previously built files.
plz config [key] [value] Sets (or reads) config of the plz instance.
Can be used to change defaults.
plz create <name> [root-dir] Generates a new project called <name>
plz serve Starts an dev server for the project.
plz stories Starts a storybook for UI components.
plz test [options] Starts a jest test runner in current
directory.
plz use <package-name> Sets the given package as template source.
See --help for more details.
Options:
-h, --help Show help [boolean]
--no-emoji Strip all emojis from the cli output in the terminal. [boolean]
--report Add memory reporting at the end of each command execution.
[boolean]
--version Show version number [boolean]
Run `plz --help` or `plz <command> --help` to get more info.
Run `DEBUG=plz plz <command> [options]` to get more detailed output for
troubleshooting.
Creates a new project.
$ plz create <name> [root-dir]
Generates a new project called <name>
Positionals:
name Name of the project, will be used by default for the name of the
generated directory. [string] [required]
root-dir Optional root directory for new project [string]
Options:
-h, --help Show help [boolean]
--no-emoji Strip all emojis from the cli output in the terminal.
[boolean]
--report Add memory reporting at the end of each command execution.
[boolean]
--version Show version number [boolean]
--project-type, -t Project type, one of: react-app, react-component,
module.The tooling configs (webpack, babel, etc.) will be
determined from the project type. [default: "react-app"]
--template, --tpl Optional custom URL of template repo to be used for the
project. Templates use handlebars to create directories
and files dynamically.
name
Name of the project, will be used by default for the name of the generated directory. It will also be passed down to the template to be used for the package name, core class names, etc.
project-type
The type of project you want to create. This determines the default template, as well as the default configs and setup for the other commands.
template
By default plz will pick the template, according to the project type, from the src/templates/[type]
folder. Optionally you can pass in your own template, either via path (relative to the current working directory), or via git repo. You can also define a sub directory of a repo, by just extending the repo URL with the dir path, e.g.:
# Relative path
plz create new-project --template ./my/relative/sub-folder
# Github repo
plz create new-project --template git@github.com:smith/my-monorepo.git
# Github repo with subfolder specified
# This will clone `git@github.com:smith/my-monorepo.git` and then copy `some/sub-folder`
# based on the repos root directory
plz create new-project --template git@github.com:smith/my-monorepo.git/some/sub-folder
The above will clone git@github.com:smith/my-monorepo.git
and then use the sub directory some/sub-folder
(relative to the repo's root folder) as the template directory.
You can also override the default template via plz config
, so you don't have to always manually specify them when using plz.
# set template.[type], can be any format mentioned above
plz config templates.react-app ./my/relative/sub-folder
If you want to use an npm package for your templates, you can use the plz use
shortcut.
npm i -g my-template-package
plz use my-template-package
Templates are parsed using copy-template-dir, which allows injecting variables via mustache syntax. See below for more details and available variables. For more details on how templates work see the advanced docs.
Exclusive to project type
react-app
!
Starts webpack dev server for a dev enviroment with good developer experience.
$ plz serve
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
--port Port for the dev server. [default: 3000]
--host Host for the dev server. [default: "localhost"]
--open-browser Open the server automatically in the default browser once it
is started. [default: true]
port / host
Port and host to be used for the dev server. By default, plz will start the server on http://localhost:3000. If the port is already used, plz will prompt you with the option to use the next available port instead.
open-browser
By default plz will automatically open the dev environment in your default browser once the server is successfully started. If you don't want that, you can disable it via plz serve --open-browser=false
.
Creates production bundle of your project.
$ plz build
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
The output depends on the project type. Modules and React components will be bundled optimised for releasing them as npm libraries, while React apps will be bundled into a public
directory optimised for deployment.
โ ๏ธ NOTE: for React apps plz does NOT set the NODE_ENV to production automatically. So when building the app on your server, you would want to run
NODE_ENV=production plz build
!
Opens development environment, starting a Storybook dev server. Plz will pick up stories from src/.stories.js
by default, you can override this via the storybook.storiesPattern
config.
$ plz stories
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
--port Port for the storybook server. [default: 3001]
--root-dir Directory to search in, for multiple package stories.
[string] [default: "components"]
--output-dir Directory to build & output a static storybook app. [string]
port
Same as with serve
, the port for the dev server. Again, plz will prompt you if the port is already in use. Defaults to http://localhost:3001.
root-dir
This option is for monorepo support. If you're maintaining a monorepo with multiple repos that all contain stories (ideally bootstrapped via plz to ensure proper folder structure), you can run plz serve
from the root specifying the root dir for all the repos you want plz to look in for stories.
output-dir
If you specify this, instead of booting up the dev server, plz will run build-stories
and put the output into the specified output directory. This can be useful e.g. for CI, if you want to create a static build of storybook for you master or PR branches.
Runs jest tests on the project.
$ plz test
Options:
-h, --help Show help [boolean]
--version Show version number [boolean]
--watch Rerun tests when files change. [boolean] [default: false]
Any options will be passed through to jest
itself, so you can use everything you already know, e.g. --watch
, --coverage
, etc.
Set instance config key value pair, or read current config. This can be useful for globally installed plz
instances, e.g. to override the templates used for the create
command.
$ plz config [key] [value]
Sets (or reads) config of the plz instance. Can be used to change defaults.
Positionals:
key Config key [string]
value Config value for given key, if a relative path is given it will be
resolved based on the current working directory. [string]
Options:
-h, --help Show help [boolean]
--no-emoji Strip all emojis from the cli output in the terminal. [boolean]
--report Add memory reporting at the end of each command execution.
[boolean]
--version Show version number [boolean]
--get Read config value(s).
Example for overriding the default template for react apps:
plz config templates.react-app ./my/custom/path
Abstraction for config
, using the given npm package for template paths in the cli default config.
$ plz use <package-name>
Sets the given package as template source. See --help for more details.
Positionals:
package-name Name of globally installed npm package. It needs to be already
installed, plz will use "npm root -g" to find the given package.
[string] [required]
Options:
-h, --help Show help [boolean]
--no-emoji Strip all emojis from the cli output in the terminal. [boolean]
--report Add memory reporting at the end of each command execution.
[boolean]
--version Show version number [boolean]
If you need to troubleshoot issues, you might find the more verbose debug output helpful. To show these, simply run:
DEBUG=plz plz <command> [options]
You can find more info here: https://github.com/visionmedia/debug
Config for the plz
๐ cli is resolved from established configuration files like other cli tools.
plz
property in package.json
file.plzrc
file (optionally with .json
, .yaml
, .js
extensions).plz.config.js
fileThe Javascript versions are especially helpful when overriding the tool configs, as you will want to define a function that receives the proposed config and returns your adjusted version.
{
// Project type, determines how project is bootstraped, built, served, etc.
// One of "react-app", "react-component" and "module"
"projectType": "react-component",
// Build dir, by default "public" for React apps
// For modules and React components its the project root, since they
// will generate multiple bundle dirs (module, lib)
"buildDir": "public",
// If enabled it adds css modules support to the project
// https://github.com/css-modules/css-modules
"cssModules": false,
// When enabled, packages found in node_modules/ that have a package.json
// plz:main field will be compiled & watched with Babel
// This can be especially helpful within monorepos
"runtimeCompilation": false,
// A map of proxy configs
// See "further documentation" for more details
"proxy": {},
// All options for Storybook's runtime
"storybook": {},
// Middleware for babel config
"babel": (config) => config,
// Same for webpack
"webpack": (config) => config
}
For more details about the tool configs see the futher documentation.
.
โโโ CHANGELOG.md # Automatically generated by lerna!
โโโ __tests__ # Test files for plz, run via `yarn test(:watch)`
โโโ package.json
โโโ readme.md
โโโ src
โย ย โโโ bin.js # Node binary entry point
โย ย โโโ commands # Commands dir, automatically detected through yargs
โย ย โย ย โโโ build.js
โย ย โย ย โโโ clean.js
โย ย โย ย โโโ create.js
โย ย โย ย โโโ serve.js
โย ย โย ย โโโ stories.js
โย ย โย ย โโโ test.js
โย ย โโโ configs # Tooling configs + collection for project types in `project`
โย ย โย ย โโโ babel
โย ย โย ย โโโ jest
โย ย โย ย โโโ project
โย ย โย ย โโโ storybook
โย ย โย ย โโโ webpack
โย ย โโโ index.js # Entry point for imports
โ โโโ templates # Default templates for the different project types
โ โ โโโ module
โ โ โโโ react-app
โ โ โโโ react-component
โย ย โโโ utils # General util methods
โโโ support # Any node helper scripts
All commands are automatically detected by yargs through the commandDir
method, which is set to /commands
. Files in there need to export all the command relevant information themselves.
# Watch for changes, rerunning tests
yarn test:watch
# Run watch once
yarn test
# Get test coverage
yarn test --coverage
FAQs
Toolkit for creating, developing building & testing projects - Vivid Module
The npm package @rexlabs/plz-cli receives a total of 62 weekly downloads. As such, @rexlabs/plz-cli popularity was classified as not popular.
We found that @rexlabs/plz-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.ย It has 26 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenanceโdevelopers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.