From 654adeaa5f6fa87638db7ce118486b3083d27975 Mon Sep 17 00:00:00 2001 From: Garrett Serack Date: Fri, 2 Feb 2018 16:13:08 -0800 Subject: [PATCH] compiles. that's it. --- .npmignore | 11 +++++++++++ main.ts | 17 ++++++++++++++++- normalizer/main.ts | 18 ++++++++++++++++++ package.json | 3 ++- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000000..5dd21578dd2 --- /dev/null +++ b/.npmignore @@ -0,0 +1,11 @@ +!dist/**/* +test/ +dist/test/ +package/ +.npmignore +tsconfig.json +*.ts +!*.d.ts +*.tgz +.vscode +.scripts \ No newline at end of file diff --git a/main.ts b/main.ts index 9455d3f4a79..cc5250f5720 100644 --- a/main.ts +++ b/main.ts @@ -1,2 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -console.log("hi"); \ No newline at end of file +import { AutoRestExtension, } from "@microsoft.azure/autorest-extension-base"; +import { process as normalizer } from "./normalizer/main"; + +async function main() { + const pluginHost = new AutoRestExtension(); + + pluginHost.Add("normalizer", normalizer); + + await pluginHost.Run(); +} + +main(); \ No newline at end of file diff --git a/normalizer/main.ts b/normalizer/main.ts index e69de29bb2d..de0bb9e0c7d 100644 --- a/normalizer/main.ts +++ b/normalizer/main.ts @@ -0,0 +1,18 @@ +import { Host } from "@microsoft.azure/autorest-extension-base"; + +export async function process(service: Host) { + // Get the list of files + const files = await service.ListInputs(); + + // + for (const file of files) { + const openapiDefinitionDocument = await service.ReadFile(file); + + } + + + // Get the code model + // const codeModel: CodeModel = load(await service.GetValue("code-model-v1.yaml")); + + +} \ No newline at end of file diff --git a/package.json b/package.json index 0e8457ed070..bbcda5573e2 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "typescript": "^2.6.1" }, "dependencies": { - "@microsoft.azure/tasks": "^2.0.12" + "@microsoft.azure/tasks": "^2.0.12", + "@microsoft.azure/autorest-extension-base": "1.0.13" } }