Skip to content

Commit 7225270

Browse files
authored
Merge branch 'main' into odata_feature_matrix
2 parents ac92580 + be272f7 commit 7225270

File tree

208 files changed

+5094
-1918
lines changed

Some content is hidden

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

208 files changed

+5094
-1918
lines changed

.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: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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(import.meta.dirname, '../../tools/cds-lint/rules');
14+
const EXAMPLES_BASE_PATH = RULES_BASE_PATH
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 = () => fs.globSync(path.join(RULES_BASE_PATH, '*/index.md')).sort()
22+
23+
/**
24+
* Generates the menu markdown file
25+
* by completely overriding its current contents.
26+
* The menu contains links to all rule description files
27+
* in alphabetical order.
28+
*/
29+
function generateMenuMarkdown () {
30+
const rules = getRuleDescriptionFiles();
31+
const menu = rules.map(rule => {
32+
const folderPath = path.posix.dirname(path.relative(RULES_BASE_PATH, rule));
33+
const name = path.basename(folderPath);
34+
return `# [${name}](${folderPath}/)`
35+
}).join('\n');
36+
const menuFilePath = path.join(RULES_BASE_PATH, MENU_FILE_NAME)
37+
fs.writeFileSync(menuFilePath, menu);
38+
console.info(`generated menu to ${path.relative(process.cwd(), menuFilePath)}`);
39+
}
40+
41+
/**
42+
* Generates a stub markdown file for a new JS rule.
43+
* The passed ruleName will be placed in the stub template
44+
* where $RULE_NAME is defined.
45+
* @param {string} ruleName - The name of the rule.
46+
*/
47+
function generateJsRuleStub (ruleName) {
48+
if (!ruleName) {
49+
console.error('Please provide a rule name, e.g. "no-shared-handler-variables" as second argument');
50+
process.exit(1);
51+
}
52+
const stubFilePath = path.join(RULES_BASE_PATH, ruleName, 'index.md');
53+
if (fs.existsSync(stubFilePath)) {
54+
console.error(`file ${stubFilePath} already exists, will not overwrite`);
55+
process.exit(2);
56+
}
57+
fs.mkdirSync(path.dirname(stubFilePath), { recursive: true });
58+
const stub = fs.readFileSync(path.join(import.meta.dirname, 'js-rule-stub.md'), 'utf-8').replaceAll('$RULE_NAME', ruleName);
59+
fs.writeFileSync(stubFilePath, stub);
60+
console.info(`generated stub to ${stubFilePath}`);
61+
const correctPath = path.join(EXAMPLES_BASE_PATH, ruleName, 'correct', 'srv');
62+
fs.mkdirSync(correctPath, { recursive: true });
63+
const incorrectPath = path.join(EXAMPLES_BASE_PATH, ruleName, 'incorrect', 'srv');
64+
fs.mkdirSync(incorrectPath, { recursive: true });
65+
console.info(`generated example directories in ${path.join(EXAMPLES_BASE_PATH, ruleName)}`);
66+
fs.writeFileSync(path.join(correctPath, 'admin-service.js'), '// correct example\n');
67+
fs.writeFileSync(path.join(incorrectPath, 'admin-service.js'), '// incorrect example\n');
68+
}
69+
70+
function main (argv) {
71+
switch (argv[0]) {
72+
case 'generate-menu':
73+
generateMenuMarkdown();
74+
break;
75+
case 'generate-js-stub':
76+
generateJsRuleStub(argv[1]);
77+
generateMenuMarkdown();
78+
break;
79+
default:
80+
console.log(`Unknown command: ${argv[0]}. Use one of: generate-menu, generate-stub`);
81+
}
82+
}
83+
84+
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+
<<< 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+
<<< 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.4.1',
110+
java_cds4j: '4.4.1'
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)