Skip to content

Commit d3f6bfe

Browse files
renejeglinskypaulchen5swaldmanngithub-actions[bot]daogrady
authored
August Release (#2078)
Co-authored-by: Paulchen <lukas.23022005@gmail.com> Co-authored-by: Steffen Waldmann <steffen.waldmann@sap.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Daniel O'Grady <103028279+daogrady@users.noreply.github.com> Co-authored-by: Christian Georgi <chgeo@users.noreply.github.com> Co-authored-by: Christian Georgi <christian.georgi@sap.com> Co-authored-by: Mahati Shankar <m.shankar@sap.com> Co-authored-by: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com> Co-authored-by: Mahati Shankar <93712176+smahati@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Matthias Schur <107557548+MattSchur@users.noreply.github.com> Co-authored-by: chgeo <7470719+chgeo@users.noreply.github.com> Co-authored-by: Olena <etimryaka@gmail.com> Co-authored-by: D070615 <olena.timrova@sap.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Robin Kuck <kuck.robin@gmail.com> Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com> Co-authored-by: Vladimir <niemda@me.com> Co-authored-by: mariayord <mariya.yordanova@sap.com> Co-authored-by: N2oB6n-SAP <109298321+N2oB6n-SAP@users.noreply.github.com> Co-authored-by: Johannes Vogt <j.vogt@sap.com> Co-authored-by: Marc Becker <marc.becker@sap.com> Co-authored-by: Adrian Görler <adrian.goerler@sap.com> Co-authored-by: Daniel Hutzel <daniel.hutzel@sap.com> Co-authored-by: BraunMatthias <59841349+BraunMatthias@users.noreply.github.com> Co-authored-by: matthia.braun@sap.com <matthias@W-5CG3323MK3> Co-authored-by: DJ Adams <dj.adams@sap.com> Co-authored-by: Lisa Julia Nebel <lisajuliafog@yahoo.de> Co-authored-by: Steffen Weinstock <79531202+stewsk@users.noreply.github.com> Co-authored-by: Tim Schulze-Hartung <108271660+tim-sh@users.noreply.github.com> Co-authored-by: Daniel O'Grady <daniel.o-grady@sap.com> Co-authored-by: ecklie <52252271+ecklie@users.noreply.github.com> Co-authored-by: D050513 <sebastian.van.syckel@sap.com> Co-authored-by: David H Lam <david.lam@sap.com>
2 parents 829bc91 + a0b9770 commit d3f6bfe

102 files changed

Lines changed: 2063 additions & 963 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This files defines code ownership.
22

33
# General content
4-
* @smahati
5-
# node.js/ @smahati
6-
# java/ @smahati
4+
* @renejeglinsky
5+
node.js/ @smahati
6+
java/ @smahati
77

88
# Infra
99
.github/ @chgeo @swaldmann

.github/cds-snippet-checker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "check-cds-snippets.js",
77
"author": "SAP SE (https://www.sap.com)",
88
"license": "SEE LICENSE IN LICENSE",
9-
"repository": "cap-js/docs",
9+
"repository": "capire/docs",
1010
"homepage": "https://cap.cloud.sap/",
1111
"scripts": {
1212
"check": "node check-cds-snippets.js"

.github/eslint-plugin/index.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/env node
2+
3+
// eslint plugin rule utility
4+
// ============================
5+
// node index.js generate-menu
6+
// generates the _menu.md file to make sure all rules are included.
7+
// node index.js generate-js-stub <rule-name>
8+
// generates a stub markdown file for a new JS rule with name <rule-name>.
9+
10+
import * as fs from 'node:fs'
11+
import * as path from 'node:path'
12+
13+
const RULES_BASE_PATH = path.join('tools', 'cds-lint', 'rules');
14+
const EXAMPLES_BASE_PATH = path.join('tools', 'cds-lint', 'examples');
15+
const MENU_FILE_NAME = '_menu.md';
16+
17+
/**
18+
* Get a list of all rule description files.
19+
* @returns {string[]} An array of rule description file names.
20+
*/
21+
const getRuleDescriptionFiles = () =>
22+
fs.readdirSync(RULES_BASE_PATH)
23+
.filter(file => file.endsWith('.md'))
24+
.filter(file => !['index.md', MENU_FILE_NAME].includes(file))
25+
.sort()
26+
27+
/**
28+
* Generates the menu markdown file
29+
* by completely overriding its current contents.
30+
* The menu contains links to all rule description files
31+
* in alphabetical order.
32+
*/
33+
function generateMenuMarkdown () {
34+
const rules = getRuleDescriptionFiles();
35+
const menu = rules.map(rule => {
36+
const clean = rule.replace('.md', '');
37+
return `# [${clean}](${clean})`
38+
}).join('\n');
39+
const menuFilePath = path.join(RULES_BASE_PATH, '_menu.md')
40+
fs.writeFileSync(menuFilePath, menu);
41+
console.info(`generated menu to ${menuFilePath}`)
42+
}
43+
44+
/**
45+
* Generates a stub markdown file for a new JS rule.
46+
* The passed ruleName will be placed in the stub template
47+
* where $RULE_NAME is defined.
48+
* @param {string} ruleName - The name of the rule.
49+
*/
50+
function generateJsRuleStub (ruleName) {
51+
if (!ruleName) {
52+
console.error('Please provide a rule name, e.g. "no-shared-handler-variables" as second argument');
53+
process.exit(1);
54+
}
55+
const stubFilePath = path.join(RULES_BASE_PATH, ruleName + '.md');
56+
if (fs.existsSync(stubFilePath)) {
57+
console.error(`file ${stubFilePath} already exists, will not overwrite`);
58+
process.exit(2);
59+
}
60+
const stub = fs.readFileSync(path.join(import.meta.dirname, 'js-rule-stub.md'), 'utf-8').replaceAll('$RULE_NAME', ruleName);
61+
fs.writeFileSync(stubFilePath, stub);
62+
console.info(`generated stub to ${stubFilePath}`);
63+
const correctPath = path.join(EXAMPLES_BASE_PATH, ruleName, 'correct', 'srv');
64+
fs.mkdirSync(correctPath, { recursive: true });
65+
const incorrectPath = path.join(EXAMPLES_BASE_PATH, ruleName, 'incorrect', 'srv');
66+
fs.mkdirSync(incorrectPath, { recursive: true });
67+
console.info(`generated example directories in ${path.join(EXAMPLES_BASE_PATH, ruleName)}`);
68+
fs.writeFileSync(path.join(correctPath, 'admin-service.js'), '// correct example\n');
69+
fs.writeFileSync(path.join(incorrectPath, 'admin-service.js'), '// incorrect example\n');
70+
}
71+
72+
function main (argv) {
73+
switch (argv[0]) {
74+
case 'generate-menu':
75+
generateMenuMarkdown();
76+
break;
77+
case 'generate-js-stub':
78+
generateJsRuleStub(argv[1]);
79+
generateMenuMarkdown();
80+
break;
81+
default:
82+
console.log(`Unknown command: ${argv[0]}. Use one of: generate-menu, generate-stub`);
83+
}
84+
}
85+
86+
main(process.argv.slice(2));
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
status: released
3+
---
4+
5+
<script setup>
6+
import PlaygroundBadge from '../components/PlaygroundBadge.vue'
7+
</script>
8+
9+
# $RULE_NAME
10+
11+
## Rule Details
12+
13+
DETAILS
14+
15+
#### Version
16+
This rule was introduced in `@sap/eslint-plugin-cds x.y.z`.
17+
18+
## Examples
19+
20+
### &nbsp; Correct example
21+
22+
DESCRIPTION OF CORRECT EXAMPLE
23+
24+
::: code-group
25+
<<< ../examples/$RULE_NAME/correct/srv/admin-service.js#snippet{js:line-numbers} [srv/admin-service.js]
26+
:::
27+
<PlaygroundBadge
28+
name="$RULE_NAME"
29+
kind="correct"
30+
:files="['srv/admin-service.js']"
31+
/>
32+
33+
### &nbsp; Incorrect example
34+
35+
DESCRIPTION OF INCORRECT EXAMPLE
36+
37+
::: code-group
38+
<<< ../examples/$RULE_NAME/incorrect/srv/admin-service.js#snippet{js:line-numbers} [srv/admin-service.js]
39+
:::
40+
<PlaygroundBadge
41+
name="$RULE_NAME"
42+
kind="incorrect"
43+
:files="['srv/admin-service.js']"
44+
/>

.github/java-snippet-checker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "check-java-snippets.js",
77
"author": "SAP SE (https://www.sap.com)",
88
"license": "SEE LICENSE IN LICENSE",
9-
"repository": "cap-js/docs",
9+
"repository": "capire/docs",
1010
"homepage": "https://cap.cloud.sap/",
1111
"scripts": {
1212
"check": "node check-java-snippets.js"

.github/workflows/PR-SAP.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: pr-sap-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1010
cancel-in-progress: true
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
build-sap:
1417
runs-on: ubuntu-latest

.github/workflows/PR.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ concurrency:
88
group: pr-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
99
cancel-in-progress: true
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest

.vitepress/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ const config = defineConfig({
4343
logo: '/cap-logo.svg',
4444
outline: [2,3],
4545
socialLinks: [
46-
{ icon: 'github', link: 'https://github.com/cap-js/docs' }
46+
{ icon: 'github', link: 'https://github.com/capire/docs' }
4747
],
4848
editLink: {
49-
pattern: 'https://github.com/cap-js/docs/edit/main/:path'
49+
pattern: 'https://github.com/capire/docs/edit/main/:path'
5050
},
5151
footer: {
5252
message: `
@@ -106,8 +106,8 @@ config.rewrites = rewrites
106106
// Add custom capire info to the theme config
107107
config.themeConfig.capire = {
108108
versions: {
109-
java_services: '4.2.0',
110-
java_cds4j: '4.2.0'
109+
java_services: '4.3.0',
110+
java_cds4j: '4.3.0'
111111
},
112112
gotoLinks: []
113113
}

.vitepress/theme/components/WasThisHelpful.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
<p class="more-feedback" v-if="feedbackSelected">
4646
More to say?
47-
<a href="https://github.com/cap-js/docs/issues" target="_blank">
47+
<a href="https://github.com/capire/docs/issues" target="_blank">
4848
Report an issue.
4949
</a>
5050
</p>

.vitepress/theme/styles.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,20 @@ main {
112112
padding-left: 2.5em;
113113
}
114114

115+
// Custom list styles for nested items
116+
ul {
117+
list-style-type: disc; // First level: filled circle
118+
119+
ul {
120+
list-style-type: circle; // Second level: empty circle
121+
122+
123+
ul {
124+
list-style-type: square; // Third level: square
125+
}
126+
}
127+
}
128+
115129
.step-by-step {
116130
ol {
117131
counter-reset: my-counter;

0 commit comments

Comments
 (0)