LearnNewsExamplesServices
Frontmatter
id3258
titlebuildScripts/createClass: workspace scope
stateClosed
labels
bug
assigneestobiu
createdAtJul 4, 2022, 12:43 AM
updatedAtJul 4, 2022, 9:19 AM
githubUrlhttps://github.com/neomjs/neo/issues/3258
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 4, 2022, 9:19 AM

buildScripts/createClass: workspace scope

Closed v8.1.0 bug
tobiu
tobiu commented on Jul 4, 2022, 12:43 AM

without the isDrop option, workspace related apps no longer get found.

might be related to @ThorstenSuckow's changes that __dirname is no longer pointing to process.cwd().

will investigate this further tomorrow.

tobiu added the bug label on Jul 4, 2022, 12:43 AM
tobiu assigned to @tobiu on Jul 4, 2022, 12:43 AM
tobiu referenced in commit b162733 - "buildScripts/createClass: workspace scope #3258" on Jul 4, 2022, 8:58 AM
tobiu
tobiu Jul 4, 2022, 9:00 AM
            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.

tobiu
tobiu Jul 4, 2022, 9:19 AM

@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.

tobiu closed this issue on Jul 4, 2022, 9:19 AM