Skip to content

Commit

Permalink
Merge branch 'release/v3.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbandler committed Jan 14, 2021
2 parents fa50881 + c693464 commit d1271a6
Show file tree
Hide file tree
Showing 8 changed files with 408 additions and 290 deletions.
76 changes: 39 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
name: build

on:
push:
branches: [master, develop]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Setup node environment
uses: actions/setup-node@v1.4.2
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Download cache
uses: actions/cache@v2.0.0
with:
key: cds-routing-handlers-cache
path: node_modules

- name: Install and build
run: |
yarn install
yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: cds-routing-handlers-artifacts
path: lib
name: build

on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
# Manual run
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Setup node environment
uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Download cache
uses: actions/cache@v2.0.0
with:
key: cds-routing-handlers-cache
path: node_modules

- name: Install and build
run: |
yarn install
yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: cds-routing-handlers-artifacts
path: lib
120 changes: 60 additions & 60 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: publish

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Setup node environment
uses: actions/setup-node@v1.4.2
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Download cache
uses: actions/cache@v2.0.0
with:
key: cds-routing-handlers-cache
path: node_modules

- name: Install and build
run: |
yarn install
yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: cds-routing-handlers-artifacts
path: lib

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: cds-routing-handlers-artifacts
path: lib

- name: Setup node environment
uses: actions/setup-node@v1.4.2
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Publish to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
name: publish

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Setup node environment
uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Download cache
uses: actions/cache@v2.0.0
with:
key: cds-routing-handlers-cache
path: node_modules

- name: Install and build
run: |
yarn install
yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: cds-routing-handlers-artifacts
path: lib

publish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: cds-routing-handlers-artifacts
path: lib

- name: Setup node environment
uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Publish to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cds-routing-handlers",
"version": "3.0.3",
"version": "3.0.4",
"description": "Package to route and implement CDS handlers via a class based approach in Typescript.",
"main": "lib/index.js",
"repository": "https://github.com/mrbandler/cds-routing-handlers",
Expand All @@ -25,7 +25,7 @@
"lib"
],
"engines": {
"node": "<=12.0.0"
"node": ">=12.0.0"
},
"scripts": {
"build": "tsc",
Expand All @@ -36,9 +36,9 @@
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@sap/cds": "^4.1.9",
"@sap/cds-dk": "^3.0.0",
"@sap/cds-odata-v2-adapter-proxy": "^1.4.12",
"@sap/cds": "^4.4.9",
"@sap/cds-dk": "^3.3.4",
"@sap/cds-odata-v2-adapter-proxy": "^1.5.1",
"@types/express": "^4.17.2",
"@types/node": "^12.12.11",
"@typescript-eslint/eslint-plugin": "^2.11.0",
Expand Down
78 changes: 39 additions & 39 deletions tests/entities.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
export namespace TestService {
export enum ActionGreeter {
name = "greeter",
paramTitle = "title",
paramName = "name",
}

export interface IActionGreeterParams {
title: string;
name: string;
}

export enum FuncHello {
name = "hello",
paramName = "name",
}

export interface IFuncHelloParams {
name: string;
}

export interface IGreeter {
Id: string;
Name: string;
Message: string;
}

export enum Entity {
Greeter = "TestService.Greeter",
}

export enum SanitizedEntity {
Greeter = "Greeter",
}
}

export enum Entity {}

export enum SanitizedEntity {}
export namespace TestService {
export enum ActionGreeter {
name = "greeter",
paramTitle = "title",
paramName = "name",
}

export interface IActionGreeterParams {
title: string;
name: string;
}

export enum FuncHello {
name = "hello",
paramName = "name",
}

export interface IFuncHelloParams {
name: string;
}

export interface IGreeter {
Id: string;
Name: string;
Message: string;
}

export enum Entity {
Greeter = "TestService.Greeter",
}

export enum SanitizedEntity {
Greeter = "Greeter",
}
}

export enum Entity {}

export enum SanitizedEntity {}
8 changes: 0 additions & 8 deletions tests/middlewares/service.after.defaults.middleware.ts

This file was deleted.

8 changes: 0 additions & 8 deletions tests/middlewares/service.before.defaults.middleware.ts

This file was deleted.

4 changes: 1 addition & 3 deletions tests/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import "reflect-metadata";
import * as handler from "../lib/index";
import express from "express";
import { Container } from "typedi";
import { ServiceBeforeDefaultsMiddleware } from "./middlewares/service.before.defaults.middleware";
import { ServiceAfterDefaultsMiddleware } from "./middlewares/service.after.defaults.middleware";
import { HandlerMiddleware } from "./middlewares/handler.middleware";
import { UserCheckerImpl } from "./middlewares/user.checker";

Expand All @@ -19,7 +17,7 @@ class Main {
handler.useContainer(Container);
const hdl = handler.createCombinedHandler({
handler: [__dirname + "/handlers/**/*.js"],
middlewares: [ServiceBeforeDefaultsMiddleware, ServiceAfterDefaultsMiddleware, HandlerMiddleware],
middlewares: [HandlerMiddleware],
userChecker: UserCheckerImpl,
});
cds.serve(genPath)
Expand Down
Loading

0 comments on commit d1271a6

Please sign in to comment.