![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@rexlabs/plz-cli
Advanced tools
CLI toolkit for frontend web dev @ rexlabs, enabling you to:
Generate new apps and npm packages!
Preview UI with Webpack Dev Server and Storybook!
Run tests with Jest and Storyshot!
Build distributions with Babel and Webpack!
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 (plz
π) 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!
$ plz help
Commands:
create <name> [root-dir] Generates a project called `@rexlabs/<name>`.
test [options] Starts a test runner in current directory.
stories Starts a storybook for UI components.
serve Starts an dev server for the project.
build Bundles a project for distribution.
clean Removes previously built files.
help Shows this help message.
Help:
--help, -h Show help [boolean]
--help-all Show all help [boolean]
Options:
--version, -v Show cli version number [boolean]
Run `plz help <command>` for more info & options.
plz create my-new-component
This will generate a new project in a folder called my-new-component
.
To change the type of project, use --project-type
.
react-component
react-app
module
Defaults to
react-component
project type.
plz serve
This will start a Webpack Dev Server with hot module replacement enabled, rebuilding your project on file changes.
plz stories
plz stories --output-dir=./storybook-build
This will start a Storybook server, loading the src/.stories.js
module. It can also be run from the root of a monorepo to load stories from each component package.
plz test
plz test --watch
This will start Jest, the Painless Test Runnerβ’. It will look for files under __tests__
anywhere in the project.
__tests__/storyshots.js
import plz from '@rexlabs/plz-cli';
plz.initStoryshots();
Components that have stories can use [Storyshot][storyshot] to snapshot the renders.
plz build
This will use Babel or Webpack, depending on the project type, to bundle the source of the project into browser-ready assets.
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
fileConfig Field | Description |
---|---|
projectType | One of the follow types:react-app , react-component , react-module |
buildDir | The location of your project's build output. For apps this is public/ .For modules this is at the root because modules output several bundle directories of their own:
|
cssModules | When enabled, CSS Modules can be imported into JS Modules. eg. import buttonStyles from './button-styles.css' . |
runtimeCompilation | When enabled, packages found in node_modules/ that have a package.json plz:main field will be compiled & watched with Babel. |
proxy | A map of proxy configs. |
storybook | All options for Storybook's runtime. See @storybook/addon-options for more details.Additionally, |
babel | Middleware for the Babel config of the project. See the Example Config for more details. |
webpack | Middleware for the Webpack config of the project. See the Example Config for more details. |
Additionally, all config options can be overridden with cli args.
# Force the "react-app" configuration
plz build --project-type "react-app" --build-dir "./public"
# Change storybook nested configs
plz stories --storybook-show-down-panel
# Enable CSS Modules for developer server
plz serve --css-modules
.plzrc.js
or plz.config.js
module.exports = {
projectType: "react-app",
buildDir: './app-build',
cssModules: false,
runtimeCompilation: true,
proxy: {
'/api/v1': { target: 'http://localhost:8080' }
},
storybook: {
url: ,
goFullScreen: false,
showLeftPanel: true,
showDownPanel: true,
showSearchBox: false,
downPanelInRight: true,
sortStoriesByKind: false
},
babel: (babelConfig) => {
// ...transform the config if required!
return transformedBabelConfig;
},
webpack: (webpackConfig) => {
// ...transform the config if required!
return transformedWebpackConfig;
}
}
Cross Origin issues are a pain that we usually encounter in development environments.
To this goal, you can route requests through the App's Webpack Dev Server instance, by matching a request's path
to a domain
.
The extent of configuration is better explained in the underlying http-proxy-middleware, but common configuration is covered below.
.plzrc.js
module.exports = {
proxy: {
{
'/api/v1': { target: 'http://localhost:8080' } /*
\_____/ \_______________________________/
| |
context options */
}
}
}
This will proxy the following shaped requests from the Webpack Dev Server to the "target" and back:
http://localhost:3000/api/v1/accounts
β http://localhost:8080/api/v1/accounts
.index.js
Start of CLI
src/commands/
Bulk of CLI logic is here, taking different paths for differing project types.
src/configs/
All the configuration for underlying tools.
# Watch for changes, rerunning tests
$ yarn test:watch
# Run watch once
$ yarn test
# The logo should be pasted to src/utils/index.js
yarn ascii | clipcopy
readme.md
# The usage info is injected into the readme
yarn update-readme
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
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.