docker run -t -i debian /bin/bash
.curl
via apt-get
, so we can then use curl
to download and install nvm
. We also set 'vi mode' in my shell, and bind Ctrl-L so that it will work for clearing the screen for us:set -o vi
bind -x '"\C-l": clear'
apt-get update
in this minimal Linux container before we can get it to find and install curl
.nvm
with curl
.nvm
to install Node.js, and we choose version 8 (see https://nodejs.org/en/download/ for other versions).@sap/cds
package with npm search @sap/cds
. This doesn't give us what we're really looking for, so we search simply for 'cds' with npm search cds
, but this yields results that don't look quite right.@sap
prefix in @sap/cds
is a scope, which relates packages to a specific registry. The searches we've done thus far are using the default registry, which we can see in the npm configuration with npm config ls -l | grep registry
, which gives us:registry = https://registry.npmjs.org/
npm config get registry
.--registry
option, thus: npm search @sap/cds --registry https://npm.sap.com
, where we get much better results that look something like this:NAME | DESCRIPTION | AUTHOR | DATE | VERSION | KEYWORDS
@sap/cds | Entry Point and API… | | 2019-02-19 | 3.5.2 |
@sap/generator-cds | Project generator… | | 2019-02-19 | 2.3.9 | cds cdx
@sap/cds-compiler | CDS (Core Data… | | 2019-02-14 | 1.8.1 | CDS
@sap/cds-hana | Driver package for… | | 2019-02-14 | 1.5.1 |
@sap/cds-ql | This package deals… | | 2019-02-14 | 1.5.1 |
@sap/cds-services | This package… | | 2019-02-14 | 1.5.2 |
@sap/cds-sql | This package offers… | | 2019-02-14 | 1.5.1 |
@sap/cds-sqlite | Driver package for… | | 2019-02-14 | 1.5.1 |
@sap/cds-reflect | Reflection for CDS… | | 2019-02-08 | 2.3.0 |
npm view
(as an alternative to npm search
) to look at details of a package. At the time of writing these annotations, this is what npm view
gives us:@sap/cds@3.5.2 | SEE LICENSE IN developer-license-3.1.txt | deps: 6 | versions: 16
Entry Point and API Facade for CDS
bin: cds
dist
.tarball: https://npm.sap.com/@sap/cds/-/cds-3.5.2.tgz
.shasum: 975fe7d2c64550c71d30f6f869e63c3250a21ca0
.integrity: sha512-8NKmfpLFSW4GwKnnnoMB1l+srhDhJ8wlkGrC7cf7NxW+XUDO2bnlPIt/dSKlCSQRnHgssAlyjGffrbMMQknVRw==
dependencies:
@sap/cds-compiler: 1.8.1 @sap/cds-reflect: 2.3.0 @sap/generator-cds: 2.3.9
@sap/cds-ql: 1.5.1 @sap/cds-services: 1.5.2 fs-extra: 7.0.1
maintainers:
- https-support.sap.com <do.not.reply@sap.com>
dist-tags:
latest: 3.5.2
published a week ago by https-support.sap.com <do.not.reply@sap.com>
npm install
. But before we do, we check the list of packages already installed, with npm list
, using the -g
option to check globally (rather than only local to the directory / project I'm currently in).npm list
with the --depth
option, to see the top level packages installed (with npm list -g --depth=0
).npm install -g @sap/cds --registry https://npm.sap.com
, and a brief look at the error that occurs (via the --verbose
flag).@sap
with npm config set @sap:registry=https://npm.sap.com
(and checking the results with npm config list
to see that this configuration was indeed successfully recorded.npm install -g @sap/cds
, and seeing that this is now successful, and that @sap/cds
version 3.0.0 was installed globally (checking with npm list -g --depth=1
, and also noticing the dependencies).npm list -g --depth=0
), and go through the process of installing @sap/cds
globally here now.cds
:=> cds
USAGE
cds <command> [<args>]
COMMANDS
c | compile ...individual models (= the default)
d | deploy ...data models to a database
s | serve ...service models to REST clients
b | build ...whole modules or projects
i | init ...jump-starts a new project
e | env get/set current cds configuration
r | repl cds's read-eval-event-loop
h | help shows usage for cds and individual commands
v | version prints detailed version information
cds help <command> gives more help about each (also with --help)
cds <file> without <command> defaults to cds compile.
cds without any arguments shows this help.
EXAMPLES
cds model.cds
cds compile model.cds
cds compile model.json --to cdl
cds serve cat-service
cds build --clean
cds compile --help
vscode-cds-1.0.36.vsix
, and noting that it's actually a gzipped tarball in disguise. So changing the .vsix
extension to .tgz
makes it more palatable and we can look inside it with tar tvzf vscode-cds-1.0.36.tgz
!tar xzf vscode-cds-1.0.36.tgz
and have a look what we have, particularly at the SAP Node.js packages in the node_modules/
directory. It's at this point we get a first glimpse of @sap/cds-lsp
which is a Language Protocol Server implementation for the CDS language.editorconfig
file (which I took from the UI5 team) here: https://github.com/qmacro/scripts/blob/master/editorconfig. The PluralSight course is "Building a JavaScript Development Environment"./usr/local/bin/cf
via Homebrew for macOS).cf
configuration that's maintained in my home directory in the .cf/
directory, and logging in to a Cloud Foundry endpoint with cf login
, specifically the endpoint that I have in my trial at https://api.cf.eu10.hana.ondemand.com.cf
asks me to select an organisation.I347491trial_trial
organisation automatically causes the dev
space to be selected within that, because that's the only space that exists inside I347491trial_trial
.cf marketplace
.cf target
and switching targets. First looking at what the possible target orgs are with cf orgs
, which gives me this:Getting orgs as dj.adams@sap.com...
name
I347491trial_trial
serverlessorg
tdash
cf target -o serverlessorg
(noting again that the single dev
space is automatically selected within that).cf target -o tdash
) gives us "No space targeted, use cf target -S SPACE" because there are multiple spaces within the tdash
organisation, which we can see with cf spaces
, which gives this:name
prod
qa
fzf
also wrote the Vim plugins Goyo and Limelight which are also wonderful).fzf
works, by looking at the sort of things it can do. We end up taking the names of the Northwind products and offering them as a selection like this:curl 'https://services.odata.org/V3/Northwind/Northwind.svc/Products?$format=json?$select=ProductName' | jq -r '.value[].ProductName' | fzf
jq
you might want to watch this short video "Using jq to parse out SCP destination info".fzf
to improve the experience of selecting choosing and setting target organisations and spaces. Check out the fzfutils.sh script to see how we did this. Basically, introducing fzf
into the cf
CLI mix looks like this, from a CF organisation perspective, for example:function cfto() {
local org
org=$(cf orgs | sed -e '1,3d' | fzf -1 -q "$1")
if [ -n "$org" ]; then
echo Setting target org to "$org"
cf target -o "$org"
fi
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
10 | |
10 | |
7 | |
7 | |
7 | |
7 |