Skip to content

Commit

Permalink
[Typescript] remove deprecated typings (#2880)
Browse files Browse the repository at this point in the history
* [Typescript] remove deprecated typings

* add typescript-v7 CI tests
  • Loading branch information
karismann authored and wing328 committed May 20, 2019
1 parent 87c9de2 commit 3014ece
Show file tree
Hide file tree
Showing 26 changed files with 41 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ private void addNpmPackageGeneration(SemVer ngVersion) {

//Files for building our lib
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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("index.mustache", getIndexDirectory(), "index.ts"));
supportingFiles.add(new SupportingFile("variables.mustache", getIndexDirectory(), "variables.ts"));

//LOGGER.warn("check additionals: " + additionalProperties.get(NPM_NAME));
if (additionalProperties.containsKey(NPM_NAME)) {
addNpmPackageGeneration();
}
Expand Down Expand Up @@ -159,7 +158,6 @@ private void addNpmPackageGeneration() {
//Files for building our lib
supportingFiles.add(new SupportingFile("README.mustache", getPackageRootDirectory(), "README.md"));
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"));
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Module system
* CommonJS
* 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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# 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_repo_id=$2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"dependencies": {
"bluebird": "^3.3.5",
"request": "^2.72.0",
"jquery": "^3.1.1"
"jquery": "^3.1"
},
"devDependencies": {
"typescript": "2.2.2",
"typings": "^1.3.0"
"@types/jquery": "^3.1",
"typescript": "^2.4"
}{{#npmRepository}},
"publishConfig":{
"registry":"{{npmRepository}}"
"publishConfig": {
"registry": "{{npmRepository}}"
}{{/npmRepository}}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
]
},
"files": [
"index.ts",
"typings/index.d.ts"
"index.ts"
]
}

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@
<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-v6-provided-in-root</module>
<module>samples/client/petstore/typescript-angular-v7-provided-in-root</module>
<!--<module>samples/client/petstore/bash</module>-->
<module>samples/server/petstore/rust-server</module>
<module>samples/server/petstore/python-aiohttp</module>
Expand All @@ -1070,7 +1071,6 @@
<!-- clients -->
<!-- test non-java projects -->
<module>samples/client/petstore/go</module>
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
<!-- test java-related projects -->
<!--<module>samples/client/petstore/scala-akka</module>-->
<module>samples/client/petstore/scala-httpclient</module>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('AppComponent', () => {

const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
apiKeys: { api_key: "foobar" },
apiKeys: { api_key: 'foobar' },
};

const apiConfig = new Configuration(apiConfigurationParams);
Expand Down Expand Up @@ -47,17 +47,17 @@ describe('AppComponent', () => {
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 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(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
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()`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Typescript Angular v6 (provided in root)';
title = 'Typescript Angular v7 (provided in root)';
pet: Pet;
store: { key: string, number: number }[];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe(`API (functionality)`, () => {

const apiConfigurationParams: ConfigurationParameters = {
// add configuration params here
apiKeys: { api_key: "foobar" }
apiKeys: { api_key: 'foobar' }
};

const apiConfig = new Configuration(apiConfigurationParams);
Expand Down Expand Up @@ -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(() => {
const petService = TestBed.get(PetService);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# 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_repo_id=$2
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/typescript-jquery/npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Module system
* CommonJS
* 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

Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/typescript-jquery/npm/git_push.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# 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_repo_id=$2
Expand Down
10 changes: 5 additions & 5 deletions samples/client/petstore/typescript-jquery/npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"dependencies": {
"bluebird": "^3.3.5",
"request": "^2.72.0",
"jquery": "^3.1.1"
"jquery": "^3.1"
},
"devDependencies": {
"typescript": "2.2.2",
"typings": "^1.3.0"
"@types/jquery": "^3.1",
"typescript": "^2.4"
},
"publishConfig":{
"registry":"https://skimdb.npmjs.com/registry"
"publishConfig": {
"registry": "https://skimdb.npmjs.com/registry"
}
}
3 changes: 1 addition & 2 deletions samples/client/petstore/typescript-jquery/npm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
]
},
"files": [
"index.ts",
"typings/index.d.ts"
"index.ts"
]
}

10 changes: 0 additions & 10 deletions samples/client/petstore/typescript-jquery/npm/typings.json

This file was deleted.

0 comments on commit 3014ece

Please sign in to comment.