-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from The-Nefarious-Developer/typescript
sap-cap-typescript-node
- Loading branch information
Showing
6 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/sap-cap-typescript-node/.devcontainer/devcontainer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/The-Nefarious-Developer/devcontainer-templates/tree/main/src/sap-cap-typescript-node | ||
{ | ||
"name": "SAP CAP", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "ghcr.io/the-nefarious-developer/sap-cap-typescript-node:${templateOption:imageVariant}" | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "yarn install", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This template references an image that was [pre-built](https://containers.dev/implementors/reference/#prebuilding) to automatically include needed devcontainer.json metadata. | ||
|
||
* **Image**: ghcr.io/the-nefarious-developer/sap-cap-typescript-node:20-bullseye ([source](https://github.com/The-Nefarious-Developer/devcontainer-images)) | ||
* **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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"id": "sap-cap-typescript-node", | ||
"version": "1.0.0", | ||
"name": "SAP CAP", | ||
"description": "Develop CAP based projects with Typescript for SAP BTP Cloud Foundry.", | ||
"documentationURL": "https://github.com/The-Nefarious-Developer/devcontainer-templates/tree/main/src/sap-cap-typescript-node", | ||
"publisher": "The Nefarious Developer", | ||
"licenseURL": "https://github.com/The-Nefarious-Developer/devcontainer-templates/blob/main/LICENSE", | ||
"options": { | ||
"imageVariant": { | ||
"type": "string", | ||
"description": "Upstream Node version (use -bookworm, -bullseye variants on local arm64/Apple Silicon):", | ||
"proposals": [ | ||
"22-bookworm", | ||
"22-bullseye", | ||
"20-bookworm", | ||
"20-bullseye", | ||
"18-bookworm", | ||
"20-bullseye", | ||
"18-bullseye" | ||
], | ||
"default": "22-bookworm" | ||
} | ||
}, | ||
"platforms": [ | ||
"Node.js", | ||
"JavaScript", | ||
"TypeScript", | ||
"SAP", | ||
"BTP", | ||
"CloudFoundry" | ||
], | ||
"keywords": [ | ||
"SAP", | ||
"CAP", | ||
"BTP", | ||
"CloudFoundry" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
# shellcheck disable=SC1091 | ||
source "$(dirname "$0")/../test-utils/harness.sh" | ||
|
||
# setup "sap-cap-typescript-node" "22-bookworm" | ||
setup "sap-cap-typescript-node" "$VARIANT" | ||
|
||
run_test "Node version is correct" "node -v" "${IMAGE_TAG:0:2}" | ||
run_test "NPM is present" "npm --help" "npm <command>" | ||
run_test "CloudFoundry CLI is present" "cf --version" "cf version 8" | ||
run_test "CAP Development Toolkit is present" "cds version" "@cap-js/asyncapi" | ||
run_test "Typescript is present" "tsc -v" "Version" | ||
run_test "ts-node is present is present" "ts-node -v" "v" | ||
run_test "CAP Typescript Plugin is present" "cds-tsx" "" | ||
run_test "Container defaults to non-root user" "whoami" "node" | ||
run_test "Non-root user is able to sudo" "sudo whoami" "root" |