-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from wpdas/feat/eject-stateful-components
Feat: Eject stateful components
- Loading branch information
Showing
21 changed files
with
1,020 additions
and
70 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 |
---|---|---|
@@ -1 +1 @@ | ||
18.0.0 | ||
18.17.0 |
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
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,31 @@ | ||
const { removeBlankLines } = require("../parse"); | ||
|
||
/** | ||
* Checa se a assinatura "as stateful" foi encontrado no topo do arquivo. | ||
* @param {*} content | ||
* @returns | ||
*/ | ||
const asStatefulCheck = (content) => { | ||
// NOTE: Checa se tem "as stateful", se tiver, deve ser tratado como um Widget/Stateful | ||
const hasAsStatefulType = | ||
content.includes('"as stateful"') || content.includes("'as stateful'"); | ||
|
||
if (hasAsStatefulType) { | ||
content = content.replace('"as stateful";', ""); | ||
content = content.replace("'as stateful';", ""); | ||
content = content.replace('"as stateful"', ""); | ||
content = content.replace("'as stateful'", ""); | ||
|
||
return { | ||
updatedContent: removeBlankLines(content), | ||
asStatefulSignalFound: true, | ||
}; | ||
} | ||
|
||
return { | ||
updatedContent: content, | ||
asStatefulSignalFound: false, | ||
}; | ||
}; | ||
|
||
module.exports = asStatefulCheck; |
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,22 @@ | ||
const { read_alem_config } = require("../config"); | ||
|
||
/** | ||
* Get the project name based on configuration | ||
* @returns | ||
*/ | ||
const getProjectName = (skipCheckers = false) => { | ||
const appConfig = read_alem_config(); | ||
let projectName = appConfig.name.replaceAll(" ", "-").toLowerCase(); | ||
|
||
// Se ignorar a checagem do nome final do projeto | ||
if (skipCheckers) { | ||
return projectName; | ||
} | ||
|
||
projectName = appConfig.isIndex ? "Index" : projectName; | ||
return appConfig.options?.createLoaderWidget | ||
? `${projectName}Loader` | ||
: projectName; | ||
}; | ||
|
||
module.exports = getProjectName; |
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
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.