-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
209 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* In case `.cjs` extension is used, Node.js will recognize CJS module system | ||
* automatically. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { readFileSync, writeFileSync } = require('fs'); | ||
const bundle = require('@asyncapi/bundler'); | ||
|
||
async function main() { | ||
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], { | ||
referenceIntoComponents: true, | ||
}); | ||
writeFileSync('asyncapi.yaml', document.yml()); | ||
} | ||
|
||
main().catch(e => console.error(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* To use `.js` extension with CJS module system, make sure | ||
* `package.json` | ||
* DOES NOT contain line | ||
* `"type": "module",` | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { readFileSync, writeFileSync } = require('fs'); | ||
const bundle = require('@asyncapi/bundler'); | ||
|
||
async function main() { | ||
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], { | ||
referenceIntoComponents: true, | ||
}); | ||
writeFileSync('asyncapi.yaml', document.yml()); | ||
} | ||
|
||
main().catch(e => console.error(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* To use `.js` extension with ESM module system, first add to | ||
* `package.json` | ||
* line | ||
* `"type": "module",` | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import { readFileSync, writeFileSync } from 'fs'; | ||
import bundle from '@asyncapi/bundler'; | ||
|
||
async function main() { | ||
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], { | ||
referenceIntoComponents: true, | ||
}); | ||
writeFileSync('asyncapi.yaml', document.yml()); | ||
} | ||
|
||
main().catch(e => console.error(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* In case `.mjs` extension is used, Node.js will recognize ESM module system | ||
* automatically. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import { readFileSync, writeFileSync } from 'fs'; | ||
import bundle from '@asyncapi/bundler'; | ||
|
||
async function main() { | ||
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], { | ||
referenceIntoComponents: true, | ||
}); | ||
writeFileSync('asyncapi.yaml', document.yml()); | ||
} | ||
|
||
main().catch(e => console.error(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"compilerOptions": { | ||
"types": [ | ||
"node" | ||
] | ||
], | ||
"esModuleInterop": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters