Frontmatter
| id | 3258 |
| title | buildScripts/createClass: workspace scope |
| state | Closed |
| labels | bug |
| assignees | tobiu |
| createdAt | Jul 4, 2022, 12:43 AM |
| updatedAt | Jul 4, 2022, 9:19 AM |
| githubUrl | https://github.com/neomjs/neo/issues/3258 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jul 4, 2022, 9:19 AM |
buildScripts/createClass: workspace scope

if (isDrop !== true) {
if (fs.existsSync(path.resolve(cwd, 'apps', rootLowerCase))) {
classFolder = path.resolve(cwd, 'apps', rootLowerCase, ns.join('/'));
} else {
console.log('\nNon existing neo app name:', chalk.red(root));
process.exit(1);
}
}
changed the 2 __dirname replacements back to cwd. it should not affect the drop mode.

@ThorstenSuckow to shed some light into this: inside the neo.mjs package.json, we included the program like this:
"create-class": "node ./buildScripts/createClass.mjs",
inside the workspace based scope, the package.json contains:
"create-class": "node ./node_modules/neo.mjs/buildScripts/createClass.mjs",
so, we do want to parse the "top level" => workspace based apps here and not the ones inside the neo repo.
while we could just copy the buildScripts into each workspace, the beauty is that we don't have to: pretty much all of them are intended to work in both scopes (easier to maintain, in case the logic changes).
i did not test the drop mode inside the workspace based scope yet, but this would be a new ticket.
without the
isDropoption, workspace related apps no longer get found.might be related to @ThorstenSuckow's changes that
__dirnameis no longer pointing toprocess.cwd().will investigate this further tomorrow.