Ensure typescript samples are up to date (#444)

See #80
This commit is contained in:
Esteban Marin 2018-07-06 07:56:51 +02:00 committed by Jérémie Bresson
parent 804094bf51
commit 3408866b79
32 changed files with 44 additions and 59 deletions

View File

@ -25,6 +25,11 @@ sleep 5
./bin/php-slim-petstore-server.sh > /dev/null 2>&1 ./bin/php-slim-petstore-server.sh > /dev/null 2>&1
./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1 ./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1
./bin/openapi3/php-petstore.sh > /dev/null 2>&1 ./bin/openapi3/php-petstore.sh > /dev/null 2>&1
./bin/typescript-angular-petstore-all.sh > /dev/null 2>&1
./bin/typescript-fetch-petstore-all.sh > /dev/null 2>&1
./bin/typescript-node-petstore-all.sh > /dev/null 2>&1
./bin/typescript-inversify-petstore.sh > /dev/null 2>&1
# Check: # Check:
if [ -n "$(git status --porcelain)" ]; then if [ -n "$(git status --porcelain)" ]; then

View File

@ -5,6 +5,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -g typescript-angular -o samples\client\petstore\typescript-angular-v2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2 set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -4,9 +4,6 @@ If Not Exist %executable% (
mvn clean package mvn clean package
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm --additional-properties ngVersion=6.0.0
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\default --additional-properties ngVersion=6.0.0
REM it is same like like setting -D providedInRoot=true
REM set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin\typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm -D providedInRoot=true --additional-properties ngVersion=6.0.0
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -4,9 +4,6 @@ If Not Exist %executable% (
mvn clean package mvn clean package
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default --additional-properties ngVersion=6.0.0
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\default --additional-properties ngVersion=6.0.0
REM it is same like like setting -D providedInRoot=true
REM set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default -D providedInRoot=true --additional-properties ngVersion=6.0.0
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -1,5 +1,3 @@
@ECHO OFF
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% ( If Not Exist %executable% (
@ -7,8 +5,6 @@ If Not Exist %executable% (
) )
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify
echo
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify\builds\default
java %JAVA_OPTS% -jar %executable% %ags% java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -1,10 +0,0 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify
java %JAVA_OPTS% -jar %executable% %ags%

View File

@ -0,0 +1,2 @@
call .\bin\windows\typescript-node-petstore.bat
call .\bin\windows\typescript-node-petstore-with-npm.bat

View File

@ -1 +1 @@
3.0.2-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -1 +1 @@
3.0.2-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -1,4 +1,4 @@
## @swagger/angular2-typescript-petstore@0.0.1 ## @
### Building ### Building
@ -19,7 +19,7 @@ Navigate to the folder of your consuming project and run one of next commands.
_published:_ _published:_
``` ```
npm install @swagger/angular2-typescript-petstore@0.0.1 --save npm install @ --save
``` ```
_without publishing (not recommended):_ _without publishing (not recommended):_
@ -37,7 +37,7 @@ npm link
In your project: In your project:
``` ```
npm link @swagger/angular2-typescript-petstore npm link
``` ```
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. __Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
@ -52,7 +52,7 @@ In your Angular project:
``` ```
// without configuring providers // without configuring providers
import { ApiModule } from '@swagger/angular2-typescript-petstore'; import { ApiModule } from '';
import { HttpModule } from '@angular/http'; import { HttpModule } from '@angular/http';
@ -70,7 +70,7 @@ export class AppModule {}
``` ```
// configuring providers // configuring providers
import { ApiModule, Configuration, ConfigurationParameters } from '@swagger/angular2-typescript-petstore'; import { ApiModule, Configuration, ConfigurationParameters } from '';
export function apiConfigFactory (): Configuration => { export function apiConfigFactory (): Configuration => {
const params: ConfigurationParameters = { const params: ConfigurationParameters = {
@ -89,7 +89,7 @@ export class AppModule {}
``` ```
``` ```
import { DefaultApi } from '@swagger/angular2-typescript-petstore'; import { DefaultApi } from '';
export class AppComponent { export class AppComponent {
constructor(private apiGateway: DefaultApi) { } constructor(private apiGateway: DefaultApi) { }
@ -126,7 +126,7 @@ export class AppModule {
If different than the generated base path, during app bootstrap, you can provide the base path to your service. If different than the generated base path, during app bootstrap, you can provide the base path to your service.
``` ```
import { BASE_PATH } from '@swagger/angular2-typescript-petstore'; import { BASE_PATH } from '';
bootstrap(AppComponent, [ bootstrap(AppComponent, [
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' }, { provide: BASE_PATH, useValue: 'https://your-web-service.com' },
@ -135,7 +135,7 @@ bootstrap(AppComponent, [
or or
``` ```
import { BASE_PATH } from '@swagger/angular2-typescript-petstore'; import { BASE_PATH } from '';
@NgModule({ @NgModule({
imports: [], imports: [],
@ -159,7 +159,7 @@ export const environment = {
In the src/app/app.module.ts: In the src/app/app.module.ts:
``` ```
import { BASE_PATH } from '@swagger/angular2-typescript-petstore'; import { BASE_PATH } from '';
import { environment } from '../environments/environment'; import { environment } from '../environments/environment';
@NgModule({ @NgModule({

View File

@ -1 +1 @@
3.0.2-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -1 +1 @@
3.0.2-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -1 +1 @@
3.0.0-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -19,7 +19,7 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition
### Building ### Building
To build an compile the typescript sources to javascript use: To build and compile the typescript sources to javascript use:
``` ```
npm install npm install
npm run build npm run build

View File

@ -13,7 +13,7 @@
"license": "Unlicense", "license": "Unlicense",
"main": "./dist/index.js", "main": "./dist/index.js",
"typings": "./dist/index.d.ts", "typings": "./dist/index.d.ts",
"scripts": { "scripts" : {
"build": "tsc --outDir dist/", "build": "tsc --outDir dist/",
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
@ -24,7 +24,7 @@
"@types/node": "^8.0.9", "@types/node": "^8.0.9",
"typescript": "^2.0" "typescript": "^2.0"
}, },
"publishConfig": { "publishConfig":{
"registry": "https://skimdb.npmjs.com/registry" "registry":"https://skimdb.npmjs.com/registry"
} }
} }

View File

@ -19,7 +19,7 @@ It can be used in both TypeScript and JavaScript. In TypeScript, the definition
### Building ### Building
To build an compile the typescript sources to javascript use: To build and compile the typescript sources to javascript use:
``` ```
npm install npm install
npm run build npm run build

View File

@ -13,7 +13,7 @@
"license": "Unlicense", "license": "Unlicense",
"main": "./dist/index.js", "main": "./dist/index.js",
"typings": "./dist/index.d.ts", "typings": "./dist/index.d.ts",
"scripts": { "scripts" : {
"build": "tsc --outDir dist/", "build": "tsc --outDir dist/",
"prepublishOnly": "npm run build" "prepublishOnly": "npm run build"
}, },
@ -24,7 +24,7 @@
"@types/node": "^8.0.9", "@types/node": "^8.0.9",
"typescript": "^2.0" "typescript": "^2.0"
}, },
"publishConfig": { "publishConfig":{
"registry": "https://skimdb.npmjs.com/registry" "registry":"https://skimdb.npmjs.com/registry"
} }
} }

View File

@ -1 +1 @@
3.0.0-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -1 +1 @@
3.0.3-SNAPSHOT 3.1.0-SNAPSHOT

View File

@ -1 +1 @@
3.0.3-SNAPSHOT 3.1.0-SNAPSHOT