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

Adapt CLI install/devinstall issues #97

Closed
swashbuck opened this issue Aug 9, 2023 · 12 comments · Fixed by #100
Closed

Adapt CLI install/devinstall issues #97

swashbuck opened this issue Aug 9, 2023 · 12 comments · Fixed by #100
Assignees
Labels
bug Something isn't working released

Comments

@swashbuck
Copy link
Contributor

swashbuck commented Aug 9, 2023

Subject of the issue

I cannot successfully install Visua11y using adapt install or adapt devinstall. This happens when using either visua11y or adapt-visua11y as the target plugin.

Your environment

  • Adapt Framework v5.31.21
  • Adapt CLI v3.0.11

Steps to reproduce

  1. Run adapt install adapt-visua11y
Screenshot 2023-08-09 at 9 15 38 AM
  1. Select the master branch to install

Expected behaviour

Visua11y should be installed.

Actual behaviour

Visua11y is not installed.

Installing plugins 100% completeTypeError: Cannot read properties of null (reading 'component')

at file:///Users/xxxxxx/.nvm/versions/node/v18.16.0/lib/node_modules/adapt-cli/lib/integration/Plugin.js:331:62
at Array.find (<anonymous>)
at Target.getType (file:///Users/xxxxxx/.nvm/versions/node/v18.16.0/lib/node_modules/adapt-cli/lib/integration/Plugin.js:331:45)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Target.getTypeFolder (file:///Users/xxxxxx/.nvm/versions/node/v18.16.0/lib/node_modules/adapt-cli/lib/integration/Plugin.js:342:18)
at async Target.install (file:///Users/xxxxxx/.nvm/versions/node/v18.16.0/lib/node_modules/adapt-cli/lib/integration/Target.js:161:30)
@swashbuck swashbuck added the bug Something isn't working label Aug 9, 2023
@swashbuck swashbuck self-assigned this Oct 3, 2023
@swashbuck
Copy link
Contributor Author

@oliverfoster Apparently, this plugin is not registered. When I try to register it, I get this error from Adapt CLI (register() in lib/integration/PluginManagement/register.js):

Error: The package you are trying to register is marked as private

Should I change private to 'false' in bower.json and package.json?

@oliverfoster
Copy link
Member

oliverfoster commented Oct 4, 2023

Please definitely do not commit a change to the private value. That would cause the plugin to be registered on npm by the github release automation. Perhaps try changing it locally before registering? See if that makes a difference. Then we can fix up the adapt-cli register functionality if that works.

@swashbuck
Copy link
Contributor Author

Changing it to "private": false locally didn't help. I believe it's looking at the bower.json that's on the master branch (or possibly the latest tag or release) in the GitHub repo rather than what I have locally.

That would cause the plugin to be registered on npm by the github release automation.

@oliverfoster Since this isn't a private Kineo plugin, don't we want it to be registered on npm? Since it's public?

@swashbuck
Copy link
Contributor Author

swashbuck commented Oct 4, 2023

In bower's register.js:

        // Attempt to resolve the package referenced by the URL to ensure
        // everything is ok before registering
        repository = new PackageRepository(config, logger);
        return repository.fetch({ name: name, source: url, target: '*' });
    })
        .spread(function(canonicalDir, pkgMeta) {
            if (pkgMeta.private) {
                throw createError(
                    'The package you are trying to register is marked as private',
                    'EPRIV'
                );
            }

I had also added the repo information to bower and package:

  "repository": {
    "type": "git",
    "url": "https://github.com/cgkineo/adapt-visua11y.git"
  },

@oliverfoster
Copy link
Member

oliverfoster commented Oct 4, 2023

No, we don't want any adapt components registered on npm because they're not installable from npm. You can't npm install adapt-visua11y npm is the registry for the npm cli.

@swashbuck
Copy link
Contributor Author

@oliverfoster Ok, thanks for clearing that up.

Would the solution here be to temporarily change private to 'true' in the repo, register the plugin via adapt-cli, and then change it back to 'false'?

@oliverfoster
Copy link
Member

I'm pondering on a possible, easy solution. Give me some time to think about it.

@swashbuck
Copy link
Contributor Author

Ok, thanks. In the meantime, I've created a linked PR to add the repo details.

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

🎉 This issue has been resolved in version 2.5.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@oliverfoster
Copy link
Member

Please approve both of these @swashbuck
adaptlearning/adapt-cli#199
adaptlearning/adapt-cli#201

@swashbuck swashbuck assigned oliverfoster and unassigned swashbuck Oct 4, 2023
@swashbuck
Copy link
Contributor Author

Approved 👍

@swashbuck
Copy link
Contributor Author

@oliverfoster Closing this ticket as the two related tickets have now been merged.

adaptlearning/adapt-cli#199
adaptlearning/adapt-cli#201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants