adapt-authoring-adaptframework 1.9.0 → 1.9.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.
@@ -111,9 +111,7 @@ class AdaptFrameworkModule extends AbstractModule {
111
111
  async installFramework (version, force = false) {
112
112
  this.log('verbose', 'INSTALL')
113
113
  try {
114
- const modsPath = path.resolve(this.path, '..', 'node_modules')
115
114
  try {
116
- await fs.stat(modsPath)
117
115
  await fs.readFile(path.resolve(this.path, 'package.json'))
118
116
  if (!force) {
119
117
  this.log('verbose', 'INSTALL no action, force !== true')
@@ -125,13 +123,6 @@ class AdaptFrameworkModule extends AbstractModule {
125
123
  // if src and node_modules are missing, install required
126
124
  }
127
125
  await this.runCliCommand('installFramework', { version })
128
- // move node_modules into place
129
- this.log('verbose', 'INSTALL node_modules')
130
- try {
131
- await fs.rm(modsPath, { recursive: true })
132
- } catch (e) {}
133
- // move node_modules so it can be shared with all builds
134
- await fs.rename(path.join(this.path, 'node_modules'), modsPath)
135
126
  } catch (e) {
136
127
  this.log('error', `failed to install framework, ${e.message}`)
137
128
  throw this.app.errors.FW_INSTALL_FAILED
@@ -198,12 +198,15 @@ class AdaptFrameworkUtils {
198
198
  * @param {Object} options
199
199
  * @param {String} options.destDir The destination directory path
200
200
  * @param {Array<String>} options.enabledPlugins List of plugins to include
201
+ * @param {Boolean} options.copyNodeModules Whether to physically copy node_modules
201
202
  * @param {Boolean} options.linkNodeModules Whether to symlink node_modules
202
203
  * @return {Promise}
203
204
  */
204
205
  static async copyFrameworkSource (options) {
205
206
  const { path: fwPath } = await App.instance.waitForModule('adaptframework')
206
- const BLACKLIST = ['.git', '.DS_Store', 'thumbs.db', 'node_modules', 'course', 'migrations']
207
+ const BLACKLIST = ['.git', '.DS_Store', 'thumbs.db', 'course', 'migrations']
208
+ if (options.copyNodeModules !== true) BLACKLIST.push('node_modules')
209
+
207
210
  const srcDir = path.join(fwPath, 'src')
208
211
  const enabledPlugins = options.enabledPlugins ?? []
209
212
  await fs.cp(fwPath, options.destDir, {
@@ -219,7 +222,7 @@ class AdaptFrameworkUtils {
219
222
  return !BLACKLIST.includes(path.basename(f))
220
223
  }
221
224
  })
222
- if (!options.linkNodeModules) await fs.symlink(`${fwPath}/node_modules`, `${options.destDir}/node_modules`, 'junction')
225
+ if (options.linkNodeModules !== false) await fs.symlink(`${fwPath}/node_modules`, `${options.destDir}/node_modules`, 'junction')
223
226
  }
224
227
 
225
228
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-adaptframework",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Adapt framework integration for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-adaptframework",
6
6
  "license": "GPL-3.0",