forked from loafle/openapi-generator-original
[Typescript] remove deprecated typings (#2880)
* [Typescript] remove deprecated typings * add typescript-v7 CI tests
This commit is contained in:
parent
87c9de210f
commit
3014ece6d8
@ -263,7 +263,6 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
|||||||
|
|
||||||
//Files for building our lib
|
//Files for building our lib
|
||||||
supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json"));
|
supportingFiles.add(new SupportingFile("package.mustache", getIndexDirectory(), "package.json"));
|
||||||
supportingFiles.add(new SupportingFile("typings.mustache", getIndexDirectory(), "typings.json"));
|
|
||||||
supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json"));
|
supportingFiles.add(new SupportingFile("tsconfig.mustache", getIndexDirectory(), "tsconfig.json"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg
|
|||||||
supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts"));
|
supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts"));
|
||||||
supportingFiles.add(new SupportingFile("variables.mustache", getIndexDirectory(), "variables.ts"));
|
supportingFiles.add(new SupportingFile("variables.mustache", getIndexDirectory(), "variables.ts"));
|
||||||
|
|
||||||
//LOGGER.warn("check additionals: " + additionalProperties.get(NPM_NAME));
|
|
||||||
if (additionalProperties.containsKey(NPM_NAME)) {
|
if (additionalProperties.containsKey(NPM_NAME)) {
|
||||||
addNpmPackageGeneration();
|
addNpmPackageGeneration();
|
||||||
}
|
}
|
||||||
@ -159,7 +158,6 @@ public class TypeScriptJqueryClientCodegen extends AbstractTypeScriptClientCodeg
|
|||||||
//Files for building our lib
|
//Files for building our lib
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", getPackageRootDirectory(), "README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", getPackageRootDirectory(), "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("package.mustache", getPackageRootDirectory(), "package.json"));
|
supportingFiles.add(new SupportingFile("package.mustache", getPackageRootDirectory(), "package.json"));
|
||||||
supportingFiles.add(new SupportingFile("typings.mustache", getPackageRootDirectory(), "typings.json"));
|
|
||||||
supportingFiles.add(new SupportingFile("tsconfig.mustache", getPackageRootDirectory(), "tsconfig.json"));
|
supportingFiles.add(new SupportingFile("tsconfig.mustache", getPackageRootDirectory(), "tsconfig.json"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -15,7 +15,7 @@ Module system
|
|||||||
* CommonJS
|
* CommonJS
|
||||||
* ES6 module system
|
* ES6 module system
|
||||||
|
|
||||||
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
|
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html))
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
#
|
#
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-typescript-jquery "minor update"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bluebird": "^3.3.5",
|
"bluebird": "^3.3.5",
|
||||||
"request": "^2.72.0",
|
"request": "^2.72.0",
|
||||||
"jquery": "^3.1.1"
|
"jquery": "^3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "2.2.2",
|
"@types/jquery": "^3.1",
|
||||||
"typings": "^1.3.0"
|
"typescript": "^2.4"
|
||||||
}{{#npmRepository}},
|
}{{#npmRepository}},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "{{npmRepository}}"
|
"registry": "{{npmRepository}}"
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"index.ts",
|
"index.ts"
|
||||||
"typings/index.d.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"ambientDependencies": {
|
|
||||||
"bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
|
|
||||||
"node": "registry:dt/node#4.0.0+20160423143914"
|
|
||||||
},
|
|
||||||
"globalDependencies": {
|
|
||||||
"jquery": "registry:dt/jquery#1.10.0+20170310222111"
|
|
||||||
}
|
|
||||||
}
|
|
2
pom.xml
2
pom.xml
@ -1050,6 +1050,7 @@
|
|||||||
<module>samples/client/petstore/typescript-angular-v4/npm</module>
|
<module>samples/client/petstore/typescript-angular-v4/npm</module>
|
||||||
<module>samples/client/petstore/typescript-angular-v4.3/npm</module>
|
<module>samples/client/petstore/typescript-angular-v4.3/npm</module>
|
||||||
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
|
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
|
||||||
|
<module>samples/client/petstore/typescript-angular-v7-provided-in-root</module>
|
||||||
<!--<module>samples/client/petstore/bash</module>-->
|
<!--<module>samples/client/petstore/bash</module>-->
|
||||||
<module>samples/server/petstore/rust-server</module>
|
<module>samples/server/petstore/rust-server</module>
|
||||||
<module>samples/server/petstore/python-aiohttp</module>
|
<module>samples/server/petstore/python-aiohttp</module>
|
||||||
@ -1070,7 +1071,6 @@
|
|||||||
<!-- clients -->
|
<!-- clients -->
|
||||||
<!-- test non-java projects -->
|
<!-- test non-java projects -->
|
||||||
<module>samples/client/petstore/go</module>
|
<module>samples/client/petstore/go</module>
|
||||||
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
|
|
||||||
<!-- test java-related projects -->
|
<!-- test java-related projects -->
|
||||||
<!--<module>samples/client/petstore/scala-akka</module>-->
|
<!--<module>samples/client/petstore/scala-akka</module>-->
|
||||||
<module>samples/client/petstore/scala-httpclient</module>
|
<module>samples/client/petstore/scala-httpclient</module>
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"globalDependencies": {
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,7 +14,7 @@ describe('AppComponent', () => {
|
|||||||
|
|
||||||
const apiConfigurationParams: ConfigurationParameters = {
|
const apiConfigurationParams: ConfigurationParameters = {
|
||||||
// add configuration params here
|
// add configuration params here
|
||||||
apiKeys: { api_key: "foobar" },
|
apiKeys: { api_key: 'foobar' },
|
||||||
};
|
};
|
||||||
|
|
||||||
const apiConfig = new Configuration(apiConfigurationParams);
|
const apiConfig = new Configuration(apiConfigurationParams);
|
||||||
@ -47,17 +47,17 @@ describe('AppComponent', () => {
|
|||||||
expect(app).toBeTruthy();
|
expect(app).toBeTruthy();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it(`should have as title 'Typescript Angular v6 (provided in root)'`, async(() => {
|
it(`should have as title 'Typescript Angular v7 (provided in root)'`, async(() => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
const app = fixture.debugElement.componentInstance;
|
const app = fixture.debugElement.componentInstance;
|
||||||
expect(app.title).toEqual('Typescript Angular v6 (provided in root)');
|
expect(app.title).toEqual('Typescript Angular v7 (provided in root)');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should render title in a h1 tag', async(() => {
|
it('should render title in a h1 tag', async(() => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const compiled = fixture.debugElement.nativeElement;
|
const compiled = fixture.debugElement.nativeElement;
|
||||||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Typescript Angular v6 (provided in root)!');
|
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Typescript Angular v7 (provided in root)!');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe(`constructor()`, () => {
|
describe(`constructor()`, () => {
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
styleUrls: ['./app.component.css']
|
styleUrls: ['./app.component.css']
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
title = 'Typescript Angular v6 (provided in root)';
|
title = 'Typescript Angular v7 (provided in root)';
|
||||||
pet: Pet;
|
pet: Pet;
|
||||||
store: { key: string, number: number }[];
|
store: { key: string, number: number }[];
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ describe(`API (functionality)`, () => {
|
|||||||
|
|
||||||
const apiConfigurationParams: ConfigurationParameters = {
|
const apiConfigurationParams: ConfigurationParameters = {
|
||||||
// add configuration params here
|
// add configuration params here
|
||||||
apiKeys: { api_key: "foobar" }
|
apiKeys: { api_key: 'foobar' }
|
||||||
};
|
};
|
||||||
|
|
||||||
const apiConfig = new Configuration(apiConfigurationParams);
|
const apiConfig = new Configuration(apiConfigurationParams);
|
||||||
@ -109,6 +109,23 @@ describe(`API (functionality)`, () => {
|
|||||||
);
|
);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it(`should update the pet name by form`, async(() => {
|
||||||
|
const petService = TestBed.get(PetService);
|
||||||
|
const newName = `pet-${Date.now()}`;
|
||||||
|
createdPet.name = newName;
|
||||||
|
|
||||||
|
petService.updatePetWithForm(createdPet.id, createdPet.name).subscribe(
|
||||||
|
result => expect(result).toBeFalsy(),
|
||||||
|
error => fail(`expected a result, not the error: ${error.message}`),
|
||||||
|
);
|
||||||
|
|
||||||
|
return petService.getPetById(createdPet.id).subscribe(
|
||||||
|
result => expect(result.name).toEqual(createdPet.name),
|
||||||
|
error => fail(`expected a result, not the error: ${error.message}`),
|
||||||
|
);
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
it(`should delete the pet`, async(() => {
|
it(`should delete the pet`, async(() => {
|
||||||
const petService = TestBed.get(PetService);
|
const petService = TestBed.get(PetService);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
#
|
#
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-typescript-jquery "minor update"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
|
@ -15,7 +15,7 @@ Module system
|
|||||||
* CommonJS
|
* CommonJS
|
||||||
* ES6 module system
|
* ES6 module system
|
||||||
|
|
||||||
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
|
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html))
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
#
|
#
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-typescript-jquery "minor update"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bluebird": "^3.3.5",
|
"bluebird": "^3.3.5",
|
||||||
"request": "^2.72.0",
|
"request": "^2.72.0",
|
||||||
"jquery": "^3.1.1"
|
"jquery": "^3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "2.2.2",
|
"@types/jquery": "^3.1",
|
||||||
"typings": "^1.3.0"
|
"typescript": "^2.4"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://skimdb.npmjs.com/registry"
|
"registry": "https://skimdb.npmjs.com/registry"
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"index.ts",
|
"index.ts"
|
||||||
"typings/index.d.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"ambientDependencies": {
|
|
||||||
"bluebird": "registry:dt/bluebird#2.0.0+20160319051630",
|
|
||||||
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
|
|
||||||
"node": "registry:dt/node#4.0.0+20160423143914"
|
|
||||||
},
|
|
||||||
"globalDependencies": {
|
|
||||||
"jquery": "registry:dt/jquery#1.10.0+20170310222111"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user