Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ extends:
displayName: "Set version suffix"
- pwsh: $(Build.SourcesDirectory)/scripts/get-version-from-csproj.ps1
displayName: "Get Kiota's version-number from .csproj"
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/packages/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/packages/npm-package/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/packages/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/packages/npm-package/lib/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
displayName: "Update VSCode extension version-number"
- script: npm i -g @vscode/vsce rimraf
displayName: "Install Global dependencies"
Expand Down Expand Up @@ -745,7 +745,7 @@ extends:
displayName: "Set version suffix"
- pwsh: $(Build.SourcesDirectory)/scripts/get-version-from-csproj.ps1
displayName: "Get Kiota's version-number from .csproj"
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/packages/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/packages/npm-package/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/packages/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/packages/npm-package/lib/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
displayName: "Update NPM package version-number"
- script: |
npm i -g rimraf
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: scripts/update-vscode-releases.ps1 -version "v${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/packages/microsoft-kiota/package.json" -runtimeFilePath "./vscode/packages/npm-package/runtime.json" -online
- run: scripts/update-vscode-releases.ps1 -version "v${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/packages/microsoft-kiota/package.json" -runtimeFilePath "./vscode/packages/npm-package/lib/runtime.json" -online
shell: pwsh

- name: Install dependencies
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: scripts/update-vscode-releases.ps1 -version "${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/packages/microsoft-kiota/package.json" -runtimeFilePath "./vscode/packages/npm-package/runtime.json" -online
- run: scripts/update-vscode-releases.ps1 -version "${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/packages/microsoft-kiota/package.json" -runtimeFilePath "./vscode/packages/npm-package/lib/runtime.json" -online
shell: pwsh

- name: Install dependencies
Expand Down
37 changes: 25 additions & 12 deletions vscode/package-lock.json

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

13 changes: 0 additions & 13 deletions vscode/packages/npm-package/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as cp from 'child_process';
import * as rpc from 'vscode-jsonrpc/node';
import { ensureKiotaIsPresent, getKiotaPath } from './install';
import { ensureKiotaIsPresent, getKiotaPath } from './install.js';


export default async function connectToKiota<T>(callback: (connection: rpc.MessageConnection) => Promise<T | undefined>, workingDirectory: string = process.cwd()): Promise<T | undefined | Error> {
Expand Down
6 changes: 3 additions & 3 deletions vscode/packages/npm-package/lib/generateClient.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { checkForSuccess } from "../utils";
import { ConsumerOperation, GenerationConfiguration, KiotaGenerationLanguage, KiotaLogEntry, KiotaResult } from "../types";
import connectToKiota from "./connect.js";
import { checkForSuccess } from "./utils.js";
import { ConsumerOperation, GenerationConfiguration, KiotaGenerationLanguage, KiotaLogEntry, KiotaResult } from "./types.js";

export interface ClientGenerationOptions {
openAPIFilePath: string;
Expand Down
6 changes: 3 additions & 3 deletions vscode/packages/npm-package/lib/generatePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { KiotaPluginType, GeneratePluginResult, ConsumerOperation, GenerationConfiguration, KiotaLogEntry, PluginAuthType } from "../types";
import connectToKiota from "./connect.js";
import { KiotaPluginType, GeneratePluginResult, ConsumerOperation, GenerationConfiguration, KiotaLogEntry, PluginAuthType } from "./types.js";
import * as path from "path";
import { checkForSuccess } from "../utils";
import { checkForSuccess } from "./utils.js";

export interface PluginGenerationOptions {
descriptionPath: string;
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/getKiotaTree.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { KiotaTreeResult, KiotaShowConfiguration } from "../types";
import connectToKiota from "./connect.js";
import { KiotaTreeResult, KiotaShowConfiguration } from "./types.js";

export interface KiotaResultOptions {
descriptionPath: string;
Expand Down
2 changes: 1 addition & 1 deletion vscode/packages/npm-package/lib/getKiotaVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from '../connect';
import connectToKiota from './connect.js';

/**
* Retrieves the version of Kiota by connecting to the Kiota service.
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/getManifestDetails.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { KiotaManifestResult, KiotaGetManifestDetailsConfiguration } from "../types";
import connectToKiota from "./connect.js";
import { KiotaManifestResult, KiotaGetManifestDetailsConfiguration } from "./types.js";

export interface ManifestOptions {
manifestPath: string;
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/getPluginManifest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { PluginManifestResult } from "../types";
import connectToKiota from "./connect.js";
import { PluginManifestResult } from "./types.js";

export interface GetPluginManifestOptions {
descriptionPath: string;
Expand Down
13 changes: 13 additions & 0 deletions vscode/packages/npm-package/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export * from './config.js';
export * from './generateClient.js';
export * from './generatePlugin.js';
export * from './getKiotaTree.js';
export * from './getKiotaVersion.js';
export * from './getManifestDetails.js';
export * from './languageInformation.js';
export * from './migrateFromLockFile.js';
export * from './removeItem.js';
export * from './searchDescription.js';
export * from './updateClients.js';
export * from './types.js';
export * from './utils.js';
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { createHash } from 'crypto';
import * as https from 'https';
import * as fs from 'fs';
import * as path from 'path';
import { getKiotaConfig } from './config';
import { getKiotaConfig } from './config.js';

import runtimeJson from './runtime.json';
import runtimeJson from './runtime.json' with { type: 'json' };
Comment thread
deinok marked this conversation as resolved.

const kiotaInstallStatusKey = "kiotaInstallStatus";
const installDelayInMs = 30000; // 30 seconds
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/languageInformation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { LanguagesInformation } from "../types";
import connectToKiota from "./connect.js";
import { LanguagesInformation } from "./types.js";

export interface LanguageInformationConfiguration {
descriptionUrl: string; clearCache: boolean;
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/migrateFromLockFile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { KiotaLogEntry } from "../types";
import connectToKiota from "./connect.js";
import { KiotaLogEntry } from "./types.js";

/**
* Migrates data from a lock file located in the specified directory.
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/removeItem.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { KiotaResult, KiotaLogEntry } from "../types";
import connectToKiota from "./connect.js";
import { KiotaResult, KiotaLogEntry } from "./types.js";

export interface RemoveItemConfiguration {
cleanOutput: boolean;
Expand Down
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/searchDescription.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from '../connect';
import { KiotaSearchResultItem, KiotaSearchResult } from "../types";
import connectToKiota from './connect.js';
import { KiotaSearchResultItem, KiotaSearchResult } from "./types.js";

export interface SearchConfiguration {
searchTerm: string;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions vscode/packages/npm-package/lib/updateClients.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rpc from "vscode-jsonrpc/node";

import connectToKiota from "../connect";
import { KiotaLogEntry } from "../types";
import connectToKiota from "./connect.js";
import { KiotaLogEntry } from "./types.js";

export interface UpdateClientsConfiguration {
cleanOutput: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KiotaLogEntry, MaturityLevel, DependencyType, LogLevel } from "./types";
import { KiotaLogEntry, MaturityLevel, DependencyType, LogLevel } from "./types.js";

export function getLogEntriesForLevel(logEntries: KiotaLogEntry[], ...levels: LogLevel[]): KiotaLogEntry[] {
return logEntries.filter((entry) => levels.indexOf(entry.level) !== -1);
Expand Down
37 changes: 10 additions & 27 deletions vscode/packages/npm-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://www.schemastore.org/package.json",
"name": "@microsoft/kiota",
"version": "1.25.1",
"version": "1.30.0",
"description": "npm package exposing Kiota CLI functionality to TypeScript",
"repository": {
"url": "https://github.com/microsoft/kiota.git",
Expand All @@ -10,43 +11,25 @@
"lib": "lib",
"test": "tests"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"main": "dist/index.js",
"exports": {
"import": {
"types": "./dist/esm/types/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/types/index.d.ts",
"default": "./dist/cjs/index.js"
}
},
"types": "dist/esm/types/index.d.ts",
"typesVersions": {
"*": {
"import": [
"./dist/esm/types/index.d.ts"
],
"require": [
"./dist/cjs/types/index.d.ts"
]
".": {
Comment thread
baywet marked this conversation as resolved.
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"type": "module",
"types": "./dist/index.d.ts",
"files": [
"dist",
"runtime.json"
"dist"
],
"scripts": {
"lint": "eslint",
"test": "jest --runInBand",
"test:unit": "jest --config=jest.config.unit.cjs",
"test:integration": "jest --config=jest.config.integration.cjs --runInBand",
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run copy-files",
"build:esm": "tsc --project tsconfig.esm.json",
"build:cjs": "tsc --project tsconfig.cjs.json",
"build": "npm run clean && tsc --project ./tsconfig.json",
"clean": "rimraf dist",
"copy-files": "node scripts/copy-files.js",
"generate-readme": "node scripts/generate-readme.js",
"test:coverage": "jest --coverage --runInBand",
"prepack": "npm run build",
Expand Down
Loading
Loading