Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/Dockerfile
**/node_modules
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 125

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ logs
*.log
npm-debug.log*

dist/

# Dependency directory
node_modules

Expand Down
49 changes: 34 additions & 15 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
include:
- 'https://gitlab.com/smartive/open-source/gitlab-ci-templates/raw/master/templates.yml'
- project: 'smartive/ci-templates'
ref: v1.4.1
file: '/github/defaults/npm.yml'
- project: 'smartive/ci-templates'
ref: v1.4.1
file: '/general/build.yml'
- project: 'smartive/ci-templates'
ref: v1.4.1
file: '/cloud-run/deploy.yml'

variables:
REPO: 'smartive/giuseppe'

stages:
- test
- test report
- release
- deploy

test:
extends: .base
stage: test
image: node:10
create release:
before_script:
- npm ci
- npx lerna bootstrap
script:
- npm test
- npm run build

release:
extends: .create-release
build documentation:
extends: .gcb-docker
stage: release
before_script:
- npm ci
- npx lerna bootstrap
- npm run build
variables:
SUB_REGISTRY: $REGISTRY
SUB_CI_PROJECT_NAMESPACE: $CI_PROJECT_NAMESPACE
SUB_CI_PROJECT_NAME: $CI_PROJECT_NAME
SUB_TAG: $CI_COMMIT_TAG
only:
- tags

