Skip to content

Commit

Permalink
fix: changes manifest type from '.manifest' to '.json' (microsoft#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurnford authored May 4, 2020
1 parent f195efa commit f75ba6f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ const styles = {
};

export const SelectManifest: React.FC<ContentProps> = ({ completeStep, skillManifests, setSkillManifest }) => {
const { actions } = useContext(StoreContext);
const { actions, state } = useContext(StoreContext);
const { botName } = state;
const [manifestVersion, setManifestVersion] = useState<string>(SCHEMA_URIS[0]);
const [errors, setErrors] = useState<{ version?: string }>({});

const [version] = VERSION_REGEX.exec(manifestVersion) || [''];
const fileName = `skill-manifest-${version.replace(/\./g, '-')}`;
const fileName = `${botName}-${version.replace(/\./g, '-')}-manifest`;

const options: IDropdownOption[] = useMemo(
() =>
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/src/store/persistence/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum ChangeType {

export enum FileExtensions {
Dialog = '.dialog',
Manifest = '.manifest',
Manifest = '.json',
Lu = '.lu',
Lg = '.lg',
}
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/indexers/src/skillManifestIndexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const index = (skillManifestFiles: FileInfo[]) => {
return skillManifestFiles.reduce((manifests: SkillManifestInfo[], { content, name, lastModified }) => {
try {
const jsonContent = JSON.parse(content);
return [...manifests, { content: jsonContent, id: getBaseName(name, '.manifest'), lastModified }];
return [...manifests, { content: jsonContent, id: getBaseName(name, '.json'), lastModified }];
} catch (error) {
return manifests;
}
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/lib/indexers/src/utils/fileExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export enum FileExtensions {
Dialog = '.dialog',
Lu = '.lu',
lg = '.lg',
Manifest = '.manifest',
Manifest = '.json',
}
6 changes: 3 additions & 3 deletions Composer/packages/server/src/models/bot/botProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const BotStructureTemplate = {
lg: 'language-generation/${LOCALE}/${DIALOGNAME}.${LOCALE}.lg',
lu: 'language-understanding/${LOCALE}/${DIALOGNAME}.${LOCALE}.lu',
},
skillManifests: 'skill-manifests/${MANIFESTNAME}.manifest',
skillManifests: 'manifests/${MANIFESTNAME}.json',
};

const templateInterpolate = (str: string, obj: { [key: string]: string }) =>
Expand Down Expand Up @@ -368,7 +368,7 @@ export class BotProject {
DIALOGNAME,
LOCALE,
});
} else if (fileType === '.manifest') {
} else if (fileType === '.json') {
dir = templateInterpolate(
Path.dirname(Path.join(BotStructureTemplate.folder, BotStructureTemplate.skillManifests)),
{
Expand Down Expand Up @@ -457,7 +457,7 @@ export class BotProject {
}

const fileList: FileInfo[] = [];
const patterns = ['**/*.dialog', '**/*.lg', '**/*.lu', '**/*.manifest'];
const patterns = ['**/*.dialog', '**/*.lg', '**/*.lu', 'manifests/*.json'];
for (const pattern of patterns) {
// load only from the data dir, otherwise may get "build" versions from
// deployment process
Expand Down
4 changes: 2 additions & 2 deletions Composer/plugins/localPublish/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ class LocalPublisher implements PublishPlugin<PublishConfig> {

private getHistoryDir = (botId: string) => path.resolve(this.getBotDir(botId), 'history');

private getManifestSrcDir = (srcDir: string) => path.resolve(srcDir, 'skill-manifests');
private getManifestSrcDir = (srcDir: string) => path.resolve(srcDir, 'manifests');

private getManifestDstDir = (botId: string) => path.resolve(this.getBotRuntimeDir(botId), 'wwwroot', 'skill-manifests');
private getManifestDstDir = (botId: string) => path.resolve(this.getBotRuntimeDir(botId), 'wwwroot', 'manifests');

private getDownloadPath = (botId: string, version: string) =>
path.resolve(this.getHistoryDir(botId), `${version}.zip`);
Expand Down

0 comments on commit f75ba6f

Please sign in to comment.