chore: wire Carplace into dev and production stacks
Build & Deploy / Build & Push Docker Image (push) Successful in 2m55s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Failing after 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Failing after 40s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Failing after 42s
Test / API Integration Tests (push) Successful in 1m0s
Build & Deploy / Build & Push Docker Image (push) Successful in 2m55s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Failing after 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Failing after 40s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Failing after 42s
Test / API Integration Tests (push) Successful in 1m0s
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { mkdir, readFile, writeFile } from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { cloneStorefrontHomepageContent, type StorefrontHomepageConfig } from '@rentaldrivego/types'
|
||||
import {
|
||||
cloneCarplaceHomepageContent,
|
||||
type CarplaceHomepageConfig,
|
||||
} from '@rentaldrivego/types'
|
||||
|
||||
function resolveContentPath() {
|
||||
const cwd = process.cwd()
|
||||
@@ -12,7 +15,7 @@ function resolveContentPath() {
|
||||
const platformContentPath = resolveContentPath()
|
||||
|
||||
type PlatformContentFile = {
|
||||
storefrontHomepage?: StorefrontHomepageConfig
|
||||
carplaceHomepage?: CarplaceHomepageConfig
|
||||
}
|
||||
|
||||
async function readPlatformContentFile(): Promise<PlatformContentFile> {
|
||||
@@ -29,16 +32,16 @@ async function writePlatformContentFile(content: PlatformContentFile) {
|
||||
await writeFile(platformContentPath, JSON.stringify(content, null, 2))
|
||||
}
|
||||
|
||||
export async function getStorefrontHomepageContent() {
|
||||
export async function getCarplaceHomepageContent() {
|
||||
const content = await readPlatformContentFile()
|
||||
return content.storefrontHomepage ?? cloneStorefrontHomepageContent()
|
||||
return content.carplaceHomepage ?? cloneCarplaceHomepageContent()
|
||||
}
|
||||
|
||||
export async function saveStorefrontHomepageContent(homepage: StorefrontHomepageConfig) {
|
||||
export async function saveCarplaceHomepageContent(homepage: CarplaceHomepageConfig) {
|
||||
const content = await readPlatformContentFile()
|
||||
await writePlatformContentFile({
|
||||
...content,
|
||||
storefrontHomepage: homepage,
|
||||
carplaceHomepage: homepage,
|
||||
})
|
||||
return homepage
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user