Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 9ed91f7

Browse files
luhan2017vishwacsenafeich-mscleemullins
authored
update component location (#729)
* Update merge.ts * Update merge.ts * Update merge.ts * fix the quote marks Co-authored-by: Vishwac Sena Kannan <[email protected]> Co-authored-by: Fei Chen <[email protected]> Co-authored-by: Chris Mullins <[email protected]>
1 parent 9d7e03a commit 9ed91f7

File tree

1 file changed

+5
-28
lines changed
  • packages/dialog/src/commands/dialog

1 file changed

+5
-28
lines changed

packages/dialog/src/commands/dialog/merge.ts

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ export default class DialogMerge extends Command {
3535
static flags: flags.Input<any> = {
3636
help: flags.help({ char: 'h' }),
3737
output: flags.string({ char: 'o', description: 'Output path and filename for merged schema. [default: app.schema]', default: 'app.schema', required: false }),
38-
branch: flags.string({ char: 'b', description: 'The branch to use for the meta-schema component.schema.', default: 'master', required: false }),
39-
update: flags.boolean({ char: 'u', description: 'Update .schema files to point the <branch> component.schema and regenerate component.schema if baseComponent.schema is present.', default: false, required: false }),
4038
verbose: flags.boolean({ description: 'output verbose logging of files as they are processed', default: false }),
4139
}
4240

@@ -54,32 +52,20 @@ export default class DialogMerge extends Command {
5452
async run() {
5553
const { argv, flags } = this.parse(DialogMerge)
5654

57-
await this.mergeSchemas(argv, flags.output, flags.branch, flags.update, flags.verbose)
55+
await this.mergeSchemas(argv, flags.output, flags.verbose)
5856
}
5957

6058
/**
6159
* Merge together .schema files to make a custom schema.
6260
* @param patterns Glob patterns for the .schema files to combine.
6361
* @param output The output file to create. app.schema by default.
64-
* @param branch Branch to use for where to find component.schema.
65-
* @param update True to update .schema files to point to branch component.schema files.
6662
*/
67-
async mergeSchemas(patterns: string[], output?: string, branch?: string, update?: boolean, verbose?: boolean): Promise<boolean> {
63+
async mergeSchemas(patterns: string[], output?: string, verbose?: boolean): Promise<boolean> {
6864
this.verbose = verbose
6965
this.failed = false
7066
this.missingKinds = new Set()
7167
try {
7268
let schemaPaths: any[] = []
73-
if (update) {
74-
if (!branch) {
75-
this.error(`${this.currentFile}: error: Must specify -branch <branch> in order to use -update`)
76-
return false
77-
}
78-
await this.updateMetaSchema(branch)
79-
if (verbose) {
80-
this.log(`Updating component.schema references to branch ${branch}`)
81-
}
82-
}
8369

8470
if (!output) {
8571
output = 'app.schema'
@@ -101,11 +87,8 @@ export default class DialogMerge extends Command {
10187
let definitions: any = {}
10288
let validator = new Validator()
10389

104-
if (!metaSchema && branch) {
105-
// Find branch specific schema
106-
let path = `https://raw.githubusercontent.com/Microsoft/botbuilder-dotnet/${branch}/schemas/component.schema`
107-
metaSchema = await getJson(path)
108-
}
90+
let path = 'https://raw.githubusercontent.com/microsoft/botframework-sdk/master/schemas/component/component.schema'
91+
metaSchema = await getJson(path)
10992

11093
if (metaSchema) {
11194
validator.addSchema(metaSchema, 'componentSchema')
@@ -116,13 +99,7 @@ export default class DialogMerge extends Command {
11699
if (verbose) {
117100
this.log(`Parsing ${schemaPath}`)
118101
}
119-
if (update) {
120-
let schema = await fs.readJSON(schemaPath)
121-
if (!schema.$id) {
122-
schema.$schema = schema.$schema.replace(/botbuilder-dotnet\/[^/]*\//, `botbuilder-dotnet/${branch}/`)
123-
await fs.writeJSON(schemaPath, schema, this.jsonOptions)
124-
}
125-
}
102+
126103
let noref = await parser.dereference(schemaPath)
127104
if (noref.$id) {
128105
this.error(`${this.currentFile}: warning: Skipping because of top-level $id:${noref.$id}.`)

0 commit comments

Comments
 (0)