![pnpm 9.5 Introduces Catalogs: Shareable Dependency Version Specifiers](https://cdn.sanity.io/images/cgdhsj6q/production/c06a5b74512bcc6da29d38cef96a454fa947810d-1024x1024.webp?w=400&fit=max&auto=format)
Security News
pnpm 9.5 Introduces Catalogs: Shareable Dependency Version Specifiers
pnpm 9.5 introduces a Catalogs feature, enabling shareable dependency version specifiers, reducing merge conflicts and improving support for monorepos.
@sap/cds-compiler
Advanced tools
Package description
@sap/cds-compiler is a package designed to compile and process Core Data Services (CDS) models. It is part of the SAP Cloud Application Programming Model (CAP) and provides functionalities to parse, compile, and transform CDS models into various formats.
Parsing CDS Models
This feature allows you to parse CDS source code into a Core Schema Notation (CSN) model. The code sample demonstrates how to parse a simple CDS model defining an entity 'Books' with a 'title' property.
const cds = require('@sap/cds-compiler');
const source = 'entity Books { title: String; }';
const csn = cds.parse(source);
console.log(JSON.stringify(csn, null, 2));
Compiling CDS Models
This feature allows you to compile CDS source code into a CSN model. The code sample shows how to compile a CDS model into its CSN representation.
const cds = require('@sap/cds-compiler');
const source = 'entity Books { title: String; }';
const csn = cds.compile.to.csn(source);
console.log(JSON.stringify(csn, null, 2));
Transforming CDS Models
This feature allows you to transform CDS models into different formats, such as EDM (Entity Data Model). The code sample demonstrates transforming a CSN model into an EDM format.
const cds = require('@sap/cds-compiler');
const source = 'entity Books { title: String; }';
const csn = cds.compile.to.csn(source);
const edm = cds.compile.to.edm(csn);
console.log(JSON.stringify(edm, null, 2));
OpenUI5 is a JavaScript UI library maintained by SAP. While it focuses on building user interfaces rather than compiling CDS models, it is part of the broader SAP ecosystem and can be used in conjunction with CDS models for building SAP applications.
odata-v4 is a package for working with OData v4 services. It provides functionalities to create, query, and manipulate OData services. While it does not compile CDS models, it can be used to interact with the OData services generated from CDS models.
Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite, and Microsoft SQL Server. It provides functionalities to define models and interact with databases. While it does not compile CDS models, it offers similar functionalities for defining and working with data models.
Readme
Installation and Usage
Documentation
Fiori annotations
Do not add direct dependency to cdsv's github project!
Unfortunately npm does not support snapshots via nexus. The only possibility is to download manually a snapshot and install it.
Configure Nexus milestones registry:
npm config set registry "http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.milestones.npm"
or releases registry:
npm config set registry "http://nexus.wdf.sap.corp:8081/nexus/content/groups/build.releases.npm"
Install via npm:
npm install "@sap/cds-compiler"
Or maintain your package.json dependencies as follows:
package.json
"dependencies": {
"@sap/cds-compiler": "*"
}
The compiler with its options is invoked like any other npm/Unix command:
cdsc [options] <file...>
See cdsc --help
for the options.
The exit code is similar to grep
and other commands:
0
: successful compilation1
: compiled with error (the command invocation itself is ok)2
: commmand invocation error (invalid options, repeated file name)FAQs
Unknown package
We found that @sap/cds-compiler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 9.5 introduces a Catalogs feature, enabling shareable dependency version specifiers, reducing merge conflicts and improving support for monorepos.
Security News
A threat actor on BreachForums is selling an unverified npm vulnerability for account takeover, but npm has not officially confirmed the existence of this security concern.
Security News
Cyber insurance rates are dropping as the market matures, according to a new report projecting global premiums to reach $43 billion by 2030, driven by international market uptake and growth in the SME sector.