Skip to content

Commit d86aee9

Browse files
dunglasalanpoulain
andauthored
feat: rename the package @api-platform/create-client (#337)
* feat: rename the package @api-platform/create-client * add missing occurences * Update README.md Co-authored-by: Alan Poulain <[email protected]> * Update README.md Co-authored-by: Alan Poulain <[email protected]> * some more renaming Co-authored-by: Alan Poulain <[email protected]>
1 parent 0c7708b commit d86aee9

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Node.js Build and Test
1+
name: CI
22

33
on:
44
pull_request:

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ Then, if it appears that it's a real bug, you may report it using Github by foll
2222

2323
### Installing the source version
2424

25-
To install the source version of the API Platform Client Generator in your project and contribute a patch, run the following commands:
25+
To install the source version of Create Client in your project and contribute a patch, run the following commands:
2626

2727
```console
28-
$ git clone [email protected]:api-platform/client-generator.git
29-
$ cd client-generator
28+
$ git clone [email protected]:api-platform/create-client.git
29+
$ cd create-client
3030
$ yarn install
3131
$ yarn watch
3232
```
3333

34-
You can now hack in the cloned repository of `client-generator`. If you want to test your work, a `lib/index.js` file containing your last changes will be created each time you invoke `yarn build`. You can also use `yarn watch` to make it created each time a change is performed in your code!
34+
You can now hack in the cloned repository of `create-client`. If you want to test your work, a `lib/index.js` file containing your last changes will be created each time you invoke `yarn build`. You can also use `yarn watch` to make it created each time a change is performed in your code!
3535

3636
### Testing your changes
3737

@@ -55,7 +55,7 @@ $ yarn test
5555

5656
### Matching coding standards
5757

58-
The API Platform Client Generator project is inspired by the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript).
58+
The style of the project is inspired by the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript).
5959
But don't worry, you can fix CS issues automatically using [ESLint](https://eslint.org/) tool:
6060

