Skip to content

Commit

Permalink
feat: add x-origin property
Browse files Browse the repository at this point in the history
  • Loading branch information
aeworxet committed Mar 11, 2024
1 parent 34a523d commit 1b3e4bd
Show file tree
Hide file tree
Showing 12 changed files with 4,179 additions and 1,082 deletions.
6 changes: 4 additions & 2 deletions example/bundle-cjs.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const bundle = require('@asyncapi/bundler');

async function main() {
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], {
referenceIntoComponents: true,
referenceIntoComponents: false,
});
writeFileSync('asyncapi.yaml', document.yml());
if (document.yml()) {
writeFileSync('asyncapi.yaml', document.yml());
}
}

main().catch(e => console.error(e));
6 changes: 4 additions & 2 deletions example/bundle-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ const bundle = require('@asyncapi/bundler');

async function main() {
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], {
referenceIntoComponents: true,
referenceIntoComponents: false,
});
writeFileSync('asyncapi.yaml', document.yml());
if (document.yml()) {
writeFileSync('asyncapi.yaml', document.yml());
}
}

main().catch(e => console.error(e));
6 changes: 4 additions & 2 deletions example/bundle-esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import bundle from '@asyncapi/bundler';

async function main() {
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], {
referenceIntoComponents: true,
referenceIntoComponents: false,
});
writeFileSync('asyncapi.yaml', document.yml());
if (document.yml()) {
writeFileSync('asyncapi.yaml', document.yml());
}
}

main().catch(e => console.error(e));
6 changes: 4 additions & 2 deletions example/bundle-esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import bundle from '@asyncapi/bundler';

async function main() {
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], {
referenceIntoComponents: true,
referenceIntoComponents: false,
});
writeFileSync('asyncapi.yaml', document.yml());
if (document.yml()) {
writeFileSync('asyncapi.yaml', document.yml());
}
}

main().catch(e => console.error(e));
6 changes: 4 additions & 2 deletions example/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import bundle from '@asyncapi/bundler';

async function main() {
const document = await bundle([readFileSync('./main.yaml', 'utf-8')], {
referenceIntoComponents: true,
referenceIntoComponents: false,
});
writeFileSync('asyncapi.yaml', document.yml());
if (document.yml()) {
writeFileSync('asyncapi.yaml', document.yml());
}
}

main().catch(e => console.error(e));
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"license": "Apache-2.0",
"dependencies": {
"@asyncapi/bundler": "../",
"@types/node": "^18.7.23",
"@types/node": "^20.11.30",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^5.4.3"
}
}
Loading

0 comments on commit 1b3e4bd

Please sign in to comment.