Skip to content

Commit 894e702

Browse files
JivusAyrusfiam
andauthored
refactor: replace wunderctl init with npx create-wundergraph-app (#337)
* refactor: replace wunderctl init with npx create-wundergraph-app * refactor: modify getting started page * refactor: replace old getting started command with npx create-wundergraph-app * chore: remove templates * chore: remove copy templates to cli script * fix: update Makefile * fix: modify script command * chore: remove init command from wunderctl * feat: add create-wundergraph-app to navigation and tags * feat: add docs for create-wundergraph-app * fix: replace wunderctl init with create-wundergraph-app * fix: modify the error message Co-authored-by: Alberto García Hierro <alberto@garciahierro.com>
1 parent 6307b72 commit 894e702

71 files changed

Lines changed: 59 additions & 1685 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Makefile‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ test-ts:
3131

3232
test: test-go test-ts
3333

34-
format-templates:
35-
pnpx prettier --write pkg/templates/assets/templates --ignore-unknown
36-
3734
golang-ci:
3835
golangci-lint run
3936

@@ -65,8 +62,4 @@ run:
6562
install:
6663
cd cmd/wunderctl && go install
6764

68-
update-examples:
69-
cd examples && rm -rf simple && mkdir simple && cd simple && wunderctl init
70-
71-
7265
.PHONY: codegen build run tag install-proto format-templates dev all check-local docs wunderctl build-docs bootstrap-minio

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ have a look at these [annotated example snippets](docs/at-a-glance.md).
119119
This section provides a high-level overview of how WunderGraph works and its most consumer centric components. For a
120120
more thorough introduction, visit the [architecture](./docs/architecture) documentation.
121121

122-
After initializing your first WunderGraph application with `npx @wundergraph/wunderctl init`, you have a NPM package and
122+
After initializing your first WunderGraph application with `npx create-wundergraph-app <project-name> -E simple`, you have a NPM package and
123123
a `.wundergraph` folder. This folder contains the following files:
124124

125125
- `wundergraph.config.ts` - The primary config file for your WunderGraph application. Add data-sources and more.

‎cli/commands/init.go‎

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

‎docs-website/config/navigation.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,10 @@ const navigation = [
540540
title: 'Overview',
541541
href: '/docs/components-of-wundergraph',
542542
},
543+
{
544+
title: 'create-wundergraph-app',
545+
href: '/docs/components-of-wundergraph/create-wundergraph-app',
546+
},
543547
{
544548
title: 'wunderctl',
545549
href: '/docs/components-of-wundergraph/wunderctl',

‎docs-website/config/tags.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const tags = {
55
'WunderGraph SDK': '/docs/components-of-wundergraph/wundergraph-sdk',
66
'TypeScript SDK': '/docs/components-of-wundergraph/wundergraph-sdk',
77
'WunderGraph CLI': '/docs/components-of-wundergraph/wunderctl',
8+
'create-wundergraph-app':
9+
'/docs/components-of-wundergraph/create-wundergraph-app',
810
CLI: '/docs/components-of-wundergraph/wunderctl',
911
wunderctl: '/docs/components-of-wundergraph/wunderctl',
1012
'_join field': '/docs/core-concepts/_join-field',

‎docs-website/src/components/Hero.jsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import blurIndigoImage from '@/images/blur-indigo.png'
1010
import { CodeBlock } from './CodeBlock'
1111
const codeLanguage = 'shell'
1212
const code = `# Create a new project
13-
npx -y @wundergraph/wunderctl init \\\n\t--template nextjs-starter
13+
npx create-wundergraph-app my-project -E nextjs
14+
15+
# Move the the project directory
16+
cd my-project
1417
1518
# Install dependencies and start
1619
npm i && npm start`
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: create-wundergraph-app
3+
pageTitle: WunderGraph - create-wundergraph-app
4+
description:
5+
---
6+
7+
The cmd `npx create-wundergraph-app <project-name>` is used to initialize a new WunderGraph project.
8+
9+
## WunderGraph & Next.js
10+
11+
```shell
12+
npx create-wundergraph-app <project-name> -E nextjs
13+
```
14+
15+
### WunderGraph & Next.js & PostgreSQL
16+
17+
```shell
18+
npx create-wundergraph-app <project-name> -E nextjs-postgres-prisma
19+
```
20+
21+
### Publish your API to WunderHub
22+
23+
Use this template to easily publish an API to WunderHub.
24+
25+
```shell
26+
npx create-wundergraph-app <project-name> -E publish-install-api
27+
```

‎docs-website/src/pages/docs/components-of-wundergraph/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ isIndexFile: true
1010
Here's an overview of the components of WunderGraph.
1111

1212
{% quick-links %}
13+
{% quick-link title="create-wundergraph-app" icon="core" href="/docs/components-of-wundergraph/create-wundergraph-app" description="" /%}
1314
{% quick-link title="wunderctl" icon="core" href="/docs/components-of-wundergraph/wunderctl" description="" /%}
1415
{% quick-link title="WunderGraph SDK" icon="core" href="/docs/components-of-wundergraph/wundergraph-sdk" description="" /%}
1516
{% quick-link title="WunderNode / WunderGraph Server" icon="core" href="/docs/components-of-wundergraph/wundernode-wundergraph-server" description="" /%}

‎docs-website/src/pages/docs/components-of-wundergraph/wunderctl.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ description:
55
---
66

77
The WunderGraph cli, also called `wunderctl` is the main entry point to use WunderGraph.
8-
You can use it to start new projects, e.g. using `wunderctl init`,
9-
you can generate code with `wunderctl generate`,
8+
You can generate code with `wunderctl generate`,
109
and you can use the WunderGraph Hub to manage API dependencies via `wunderctl add` or `wunderctl publish`.
1110

1211
The cli is written in Go, and it's available [in our monorepo](https://github.com/wundergraph/wundergraph).

‎docs-website/src/pages/docs/features/configuration-as-code.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ creates an Application from it and then builds your WunderGraph configuration in
7676

7777
## Getting Started
7878

79-
The easiest way to get started is using our CLI, wunderctl.
79+
The easiest way to get started is using our 'create-wundergraph-app' npx command.
8080

8181
To start a new project use the following command,
8282
is scaffolds all required files:
8383

8484
```
85-
wunderctl init
85+
npx create-wundergraph-app <project-name>
8686
```
8787

8888
More documentation on the configuration wundergraph.config.ts reference.

0 commit comments

Comments
 (0)