Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR servicebus/resource-manager] Add servicebus/resource-manager/readme.typescript.md #168

Merged
merged 82 commits into from
Oct 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
d819803
Generate @azure/arm-servicefabric package
kpajdzik Oct 10, 2018
2a8bf7b
Generate @azure/arm-containerservice package
kpajdzik Oct 10, 2018
7c8ebde
add code of conduct to the readme and contributing doc
jiyeonseo Oct 11, 2018
eb37c33
Generate @azure/arm-customerinsights package
kpajdzik Oct 11, 2018
78188db
Generate @azure/arm-datafactory package
kpajdzik Oct 11, 2018
c33c3b3
Generate @azure/arm-datamigration package
kpajdzik Oct 11, 2018
070d7b2
Generate @azure/arm-devtestlabs package
kpajdzik Oct 11, 2018
ab2fa52
Generate @azure/arm-frontdoor package
kpajdzik Oct 11, 2018
06176d4
Generate servicefabric package with the correct name
kpajdzik Oct 11, 2018
8551ce3
Remove package with incorrect name
kpajdzik Oct 11, 2018
a7e6129
Generated from a90288c3762cb1ac6f3998e2cd1c23d33f37dcb4
AutorestCI Oct 11, 2018
565997f
Generated from f40292b667f4b6ce5b580131a308c336c9a9c9fc
AutorestCI Oct 12, 2018
2ce2261
Generated from 0e674c326306c1f36684403445db833f3dae4a9a
AutorestCI Oct 12, 2018
ce90d93
Generate @azure/arm-containerservice package
kpajdzik Oct 12, 2018
e374b82
Merge pull request #83 from Azure/generated/@azure/arm-containerservi…
Oct 12, 2018
3132469
Merge pull request #101 from Azure/generated/@azure/arm-frontdoor-201…
Oct 12, 2018
17bf21c
Merge pull request #84 from jiyeonseo/master
Oct 12, 2018
cc45296
Merge pull request #97 from Azure/generated/@azure/arm-devtestlabs-20…
Oct 12, 2018
2f02a6e
Update SwaggerToSDK generator version to 2.0.559
Oct 12, 2018
3e10bb1
Merge pull request #82 from Azure/generated/@azure/arm-servicefabric-…
Oct 12, 2018
7a68bdc
Merge pull request #86 from Azure/generated/@azure/arm-customerinsigh…
Oct 12, 2018
85ce191
Merge pull request #90 from Azure/generated/@azure/arm-datafactory-20…
Oct 12, 2018
afbf2ce
Merge pull request #93 from Azure/generated/@azure/arm-datamigration-…
Oct 12, 2018
a6a86ac
Add generating readme files and SDKs (#39)
kpajdzik Oct 12, 2018
16a1a38
Generated from f3b3520c32cfe447a5f85b6491d65d59855b440a (#176)
AutorestCI Oct 12, 2018
bf310b0
Generated from 4e40c606f9da0b2bc4d5fc95cb7d6fe072cf2170 (#138)
AutorestCI Oct 15, 2018
3a65c35
Update generator version for Swagger to SDK
Oct 15, 2018
b17e795
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-js
Oct 15, 2018
29acdb4
Merge branch 'master' into daschult/swaggerToSdk
Oct 15, 2018
32d3b76
Merge pull request #170 from Azure/daschult/swaggerToSdk
Oct 15, 2018
f67bd2e
Merge pull request #158 from Azure/generated/@azure/arm-containerserv…
Oct 15, 2018
df48c71
Merge branch 'master' into restapi_auto_containerservices/resource-ma…
Oct 15, 2018
b376451
Remove unnecessary generated files
Oct 15, 2018
457cd1c
Merge pull request #181 from Azure/restapi_auto_containerservices/res…
Oct 15, 2018
ad3f89a
Merge branch 'master' into restapi_auto_containerregistry/resource-ma…
Oct 15, 2018
63a171c
Regenerate arm-containerregistry
Oct 15, 2018
eca2174
[AutoPR consumption/resource-manager] Introducing New Version 2018-10…
AutorestCI Oct 15, 2018
91ca2c2
Merge pull request #177 from Azure/restapi_auto_containerregistry/res…
Oct 15, 2018
fdda00a
Merge branch 'master' into restapi_auto_consumption/resource-manager
Oct 15, 2018
05d3570
Generated from 702e8f7ab327cd8fe694ed64684a300ed6bed1d9 (#185)
AutorestCI Oct 15, 2018
032f620
Regenerate arm-consumption
Oct 15, 2018
80b2828
Merge pull request #183 from Azure/restapi_auto_consumption/resource-…
Oct 15, 2018
91bee1e
Regenerate arm-sql
Oct 15, 2018
1033c3a
Regenerate arm-consumption
Oct 15, 2018
dee1330
Merge pull request #187 from Azure/restapi_auto_consumption/resource-…
Oct 15, 2018
babb6d9
Merge pull request #186 from Azure/restapi_auto_sql/resource-manager
Oct 15, 2018
b5cbe94
Upgrade Gulp to version 4.0.0 (#175)
kpajdzik Oct 15, 2018
6d9ead3
Generated from eed7377f78cd284d52631b7cb06ea07789c4ac68
AutorestCI Oct 15, 2018
2027522
Automate SDK regeneration (#212)
kpajdzik Oct 17, 2018
a211dec
Merge remote-tracking branch 'origin/master' into restapi_auto_genera…
kpajdzik Oct 17, 2018
87d8a4e
Regenerate package
kpajdzik Oct 17, 2018
2dd6d91
Merge remote-tracking branch 'origin/restapi_auto_generated/powerbiem…
kpajdzik Oct 17, 2018
c665779
Merge pull request #140 from Azure/restapi_auto_generated/deviceprovi…
Oct 17, 2018
cbb5a5d
Regenerated "@azure/arm-powerbiembedded" SDK.
kpajdzik Oct 17, 2018
589b96c
Merge pull request #133 from Azure/restapi_auto_generated/powerbiembe…
Oct 17, 2018
4f4743e
[AutoPR postgresql/resource-manager] Add postgresql/resource-manager/…
AutorestCI Oct 17, 2018
2e1d43a
[AutoPR eventgrid/data-plane] Add eventgrid/data-plane/readme.typescr…
AutorestCI Oct 17, 2018
79b2234
[AutoPR powerbidedicated/resource-manager] Add powerbidedicated/resou…
AutorestCI Oct 17, 2018
a1216d6
Restapi auto generated/search 2018 10 12 892 (#216)
kpajdzik Oct 17, 2018
ce91f80
[AutoPR iothub/resource-manager] Add iothub/resource-manager/readme.t…
AutorestCI Oct 17, 2018
52694fc
[AutoPR mariadb/resource-manager] Add mariadb/resource-manager/readme…
AutorestCI Oct 17, 2018
2294455
[AutoPR graphrbac/data-plane] Add graphrbac/data-plane/readme.typescr…
AutorestCI Oct 17, 2018
4dc158d
[AutoPR monitor/resource-manager] Add monitor/resource-manager/readme…
AutorestCI Oct 17, 2018
cf07adb
[AutoPR mediaservices/resource-manager] Add mediaservices/resource-ma…
AutorestCI Oct 17, 2018
a17370d
[AutoPR operationalinsights/data-plane] Add operationalinsights/data-…
AutorestCI Oct 17, 2018
2f4399d
[AutoPR notificationhubs/resource-manager] Add notificationhubs/resou…
AutorestCI Oct 17, 2018
133f2ac
[AutoPR marketplaceordering/resource-manager] Add marketplaceordering…
AutorestCI Oct 17, 2018
35077d7
[AutoPR iotspaces/resource-manager] Add iotspaces/resource-manager/re…
AutorestCI Oct 17, 2018
17c2497
[AutoPR iotcentral/resource-manager] Add iotcentral/resource-manager/…
AutorestCI Oct 17, 2018
9d6d67c
[AutoPR containerregistry/resource-manager] Add containerregistry/res…
AutorestCI Oct 17, 2018
f6c9903
[AutoPR recoveryservicessiterecovery/resource-manager] Add recoveryse…
AutorestCI Oct 17, 2018
3e3487b
[AutoPR machinelearningservices/resource-manager] Add machinelearning…
AutorestCI Oct 17, 2018
d638d4a
[AutoPR machinelearningcompute/resource-manager] Add machinelearningc…
AutorestCI Oct 17, 2018
1272695
[AutoPR eventgrid/resource-manager] Add eventgrid/resource-manager/re…
AutorestCI Oct 17, 2018
7929378
[AutoPR deploymentmanager/resource-manager] Add deploymentmanager/res…
AutorestCI Oct 17, 2018
73d648e
[AutoPR reservations/resource-manager] Add reservations/resource-mana…
AutorestCI Oct 17, 2018
6230b26
[AutoPR devtestlabs/resource-manager] Add devtestlabs/resource-manage…
AutorestCI Oct 17, 2018
e2508c2
[AutoPR devspaces/resource-manager] Add devspaces/resource-manager/re…
AutorestCI Oct 17, 2018
8089afd
[AutoPR datafactory/resource-manager] Add datafactory/resource-manage…
AutorestCI Oct 17, 2018
7878f46
Merge remote-tracking branch 'origin/restapi_auto_generated/servicebu…
kpajdzik Oct 17, 2018
a9dc660
Regenerated "@azure/arm-servicebus" SDK.
kpajdzik Oct 17, 2018
7e17af9
Remove arm-sb folder
kpajdzik Oct 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
74 changes: 74 additions & 0 deletions .scripts/commandLine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

import * as minimist from "minimist";
import { arrayContains } from "./common";

export interface CommandLineOptions extends minimist.ParsedArgs {
"azure-sdk-for-js-repo-root": string;
"azure-rest-api-specs-root": string;
debugger: boolean;
"logging-level": string;
package: string;
"skip-sdk": boolean;
"skip-spec": boolean;
type: string;
use: boolean;
verbose: boolean;
whatif: boolean;
getSdkType(): SdkType;
}

export const commandLineConfiguration = {
string: ["azure-sdk-for-js-repo-root", "azure-rest-api-specs-root", "logging-level", "package", "type"],
boolean: ["debugger", "use", "skip-sdk", "skip-spec", "verbose", "whatif"],
alias: {
l: "logging-level",
log: "logging-level",
package: "packageName",
u: "use",
v: "version",
},
default: {
"logging-level": "info",
type: "arm"
}
};

export enum SdkType {
ResourceManager = "resource-manager",
DataPlane = "data-plane",
ControlPlane = "control-plane"
}

let _options: CommandLineOptions;
export function getCommandLineOptions() {
if (!_options) {
_options = createCommandLineParameters();
}

return _options;
}

function createCommandLineParameters() {
const args = minimist(process.argv.slice(2), commandLineConfiguration) as CommandLineOptions;
args.getSdkType = getSdkType;
return args;
}

export function getSdkType() {
const resourceManagerStrings = ["arm", "rm", "resourcemanager"]
const dataPlaneStrings = ["dp", "data", "dataplane"]

const type = this.type.toLowerCase().replace("-", "");
if (arrayContains(resourceManagerStrings, type)) {
return SdkType.ResourceManager;
} else if (arrayContains(dataPlaneStrings, type)) {
return SdkType.DataPlane;
} else {
throw new Error("Unknown SDK type");
}
}
22 changes: 0 additions & 22 deletions .scripts/commandLineOptions.ts

This file was deleted.

57 changes: 57 additions & 0 deletions .scripts/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

import * as fssync from "fs";
import { promises as fs } from "fs";
import { execSync } from "child_process";
import { getLogger } from "./logger";

const _logger = getLogger();

export function arrayContains<T>(array: T[], el: T): boolean {
return array.indexOf(el) != -1
}

export async function isDirectory(directoryPath: string): Promise<boolean> {
const stats = await fs.lstat(directoryPath);
return stats.isDirectory();
}

export async function pathExists(path: string): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
fssync.exists(path, exists => {
resolve(exists);
})
});
}

export function startsWith(value: string, prefix: string): boolean {
return value && prefix && value.indexOf(prefix) === 0;
}

export function endsWith(value: string, suffix: string): boolean {
return value && suffix && value.length >= suffix.length && value.lastIndexOf(suffix) === value.length - suffix.length;
}

export function contains(values: string[], searchString: string): boolean {
return arrayContains(values, searchString);
}

export function execute(command: string, packageFolderPath: string): void {
if (!fssync.existsSync(packageFolderPath)) {
_logger.logWithPath(packageFolderPath, "Folder not found.");
} else {
execSync(command, { cwd: packageFolderPath, stdio: "inherit" });
}
}

export function npmRunBuild(packageFolderPath: string): void {
execute("npm run build", packageFolderPath);
}

export function npmInstall(packageFolderPath: string): void {
execute("npm install", packageFolderPath);
}
Loading