6161
```console

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# API Platform Client Generator
1+
# API Platform Create Client
22

3-
[![Build Status](https://travis-ci.org/api-platform/client-generator.svg?branch=master)](https://travis-ci.org/api-platform/client-generator)
4-
[![npm version](https://badge.fury.io/js/%40api-platform%2Fclient-generator.svg)](https://badge.fury.io/js/%40api-platform%2Fclient-generator)
3+
[![GitHub Actions](https://github.com/api-platform/create-client/workflows/CI/badge.svg)](https://github.com/api-platform/create-client/actions?workflow=CI)
4+
[![npm version](https://badge.fury.io/js/%40api-platform%2Fcreate-client.svg)](https://badge.fury.io/js/%40api-platform%2Fcreate-client)
55

6-
API Platform Client Generator is a generator to scaffold app with Create-Retrieve-Update-Delete features for any API exposing a [Hydra](http://www.hydra-cg.com/spec/latest/core/) or [OpenAPI](https://www.openapis.org/) documentation for:
6+
API Platform Create Client is a generator to scaffold apps with Create-Retrieve-Update-Delete features for any API exposing a [Hydra](http://www.hydra-cg.com/spec/latest/core/) or [OpenAPI](https://www.openapis.org/) documentation for:
77

88
* Next.js
99
* Nuxt
@@ -18,7 +18,7 @@ Works especially well with APIs built with the [API Platform](https://api-platfo
1818

1919
## Documentation
2020

21-
The documentation of API Platform's Client Generator can be browsed [on the official website](https://api-platform.com/docs/client-generator).
21+
The documentation of API Platform Create Client can be browsed [on the official website](https://api-platform.com/docs/create-client).
2222

2323
## Features
2424

@@ -27,27 +27,28 @@ The documentation of API Platform's Client Generator can be browsed [on the offi
2727
* Creation form
2828
* Editing form
2929
* Deletion button
30-
* Use the Hydra or OpenAPI documentations to generate the code
31-
* Generate the suitable HTML5 input type (`number`, `date`...) according to the type of the API property
30+
* Use the Hydra or OpenAPI documentation to generate the code
31+
* Generate the suitable input type (`number`, `date`...) according to the type of the API property
3232
* Display of the server-side validation errors under the related input (if using API Platform Core)
3333
* Client-side validation (`required` attributes)
3434
* The generated HTML is compatible with [Bootstrap](https://getbootstrap.com/) and includes mandatory classes
3535
* The generated HTML code is accessible to people with disabilities ([ARIA](https://www.w3.org/WAI/intro/aria) support)
36+
* Bring your own templates
3637

3738
## Usage
3839

3940
### Hydra
4041

41-
npx @api-platform/client-generator https://demo.api-platform.com/ output/ --resource Book
42+
npm init @api-platform/client https://demo.api-platform.com/ output/ --resource Book
4243

4344
### OpenAPI 3
4445

45-
npx @api-platform/client-generator https://demo.api-platform.com/docs.json output/ --resource Book --format openapi3
46+
npm init @api-platform/client https://demo.api-platform.com/docs.json output/ --resource Book --format openapi3
4647

4748
## Credits
4849

4950
Created by [Kévin Dunglas](https://dunglas.fr).
5051

5152
Sponsored by [Les-Tilleuls.coop](https://les-tilleuls.coop).
5253

53-
Commercial support available upon request.
54+
Commercial support is available upon request.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@api-platform/client-generator",
2+
"name": "@api-platform/create-client",
33
"version": "0.8.0",
44
"description": "Generate apps built with Next, Nuxt, Quasar, React, React Native, Vue or Vuetify for any API documented using Hydra or OpenAPI",
55
"files": [
@@ -11,9 +11,9 @@
1111
],
1212
"type": "module",
1313
"exports": "./lib/index.js",
14-
"repository": "api-platform/client-generator",
15-
"homepage": "https://github.com/api-platform/client-generator",
16-
"bugs": "https://github.com/api-platform/client-generator/issues",
14+
"repository": "api-platform/create-client",
15+
"homepage": "https://github.com/api-platform/create-client",
16+
"bugs": "https://github.com/api-platform/create-client/issues",
1717
"author": "Kévin Dunglas",
1818
"license": "MIT",
1919
"devDependencies": {
@@ -63,7 +63,7 @@
6363
"test-gen": "rm -rf ./tmp && yarn build && ./testgen.sh",
6464
"test-gen-openapi3": "rm -rf ./tmp && yarn build && ENTRYPOINT=https://demo.api-platform.com/docs.json FORMAT=openapi3 ./testgen.sh",
6565
"test-gen-custom": "rm -rf ./tmp && yarn build && babel src/generators/ReactGenerator.js src/generators/BaseGenerator.js -d ./tmp/gens && cp -r ./templates/react ./templates/react-common ./templates/entrypoint.js ./tmp/gens && ./lib/index.js https://demo.api-platform.com ./tmp/react-custom -g \"$(pwd)/tmp/gens/ReactGenerator.js\" -t ./tmp/gens",
66-
"test-gen-env": "rm -rf ./tmp && yarn build && API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CLIENT_GENERATOR_OUTPUT=./tmp ./lib/index.js",
66+
"test-gen-env": "rm -rf ./tmp && yarn build && API_PLATFORM_CREATE_CLIENT_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CREATE_CLIENT_OUTPUT=./tmp ./lib/index.js",
6767
"test-react-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create react-app --template typescript ./tmp/app/reactapp && yarn --cwd ./tmp/app/reactapp add react-router-dom react-hook-form && cp -R ./tmp/react/* ./tmp/app/reactapp/src && cp ./templates/react/index.tsx ./tmp/app/reactapp/src && start-server-and-test 'BROWSER=none yarn --cwd ./tmp/app/reactapp start' http://127.0.0.1:3000/books/ 'yarn playwright test'",
6868
"test-next-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create next-app --typescript ./tmp/app/next && yarn --cwd ./tmp/app/next add isomorphic-unfetch formik react-query && cp -R ./tmp/next/* ./tmp/app/next && rm ./tmp/app/next/pages/index.tsx && rm -rf ./tmp/app/next/pages/api && yarn --cwd ./tmp/app/next build && start-server-and-test 'yarn --cwd ./tmp/app/next start' http://127.0.0.1:3000/books/ 'yarn playwright test'",
6969
"test-vue-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && cd ./tmp/app && npm init -y vue@2 -- --router vue && cd ../.. && yarn --cwd ./tmp/app/vue add vuex@3 vuex-map-fields lodash && cp -R ./tmp/vue/* ./tmp/app/vue/src && cp ./templates/vue/main.js ./tmp/app/vue/src && yarn --cwd ./tmp/app/vue build && start-server-and-test 'yarn --cwd ./tmp/app/vue vite preview --host 127.0.0.1 --port 3000' http://127.0.0.1:3000/books/ 'yarn playwright test'",

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ async function main() {
6060

6161
if (
6262
2 !== program.args.length &&
63-
(!process.env.API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT ||
64-
!process.env.API_PLATFORM_CLIENT_GENERATOR_OUTPUT)
63+
(!process.env.API_PLATFORM_CREATE_CLIENT_ENTRYPOINT ||
64+
!process.env.API_PLATFORM_CREATE_CLIENT_OUTPUT)
6565
) {
6666
program.help();
6767
}
6868

6969
const options = program.opts();
7070

7171
const entrypoint =
72-
program.args[0] || process.env.API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT;
72+
program.args[0] || process.env.API_PLATFORM_CREATE_CLIENT_ENTRYPOINT;
7373
const outputDirectory =
74-
program.args[1] || process.env.API_PLATFORM_CLIENT_GENERATOR_OUTPUT;
74+
program.args[1] || process.env.API_PLATFORM_CREATE_CLIENT_OUTPUT;
7575

7676
const entrypointWithSlash = entrypoint.endsWith("/")
7777
? entrypoint

0 commit comments

Comments
 (0)