Skip to content

Commit

Permalink
allow --NoOaiConverter to fix library usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fearthecowboy committed Jan 10, 2019
1 parent dd55906 commit df3ac1d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/autorest-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"urijs": "^1.18.10",
"vscode-jsonrpc": "^3.3.1",
"yaml-ast-parser": "0.0.40",
"z-schema": "^3.19.0"
"z-schema": "3.19.0"
},
"patch": "const fs = require(`fs`); let txt = fs.readFileSync('./node_modules/npm/lib/install/action/extract.js','utf8').replace(`const ENABLE_WORKERS = process.platform === 'darwin'`, `const ENABLE_WORKERS = false;`); fs.writeFileSync('./node_modules/npm/lib/install/action/extract.js', txt ); txt = fs.readFileSync(`./node_modules/npm/lib/npm.js`,`utf8`).replace(`var j = parseJSON(fs.readFileSync(`, `var j = require(path.join(__dirname, '../package.json'));` ).replace(`path.join(__dirname, '../package.json')) + '')`,``); fs.writeFileSync(`./node_modules/npm/lib/npm.js`, txt ); txt = fs.readFileSync('./node_modules/npm/lib/pack.js','utf8').replace(`require.main.filename`, `require.resolve('../bin/npm-cli.js')`); fs.writeFileSync('./node_modules/npm/lib/pack.js', txt );"
},
Expand Down
34 changes: 21 additions & 13 deletions src/autorest-core/resources/default-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,27 @@ pipeline:
swagger-document/emitter:
input: identity
scope: scope-swagger-document/emitter
scope-swagger-document/emitter:
input-artifact: swagger-document
is-object: true
# rethink that output-file part
output-uri-expr: |
$config["output-file"] ||
($config.namespace ? $config.namespace.replace(/:/g,'_') : undefined) ||
$config["input-file"][0].split('/').reverse()[0].split('\\').reverse()[0].replace(/\.json$/, "")
scope-cm/emitter: # can remove once every generator depends on recent modeler
input-artifact: code-model-v1
is-object: true
output-uri-expr: |
"code-model-v1"
```

``` yaml ! $(NoOaiConverter)
pipeline:
# OpenAPI
openapi-document/openapi-document-converter:
input: swagger-document/identity
Expand All @@ -349,14 +370,6 @@ pipeline:
input: identity
scope: scope-openapi-document/emitter
scope-swagger-document/emitter:
input-artifact: swagger-document
is-object: true
# rethink that output-file part
output-uri-expr: |
$config["output-file"] ||
($config.namespace ? $config.namespace.replace(/:/g,'_') : undefined) ||
$config["input-file"][0].split('/').reverse()[0].split('\\').reverse()[0].replace(/\.json$/, "")
scope-openapi-document/emitter:
input-artifact: openapi-document
is-object: true
Expand All @@ -365,11 +378,6 @@ scope-openapi-document/emitter:
$config["output-file"] ||
($config.namespace ? $config.namespace.replace(/:/g,'_') : undefined) ||
$config["input-file"][0].split('/').reverse()[0].split('\\').reverse()[0].replace(/\.json$/, "")
scope-cm/emitter: # can remove once every generator depends on recent modeler
input-artifact: code-model-v1
is-object: true
output-uri-expr: |
"code-model-v1"
```

#### Polyfills
Expand Down

0 comments on commit df3ac1d

Please sign in to comment.