From 8a52627847f370cf1a799b53c925a648efe30b45 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 15 May 2024 16:38:02 +1000 Subject: [PATCH] feat(@dpc-sdp/ripple-sdp-core): :sparkles: combine tide layers into sdp-core --- .vscode/settings.json | 3 +- examples/nuxt-app/nuxt.config.ts | 15 +- examples/nuxt-app/package.json | 12 +- .../init/_templates/layer/latest/nvmrc.t | 2 +- .../_templates/layer/latest/package.json.t | 11 +- .../layer/latest/playground/nuxt.config.ts.t | 11 +- .../_templates/site/latest/app.config.ts.t | 3 +- .../_templates/site/latest/nuxt.config.ts.t | 11 +- .../init/_templates/site/latest/nvmrc.t | 2 +- .../_templates/site/latest/package.json.t | 15 +- .../nuxt-ripple/components/TideBaseLayout.vue | 3 +- .../nuxt-ripple/components/TideHeroHeader.vue | 21 +- .../components/TideSidebarContactUs.vue | 2 +- .../components/TideSidebarRelatedLinks.vue | 2 +- packages/ripple-sdp-core/CHANGELOG.md | 0 packages/ripple-sdp-core/LICENSE | 201 ++++++++++++++++++ packages/ripple-sdp-core/README.md | 24 +++ .../components/TideAlerts.vue | 5 +- .../components/TideBreadcrumbs.vue | 3 +- .../components/TideContentPage.vue | 7 +- .../components/TideContentRating.vue | 6 +- .../components/TideLoadingIndicator.vue | 7 +- .../components/TideSidebarSiteSectionNav.vue | 2 +- .../components/TideSidebarSocialShare.vue | 4 +- .../components/TideUpdatedDate.vue | 2 +- packages/ripple-sdp-core/nuxt.config.ts | 17 ++ packages/ripple-sdp-core/package.json | 28 +++ packages/ripple-sdp-core/tsconfig.json | 3 + packages/ripple-sdp-core/types.ts | 49 +++++ packages/ripple-ui-core/src/index.ts | 2 + pnpm-lock.yaml | 96 +++++---- tsconfig.json | 3 + 32 files changed, 430 insertions(+), 142 deletions(-) create mode 100644 packages/ripple-sdp-core/CHANGELOG.md create mode 100644 packages/ripple-sdp-core/LICENSE create mode 100644 packages/ripple-sdp-core/README.md rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideAlerts.vue (92%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideBreadcrumbs.vue (90%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideContentPage.vue (90%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideContentRating.vue (95%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideLoadingIndicator.vue (90%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideSidebarSiteSectionNav.vue (95%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideSidebarSocialShare.vue (95%) rename packages/{nuxt-ripple => ripple-sdp-core}/components/TideUpdatedDate.vue (93%) create mode 100644 packages/ripple-sdp-core/nuxt.config.ts create mode 100644 packages/ripple-sdp-core/package.json create mode 100644 packages/ripple-sdp-core/tsconfig.json create mode 100644 packages/ripple-sdp-core/types.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index c04dcdc5e4..f7fe483b52 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -31,7 +31,8 @@ "eslint-config-ripple", "@dpc-sdp/ripple-ui-maps", "@dpc-sdp/ripple-tide-webform", - "ripple-storybook" + "ripple-storybook", + "@dpc-sdp/ripple-sdp-core" ], "cSpell.words": [ "colour", diff --git a/examples/nuxt-app/nuxt.config.ts b/examples/nuxt-app/nuxt.config.ts index 16c703c7e2..482a02fed9 100644 --- a/examples/nuxt-app/nuxt.config.ts +++ b/examples/nuxt-app/nuxt.config.ts @@ -15,20 +15,7 @@ export default defineNuxtConfig({ } }, // See https://nuxt.com/docs/getting-started/layers - each content type is a added as a Nuxt layer - extends: [ - '@dpc-sdp/nuxt-ripple', - '@dpc-sdp/nuxt-ripple-analytics', - '@dpc-sdp/nuxt-ripple-preview', - '@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', - '@dpc-sdp/ripple-tide-webform' - ], + extends: ['@dpc-sdp/nuxt-ripple', '@dpc-sdp/ripple-sdp-core'], // Nuxt devtools sourcemap: true, devtools: { diff --git a/examples/nuxt-app/package.json b/examples/nuxt-app/package.json index 800b382e96..550b00de09 100644 --- a/examples/nuxt-app/package.json +++ b/examples/nuxt-app/package.json @@ -22,18 +22,8 @@ }, "dependencies": { "@dpc-sdp/nuxt-ripple": "workspace:*", - "@dpc-sdp/nuxt-ripple-analytics": "workspace:*", "@dpc-sdp/nuxt-ripple-cli": "workspace:*", - "@dpc-sdp/nuxt-ripple-preview": "workspace:*", - "@dpc-sdp/ripple-tide-event": "workspace:*", - "@dpc-sdp/ripple-tide-grant": "workspace:*", - "@dpc-sdp/ripple-tide-landing-page": "workspace:*", - "@dpc-sdp/ripple-tide-media": "workspace:*", - "@dpc-sdp/ripple-tide-news": "workspace:*", - "@dpc-sdp/ripple-tide-publication": "workspace:*", - "@dpc-sdp/ripple-tide-search": "workspace:*", - "@dpc-sdp/ripple-tide-topic": "workspace:*", - "@dpc-sdp/ripple-tide-webform": "workspace:*", + "@dpc-sdp/ripple-sdp-core": "workspace:*", "@dpc-sdp/ripple-ui-maps": "workspace:*" }, "devDependencies": { diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/nvmrc.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/nvmrc.t index 1a9be571da..707571c832 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/nvmrc.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/nvmrc.t @@ -1,4 +1,4 @@ --- to: .nvmrc --- -lts/hydrogen +lts/iron diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/package.json.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/package.json.t index e0f4c5eff2..82233e3c0e 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/package.json.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/package.json.t @@ -33,18 +33,9 @@ to: package.json "@babel/preset-typescript": "^7.21.5", "@dpc-sdp/eslint-config-ripple": "<%= rplVersion %>", "@dpc-sdp/nuxt-ripple": "<%= rplVersion %>", - "@dpc-sdp/nuxt-ripple-analytics": "<%= rplVersion %>", - "@dpc-sdp/nuxt-ripple-preview": "<%= rplVersion %>", + "@dpc-sdp/ripple-sdp-core": "<%= rplVersion %>", "@dpc-sdp/ripple-test-utils": "<%= rplVersion %>", "@dpc-sdp/ripple-tide-api": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-event": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-topic": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-grant": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-landing-page": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-media": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-news": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-publication": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-search": "<%= rplVersion %>", "cypress": "^13.6.6", "eslint": "^8.28.0", "jest-environment-jsdom": "^29.5.0", diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/playground/nuxt.config.ts.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/playground/nuxt.config.ts.t index 77ead54f3e..fd474b5a92 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/playground/nuxt.config.ts.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/layer/latest/playground/nuxt.config.ts.t @@ -21,16 +21,7 @@ export default defineNuxtConfig({ // See https://nuxt.com/docs/getting-started/layers - each content type is added as a Nuxt layer extends: [ '@dpc-sdp/nuxt-ripple', - '@dpc-sdp/nuxt-ripple-analytics', - '@dpc-sdp/nuxt-ripple-preview', - '@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', + '@dpc-sdp/ripple-sdp-core', '..' ] }) diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/app.config.ts.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/app.config.ts.t index 0099f1c762..8f4cbfceed 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/app.config.ts.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/app.config.ts.t @@ -2,6 +2,7 @@ to: app.config.ts --- import pkg from './package.json' +import { getDpcPkgs } from '@dpc-sdp/ripple-tide-api/utils' import { defineAppConfig } from '#imports' export default defineAppConfig({ @@ -10,7 +11,7 @@ export default defineAppConfig({ version: pkg.version }, ripple: { - version: pkg.dependencies['@dpc-sdp/nuxt-ripple'], + packages: getDpcPkgs({ ...pkg.dependencies, ...pkg.devDependencies }), featureFlags: { contentCollectionSearchConnector: 'elasticsearch' }, diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nuxt.config.ts.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nuxt.config.ts.t index 6a343aa425..346c342add 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nuxt.config.ts.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nuxt.config.ts.t @@ -6,16 +6,7 @@ export default defineNuxtConfig({ extends: [ // Core layers '@dpc-sdp/nuxt-ripple', - '@dpc-sdp/nuxt-ripple-analytics', - '@dpc-sdp/nuxt-ripple-preview', - '@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' + '@dpc-sdp/ripple-sdp-core' // Custom layers ] }) diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nvmrc.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nvmrc.t index 1a9be571da..707571c832 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nvmrc.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/nvmrc.t @@ -1,4 +1,4 @@ --- to: .nvmrc --- -lts/hydrogen +lts/iron diff --git a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/package.json.t b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/package.json.t index b91d338b4c..575a3c5076 100644 --- a/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/package.json.t +++ b/packages/nuxt-ripple-cli/src/commands/init/_templates/site/latest/package.json.t @@ -16,16 +16,7 @@ to: package.json }, "dependencies": { "@dpc-sdp/nuxt-ripple": "<%= rplVersion %>", - "@dpc-sdp/nuxt-ripple-analytics": "<%= rplVersion %>", - "@dpc-sdp/nuxt-ripple-preview": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-event": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-grant": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-landing-page": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-media": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-news": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-publication": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-search": "<%= rplVersion %>", - "@dpc-sdp/ripple-tide-topic": "<%= rplVersion %>" + "@dpc-sdp/ripple-sdp-core": "<%= rplVersion %>" }, "devDependencies": { "@dpc-sdp/eslint-config-ripple": "<%= rplVersion %>", @@ -33,7 +24,7 @@ to: package.json "eslint": "^8.28.0" }, "engines": { - "node": "^16.17.0 || ^18.12.1", - "npm": "^9.5.1" + "node": "^18.15.0 || ^20.9.0", + "npm": "^10.2.4" } } diff --git a/packages/nuxt-ripple/components/TideBaseLayout.vue b/packages/nuxt-ripple/components/TideBaseLayout.vue index 127e820deb..aaf3ad5d0d 100644 --- a/packages/nuxt-ripple/components/TideBaseLayout.vue +++ b/packages/nuxt-ripple/components/TideBaseLayout.vue @@ -97,8 +97,7 @@ diff --git a/packages/nuxt-ripple/components/TideContentRating.vue b/packages/ripple-sdp-core/components/TideContentRating.vue similarity index 95% rename from packages/nuxt-ripple/components/TideContentRating.vue rename to packages/ripple-sdp-core/components/TideContentRating.vue index daa128b74c..091faa1731 100644 --- a/packages/nuxt-ripple/components/TideContentRating.vue +++ b/packages/ripple-sdp-core/components/TideContentRating.vue @@ -1,5 +1,5 @@