Skip to content

Commit

Permalink
Merge branch 'main' into event-broker-cap
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Kunz committed Sep 20, 2024
2 parents 4d8d872 + e6822a0 commit 61778ad
Show file tree
Hide file tree
Showing 29 changed files with 477 additions and 670 deletions.
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# General content
* @smahati
## * @renejeglinsky
* @renejeglinsky

# Infra
.github/ @chgeo @swaldmann
.vitepress/ @chgeo @swaldmann

# allow dependencies updates through renovate w/o code owners
package.json
package-lock.json
package-lock.json
2 changes: 2 additions & 0 deletions .github/workflows/PR-SAP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
working-directory: docs
- run: npm test
working-directory: docs
- run: npm run lint
working-directory: docs
- run: npm run docs:build
working-directory: docs
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ jobs:
- run: npm ci
- run: npm test
- run: npm run docs:build
- run: npm run lint
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run docs:build
env:
GH_BASE: /
Expand Down
15 changes: 12 additions & 3 deletions .vitepress/lib/md-typed-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { execSync } from 'node:child_process'
import { dirname, join, relative, resolve } from 'node:path'
import { existsSync } from 'node:fs'

type mdItEnv = { frontmatter: Record<string, any>, path: string, realPath: string }
type mdItEnv = { frontmatter: Record<string, any>, path: string, realPath?: string }
const modelOut = '@cds-models'