deploy documentation:
extends: .cloud-run-public-static-site
stage: deploy
variables:
NAME: smartive-opensource-giuseppe-documentation
IMAGE: ${REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/docs:${CI_COMMIT_TAG}
URL: giuseppe
only:
- master
- tags
File renamed without changes.
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json.schemastore.org/prettierrc",
"singleQuote": true,
"printWidth": 125,
"trailingComma": "all",
"arrowParens": "always"
}
File renamed without changes.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,20 @@ decorators and annotations named after the great Italian componist Giuseppe Verd
but not a great piece of musical history! We compose routes for you. giuseppe is dedicated to
[Express](http://expressjs.com/) and depends on it. We were tired of writing all the route registrations by ourselves.

[![Build Status](https://travis-ci.org/smartive/giuseppe.svg)](https://travis-ci.org/smartive/giuseppe)
[![Build Status](https://ci.appveyor.com/api/projects/status/7m14ruqjaopwbfn4?svg=true)](https://ci.appveyor.com/project/buehler/giuseppe)
[![npm](https://img.shields.io/npm/v/giuseppe.svg?maxAge=3600)](https://www.npmjs.com/package/giuseppe)
[![Coverage status](https://img.shields.io/coveralls/smartive/giuseppe.svg?maxAge=3600)](https://coveralls.io/github/smartive/giuseppe)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Greenkeeper badge](https://badges.greenkeeper.io/smartive/giuseppe.svg)](https://greenkeeper.io/)

## Installation

To install this package, simply run

[![NPM](https://nodei.co/npm/giuseppe.png?downloads=true&stars=true)](https://nodei.co/npm/giuseppe/)

Or use the yeoman generator which we created @ [generator-giuseppe](https://github.com/smartive/generator-giuseppe).
If you want to create a plugin for giuseppe, use the other yeoman generator @
[generator-giuseppe-plugin](https://github.com/smartive/generator-giuseppe-plugin)

## Documentation and examples

All of our documentation and examples are available on [giuseppe.smartive.ch](http://giuseppe.smartive.ch).
All of our documentation and examples are available on [giuseppe.cloud-run.smartive.cloud](http://giuseppe.cloud-run.smartive.cloud).

## Changelog

The changelog is generated by [semantic release](https://github.com/semantic-release/semantic-release) and is located under
the [release section](https://github.com/smartive/giuseppe-version-plugin/releases).
the [release section](https://github.com/smartive/giuseppe/releases).

## Licence

Expand Down
7 changes: 7 additions & 0 deletions cloudbuild/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
steps:
- name: gcr.io/kaniko-project/executor:latest
id: docs
args:
- --dockerfile=./docs/Dockerfile
- --cache=true
- --destination=${_REGISTRY}/${_CI_PROJECT_NAMESPACE}/${_CI_PROJECT_NAME}/docs:${_TAG}
21 changes: 21 additions & 0 deletions config/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"moduleResolution": "node",
"removeComments": false,
"outDir": "../build",
"rootDir": "../src",
"declaration": true,
"sourceMap": false,
"importHelpers": true,
"strict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"lib": ["ES2015", "ES2016", "ES2017", "ES2018"]
},
"include": ["../src/**/*"],
"exclude": ["../node_modules", "../build"]
}
7 changes: 7 additions & 0 deletions config/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "../dist"
},
"exclude": ["../node_modules", "../build", "../test"]
}
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
api/
10 changes: 10 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:12 as build-api
WORKDIR /app
COPY package* ./
RUN npm ci
COPY ./ ./
RUN npm run typedoc

FROM starefossen/github-pages as final
COPY --from=build-api /app/docs/ /usr/src/app/
CMD jekyll serve -d /_site --watch --force_polling -H 0.0.0.0 -P 8080
File renamed without changes.
File renamed without changes.
42 changes: 14 additions & 28 deletions packages/giuseppe/docs/index.md → docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
layout: default
title: giuseppe - by smartive AG
---

giuseppe [Italian: dʒuˈzɛppe] is a controller routing system for [Express](http://expressjs.com/) using [TypeScript](https://www.typescriptlang.org/)
decorators and annotations named after the great Italian componist Giuseppe Verdi. Like Verdi,
it composes things, but not a great piece of musical history! We compose routes for you. giuseppe is dedicated to
[Express](http://expressjs.com/) and depends on it. We were tired of writing all the route registrations by ourselves.

[![Build Status](https://travis-ci.org/smartive/giuseppe.svg)](https://travis-ci.org/smartive/giuseppe)
[![Build Status](https://ci.appveyor.com/api/projects/status/7m14ruqjaopwbfn4?svg=true)](https://ci.appveyor.com/project/buehler/giuseppe)
[![npm](https://img.shields.io/npm/v/giuseppe.svg?maxAge=3600)](https://www.npmjs.com/package/giuseppe)
[![Coverage status](https://img.shields.io/coveralls/smartive/giuseppe.svg?maxAge=3600)](https://coveralls.io/github/smartive/giuseppe)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

## Table of contents

- [Installation](#installation)
Expand Down Expand Up @@ -62,10 +57,7 @@ is compiled in the correct way.
"experimentalDecorators": true,
"emitDecoratorMetadata": true
},
"exclude": [
"node_modules",
"build"
]
"exclude": ["node_modules", "build"]
}
```

Expand All @@ -84,12 +76,10 @@ import { Controller, Get, Giuseppe } from 'giuseppe';

@Controller()
class PingPongController {

@Get('ping')
public ping(): any {
return {ping: 'pong'};
}

@Get('ping')
public ping(): any {
return { ping: 'pong' };
}
}

const giusi = new Giuseppe();
Expand All @@ -111,22 +101,18 @@ import { Controller, Get, Query } from 'giuseppe';

@Controller()
export class PingPongController {

@Get('ping')
public ping(): any {
return {ping: 'pong'};
}

@Get('ping')
public ping(): any {
return { ping: 'pong' };
}
}

@Controller('echo')
export class EchoController {

@Get()
public ping(@Query('data') data: string): string {
return 'you gave me: ' + data;
}

@Get()
public ping(@Query('data') data: string): string {
return 'you gave me: ' + data;
}
}
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions jest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"preset": "ts-jest",
"testEnvironment": "node",
"globals": {
"ts-jest": {
"diagnostics": false
}
}
}
6 changes: 0 additions & 6 deletions lerna.json

This file was deleted.

Loading