Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3bd3ee3
Package manager: Update tags for default search terms to msbot-component
carlosscastro Mar 26, 2021
0babc21
Merge branch 'main' into ccastro/update-component-tag-nomenclature
carlosscastro Mar 30, 2021
ff96ee8
Package manager: community packages source read only
carlosscastro Mar 30, 2021
50cc2f3
Merge branch 'ccastro/update-component-tag-nomenclature' of https://g…
carlosscastro Mar 30, 2021
0ee5021
Merge branch 'main' into ccastro/update-component-tag-nomenclature
beyackle Mar 30, 2021
1c29605
Package manager: enforce read-only sources to be read only
carlosscastro Mar 30, 2021
ca36ddb
Merge branch 'ccastro/update-component-tag-nomenclature' of https://g…
carlosscastro Mar 30, 2021
cccc17d
Package manager: const variable
carlosscastro Mar 30, 2021
be5faf9
Merge branch 'main' into ccastro/update-component-tag-nomenclature
carlosscastro Mar 30, 2021
0c3e726
Package manager: Add constant for default tag, fix const-correctness …
carlosscastro Mar 31, 2021
3ad38a2
Merge branch 'ccastro/update-component-tag-nomenclature' of https://g…
carlosscastro Mar 31, 2021
4d68cf0
Merge branch 'main' into ccastro/update-component-tag-nomenclature
carlosscastro Mar 31, 2021
d79d91d
Pacakge manager: localize package source text and remove redundant st…
carlosscastro Mar 31, 2021
67ee385
Merge branch 'ccastro/update-component-tag-nomenclature' of https://g…
carlosscastro Mar 31, 2021
d236734
Package manager: Organize imports
carlosscastro Mar 31, 2021
1503eea
Merge branch 'main' into ccastro/update-component-tag-nomenclature
carlosscastro Mar 31, 2021
a91b959
Merge branch 'main' into ccastro/update-component-tag-nomenclature
carlosscastro Mar 31, 2021
3635dd3
Merge branch 'main' into ccastro/update-component-tag-nomenclature
cwhitten Apr 1, 2021
cbefa5a
Package manager: fix linter errors
carlosscastro Apr 1, 2021
90f347d
Merge branch 'ccastro/update-component-tag-nomenclature' of https://g…
carlosscastro Apr 1, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class NuGetFeed implements IFeed {
// Is the seed data a search result? Note that ideally we want to remove this codepath since we cannot
// do paging or other more advanced operations. Since this path is very inflexible, also
// ignores the query provided in the package query.
// Example url that ends up in this path: https://azuresearch-usnc.nuget.org/query?q=Tags:%22bf-component%22&prerelease=true
// Example url that ends up in this path: https://azuresearch-usnc.nuget.org/query?q=Tags:%22msbot-component%22&prerelease=true
const searchResult = this.data as INuGetSearchResult;
if (searchResult.data) {
return this.asPackageDefinition(searchResult);
Expand Down
80 changes: 42 additions & 38 deletions extensions/packageManager/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import * as path from 'path';

import axios from 'axios';
import formatMessage from 'format-message';
import { IExtensionRegistration } from '@botframework-composer/types';
import { SchemaMerger } from '@microsoft/bf-dialog/lib/library/schemaMerger';

Expand Down Expand Up @@ -57,47 +58,50 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
}
},
getFeeds: async function (req, res) {
// read the list of sources from the config file.
let packageSources: IPackageSource[] = composer.store.read('feeds') as IPackageSource[];

// if no sources are in the config file, set the default list to our 1st party feed.
if (!packageSources) {
packageSources = [
// TODO: Re-enable the NPM feed when we have a JS runtime
// {
// key: 'npm',
// text: 'npm',
// url: 'https://registry.npmjs.org/-/v1/search?text=keywords:bf-component&size=100&from=0',
// searchUrl: 'https://registry.npmjs.org/-/v1/search?text={{keyword}}+keywords:bf-component&size=100&from=0',
// readonly: true,
// },
{
key: 'nuget',
text: 'nuget',
url: 'https://api.nuget.org/v3/index.json',
readonly: true,
defaultQuery: {
prerelease: true,
semVerLevel: '2.0.0',
query: 'microsoft.bot.components+tags:bf-component',
},
type: PackageSourceType.NuGet,
// Read the list of sources from the config file.
const userStoredSources: IPackageSource[] = composer.store.read('feeds') as IPackageSource[];

const botComponentTag = 'msbot-component';

// Default sources
let packageSources: IPackageSource[] = [
{
key: 'nuget',
text: formatMessage('nuget'),
url: 'https://api.nuget.org/v3/index.json',
readonly: true,
defaultQuery: {
prerelease: true,
semVerLevel: '2.0.0',
query: `microsoft.bot.components+tags:${botComponentTag}`,
},
{
key: 'nuget-community',
text: 'community packages',
url: 'https://api.nuget.org/v3/index.json',
defaultQuery: {
prerelease: true,
semVerLevel: '2.0.0',
query: 'tags:bf-component',
},
type: PackageSourceType.NuGet,
type: PackageSourceType.NuGet,
},
{
key: 'nuget-community',
text: formatMessage('community packages'),
url: 'https://api.nuget.org/v3/index.json',
readonly: true,
defaultQuery: {
prerelease: true,
semVerLevel: '2.0.0',
query: `tags:${botComponentTag}`,
},
];
composer.store.write('feeds', packageSources);
type: PackageSourceType.NuGet,
},
];

// If there are package sources stored in the user profile
if (userStoredSources) {
// Extract list of read-only sources
const readOnlyKeys = packageSources.map((s) => s.key);

// Add user sources to the package sources, excluding modifications of the read-only ones
packageSources = packageSources.concat(userStoredSources.filter((s) => !readOnlyKeys.includes(s.key)));
}

composer.store.write('feeds', packageSources);

res.json(packageSources);
},
updateFeeds: async function (req, res) {
Expand Down Expand Up @@ -154,7 +158,7 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
const packageQuery: IPackageQuery = {
prerelease: true,
semVerLevel: '2.0.0',
query: 'tags:bf-component',
query: 'tags:msbot-component',
};

const packages = await feed.getPackages(packageSource.defaultQuery ?? packageQuery);
Expand Down