Skip to content

Commit

Permalink
feat: add typescript templates (#355)
Browse files Browse the repository at this point in the history
* feat: add typescript templates

Bumps the faas-js-runtime dependency to 0.7.1 and Node.js buildpack dependency to v0.8.1

fix file globbing on windows

adjust eslint/prettier for windows

improve READMEs

add usage guide

Signed-off-by: Lance Ball <lball@redhat.com>
  • Loading branch information
lance committed May 26, 2021
1 parent caf0659 commit d3eafe2
Show file tree
Hide file tree
Showing 31 changed files with 8,568 additions and 636 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/func_*
/templates/go/events/go.sum
/templates/go/http/go.sum
/templates/typescript/events/build
/templates/typescript/http/build
/coverage.out
/bin

Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ $(TEMPLATE_PACKAGE): templates $(TEMPLATE_DIRS) $(TEMPLATE_FILES)
rm -rf templates/node/http/node_modules
rm -rf templates/python/events/__pycache__
rm -rf templates/python/http/__pycache__
rm -rf templates/typescript/events/node_modules
rm -rf templates/typescript/http/node_modules
# to install pkger: go get github.com/markbates/pkger/cmd/pkger
$(PKGER)

Expand All @@ -52,7 +54,7 @@ $(LINUX):
$(WINDOWS):
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o $(WINDOWS) -ldflags "-X main.date=$(DATE) -X main.vers=$(VERS) -X main.hash=$(HASH)" ./cmd/$(BIN)

test: test-binary test-node test-python test-quarkus test-go
test: test-binary test-node test-python test-quarkus test-go test-typescript

test-binary:
go test -race -cover -coverprofile=coverage.out ./...
Expand All @@ -61,6 +63,10 @@ test-node:
cd templates/node/events && npm ci && npm test && rm -rf node_modules
cd templates/node/http && npm ci && npm test && rm -rf node_modules

test-typescript:
cd templates/typescript/events && npm ci && npm test && rm -rf node_modules build
cd templates/typescript/http && npm ci && npm test && rm -rf node_modules build

test-python:
cd templates/python/events && pip3 install -r requirements.txt && python3 test_func.py
cd templates/python/http && python3 test_func.py
Expand Down
1 change: 1 addition & 0 deletions buildpacks/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var RuntimeToBuildpack = map[string]string{
"go": "quay.io/boson/faas-go-builder",
"springboot": "quay.io/boson/faas-springboot-builder",
"python": "quay.io/boson/faas-python-builder",
"typescript": "quay.io/boson/faas-nodejs-builder",
}

// Build the Function at path.
Expand Down
Loading

0 comments on commit d3eafe2

Please sign in to comment.