From ff707dafe4b62414cb3198cfb2e217bb961e2bab Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 22 Feb 2024 10:40:01 +1100 Subject: [PATCH] docs: :memo: update readme --- README.md | 79 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 5389512..1b3b908 100644 --- a/README.md +++ b/README.md @@ -4,62 +4,75 @@ A layer is just like a regular Nuxt project, for more information on layers see: ## Setup +Note: Ripple 2 packages are all hosted on Github Packages, any packages published to npm are either pre-release or deprecated, and should not be used! Please see the section [Access to Github Packages repos](https://ripple.sdp.vic.gov.au/design-system/develop/usage/access-to-github-packages) for instructions on how to set up a personal access token, and where to use it. + Install all dependencies: ```bash -npm install +npm i ``` ## Development The `.playground` directory should help you to develop your layer. -Running `npm run dev` will prepare and boot `.playground` directory, which imports your layer itself. - -## Publishing +Set up a `.env` file [like this one](https://github.com/dpc-sdp/ripple-framework/blob/develop/examples/nuxt-app/.example.env) under `.playground` to change the backend API, site ID and search details. -To publish, you only have to check if `files` in `package.json` are valid, then run: +To run dev mode in the `.playground` directory, which imports your layer itself: ```bash -npm publish --access public +npm run dev ``` -Once done, you will only have to run: +## Publishing -```bash -npm install --save ripple-lib-starter -``` +To publish a release, prepare all changes in the `main` branch. -Then add the dependency to into the main Nuxt apps `extends` in `nuxt.config`: +Using the Github interface, **Draft a new release**. Under **Choose a tag**, then create a new tag using semver (typically the first release will be `v0.1.0`), using **Target: main**. -```ts -defineNuxtConfig({ - extends: [ - 'ripple-lib-starter' - ] -}) -``` +Use the tag name as the release title (e.g. `v0.1.0`). -## Development Server +**Generate release notes** can automatically write a changelog of PRs from the last release. -Start the development server on http://localhost:3000 +Make sure **Set as the latest release** is ticked then **Publish release**. A Github action will then publish the package [on our org](https://github.com/orgs/dpc-sdp/packages). -```bash -npm run dev -``` +## Using the published package -## Production +Add to the site app via `package.json` e.g. -Build the production application: - -```bash -npm run build +```json +dependencies: { + ... + "@dpc-sdp/ripple-lib-starter": "v0.1.0", + ... +} ``` -Locally preview production build: +Finally, the site app will need to add this custom later in its own `nuxt.config.ts` e.g. -```bash -npm run preview +```json +export default defineNuxtConfig({ + // See https://nuxt.com/docs/getting-started/layers - please add custom layers after the //custom layers comment + extends: [ + // Core layers + '@dpc-sdp/nuxt-ripple', + '@dpc-sdp/nuxt-ripple-analytics', + '@dpc-sdp/nuxt-ripple-preview', + + // Custom layers + '@dpc-sdp/ripple-lib-starter', + + // Content types + '@dpc-sdp/ripple-tide-event', + '@dpc-sdp/ripple-tide-topic', + '@dpc-sdp/ripple-tide-landing-page', + '@dpc-sdp/ripple-tide-grant', + '@dpc-sdp/ripple-tide-publication', + '@dpc-sdp/ripple-tide-media', + '@dpc-sdp/ripple-tide-news', + '@dpc-sdp/ripple-tide-search', + + // Local layers + ] +}) ``` - -Checkout the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.