Skip to content

Commit

Permalink
feat(@dpc-sdp/nuxt-ripple-cli): ✨ add ability to set .env values from…
Browse files Browse the repository at this point in the history
… cli
  • Loading branch information
dylankelly committed Jul 18, 2023
1 parent b7a5992 commit 98bc213
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
to: .env
---
# The values in this file are FOR DEVELOPMENT ONLY - none of these values are read in the production build!
# If your site needs a new environment variable please log an issue with SDP support so it can be added via the config management database

# Tide Drupal CMS URL - change this to the project CMS as required
NUXT_PUBLIC_TIDE_BASE_URL=https://develop.content.reference.sdp.vic.gov.au/
NUXT_PUBLIC_TIDE_BASE_URL=<%= tideBaseUrl %>
# Tide site taxonomy id - change this to the project site ID as required
NUXT_PUBLIC_TIDE_SITE=8888
NUXT_PUBLIC_TIDE_SITE=<%= tideSite %>
# SDP common GTM container - this should be common to all SDP sites utilising WoVG analytics
NUXT_PUBLIC_TIDE_ANALYTICS_GTM=G-J386JGDPXW
# Production site URL (used for OAuth and logging) - this should be the production url eg: https://www.YOURPROJECT.vic.gov.au/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@
to: nuxt.config.ts
---
export default defineNuxtConfig({
// These can be overridden via environment variables eg: NUXT_PUBLIC_TIDE_BASE_URL
// Check the layer readme files for the available runtimeConfig options
// See https://nuxt.com/docs/api/configuration/nuxt-config#runtimeconfig for more info
runtimeConfig: {
public: {
siteUrl: '',
apiUrl: '',
tide: {
baseUrl: '',
site: '',
menuEndpoint: ''
}
}
},
// See https://nuxt.com/docs/getting-started/layers - each content type is added as a Nuxt layer
// See https://nuxt.com/docs/getting-started/layers - please add custom layers after the //custom layers comment
extends: [
// Core layers
'@dpc-sdp/nuxt-ripple',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
to: .nvmrc
---

lts/gallium
lts/hydrogen
6 changes: 6 additions & 0 deletions packages/nuxt-ripple-cli/src/commands/init/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export default function rplInitCommand() {
`The ripple version to use: eg: 2.1.0, default is most up to date version`,
LIB_VERSION
)
.option('--tideSite [tideSite]', `Tide Site ID, defaults to 4`, '4')
.option(
'--tideBaseUrl [tideBaseUrl]',
`Tide base URL for .env. Defaults to reference site backend`,
'https://develop.content.reference.sdp.vic.gov.au/'
)
.action((template, directory, options) => {
init(template, directory, options)
console.info(`
Expand Down

0 comments on commit 98bc213

Please sign in to comment.