Skip to content

Commit 348cb85

Browse files
authored
[INTERNAL] Update Repo Setup (#155)
Based on UI5 Tooling best practices like within ui5-builder: https://github.com/SAP/ui5-builder Travis -> GitHub CI, add coverage / depcheck
1 parent 51cb512 commit 348cb85

14 files changed

+1735
-121
lines changed

.editorconfig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
root = true
44

55
[*]
6-
indent_style = tab
7-
end_of_line = lf
86
charset = utf-8
7+
indent_style = tab
8+
9+
[*.{css,html,js,less,txt,json,yml,md}]
910
trim_trailing_whitespace = true
11+
end_of_line = lf
12+
indent_size = 4
1013
insert_final_newline = true
1114

12-
# npm is using 2 spaces when modifying package.json
13-
[package.json]
15+
[*.{yml,yaml}]
1416
indent_style = space
1517
indent_size = 2
1618

.eslintrc.js

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,56 @@
11
module.exports = {
2-
"env": {
3-
"node": true,
4-
"es6": true
5-
},
6-
"parserOptions": {
7-
"ecmaVersion": 8
8-
},
9-
"extends": ["eslint:recommended", "google"],
10-
"rules": {
11-
"indent": [
12-
"error",
13-
"tab"
14-
],
15-
"linebreak-style": [
16-
"error",
17-
"unix"
18-
],
19-
"quotes": [
20-
"error",
21-
"double"
22-
],
23-
"semi": [
24-
"error",
25-
"always"
26-
],
27-
"no-negated-condition": "off",
28-
"require-jsdoc": "off",
29-
"no-mixed-requires": "off",
30-
"max-len": ["warn", 120],
31-
"no-implicit-coercion": [
32-
2,
33-
{ "allow": ["!!"] }
34-
],
35-
"comma-dangle": "off",
36-
"no-tabs": "off",
37-
'valid-jsdoc': [
38-
2,
39-
{
40-
requireParamDescription: false,
41-
requireReturnDescription: false,
42-
requireReturn: false,
43-
prefer: {return: 'returns'},
44-
}
45-
],
46-
},
47-
"root": true
2+
"env": {
3+
"node": true,
4+
"es6": true
5+
},
6+
"parserOptions": {
7+
"ecmaVersion": 8
8+
},
9+
"extends": ["eslint:recommended", "google"],
10+
"rules": {
11+
"indent": [
12+
"error",
13+
"tab"
14+
],
15+
"linebreak-style": [
16+
"error",
17+
"unix"
18+
],
19+
"quotes": [
20+
"error",
21+
"double",
22+
{"allowTemplateLiterals": true}
23+
],
24+
"semi": [
25+
"error",
26+
"always"
27+
],
28+
"no-negated-condition": "off",
29+
"require-jsdoc": "off",
30+
"no-mixed-requires": "off",
31+
"max-len": [
32+
"warn", // TODO: set to "error" and fix all findings
33+
{
34+
"code": 120,
35+
"ignoreUrls": true,
36+
"ignoreRegExpLiterals": true
37+
}
38+
],
39+
"no-implicit-coercion": [
40+
2,
41+
{"allow": ["!!"]}
42+
],
43+
"comma-dangle": "off",
44+
"no-tabs": "off",
45+
'valid-jsdoc': [
46+
2,
47+
{
48+
requireParamDescription: false,
49+
requireReturnDescription: false,
50+
requireReturn: false,
51+
prefer: {return: 'returns'},
52+
}
53+
],
54+
},
55+
"root": true
4856
};

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* -text
1+
* text=auto eol=lf

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
37
- package-ecosystem: npm
48
directory: "/"
59
schedule:

.github/workflows/codeql-analysis.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
# Execute at least once per week to get new findings without active development taking place
10+
schedule:
11+
- cron: '42 16 * * 6'
12+
13+
jobs:
14+
codeql-analyze:
15+
name: "CodeQL Analyze"
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
# Initializes the CodeQL tools for scanning.
23+
- name: Initialize CodeQL
24+
uses: github/codeql-action/init@v1
25+
with:
26+
languages: 'javascript'
27+
# If you wish to specify custom queries, you can do so here or in a config file.
28+
# By default, queries listed here will override any specified in a config file.
29+
# Prefix the list here with "+" to use these queries and those in the config file.
30+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
31+
32+
# ℹ️ Command-line programs to run using the OS shell.
33+
# 📚 https://git.io/JvXDl
34+
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v1

.github/workflows/github-ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: GitHub CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
name: General checks, tests and coverage reporting
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Use Node.js LTS 14.x
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 14.x
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Perform checks and tests
26+
run: npm test
27+
28+
- name: Send report to Coveralls
29+
uses: coverallsapp/github-action@v1.1.2
30+
with:
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
test-matrix:
34+
name: Unit tests on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
node-version: [15]
39+
os: [ubuntu-latest, windows-latest, macOS-latest]
40+
include:
41+
- node-version: 10
42+
os: ubuntu-latest
43+
- node-version: 12
44+
os: ubuntu-latest
45+
- node-version: 14
46+
os: ubuntu-latest
47+
runs-on: ${{ matrix.os }}
48+
steps:
49+
50+
- uses: actions/checkout@v2
51+
52+
- name: Use Node.js ${{ matrix.node-version }}
53+
uses: actions/setup-node@v1
54+
with:
55+
node-version: ${{ matrix.node-version }}
56+
57+
- run: npm ci
58+
name: Install dependencies
59+
60+
- run: npm ls
61+
name: Check for missing / extraneous Dependencies
62+
63+
- run: npm run unit
64+
name: Run unit tests
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
name: REUSE Compliance Check
1+
name: REUSE
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
48

59
jobs:
6-
test:
10+
compliance-check:
11+
name: Compliance Check
712
runs-on: ubuntu-latest
813
steps:
914
- uses: actions/checkout@v2
10-
- name: REUSE Compliance Check
15+
- name: Execute REUSE Compliance Check
1116
uses: fsfe/reuse-action@v1.1

.gitignore

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,58 @@
1-
# Ignore npm files/folders
2-
node_modules
3-
npm-debug.log
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
413

5-
# Ignore Eclipse project and settings files
6-
.classpath
7-
.settings
8-
.project
9-
.externalToolBuilders
14+
# Coverage directory used by tools like istanbul
15+
coverage
1016

11-
# Ignore IntelliJ project and settings files
12-
.idea
13-
*.iml
17+
# nyc test coverage
18+
.nyc_output
1419

15-
# Ignore Visual Studio Code project and settings files
20+
# CI (Azure Pipelines) xUnit test results
21+
test-results.xml
22+
23+
# IDEs
1624
.vscode/
25+
*.~vsdx
26+
.idea/
27+
28+
# node-waf configuration
29+
.lock-wscript
30+
31+
# Compiled binary addons (http://nodejs.org/api/addons.html)
32+
build/Release
33+
34+
# Dependency directories
35+
node_modules
36+
jspm_packages
1737

18-
# Ignore Mac files
38+
# Optional npm cache directory
39+
.npm
40+
41+
# Optional eslint cache
42+
.eslintcache
43+
44+
# Optional REPL history
45+
.node_repl_history
46+
47+
# Output of 'npm pack'
48+
*.tgz
49+
50+
# Yarn Integrity file
51+
.yarn-integrity
52+
53+
# Misc
54+
yarn.lock
1955
.DS_Store
56+
57+
# Don't include private SSH key for deployment via Travis CI
58+
deploy_key

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Enforce public npm registry
2+
registry = https://registry.npmjs.org/

.reuse/dep5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
2525
parties the right to use of access any SAP External Product, through API Calls.
2626

2727
Files: *
28-
Copyright: 2018-2020 SAP SE or an SAP affiliate company and less-openui5 contributors
28+
Copyright: 2016-2021 SAP SE or an SAP affiliate company and less-openui5 contributors
2929
License: Apache-2.0
3030

3131
Files: lib/thirdparty/less/*

0 commit comments

Comments
 (0)