Skip to content

docs(cli-ui): add more notes for local development #2281

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 5 commits into from
Aug 22, 2018

Conversation

Kocal
Copy link
Contributor

@Kocal Kocal commented Aug 19, 2018

This should improve actual README with more user-friendly notes for starting local development and explaining how to run tests in local aswell.

@Kocal Kocal changed the title docs(cli-ui): add notes for local development docs(cli-ui): add more notes for local development Aug 19, 2018
@yyx990803 yyx990803 requested a review from Akryum August 20, 2018 15:38
Then you should start a local Apollo server:

```
yarn run apollo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be run in the cli-ui folder (not cli-ui-addon-webpack).

Copy link
Contributor Author

@Kocal Kocal Aug 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though cd - in the previous code block (like it's done in https://github.com/vuejs/vue-cli/blob/dev/.github/CONTRIBUTING.md) was enough. 🤔

Anyway I'm gonna change it to be more clear

cd -
```

Then you should start a local Apollo server:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start the ui server (based on Apollo)

yarn run apollo
```

And then in another terminal, you should serve cli-ui:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should serve the ui web app

Just after, you should build `@vue/cli-ui-addon-webpack` by running:
```bash
cd ../cli-ui-addon-webpack
yarn build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead: run yarn serve in a 3rd terminal.

Copy link
Contributor Author

@Kocal Kocal Aug 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, I think I will revert to yarn build. Using yarn serve give me this error during g4-tasks spec:

Error: Cannot find module '@vue/cli-ui-addon-webpack/dist'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.resolve (internal/modules/cjs/helpers.js:18:19)
    at serve (/home/kocal/Dev/vue-cli/packages/@vue/cli-ui/apollo-server/connectors/client-addons.js:56:34)
    at Layer.handle [as handle_request] (/home/kocal/Dev/vue-cli/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/kocal/Dev/vue-cli/node_modules/express/lib/router/index.js:317:13)
    at /home/kocal/Dev/vue-cli/node_modules/express/lib/router/index.js:284:7
    at param (/home/kocal/Dev/vue-cli/node_modules/express/lib/router/index.js:354:14)
    at param (/home/kocal/Dev/vue-cli/node_modules/express/lib/router/index.js:365:14)
    at param (/home/kocal/Dev/vue-cli/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/home/kocal/Dev/vue-cli/node_modules/express/lib/router/index.js:410:3)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the tests you need to build the webpack addon at least once.

Copy link
Contributor Author

@Kocal Kocal Aug 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what's the point for using yarn serve since it doesn't output anything in dist folder?
Or am I missing something? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's serving the hot-reloaded webpack dashboard components on localhost which are then loaded in the UI when run in dev mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

yarn run test:e2e
```

Then in another terminal:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn run test:e2e should be enough. It both starts the apollo server and the vue-cli e2e service (yarn run test:e2e:dev).

Copy link
Contributor Author

@Kocal Kocal Aug 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems not.

When running yarn run test:e2e alone, it just starts an Apollo server and waits (and nothing happens).
I have to run both command yarn run test:e2e and yarn run test:e2e:dev in order to run tests (and make them work).

Maybe this is a bug?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure http://localhost:4040 works. It should start test:e2e:dev script as soon as http://localhost:4040 responds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it works, it show me a GraphQL Playground webapp.

This is my output:

➜  cli-ui git:(chore/docs-cli-ui) yarn run test:e2e                  
yarn run v1.7.0
$ yarn run test:clear && start-server-and-test apollo:run:test http://localhost:4040 test:e2e:dev
$ rimraf ../../test/cli-ui-test && rimraf ./live-test
starting server using command "npm run apollo:run:test"
and when url "http://localhost:4040" is responding
running tests using command "test:e2e:dev"

> @vue/cli-ui@3.0.1 apollo:run:test /home/kocal/Dev/vue-cli/packages/@vue/cli-ui
> cross-env VUE_CLI_UI_TEST=true VUE_APP_GRAPHQL_PORT=4040 VUE_APP_CLI_UI_URL=ws://localhost:4040/graphql VUE_CLI_IPC=vue-cli-test vue-cli-service apollo:watch

$ cross-env VUE_CLI_DEBUG=true VUE_CLI_IPC=vue-cli-dev vue-cli-service apollo:run --delay
✔️  GraphQL Server is running on http://localhost:4040/graphql

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there is something strange here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna open a new issue and apply your changes

@Kocal Kocal force-pushed the chore/docs-cli-ui branch from 3b4ca4e to 50f6267 Compare August 21, 2018 14:58
@Akryum Akryum merged commit a115151 into vuejs:dev Aug 22, 2018
@Kocal Kocal deleted the chore/docs-cli-ui branch January 23, 2019 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants