-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,17 @@ | ||
# sv | ||
# Carenage dashboard | ||
|
||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). | ||
This is the front-end interface for Carenage. It is a [SvelteKit](https://svelte.dev) project, thought as a dashboard representing metadata and environmental impact metrics for a given project, a CI pipeline, a CI run for a job, etc. | ||
|
||
## Creating a project | ||
## Development | ||
|
||
If you're seeing this, you've probably already done this step. Congrats! | ||
### Setup | ||
|
||
```bash | ||
# create a new project in the current directory | ||
npx sv create | ||
With `npm` installed, you can do `make install` to setup needed dependencies for the project. Then, with `make run_dev`, this will launch the server for | ||
the dashboard. | ||
|
||
# create a new project in my-app | ||
npx sv create my-app | ||
``` | ||
### Testing | ||
|
||
## Developing | ||
Unit and integration tests are executed with `make component_test`, end-to-end testing with `make e2e_test`. | ||
|
||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
|
||
```bash | ||
npm run dev | ||
|
||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
|
||
## Building | ||
|
||
To create a production version of your app: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
You can preview the production build with `npm run preview`. | ||
|
||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. | ||
For integration testing and mocking responses from external services like `Boagent`, [msw](https://mswjs.io/) is used. You can add handlers for specific | ||
URLs in `src/mocks/handlers.ts`. In a development environment, those will be able to handle fetching valid URLs by the server code, and render data on the adequate pages. Handlers work either in the browser and in a Node environment. |