/**
Expand All @@ -30,15 +30,24 @@ export function install(md: MarkdownRenderer) {

runTyper(srcDir, modelOut)

const resolvedPath = resolve(mdDir, modelPath, modelOut, '*')
tokens[idx].content = tokens[idx].content.replaceAll(`%typedModels:${modelKey}:resolved%`, resolvedPath)
const resPath = resolvedImportPath(srcDir, modelOut)
// console.log(`📚 ${modelPath} -> ${resPath}`)
tokens[idx].content = tokens[idx].content.replaceAll(`%typedModels:${modelKey}:resolved%`, resPath)
}
}

return fence!(tokens, idx, options, env, ...args)
}
}

function resolvedImportPath(srcDir: string, modelOut: string) {
// make resolved path relative - tsc seems to have problems with absolute Windows paths (C:\...)
let resolvedPath = relative(process.cwd(), srcDir)
// also make it a local import path, starting with ./ and replacing Windows \
resolvedPath = join(resolvedPath, modelOut, '*').replace(/\\/g, '/')
return resolvedPath.startsWith('.') ? resolvedPath : './'+resolvedPath
}

function runTyper(srcDir:string, out:string) {
const outPath = resolve(srcDir, out)
// If target dir exists, stop here. Delta compilation is done through cds-typer ion VS Code.
Expand Down
8 changes: 4 additions & 4 deletions .vitepress/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import path from 'node:path'
import fs from 'node:fs'

import rulesSidebar from '../tools/cds-lint/sidebar.js'
Expand All @@ -13,7 +12,7 @@ const dynamicItems = (item) => {
/**
* Construct sidebar from markdown
*/
export function sidebar (file = 'menu.md', filter=(_)=>true) {
export function sidebar (file = 'menu.md', filter=()=>true) {
const source = file
const markdown = fs.readFileSync(source,'utf8')
const sidebar = []
Expand All @@ -26,13 +25,13 @@ export function sidebar (file = 'menu.md', filter=(_)=>true) {
let [, text, link ] = /^-\s*\[(.*)\]\((.*)\)/.exec(line) || /^-\s*(.*)/.exec(line) || []
if (text && filter(link)) section.items.push (item = _item({ link, text }))
else {
let [, text, link ] = /^ -\s*\[(.*)\]\((.*)\)/.exec(line) || /^ -\s*(.*)/.exec(line) || []
let [, text, link ] = /^ {2}-\s*\[(.*)\]\((.*)\)/.exec(line) || /^ {2}-\s*(.*)/.exec(line) || []
if (text && filter(link)) {
(item.items ??= []).push (subitem = _item({ link, text }))
item.collapsed = true
}
else {
let [, text, link ] = /^ -\s*\[(.*)\]\((.*)\)/.exec(line) || /^ -\s*(.*)/.exec(line) || []
let [, text, link ] = /^ {4}-\s*\[(.*)\]\((.*)\)/.exec(line) || /^ {4}-\s*(.*)/.exec(line) || []
if (text && filter(link)) {
(subitem.items ??= []).push (_item({ link, text }))
subitem.collapsed = true
Expand Down Expand Up @@ -63,5 +62,6 @@ export function nav4(sidebar) {

if (process.argv[1] === import.meta.url.slice(7)) {
let {inspect} = await import ('node:util')
// eslint-disable-next-line no-console
console.log(inspect(sidebar('menu.md'),{depth:11,colors:true}))
}
2 changes: 1 addition & 1 deletion .vitepress/theme/components/NotFound.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import { useRoute, useData, withBase } from 'vitepress'
import { onMounted, ref } from 'vue'
const { frontmatter, site } = useData()
const { site } = useData()
const route = useRoute()
const base = site.value.base
Expand Down
10 changes: 4 additions & 6 deletions .vitepress/theme/components/NotebookHint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@

<script setup>
import { onMounted, computed, ref } from 'vue'
import { useData, useRoute } from 'vitepress'
import { computed } from 'vue'
import { useData } from 'vitepress'
const { frontmatter, base, page, site } = useData()
const { path } = useRoute()
const { frontmatter, site } = useData()
const supportsNotebook = computed(() => !!frontmatter.value['notebook'])
const isExternal = import.meta.env.VITE_CAPIRE_ENV === 'external'
function linkNotebook($event) {
return typeof localStorage !== 'undefined' ? useNotebook($event) : () => {}
}
function useNotebook(event) {
function getNotebook(event) {
function getNotebook() {
const baseUrl = new URL(window.location);
const urlParams = new URLSearchParams(window.location.search)
const implVariant = urlParams.get('impl-variant')
Expand Down
6 changes: 3 additions & 3 deletions .vitepress/theme/components/implvariants/ImplVariants.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function scrollTo(id) {
function currentCheckState() {
const url = new URL(window.location)
let variant = url.searchParams.get('impl-variant')
if (url.searchParams.has('impl-variant'))
return url.searchParams.get('impl-variant') === 'java'
return localStorage.getItem('impl-variant') === 'java'
Expand Down Expand Up @@ -87,7 +86,8 @@ transition: none !important;
cb()
// @ts-expect-error keep unused declaration, used to force the browser to redraw
// keep unused declaration, used to force the browser to redraw
// eslint-disable-next-line no-unused-vars
const _ = window.getComputedStyle(css).opacity
document.head.removeChild(css)
}
Expand All @@ -100,7 +100,7 @@ watchEffect(() => {
}, 20)
})
function toggleContent(variant, initial) {
function toggleContent(variant) {
const htmlClassList = document.documentElement.classList
knownImplVariants.forEach(v => htmlClassList.remove(v))
htmlClassList.add(variant)
Expand Down
19 changes: 16 additions & 3 deletions about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,22 @@ Following is an excerpt of generic features provided:
- [Temporal Data](../guides/temporal-data)
- [Verticalization & Extensibility](../guides/extensibility/)

<br>

[See also the Features Overview](./features){.learn-more}
**CAP-level Service Integrations ('Calesi')**

- [Authentication → SAP Identity Services](../plugins/#security-ams)
- [Open Telementry → SAP Cloud Logging, Dynatrace, ...](../plugins/#telemetry)
- [Attachments → SAP Object Store](../plugins/#attachments)
- [Attachments → SAP Document Management Service](../plugins/#@cap-js/sdm)
- [Messaging → SAP Event Broker](../plugins/#event-broker)
- [Messaging → Kafka](../plugins/#apache-kafka)
- [Change Tracking](../plugins/#change-tracking)
- [Notifications](../plugins/#notifications)
- [Audit Logging](../plugins/#audit-logging)
- [Personal Data Management](../guides/data-privacy/)

[Find more in the **CAP Plugins** page](../plugins/){.learn-more}

[See also the **Features Overview**](./features){.learn-more}



Expand Down
63 changes: 0 additions & 63 deletions assets/concepts/_snippets/cds.cds

This file was deleted.

13 changes: 0 additions & 13 deletions assets/concepts/_snippets/http.groovy

This file was deleted.

37 changes: 0 additions & 37 deletions assets/concepts/_snippets/javascript.js

This file was deleted.

26 changes: 26 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import cds from '@sap/cds/eslint.config.mjs'
import vue from 'eslint-plugin-vue'

export default [
{
ignores: [
'**/.vitepress/dist/**',
'**/.vitepress/cache/**',
'**/.github/**'
],
},
...cds.recommended,
...vue.configs['flat/essential'],
{
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: '@typescript-eslint/parser'
},
},
rules: {
'vue/multi-word-component-names': 0,
'vue/no-v-text-v-html-on-component': 0
}
}
]
1 change: 1 addition & 0 deletions get-started/in-a-nutshell.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ synopsis: >
notebook: true
status: released
uacp: This page is linked from the Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/29c25e504fdb4752b0383d3c407f52a6.html
redirect_from: get-started/
impl-variants: true
---

Expand Down
23 changes: 0 additions & 23 deletions guides/assets/actions-functions/requests.http

This file was deleted.

Loading

0 comments on commit 61778ad

Please sign in to comment.