Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
> High quality Salesforce Commerce Cloud type definitions. A dw-api-types "done right"
High quality Salesforce Commerce Cloud type definitions. A dw-api-types "done right"
sfcc-dts
provides full typeScript definitions for Salesforce Commerce Cloud apis, plus a typescript plugin for resolving requires using "*" cartridge path and a fancy wizard for setting up your project.
The aim of the project is to provide fully working typescript compilation of commerce cloud server side javascript.
Wait, why is this better than the official dw-api from salesforce?
Well, tons of reasons:
Using the wizard:
$ npm i -g sfcc-dts
From your sfcc project root directory type:
$ sfcc-dts-setup
The wizard will guide you for adding required dependencies to package.json
, setup a working tsconfig.json
and configure a customizable dw types entry point for your project.
Vscode will fully benefit from the typescript configuration from tsconfig.json
only when is configured for using the workspace version of typescript.
For enabling it press [cmd]+[shift]+P -> "TypeScript: Select TypeScript version" and select "Use workspace version" with the version pointing to the node_modules/typescript dir in the workspace.
If the "TypeScript: Select TypeScript version" option or the expected directory dooesn't show up, just open the node_modules/typescript/bin/tsc file inside vscode and retry, this is usually enough to make vscode detect the available typescript installation.
sfcc-dts can generate definitions for project-specific system object extensions by parsing a system-objecttype-extensions.xml
file.
Custom attribute definitions are automatically generated by the sfcc-dts-setup
wizard, assuming a system-objecttype-extensions.xml
file is available (the default location is sites/site_template/meta/system-objecttype-extensions.xml
but the wizard will allow you to choose a different path) and saved to @types/dw/attrs.d.ts
.
Definitions can be updated by running sfcc-dts-updateattrs
If everything goes well you will see autocomplete and validation working in your existing javascript files. Typescript will fully detect:
dw/system/Site
syntax*/cartridge/somefile
or ~/cartridge/somefile
dw.system.Site
request
Still in the checklist:
Released under the MIT license.
FAQs
> High quality Salesforce Commerce Cloud type definitions. A dw-api-types "done right"
The npm package sfcc-dts receives a total of 401 weekly downloads. As such, sfcc-dts popularity was classified as not popular.
We found that sfcc-dts demonstrated a not healthy version release cadence and project activity because the last version was released 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.