Add package lock and eslint config (#711)

This commit is contained in:
Daniel O'Grady
2024-05-03 12:40:11 +02:00
committed by GitHub
parent 546f374b08
commit d9f50d635f
5 changed files with 3450 additions and 3633 deletions

View File

@@ -1,31 +0,0 @@
{
"extends": [
"plugin:@sap/cds/recommended",
"eslint:recommended"
],
"env": {
"browser": true,
"es2022": true,
"node": true,
"jest": true,
"mocha": true
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"CDL": true,
"CQL": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off",
"require-await":"warn",
"no-unused-vars": ["warn", { "argsIgnorePattern": "_" }]
}
}

View File

@@ -11,7 +11,6 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@@ -19,10 +18,21 @@ jobs:
node-version: [20.x, 18.x] node-version: [20.x, 18.x]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- run: npm ci - run: npm ci
- run: npm test - run: npm test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npm run lint

36
eslint.config.js Normal file
View File

@@ -0,0 +1,36 @@
const cds = require('@sap/eslint-plugin-cds')
const globals = require('globals')
const js = require('@eslint/js')
module.exports = [
cds.configs.recommended,
js.configs.recommended,
{
languageOptions: {
globals: {
es2022: true,
...globals.browser,
...globals.node,
...globals.jest,
...globals.mocha,
cds: true,
sap: true,
CDL: true,
CQL: true,
CREATE: true,
DELETE: true,
DROP: true,
INSERT: true,
SELECT: true,
UPDATE: true,
UPSERT: true
}
},
rules: {
'no-console': 'off',
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'require-atomic-updates': 'off',
'require-await': 'warn'
}
}
]

6888
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,56 +1,58 @@
{ {
"name": "@capire/samples", "name": "@capire/samples",
"version": "2.0.0", "version": "2.0.0",
"description": "A monorepo with several samples for CAP.", "description": "A monorepo with several samples for CAP.",
"repository": "https://github.com/sap-samples/cloud-cap-samples.git", "repository": "https://github.com/sap-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com", "author": "daniel.hutzel@sap.com",
"dependencies": { "dependencies": {
"@sap/cds": ">=7" "@sap/cds": ">=7"
}, },
"workspaces": [ "workspaces": [
"./bookshop", "./bookshop",
"./bookstore", "./bookstore",
"./common", "./common",
"./data-viewer", "./data-viewer",
"./fiori", "./fiori",
"./hello", "./hello",
"./media", "./media",
"./orders", "./orders",
"./loggers", "./loggers",
"./reviews" "./reviews"
], ],
"devDependencies": { "devDependencies": {
"@cap-js/sqlite": "^1", "@cap-js/sqlite": "^1",
"@sap/eslint-plugin-cds": "^2.6.1", "@sap/eslint-plugin-cds": "^3",
"axios": "^1", "axios": "^1",
"chai": "^4.3.4", "chai": "^4.3.4",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0", "chai-subset": "^1.6.0",
"semver": "^7" "eslint": "^9",
}, "semver": "^7"
"scripts": { },
"cleanup": "rm -rf node_modules && rm -rf */node_modules && rm -rf */*/node_modules", "scripts": {
"bookshop": "cds watch bookshop", "cleanup": "rm -rf node_modules && rm -rf */node_modules && rm -rf */*/node_modules",
"fiori": "cds watch fiori", "bookshop": "cds watch bookshop",
"hello": "cds watch hello", "fiori": "cds watch fiori",
"media": "cds watch media", "hello": "cds watch hello",
"mocha": "CDS_TEST_SILENT=y npx mocha", "media": "cds watch media",
"jest": "npx jest --silent", "mocha": "CDS_TEST_SILENT=y npx mocha",
"start": "cds watch fiori", "jest": "npx jest --silent",
"test": "npm run jest -- --silent", "start": "cds watch fiori",
"test:hello": "cd hello && npm test" "test": "npm run jest -- --silent",
}, "test:hello": "cd hello && npm test",
"jest": { "lint": "eslint ."
"testTimeout": 20000, },
"testMatch": [ "jest": {
"**/*.test.js" "testTimeout": 20000,
] "testMatch": [
}, "**/*.test.js"
"mocha": { ]
"recursive": true, },
"parallel": true, "mocha": {
"timeout": 6666 "recursive": true,
}, "parallel": true,
"license": "SEE LICENSE IN LICENSE", "timeout": 6666
"private": true },
} "license": "SEE LICENSE IN LICENSE",
"private": true
}