Skip to content

Commit 41937aa

Browse files
dunglasalanpoulain
andauthored
docs(create-client): rename Client Generator in Create Client (#1603)
* docs(create-client): rename Client Generator in Create Client * Update create-client/vuetify.md Co-authored-by: Alan Poulain <[email protected]> Co-authored-by: Alan Poulain <[email protected]>
1 parent 5ab0df4 commit 41937aa

34 files changed

+194
-181
lines changed

admin/getting-started.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,19 @@
44

55
If you use the [API Platform Distribution](../distribution/), API Platform Admin is already installed, you can skip this installation guide.
66

7-
Otherwise, all you need to install API Platform Admin is a JavaScript package manager. We recommend [Yarn](https://yarnpkg.com/) ([npm](https://www.npmjs.com/) is also supported).
7+
Otherwise, follow this guide.
88

99
If you don't have an existing React Application, create one using [Create React App](https://create-react-app.dev/):
1010

1111
```console
12-
yarn create react-app my-admin
13-
```
14-
15-
Go to the directory of your project:
16-
17-
```console
12+
npm init react-app my-admin
1813
cd my-admin
1914
```
2015

21-
Finally, install the `@api-platform/admin` library:
16+
Then, install the `@api-platform/admin` library:
2217

2318
```console
24-
yarn add @api-platform/admin
19+
npm install @api-platform/admin
2520
```
2621

2722
## Creating the Admin
@@ -69,6 +64,6 @@ docker compose exec php \
6964
bin/console cache:clear --env=prod
7065
```
7166

72-
Your new administration interface is ready! Type `yarn start` to try it!
67+
Your new administration interface is ready! Type `npm start` to try it!
7368

7469
Note: if you don't want to hardcode the API URL, you can [use an environment variable](https://create-react-app.dev/docs/adding-custom-environment-variables).

client-generator/nextjs.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

core/angularjs-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AngularJS Integration
22

3-
Warning: for a new project, you should consider using [the API Platform's Progressive Web App generator](../client-generator/index.md)
3+
Warning: for a new project, you should consider using [the API Platform's Progressive Web App generator](../create-client/index.md)
44
(that supports React and Vue.js) instead of this Angular v1 integration.
55

66
## Restangular

core/deprecations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class Parchment
3636
As you can see, to deprecate a resource, we just have to explain what the client should do to upgrade in the dedicated attribute.
3737

3838
The deprecation will automatically be taken into account by clients supporting the previously mentioned format, including
39-
[API Platform Admin](../admin/index.md), [API Platform Client Generator](../client-generator/index.md) and the lower level
40-
[api-doc-parser library](https://github.com/api-platform/api-doc-parser).
39+
[Admin](../admin/index.md), clients created with [Create Client](../create-client/index.md) and the lower level
40+
[api-doc-parser](https://github.com/api-platform/api-doc-parser) library.
4141

4242
Here is how it renders for OpenAPI in the built-in Swagger UI shipped with the framework:
4343

core/mercure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ This header allows smart clients to automatically discover the Mercure hub.
4646

4747
![Mercure subscriptions](images/mercure-discovery.png)
4848

49-
Clients generated using [the API Platform Client Generator](../client-generator/index.md) will use this capability to automatically subscribe to Mercure updates when available:
49+
Clients generated using [Create Client](../create-client/index.md) will use this capability to automatically subscribe to Mercure updates when available:
5050

51-
![Screencast](../client-generator/images/client-generator-demo.gif)
51+
![Screencast](../create-client/images/create-client-demo.gif)
5252

5353
[Learn how to use the discovery capabilities of Mercure in your own clients](https://mercure.rocks/docs/ecosystem/awesome).
5454

client-generator/custom.md renamed to create-client/custom.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
# Custom Generator
22

3-
Client Generator provides support for many of the popular JS frameworks, but you may be using another framework or language and may need a solution adapted to your specific needs. For this cenario, you can write your own generator and pass it to the CLI using a path as the `-g` argument.
3+
Create Client provides support for many of the popular JS frameworks, but you may be using another framework or language and may need a solution adapted to your specific needs. For this cenario, you can write your own generator and pass it to the CLI using a path as the `-g` argument.
44

5-
You will probably want to extend or, at least, take a look at [BaseGenerator.js](https://github.com/api-platform/client-generator/blob/main/src/generators/BaseGenerator.js), since the library expects some methods to be available, as well as one of the [included generators](https://github.com/api-platform/client-generator/blob/main/src/generators/BaseGenerator.j) to make your own.
5+
You will probably want to extend or, at least, take a look at [BaseGenerator.js](https://github.com/api-platform/create-client/blob/main/src/generators/BaseGenerator.js), since the library expects some methods to be available, as well as one of the [included generators](https://github.com/api-platform/create-client/blob/main/src/generators/BaseGenerator.j) to make your own.
66

77
## Usage
88

99
```shell
10-
generate-api-platform-client -g "$(pwd)/path/to/custom/generator.js" -t "$(pwd)/path/to/templates"
10+
npm init @api-platform/client -g "$(pwd)/path/to/custom/generator.js" -t "$(pwd)/path/to/templates"
1111
```
1212

1313
The `-g` argument can point to any resolvable node module which means it can be a package dependency of the current project as well as any js file.
1414

1515
## Example
1616

17-
Client Generator makes use of the [Handlebars](https://handlebarsjs.com/) template engine. You can use any programming language or file type. Your generator can also pass data to your templates in any shape you want.
17+
Create Client makes use of the [Handlebars](https://handlebarsjs.com/) template engine. You can use any programming language or file type. Your generator can also pass data to your templates in any shape you want.
1818

1919
In this example, we'll create a simple [Rust](https://www.rust-lang.org) file defining a new `struct` and creating some instances of this `struct`.
2020

2121
### Generator
2222

2323
```js
2424
// ./Generator.js
25-
import BaseGenerator from "@api-platform/client-generator/lib/generators/BaseGenerator";
25+
import BaseGenerator from "@api-platform/create-client/lib/generators/BaseGenerator";
2626

2727
export default class extends BaseGenerator {
2828
constructor(params) {
@@ -94,7 +94,7 @@ fn main() {
9494
Then we can use our generator:
9595

9696
```shell
97-
generate-api-platform-client https://demo.api-platform.com out/ -g "$(pwd)/Generator.js" -t "$(pwd)/template"
97+
npm init @api-platform/client https://demo.api-platform.com out/ -g "$(pwd)/Generator.js" -t "$(pwd)/template"
9898
```
9999

100100
which will produces:

0 commit comments

Comments
 (0)