Skip to content

Commit d0c4f43

Browse files
authored
Rename cra-plugin-* to react-scripts-plugin-* (#10)
1 parent d680431 commit d0c4f43

File tree

15 files changed

+33
-23
lines changed

15 files changed

+33
-23
lines changed

packages/cra-plugin-css-modules/README.md renamed to packages/react-scripts-plugin-css-modules/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Enable [CSS Modules](https://github.com/css-modules/css-modules) in your CRA app
55
## Install
66

77
```bash
8-
yarn add -D cra-plugin-css-modules
8+
yarn add -D react-scripts-plugin-css-modules
99
```
1010

1111
Add to `cra.config.js`

packages/cra-plugin-css-modules/index.js renamed to packages/react-scripts-plugin-css-modules/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

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

55
module.exports = {
66
webpack: config => {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "cra-plugin-css-modules",
2+
"name": "react-scripts-plugin-css-modules",
33
"version": "0.2.0",
44
"description": "CSS Modules plugin for Create React App",
55
"main": "index.js",
66
"repository": "jdcrensh/create-react-app#custom",
77
"author": "Jon Crenshaw <[email protected]>",
88
"license": "MIT",
99
"dependencies": {
10-
"cra-plugin-utils": "^0.2.0"
10+
"react-scripts-plugin-utils": "^0.2.0"
1111
}
1212
}

packages/cra-plugin-no-hashes/README.md renamed to packages/react-scripts-plugin-no-hashes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Disables file hashes (ie. `main.35dbe941.js`) in your CRA app's build output.
55
## Install
66

77
```bash
8-
yarn add -D cra-plugin-no-hashes
8+
yarn add -D react-scripts-plugin-no-hashes
99
```
1010

1111
Add to `cra.config.js`

packages/cra-plugin-no-hashes/index.js renamed to packages/react-scripts-plugin-no-hashes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

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

55
module.exports = {
66
webpack: (config, { env }) => {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "cra-plugin-no-hashes",
2+
"name": "react-scripts-plugin-no-hashes",
33
"version": "0.2.0",
44
"description": "Plugin to disable file hashes for Create React App",
55
"main": "index.js",
66
"repository": "jdcrensh/create-react-app#custom",
77
"author": "Jon Crenshaw <[email protected]>",
88
"license": "MIT",
99
"dependencies": {
10-
"cra-plugin-utils": "^0.2.0"
10+
"react-scripts-plugin-utils": "^0.2.0"
1111
}
1212
}

packages/cra-plugin-no-minify/README.md renamed to packages/react-scripts-plugin-no-minify/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Disable build minification in your CRA app's build output.
55
## Install
66

77
```bash
8-
yarn add -D cra-plugin-no-minify
8+
yarn add -D react-scripts-plugin-no-minify
99
```
1010

1111
Add to `cra.config.js`

packages/cra-plugin-no-minify/index.js renamed to packages/react-scripts-plugin-no-minify/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
'use strict';
22

3-
const { findCssLoader, filterPlugins, isEnabled } = require('cra-plugin-utils');
3+
const {
4+
findCssLoader,
5+
filterPlugins,
6+
isEnabled,
7+
} = require('react-scripts-plugin-utils');
48

59
module.exports = {
610
webpack: (config, { env }) => {
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "cra-plugin-no-minify",
2+
"name": "react-scripts-plugin-no-minify",
33
"version": "0.2.0",
44
"description": "Plugin to disable minification for Create React App",
55
"main": "index.js",
66
"repository": "jdcrensh/create-react-app#custom",
77
"author": "Jon Crenshaw <[email protected]>",
88
"license": "MIT",
99
"dependencies": {
10-
"cra-plugin-utils": "^0.2.0"
10+
"react-scripts-plugin-utils": "^0.2.0"
1111
}
1212
}

packages/cra-plugin-utils/README.md renamed to packages/react-scripts-plugin-utils/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ _Note: This plugin system is unsupported by the CRA team and will not work with
66

77
## What is a plugin?
88

9-
* Naming convension for plugin modules is `cra-plugin-NAME` (scoped modules are supported).
9+
* Naming convension for plugin modules is `react-scripts-plugin-NAME` (scoped modules are supported).
1010
* Plugins are loaded via the `plugins` array in `cra.config.js`.
1111
* A plugin is a simple module exporting the feature(s) that it supports.
1212
* 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.
1313

1414
## Install
1515

1616
```bash
17-
yarn add cra-plugin-utils
17+
yarn add react-scripts-plugin-utils
1818
```
1919

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

3333
#### Example
3434

35-
`cra-plugin-example/index.js`
35+
`react-scripts-plugin-example/index.js`
3636

3737
```js
3838
module.exports = {

packages/cra-plugin-utils/package.json renamed to packages/react-scripts-plugin-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "cra-plugin-utils",
2+
"name": "react-scripts-plugin-utils",
33
"version": "0.2.0",
44
"description": "Core utilities for Create React App plugins",
55
"main": "index.js",

packages/react-scripts/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ The ES5 module exported by `cra.config.js` at the app's root is used for configu
1919
```js
2020
module.exports = {
2121
// Load plugins by name and/or by reference. Loading plugins by name is for
22-
// convenience, eg. `'css-modules'` is the same as `require('cra-plugin-css-modules')`
22+
// convenience, eg. `'css-modules'` is the same as `require('react-scripts-plugin-css-modules')`
2323
plugins: ['css-modules', require('./my-internal-plugin')],
2424

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

3232
## Plugin Development
3333

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

3636
## Plugin Listing
3737

38-
* [cra-plugin-css-modules](https://www.npmjs.com/package/cra-plugin-css-modules)
39-
* [cra-plugin-no-hashes](https://www.npmjs.com/package/cra-plugin-no-hashes)
40-
* [cra-plugin-no-minify](https://www.npmjs.com/package/cra-plugin-no-minify)
38+
* [react-scripts-plugin-css-modules](https://www.npmjs.com/package/react-scripts-plugin-css-modules)
39+
* [react-scripts-plugin-no-hashes](https://www.npmjs.com/package/react-scripts-plugin-no-hashes)
40+
* [react-scripts-plugin-no-minify](https://www.npmjs.com/package/react-scripts-plugin-no-minify)

packages/react-scripts/config/configure.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const loadPlugins = (plugins = []) => {
1212
if (isPlainObject(p)) {
1313
return p;
1414
} else if (typeof p === 'string') {
15-
const pluginPath = path.resolve(paths.appNodeModules, `cra-plugin-${p}`);
15+
const pluginPath = path.resolve(
16+
paths.appNodeModules,
17+
`react-scripts-plugin-${p}`
18+
);
1619
if (fs.existsSync(pluginPath)) {
1720
return require(pluginPath);
1821
} else {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = {};

0 commit comments

Comments
 (0)