Skip to content

Commit

Permalink
Update codemodel pacakge (#865)
Browse files Browse the repository at this point in the history
* Update codemodel dependency package

* update smoke packages
  • Loading branch information
joheredi authored Feb 17, 2021
1 parent 023ed10 commit 12ddc25
Show file tree
Hide file tree
Showing 38 changed files with 115 additions and 132 deletions.
146 changes: 61 additions & 85 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"LICENSE"
],
"dependencies": {
"@autorest/extension-base": "^3.1.0",
"@autorest/codemodel": "^4.14.5",
"@autorest/extension-base": "^3.2.0",
"@azure-tools/codegen": "^2.4.267",
"@azure-tools/codemodel": "^4.13.339",
"@azure/core-http": "^1.2.1-alpha.20201203.2",
"@azure/core-lro": "^1.0.1",
"@azure/core-paging": "^1.1.3",
Expand Down Expand Up @@ -71,7 +71,7 @@
"karma-source-map-support": "^1.4.0",
"karma-typescript": "^5.0.3",
"karma-typescript-es6-transform": "^5.0.3",
"mocha": "6.2.1",
"mocha": "^6.2.1",
"mocha-typescript": "1.1.17",
"moment": "^2.24.0",
"node-cmd": "^3.0.0",
Expand Down
10 changes: 6 additions & 4 deletions src/generators/clientContextFileGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { normalizeName, NameType } from "../utils/nameUtils";
import { ClientDetails } from "../models/clientDetails";
import { PackageDetails } from "../models/packageDetails";
import { ParameterDetails } from "../models/parameterDetails";
import { ImplementationLocation, SchemaType } from "@azure-tools/codemodel";
import { ImplementationLocation, SchemaType } from "@autorest/codemodel";
import { EndpointDetails } from "../transforms/urlTransforms";
import { formatJsDocParam } from "./utils/parameterUtils";

Expand Down Expand Up @@ -50,11 +50,13 @@ export function generateClientContext(

const contextClass = buildClass(sourceFile, clientContextClassName);

if(hideClients) {
if (hideClients) {
contextClass.addJsDoc({
tags: [{
tags: [
{
tagName: "hidden"
}],
}
]
});
}

Expand Down
16 changes: 11 additions & 5 deletions src/generators/clientFileGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
writeGetOperationOptions
} from "./operationGenerator";
import { normalizeName, NameType } from "../utils/nameUtils";
import { ImplementationLocation, SchemaType } from "@azure-tools/codemodel";
import { ImplementationLocation, SchemaType } from "@autorest/codemodel";
import {
OperationDetails,
OperationGroupDetails
Expand All @@ -27,7 +27,11 @@ import { addPagingImports } from "./utils/pagingOperations";

type OperationDeclarationDetails = { name: string; typeName: string };

export function generateClient(clientDetails: ClientDetails, project: Project, hideClients: boolean) {
export function generateClient(
clientDetails: ClientDetails,
project: Project,
hideClients: boolean
) {
const clientContextClassName = `${clientDetails.className}Context`;
const hasMappers = !!clientDetails.mappers.length;

Expand Down Expand Up @@ -123,11 +127,13 @@ export function generateClient(clientDetails: ClientDetails, project: Project, h
isExported: true
});

if(hideClients) {
if (hideClients) {
clientClass.addJsDoc({
tags: [{
tags: [
{
tagName: "hidden"
}],
}
]
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/generators/modelsGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
ImplementationLocation,
Parameter,
SchemaType
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { KnownMediaType } from "@azure-tools/codegen";
import { getStringForValue } from "../utils/valueHelpers";
import { getLanguageMetadata } from "../utils/languageHelpers";
Expand Down
2 changes: 1 addition & 1 deletion src/generators/operationGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
ChoiceSchema,
SealedChoiceSchema,
ConstantSchema
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { getLanguageMetadata } from "../utils/languageHelpers";
import { shouldImportParameters } from "./utils/importUtils";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/generators/parametersGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ParameterLocation } from "@azure-tools/codemodel";
import { ParameterLocation } from "@autorest/codemodel";
import {
Project,
VariableDeclarationKind,
Expand Down
2 changes: 1 addition & 1 deletion src/generators/utils/parameterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SchemaType,
ParameterLocation,
Parameter
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { wrapString, IndentationType } from "./stringUtils";
import { ClassDeclaration } from "ts-morph";
import { ParameterWithDescription } from "./docsUtils";
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
startSession
} from "@autorest/extension-base";
import { generateTypeScriptLibrary } from "./typescriptGenerator";
import { CodeModel, codeModelSchema } from "@azure-tools/codemodel";
import { CodeModel, codeModelSchema } from "@autorest/codemodel";

export async function processRequest(host: Host) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/models/modelDetails.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { ObjectSchema } from "@azure-tools/codemodel";
import { ObjectSchema } from "@autorest/codemodel";

export type ObjectDetails =
| BasicObjectDetails
Expand Down
2 changes: 1 addition & 1 deletion src/models/operationDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Language as ModelerLanguage,
Parameter,
VirtualParameter
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { KnownMediaType } from "@azure-tools/codegen";
import { Mapper } from "@azure/core-http";
import { ParameterDetails } from "./parameterDetails";
Expand Down
2 changes: 1 addition & 1 deletion src/models/parameterDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
AllSchemaTypes,
ImplementationLocation,
VirtualParameter
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { Mapper } from "@azure/core-http";
import { TypeDetails } from "./modelDetails";
import { KnownMediaType } from "@azure-tools/codegen";
Expand Down
2 changes: 1 addition & 1 deletion src/models/unionDetails.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { SchemaType } from "@azure-tools/codemodel";
import { SchemaType } from "@autorest/codemodel";

/**
* Details of a typed value union, transformed from ChoiceSchema.
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Protocol,
ParameterLocation,
ImplementationLocation
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { cloneOperation } from "../utils/cloneOperation";
import { extractPaginationDetails } from "../utils/extractPaginationDetails";
import { getLanguageMetadata } from "../utils/languageHelpers";
Expand Down
2 changes: 1 addition & 1 deletion src/transforms/groupTransforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GroupSchema,
GroupProperty,
ObjectSchema
} from "@azure-tools/codemodel";
} from "@autorest/codemodel";
import { getLanguageMetadata } from "../utils/languageHelpers";
import { ObjectDetails, ObjectKind } from "../models/modelDetails";
import { transformProperty } from "./objectTransforms";
Expand Down
Loading

0 comments on commit 12ddc25

Please # to comment.