adapt-authoring-contentplugin 1.0.2 → 1.0.7
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.
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
# Calls the org-level reusable workflow to add PRs to the TODO Board
|
|
2
|
+
|
|
3
|
+
name: Add PR to Project
|
|
2
4
|
|
|
3
5
|
on:
|
|
4
|
-
issues:
|
|
5
|
-
types:
|
|
6
|
-
- opened
|
|
7
6
|
pull_request:
|
|
8
7
|
types:
|
|
9
8
|
- opened
|
|
9
|
+
- reopened
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
12
|
add-to-project:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- uses: actions/add-to-project@v0.1.0
|
|
17
|
-
with:
|
|
18
|
-
project-url: https://github.com/orgs/adapt-security/projects/5
|
|
19
|
-
github-token: ${{ secrets.PROJECTS_SECRET }}
|
|
13
|
+
uses: adapt-security/.github/.github/workflows/new.yml@main
|
|
14
|
+
secrets:
|
|
15
|
+
PROJECTS_SECRET: ${{ secrets.PROJECTS_SECRET }}
|
|
@@ -3,10 +3,16 @@ on:
|
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
5
5
|
- master
|
|
6
|
+
|
|
6
7
|
jobs:
|
|
7
8
|
release:
|
|
8
9
|
name: Release
|
|
9
10
|
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write # to be able to publish a GitHub release
|
|
13
|
+
issues: write # to be able to comment on released issues
|
|
14
|
+
pull-requests: write # to be able to comment on released pull requests
|
|
15
|
+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
|
|
10
16
|
steps:
|
|
11
17
|
- name: Checkout
|
|
12
18
|
uses: actions/checkout@v3
|
|
@@ -16,10 +22,11 @@ jobs:
|
|
|
16
22
|
uses: actions/setup-node@v3
|
|
17
23
|
with:
|
|
18
24
|
node-version: 'lts/*'
|
|
25
|
+
- name: Update npm
|
|
26
|
+
run: npm install -g npm@latest
|
|
19
27
|
- name: Install dependencies
|
|
20
28
|
run: npm ci
|
|
21
29
|
- name: Release
|
|
22
30
|
env:
|
|
23
31
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
24
|
-
|
|
25
|
-
run: npx semantic-release
|
|
32
|
+
run: npx semantic-release
|
|
@@ -149,7 +149,11 @@ class ContentPluginModule extends AbstractApiModule {
|
|
|
149
149
|
const missing = await this.getMissingPlugins()
|
|
150
150
|
if (missing.length) { // note we're using CLI directly, as plugins already exist in the DB
|
|
151
151
|
this.log('debug', 'MISSING', missing)
|
|
152
|
-
|
|
152
|
+
try {
|
|
153
|
+
await this.framework.runCliCommand('installPlugins', { plugins: missing })
|
|
154
|
+
} catch (e) {
|
|
155
|
+
this.log('error', 'MISSING_INSTALL', e)
|
|
156
|
+
}
|
|
153
157
|
}
|
|
154
158
|
const results = await Promise.allSettled([
|
|
155
159
|
this.syncPluginData(),
|
|
@@ -190,13 +194,16 @@ class ContentPluginModule extends AbstractApiModule {
|
|
|
190
194
|
|
|
191
195
|
/**
|
|
192
196
|
* Loads and processes all installed content plugin schemas
|
|
193
|
-
* @param {Array} pluginInfo Plugin info data
|
|
197
|
+
* @param {Array|Object} pluginInfo Plugin info data
|
|
194
198
|
* @return {Promise}
|
|
195
199
|
*/
|
|
196
200
|
async processPluginSchemas (pluginInfo) {
|
|
197
201
|
if (!pluginInfo) {
|
|
198
202
|
pluginInfo = await this.framework.runCliCommand('getPluginUpdateInfos')
|
|
199
203
|
}
|
|
204
|
+
if (!Array.isArray(pluginInfo)) {
|
|
205
|
+
pluginInfo = [pluginInfo]
|
|
206
|
+
}
|
|
200
207
|
const jsonschema = await this.app.waitForModule('jsonschema')
|
|
201
208
|
return Promise.all(pluginInfo.map(async plugin => {
|
|
202
209
|
const name = plugin.name
|
|
@@ -319,7 +326,7 @@ class ContentPluginModule extends AbstractApiModule {
|
|
|
319
326
|
throw this.app.errors.CONTENTPLUGIN_ATTR_MISSING
|
|
320
327
|
.setData({ name })
|
|
321
328
|
}
|
|
322
|
-
await this.processPluginSchemas(
|
|
329
|
+
await this.processPluginSchemas(data)
|
|
323
330
|
return info
|
|
324
331
|
}
|
|
325
332
|
|
package/package.json
CHANGED
|
@@ -1,25 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-contentplugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Module for managing framework plugins",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-contentplugin",
|
|
6
|
+
"repository": "github:adapt-security/adapt-authoring-contentplugin",
|
|
6
7
|
"main": "index.js",
|
|
7
8
|
"type": "module",
|
|
8
9
|
"dependencies": {
|
|
9
|
-
"adapt-cli": "
|
|
10
|
-
"glob": "^
|
|
10
|
+
"adapt-cli": "^3.3.3",
|
|
11
|
+
"glob": "^13.0.0",
|
|
11
12
|
"semver": "^7.6.0"
|
|
12
13
|
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"adapt-authoring-adaptframework": "^1.9.3",
|
|
16
|
+
"adapt-authoring-content": "^1.2.3",
|
|
17
|
+
"adapt-authoring-core": "^1.7.0",
|
|
18
|
+
"adapt-authoring-jsonschema": "^1.2.0",
|
|
19
|
+
"adapt-authoring-middleware": "^1.0.2",
|
|
20
|
+
"adapt-authoring-mongodb": "^1.1.3"
|
|
21
|
+
},
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"adapt-authoring-adaptframework": {
|
|
24
|
+
"optional": true
|
|
25
|
+
},
|
|
26
|
+
"adapt-authoring-content": {
|
|
27
|
+
"optional": true
|
|
28
|
+
},
|
|
29
|
+
"adapt-authoring-core": {
|
|
30
|
+
"optional": true
|
|
31
|
+
},
|
|
32
|
+
"adapt-authoring-jsonschema": {
|
|
33
|
+
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"adapt-authoring-middleware": {
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
"adapt-authoring-mongodb": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
13
42
|
"devDependencies": {
|
|
14
|
-
"standard": "^17.1.0",
|
|
15
|
-
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
16
43
|
"@semantic-release/git": "^10.0.1",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"conventional-changelog-eslint": "^3.0.9",
|
|
21
|
-
"semantic-release": "^21.0.1",
|
|
22
|
-
"semantic-release-replace-plugin": "^1.2.7"
|
|
44
|
+
"conventional-changelog-eslint": "^6.0.0",
|
|
45
|
+
"semantic-release": "^25.0.2",
|
|
46
|
+
"standard": "^17.1.0"
|
|
23
47
|
},
|
|
24
48
|
"release": {
|
|
25
49
|
"plugins": [
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
name: Add labelled PRs to project
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [ labeled ]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
add-to-project:
|
|
9
|
-
if: ${{ github.event.label.name == 'dependencies' }}
|
|
10
|
-
name: Add to main project
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/add-to-project@v0.1.0
|
|
14
|
-
with:
|
|
15
|
-
project-url: https://github.com/orgs/adapt-security/projects/5
|
|
16
|
-
github-token: ${{ secrets.PROJECTS_SECRET }}
|