Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove-package tool doesn't work off current plugin-seed #8

Closed
pekevski opened this issue Sep 15, 2021 · 4 comments · Fixed by #9
Closed

remove-package tool doesn't work off current plugin-seed #8

pekevski opened this issue Sep 15, 2021 · 4 comments · Fixed by #9

Comments

@pekevski
Copy link
Contributor

Looks like the plugin seed only has demos for plain/ts and angular apps in the /apps directory. So when a developer npm run add's a plugin it will only get added / removed from the following directories:

/apps/demo
/apps/demo-angular

Looks like the remove-package code loops through all flavours of demo without actually checking they exist in the file tree.

Would the appropriate fix be to

  1. Add all the demo flavours to /app with a package.json; or
  2. Add something like:
for (const t of getDemoTypes()) {
    const demoAppRoot = getDemoAppRoot(t);
    if (tree.exists(demoAppRoot)) {
        removeDemoFiles(tree, t, demoAppRoot);
        removeFromDemoIndex(tree, t, demoAppRoot);
        updateDemoDependencies(tree, demoAppRoot);
    }
}

to packages/plugin-tools/src/generators/remove-package/index.ts?

(Happy to make the fix based on the best way forward as well)

@pekevski
Copy link
Contributor Author

Looks like #7 tries to address the issue, however I think checking for existence covers a wider range of possibilities

@NathanWalker
Copy link
Contributor

@pekevski thanks for ping on this. I’m going to work on getting updates out by tomorrow afternoon on this.

@NathanWalker
Copy link
Contributor

NathanWalker commented Sep 15, 2021

Actually @pekevski i like your suggested fix better if you want to PR that? If you don’t have time no worries - I may revert the other tomorrow as I think your suggestion would cover more and be simpler.

@pekevski
Copy link
Contributor Author

Sure ill quickly do it now for you

pekevski added a commit to pekevski/plugin-tools that referenced this issue Sep 15, 2021
Only delete the specific package from demo flavours used rather than
depend on a package.json being present.

Closes: NativeScript#8
NathanWalker pushed a commit that referenced this issue Sep 15, 2021
Only delete the specific package from demo flavours used rather than
depend on a package.json being present.

Closes: #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants