Skip to content

Commit

Permalink
Merge pull request #70 from cap-js/fix/build
Browse files Browse the repository at this point in the history
Fix issue with build step
  • Loading branch information
schiwekM authored Sep 19, 2024
2 parents 6d1f37d + 4fc0659 commit bcb9ea4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions cds-plugin.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
const cds = require("@sap/cds/lib");
const NotificationsBuildPlugin = require("./lib/build");

if (cds.cli.command === "build") {
// register build plugin
cds.build?.register?.('notifications', {
impl: '@cap-js/notifications/lib/build',
taskDefaults: { src: cds.env.folders.srv }
});
cds.build?.register?.('notifications', NotificationsBuildPlugin);
}

else cds.once("served", async () => {
Expand Down
6 changes: 3 additions & 3 deletions lib/build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const cds = require('@sap/cds')
const { BuildPlugin } = cds.build

const { copy, exists, path } = cds.utils

module.exports = class NotificationsBuildPlugin extends BuildPlugin {

module.exports = class NotificationsBuildPlugin extends cds.build.Plugin {
static taskDefaults = { src: cds.env.folders.srv }

static hasTask() {
const notificationTypesFile = cds.env.requires?.notifications?.types;
return notificationTypesFile === undefined ? false : exists(notificationTypesFile);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cap-js/notifications",
"version": "0.2.1",
"version": "0.2.2",
"description": "CDS plugin providing integration to the SAP BTP Alert Notification Service.",
"repository": "cap-js/notifications",
"author": "SAP SE (https://www.sap.com)",
Expand Down

0 comments on commit bcb9ea4

Please sign in to comment.