adapt-authoring-contentplugin 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,13 +145,12 @@ class ContentPluginModule extends AbstractApiModule {
145
145
  * @return {Promise}
146
146
  */
147
147
  async initPlugins () {
148
- await this.syncPluginData()
149
-
150
148
  const missing = await this.getMissingPlugins()
151
149
  if (missing.length) { // note we're using CLI directly, as plugins already exist in the DB
152
150
  this.log('debug', 'MISSING', missing)
153
151
  await this.framework.runCliCommand('installPlugins', { plugins: missing })
154
152
  }
153
+ await this.syncPluginData()
155
154
  await this.processPluginSchemas()
156
155
  }
157
156
 
@@ -170,10 +169,13 @@ class ContentPluginModule extends AbstractApiModule {
170
169
 
171
170
  /**
172
171
  * Returns a list of plugins defined in the database but not installed in the framework
172
+ * If no plugins are defined in the database, it returns all plugins defined in the framework manifest
173
173
  * @return {Array} List of plugin names mapped to version/dir
174
174
  */
175
175
  async getMissingPlugins() {
176
176
  const dbPlugins = await this.find()
177
+ if (!dbPlugins.length)
178
+ return (await this.framework.getManifestPlugins()).map(([name, version]) => `${name}@${version}`)
177
179
  const fwPlugins = await this.framework.getInstalledPlugins()
178
180
  return dbPlugins
179
181
  .filter(dbP => !fwPlugins.find(fwP => dbP.name === fwP.name))
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "adapt-authoring-contentplugin",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Module for managing framework plugins",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-contentplugin",
6
6
  "main": "index.js",
7
7
  "type": "module",
8
8
  "dependencies": {
9
- "adapt-cli": "github:adaptlearning/adapt-cli#v3.3.2",
9
+ "adapt-cli": "github:adaptlearning/adapt-cli#v3.3.3",
10
10
  "glob": "^11.0.0",
11
11
  "semver": "^7.6.0"
12
12
  },