@autorest/cadl
Advanced tools
Comparing version 0.0.3 to 0.1.0-dev.1
{ | ||
"files": { | ||
"packages/extensions/cadl/.eslintrc.yaml": "93aec9adff6b9352a29933827b6fe7d43e1f2e4d", | ||
"packages/extensions/cadl/CHANGELOG.json": "1a669f9404fffe576a28a3fd031deb04a34a1e80", | ||
"packages/extensions/cadl/CHANGELOG.md": "71b15919356a3ca02971ec5c868e9e4441cada70", | ||
"packages/extensions/cadl/CHANGELOG.json": "98faed38f78c924f46f20ba608127e12d7ec3889", | ||
"packages/extensions/cadl/CHANGELOG.md": "fc2f21e8172510d8753751fbf63b043bda4809e0", | ||
"packages/extensions/cadl/jest.config.js": "1381dfc750f59545f757a7e86be313b071eccad5", | ||
"packages/extensions/cadl/package.json": "71e70b65e9d0c90227d752efd72181490fb4a84d", | ||
"packages/extensions/cadl/package.json": "7359e5f11819b329b308085f4cb6d81b1c2694c4", | ||
"packages/extensions/cadl/readme.md": "9ed94006e5c9334a03956b718a949388d61ca3d6", | ||
"packages/extensions/cadl/src/cadl-compiler-plugin.ts": "a19d1056aa4954a01257acbf042eb9b535ddf3e7", | ||
"packages/extensions/cadl/src/cadl-compiler-plugin.ts": "8ae2cf434825d3b3598dff081e70712d51c4e28c", | ||
"packages/extensions/cadl/src/cadl-compiler.ts": "14a6e66af4ab2f6464b5d7b536b4e60ae8435b4b", | ||
"packages/extensions/cadl/src/main.ts": "bf1f09199efb0f19a63201fc7733cfd360219e8a", | ||
"packages/extensions/cadl/src/main.ts": "ddeee88f3f6d91125b37ce89ec409c3d04c7c589", | ||
"packages/extensions/cadl/test/adl-compiler.test.ts": "89d1fabcc916bdff138dff00a267c8df384dcd28", | ||
@@ -13,0 +13,0 @@ "packages/extensions/cadl/test/scenarios/simple.adl": "7810ce25843eb9f5f083e465880ac308cd9e71a2", |
{ | ||
"name": "@autorest/cadl", | ||
"name": "@autorest/adl", | ||
"entries": [ | ||
{ | ||
"version": "0.0.3", | ||
"tag": "@autorest/cadl_v0.0.3", | ||
"date": "Tue, 16 Nov 2021 17:02:17 GMT", | ||
"comments": { | ||
"dependency": [ | ||
{ | ||
"comment": "Updating dependency \"@autorest/extension-base\" from `~3.3.2` to `~3.4.0`" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "0.0.2", | ||
@@ -18,0 +6,0 @@ "tag": "@autorest/adl_v0.0.2", |
@@ -1,10 +0,5 @@ | ||
# Change Log - @autorest/cadl | ||
# Change Log - @autorest/adl | ||
This log was last generated on Tue, 16 Nov 2021 17:02:17 GMT and should not be manually modified. | ||
This log was last generated on Mon, 19 Jul 2021 15:15:42 GMT and should not be manually modified. | ||
## 0.0.3 | ||
Tue, 16 Nov 2021 17:02:17 GMT | ||
_Version update only_ | ||
## 0.0.2 | ||
@@ -11,0 +6,0 @@ Mon, 19 Jul 2021 15:15:42 GMT |
@@ -1,3 +0,3 @@ | ||
import { Host } from "@autorest/extension-base"; | ||
export declare function setupAdlCompilerPlugin(host: Host): Promise<void>; | ||
import { AutorestExtensionHost } from "@autorest/extension-base"; | ||
export declare function setupAdlCompilerPlugin(host: AutorestExtensionHost): Promise<void>; | ||
/** | ||
@@ -4,0 +4,0 @@ * Retrieve the position(Line,Column) from the index in the source. |
@@ -6,3 +6,4 @@ import { fileURLToPath } from "url"; | ||
var _a; | ||
const inputFiles = await host.GetValue("inputFileUris"); | ||
const inputFiles = await host.getValue("inputFileUris"); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const entrypoint = inputFiles[0]; | ||
@@ -12,3 +13,3 @@ const result = await compileAdl(fileURLToPath(entrypoint)); | ||
for (const diagnostic of result.diagnostics) { | ||
host.Message({ | ||
host.message({ | ||
Channel: Channel.Error, | ||
@@ -29,3 +30,3 @@ Text: diagnostic.message, | ||
for (const [name, content] of Object.entries(result.compiledFiles)) { | ||
host.WriteFile(name, content, undefined, "swagger-document"); | ||
host.writeFile({ filename: name, content, artifactType: "swagger-document" }); | ||
} | ||
@@ -32,0 +33,0 @@ } |
import { AutoRestExtension } from "@autorest/extension-base"; | ||
import { setupAdlCompilerPlugin } from "./cadl-compiler-plugin.js"; | ||
export async function initializePlugins(pluginHost) { | ||
pluginHost.Add("adl-compiler", setupAdlCompilerPlugin); | ||
pluginHost.add("adl-compiler", setupAdlCompilerPlugin); | ||
} | ||
@@ -9,3 +9,3 @@ async function main() { | ||
await initializePlugins(pluginHost); | ||
await pluginHost.Run(); | ||
await pluginHost.run(); | ||
} | ||
@@ -12,0 +12,0 @@ main().catch((e) => { |
{ | ||
"name": "@autorest/cadl", | ||
"version": "0.0.3", | ||
"version": "0.1.0-dev.1", | ||
"description": "AutoRest Cadl plugin", | ||
@@ -65,4 +65,4 @@ "engines": { | ||
"@cadl-lang/compiler": "~0.19.0 ", | ||
"@autorest/extension-base": "~3.4.0" | ||
"@autorest/extension-base": "~3.4.0-dev.3" | ||
} | ||
} | ||
} |
import { fileURLToPath } from "url"; | ||
import { Channel, Host } from "@autorest/extension-base"; | ||
import { AutorestExtensionHost, Channel } from "@autorest/extension-base"; | ||
import { compileAdl } from "./cadl-compiler.js"; | ||
export async function setupAdlCompilerPlugin(host: Host) { | ||
const inputFiles = await host.GetValue("inputFileUris"); | ||
const entrypoint = inputFiles[0]; | ||
export async function setupAdlCompilerPlugin(host: AutorestExtensionHost) { | ||
const inputFiles = await host.getValue<string[]>("inputFileUris"); | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const entrypoint = inputFiles![0]; | ||
const result = await compileAdl(fileURLToPath(entrypoint)); | ||
@@ -12,3 +13,3 @@ | ||
for (const diagnostic of result.diagnostics) { | ||
host.Message({ | ||
host.message({ | ||
Channel: Channel.Error, | ||
@@ -32,3 +33,3 @@ Text: diagnostic.message, | ||
for (const [name, content] of Object.entries(result.compiledFiles)) { | ||
host.WriteFile(name, content, undefined, "swagger-document"); | ||
host.writeFile({ filename: name, content, artifactType: "swagger-document" }); | ||
} | ||
@@ -35,0 +36,0 @@ } |
@@ -5,3 +5,3 @@ import { AutoRestExtension } from "@autorest/extension-base"; | ||
export async function initializePlugins(pluginHost: AutoRestExtension) { | ||
pluginHost.Add("adl-compiler", setupAdlCompilerPlugin); | ||
pluginHost.add("adl-compiler", setupAdlCompilerPlugin); | ||
} | ||
@@ -12,3 +12,3 @@ | ||
await initializePlugins(pluginHost); | ||
await pluginHost.Run(); | ||
await pluginHost.run(); | ||
} | ||
@@ -15,0 +15,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92943
910