Skip to content

Rename cra-plugin-* to react-scripts-plugin-* #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Enable [CSS Modules](https://github.com/css-modules/css-modules) in your CRA app
## Install

```bash
yarn add -D cra-plugin-css-modules
yarn add -D react-scripts-plugin-css-modules
```

Add to `cra.config.js`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { findCssLoader } = require('cra-plugin-utils');
const { findCssLoader } = require('react-scripts-plugin-utils');

module.exports = {
webpack: config => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "cra-plugin-css-modules",
"name": "react-scripts-plugin-css-modules",
"version": "0.2.0",
"description": "CSS Modules plugin for Create React App",
"main": "index.js",
"repository": "jdcrensh/create-react-app#custom",
"author": "Jon Crenshaw <[email protected]>",
"license": "MIT",
"dependencies": {
"cra-plugin-utils": "^0.2.0"
"react-scripts-plugin-utils": "^0.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Disables file hashes (ie. `main.35dbe941.js`) in your CRA app's build output.
## Install

```bash
yarn add -D cra-plugin-no-hashes
yarn add -D react-scripts-plugin-no-hashes
```

Add to `cra.config.js`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { isEnabled } = require('cra-plugin-utils');
const { isEnabled } = require('react-scripts-plugin-utils');

module.exports = {
webpack: (config, { env }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "cra-plugin-no-hashes",
"name": "react-scripts-plugin-no-hashes",
"version": "0.2.0",
"description": "Plugin to disable file hashes for Create React App",
"main": "index.js",
"repository": "jdcrensh/create-react-app#custom",
"author": "Jon Crenshaw <[email protected]>",
"license": "MIT",
"dependencies": {
"cra-plugin-utils": "^0.2.0"
"react-scripts-plugin-utils": "^0.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Disable build minification in your CRA app's build output.
## Install

```bash
yarn add -D cra-plugin-no-minify
yarn add -D react-scripts-plugin-no-minify
```

Add to `cra.config.js`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

const { findCssLoader, filterPlugins, isEnabled } = require('cra-plugin-utils');
const {
findCssLoader,
filterPlugins,
isEnabled,
} = require('react-scripts-plugin-utils');

module.exports = {
webpack: (config, { env }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "cra-plugin-no-minify",
"name": "react-scripts-plugin-no-minify",
"version": "0.2.0",
"description": "Plugin to disable minification for Create React App",
"main": "index.js",
"repository": "jdcrensh/create-react-app#custom",
"author": "Jon Crenshaw <[email protected]>",
"license": "MIT",
"dependencies": {
"cra-plugin-utils": "^0.2.0"
"react-scripts-plugin-utils": "^0.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ _Note: This plugin system is unsupported by the CRA team and will not work with

## What is a plugin?

* Naming convension for plugin modules is `cra-plugin-NAME` (scoped modules are supported).
* Naming convension for plugin modules is `react-scripts-plugin-NAME` (scoped modules are supported).
* Plugins are loaded via the `plugins` array in `cra.config.js`.
* A plugin is a simple module exporting the feature(s) that it supports.
* Plugins have some access to Create React App internals through an `options` object passed to it. If there's an aspect of the internals that aren't provided, open a PR to request it.

## Install

```bash
yarn add cra-plugin-utils
yarn add react-scripts-plugin-utils
```

## Features
Expand All @@ -32,7 +32,7 @@ It will be passed the config object and some options.

#### Example

`cra-plugin-example/index.js`
`react-scripts-plugin-example/index.js`

```js
module.exports = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cra-plugin-utils",
"name": "react-scripts-plugin-utils",
"version": "0.2.0",
"description": "Core utilities for Create React App plugins",
"main": "index.js",
Expand Down
12 changes: 6 additions & 6 deletions packages/react-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ The ES5 module exported by `cra.config.js` at the app's root is used for configu
```js
module.exports = {
// Load plugins by name and/or by reference. Loading plugins by name is for
// convenience, eg. `'css-modules'` is the same as `require('cra-plugin-css-modules')`
// convenience, eg. `'css-modules'` is the same as `require('react-scripts-plugin-css-modules')`
plugins: ['css-modules', require('./my-internal-plugin')],

// Webpack configuration (see `cra-plugin-utils` for info)
// Webpack configuration (see `react-scripts-plugin-utils` for info)
webpack: (config, options) => {
return config;
},
Expand All @@ -31,10 +31,10 @@ module.exports = {

## Plugin Development

See [cra-plugin-utils](https://www.npmjs.com/package/cra-plugin-utils)
See [react-scripts-plugin-utils](https://www.npmjs.com/package/react-scripts-plugin-utils)

## Plugin Listing

* [cra-plugin-css-modules](https://www.npmjs.com/package/cra-plugin-css-modules)
* [cra-plugin-no-hashes](https://www.npmjs.com/package/cra-plugin-no-hashes)
* [cra-plugin-no-minify](https://www.npmjs.com/package/cra-plugin-no-minify)
* [react-scripts-plugin-css-modules](https://www.npmjs.com/package/react-scripts-plugin-css-modules)
* [react-scripts-plugin-no-hashes](https://www.npmjs.com/package/react-scripts-plugin-no-hashes)
* [react-scripts-plugin-no-minify](https://www.npmjs.com/package/react-scripts-plugin-no-minify)
5 changes: 4 additions & 1 deletion packages/react-scripts/config/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const loadPlugins = (plugins = []) => {
if (isPlainObject(p)) {
return p;
} else if (typeof p === 'string') {
const pluginPath = path.resolve(paths.appNodeModules, `cra-plugin-${p}`);
const pluginPath = path.resolve(
paths.appNodeModules,
`react-scripts-plugin-${p}`
);
if (fs.existsSync(pluginPath)) {
return require(pluginPath);
} else {
Expand Down
3 changes: 3 additions & 0 deletions packages/react-scripts/template/cra.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = {};