Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: changed manifest file type from '.manifest' to '.json' #2888

Merged
merged 1 commit into from
May 4, 2020
Merged
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
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
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
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