Skip to content

Commit 57b8a64

Browse files
authored
Merge pull request #20 from The-Nefarious-Developer/typescript
sap-cap-typescript-node
2 parents ecdd9be + be181eb commit 57b8a64

File tree

6 files changed

+84
-0
lines changed

6 files changed

+84
-0
lines changed

.github/workflows/test-pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
with:
1616
filters: |
1717
sap-cap-javascript-node: ./**/sap-cap-javascript-node/**
18+
sap-cap-typescript-node: ./**/sap-cap-typescript-node/**
1819
1920
test:
2021
needs: [detect-changes]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Ths repository generates the following devcontainer templates:
1818
| Template | Image |
1919
|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2020
| sap-cap-javascript-node | [ghcr.io/the-nefarious-developer/sap-cap-javascript-node:{VERSION}](https://github.com/The-Nefarious-Developer/devcontainer-images/pkgs/container/sap-cap-javascript-node) |
21+
| sap-cap-typescript-node | [ghcr.io/the-nefarious-developer/sap-cap-typescript-node:{VERSION}](https://github.com/The-Nefarious-Developer/devcontainer-images/pkgs/container/sap-cap-typescript-node) |
2122

2223
## Content
2324

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/The-Nefarious-Developer/devcontainer-templates/tree/main/src/sap-cap-typescript-node
3+
{
4+
"name": "SAP CAP",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "ghcr.io/the-nefarious-developer/sap-cap-typescript-node:${templateOption:imageVariant}"
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "yarn install",
16+
17+
// Configure tool-specific properties.
18+
// "customizations": {},
19+
20+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21+
// "remoteUser": "root"
22+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This template references an image that was [pre-built](https://containers.dev/implementors/reference/#prebuilding) to automatically include needed devcontainer.json metadata.
2+
3+
* **Image**: ghcr.io/the-nefarious-developer/sap-cap-typescript-node:20-bullseye ([source](https://github.com/The-Nefarious-Developer/devcontainer-images))
4+
* **Applies devcontainer.json contents from image**: Yes ([source](https://github.com/The-Nefarious-Developer/devcontainer-images/blob/main/src/sap-cap-typescript-node/.devcontainer/devcontainer.json))
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"id": "sap-cap-typescript-node",
3+
"version": "1.0.0",
4+
"name": "SAP CAP",
5+
"description": "Develop CAP based projects with Typescript for SAP BTP Cloud Foundry.",
6+
"documentationURL": "https://github.com/The-Nefarious-Developer/devcontainer-templates/tree/main/src/sap-cap-typescript-node",
7+
"publisher": "The Nefarious Developer",
8+
"licenseURL": "https://github.com/The-Nefarious-Developer/devcontainer-templates/blob/main/LICENSE",
9+
"options": {
10+
"imageVariant": {
11+
"type": "string",
12+
"description": "Upstream Node version (use -bookworm, -bullseye variants on local arm64/Apple Silicon):",
13+
"proposals": [
14+
"22-bookworm",
15+
"22-bullseye",
16+
"20-bookworm",
17+
"20-bullseye",
18+
"18-bookworm",
19+
"20-bullseye",
20+
"18-bullseye"
21+
],
22+
"default": "22-bookworm"
23+
}
24+
},
25+
"platforms": [
26+
"Node.js",
27+
"JavaScript",
28+
"TypeScript",
29+
"SAP",
30+
"BTP",
31+
"CloudFoundry"
32+
],
33+
"keywords": [
34+
"SAP",
35+
"CAP",
36+
"BTP",
37+
"CloudFoundry"
38+
]
39+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
# shellcheck disable=SC1091
4+
source "$(dirname "$0")/../test-utils/harness.sh"
5+
6+
# setup "sap-cap-typescript-node" "22-bookworm"
7+
setup "sap-cap-typescript-node" "$VARIANT"
8+
9+
run_test "Node version is correct" "node -v" "${IMAGE_TAG:0:2}"
10+
run_test "NPM is present" "npm --help" "npm <command>"
11+
run_test "CloudFoundry CLI is present" "cf --version" "cf version 8"
12+
run_test "CAP Development Toolkit is present" "cds version" "@cap-js/asyncapi"
13+
run_test "Typescript is present" "tsc -v" "Version"
14+
run_test "ts-node is present is present" "ts-node -v" "v"
15+
run_test "CAP Typescript Plugin is present" "cds-tsx" ""
16+
run_test "Container defaults to non-root user" "whoami" "node"
17+
run_test "Non-root user is able to sudo" "sudo whoami" "root"

0 commit comments

Comments
 (0)