-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from cap-js/no-lodash
Removed lodash + eslint fixes
- Loading branch information
Showing
8 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends: eslint:recommended | ||
env: | ||
node: true | ||
commonjs: true | ||
jest: true | ||
es2021: true | ||
parserOptions: | ||
ecmaVersion: latest | ||
rules: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
const cds = require("@sap/cds"); | ||
const build = require('@sap/cds-dk/lib/build') | ||
const { validateNotificationTypes, readFile } = require("./lib/utils"); | ||
const { createNotificationTypesMap } = require("./lib/notificationTypes"); | ||
const { setGlobalLogLevel } = require("@sap-cloud-sdk/util"); | ||
const cds = require("@sap/cds/lib"); | ||
|
||
// register build plugin | ||
build.register('notifications', { impl: '@cap-js/notifications/lib/build', description: 'Notifications build plugin', taskDefaults: { src: cds.env.folders.srv } }); | ||
if (cds.cli.command === "build") { | ||
// register build plugin | ||
const build = require('@sap/cds-dk/lib/build') | ||
build.register('notifications', { | ||
impl: '@cap-js/notifications/lib/build', | ||
description: 'Notifications build plugin', | ||
taskDefaults: { src: cds.env.folders.srv } | ||
}) | ||
} | ||
|
||
cds.once("served", async () => { | ||
setGlobalLogLevel("error"); | ||
const profiles = cds.env.profiles ?? []; | ||
const production = profiles.includes("production"); | ||
else cds.once("served", async () => { | ||
const { validateNotificationTypes, readFile } = require("./lib/utils"); | ||
const { createNotificationTypesMap } = require("./lib/notificationTypes"); | ||
const production = cds.env.profiles?.includes("production"); | ||
|
||
// read notification types | ||
const notificationTypes = readFile(cds.env.requires?.notifications?.types); | ||
|
||
if (validateNotificationTypes(notificationTypes)) { | ||
if (!production) { | ||
const notificationTypesMap = createNotificationTypesMap(notificationTypes, true); | ||
cds.notifications = { local: { types: notificationTypesMap } }; | ||
} | ||
} | ||
}); | ||
|
||
require("@sap-cloud-sdk/util").setGlobalLogLevel("error") | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// FIXME: should not be necessary | ||
process.env.CDS_ENV = 'better-sqlite' | ||
|
||
const config = { | ||
testTimeout: 42222, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters