-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
19 changed files
with
301 additions
and
3,502 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
node_modules | ||
output | ||
test/temp | ||
__transpiled |
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,44 @@ | ||
const _ = require('lodash'); | ||
const sanitizeFilename = require('sanitize-filename'); | ||
|
||
function camelCase(string) { | ||
return _.camelCase(string); | ||
} | ||
|
||
function pascalCase(string) { | ||
string = _.camelCase(string); | ||
return string.charAt(0).toUpperCase() + string.slice(1); | ||
} | ||
|
||
function kebabCase(string) { | ||
return _.kebabCase(string); | ||
} | ||
|
||
function capitalize(string) { | ||
return _.capitalize(string); | ||
} | ||
|
||
function oneLine(string) { | ||
return string.replace(/\n/g, ' ').trim(); | ||
} | ||
|
||
function convertToFilename(string, options = { replacement: '-', maxLength: 255 }) { | ||
let sanitizedString = sanitizeFilename(string); | ||
|
||
sanitizedString = sanitizedString.replace(/[\s]+/g, options.replacement); | ||
|
||
if (sanitizedString.length > options.maxLength) { | ||
sanitizedString = sanitizedString.slice(0, options.maxLength); | ||
} | ||
|
||
return sanitizedString; | ||
} | ||
|
||
module.exports = { | ||
camelCase, | ||
pascalCase, | ||
kebabCase, | ||
capitalize, | ||
oneLine, | ||
convertToFilename | ||
}; |
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 was deleted.
Oops, something went wrong.
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,15 @@ | ||
const { File } = require('@asyncapi/generator-react-sdk'); | ||
|
||
function ReadmeFile({ asyncapi }) { | ||
console.log("Hello", asyncapi.info().description()); | ||
return ( | ||
<File name={'README.md'}> | ||
{`# ${asyncapi.info().title()} | ||
${asyncapi.info().description() || 'Safe'} | ||
`} | ||
</File> | ||
); | ||
} | ||
|
||
module.exports = ReadmeFile; |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
const { File } = require('@asyncapi/generator-react-sdk'); | ||
const { port } = require('../../filters/all.js'); | ||
|
||
function commonConfig({ asyncapi, params }) { | ||
const serverUrl = asyncapi.server(params.server).url(); | ||
|
||
return ( | ||
<File name={'common.yml'}> | ||
{`default: | ||
port: ${port(serverUrl)} | ||
development: | ||
test: | ||
staging: | ||
production: | ||
`} | ||
</File> | ||
); | ||
} | ||
|
||
module.exports = commonConfig; |
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
Oops, something went wrong.