adapt-authoring-errors 1.0.0 → 1.1.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.
- package/.github/workflows/new.yml +7 -11
- package/.github/workflows/releases.yml +9 -2
- package/.github/workflows/standardjs.yml +13 -0
- package/adapt-authoring.json +1 -1
- package/docs/plugins/errors.js +15 -13
- package/errors/adapt-errors.json +1 -1
- package/package.json +10 -11
- package/.eslintignore +0 -1
- package/.eslintrc +0 -14
- package/.github/workflows/labelled_prs.yml +0 -16
|
@@ -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
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: Standard.js formatting check
|
|
2
|
+
on: push
|
|
3
|
+
jobs:
|
|
4
|
+
default:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
steps:
|
|
7
|
+
- uses: actions/checkout@master
|
|
8
|
+
- uses: actions/setup-node@master
|
|
9
|
+
with:
|
|
10
|
+
node-version: 'lts/*'
|
|
11
|
+
cache: 'npm'
|
|
12
|
+
- run: npm ci
|
|
13
|
+
- run: npx standard
|
package/adapt-authoring.json
CHANGED
package/docs/plugins/errors.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export default class Errors {
|
|
2
|
-
async run() {
|
|
3
|
-
this.manualFile = 'errorsref.md'
|
|
4
|
-
this.contents = Object.keys(this.app.errors)
|
|
5
|
-
this.replace = { ERRORS: this.generateMd() }
|
|
2
|
+
async run () {
|
|
3
|
+
this.manualFile = 'errorsref.md'
|
|
4
|
+
this.contents = Object.keys(this.app.errors)
|
|
5
|
+
this.replace = { ERRORS: this.generateMd() }
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
generateMd () {
|
|
8
9
|
return Object.keys(this.app.errors).reduce((md, k) => {
|
|
9
|
-
const e = this.app.errors[k]
|
|
10
|
-
return `${md}\n| \`${e.code}\` | ${e.meta.description} | ${e.statusCode} | <ul>${this.dataToMd(e.meta.data)}</ul>
|
|
11
|
-
}, '| Error code | Description | HTTP status code | Supplemental data |\n| - | - | :-: | - |')
|
|
10
|
+
const e = this.app.errors[k]
|
|
11
|
+
return `${md}\n| \`${e.code}\` | ${e.meta.description} | ${e.statusCode} | <ul>${this.dataToMd(e.meta.data)}</ul> |`
|
|
12
|
+
}, '| Error code | Description | HTTP status code | Supplemental data |\n| - | - | :-: | - |')
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
dataToMd (data, s = '') {
|
|
16
|
+
if (!data) return s
|
|
15
17
|
return Object.entries(data).reduce((s, [k, v]) => {
|
|
16
|
-
return `${s}<li>\`${k}\`: ${typeof v === 'object' ? this.dataToMd(v, s) : v}</li
|
|
17
|
-
}, s)
|
|
18
|
+
return `${s}<li>\`${k}\`: ${typeof v === 'object' ? this.dataToMd(v, s) : v}</li>`
|
|
19
|
+
}, s)
|
|
18
20
|
}
|
|
19
|
-
}
|
|
21
|
+
}
|
package/errors/adapt-errors.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-errors",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Error handling for the Adapt authoring tool",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-errors",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -8,16 +8,15 @@
|
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"repository": "github:adapt-security/adapt-authoring-errors",
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"
|
|
12
|
-
"standard": "^17.1.0",
|
|
13
|
-
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
11
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
14
12
|
"@semantic-release/git": "^10.0.1",
|
|
15
|
-
"@semantic-release/github": "^
|
|
16
|
-
"@semantic-release/npm": "^
|
|
17
|
-
"@semantic-release/release-notes-generator": "^
|
|
18
|
-
"conventional-changelog-eslint": "^
|
|
19
|
-
"semantic-release": "^
|
|
20
|
-
"semantic-release-replace-plugin": "^1.2.7"
|
|
13
|
+
"@semantic-release/github": "^12.0.2",
|
|
14
|
+
"@semantic-release/npm": "^13.1.2",
|
|
15
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
16
|
+
"conventional-changelog-eslint": "^6.0.0",
|
|
17
|
+
"semantic-release": "^25.0.2",
|
|
18
|
+
"semantic-release-replace-plugin": "^1.2.7",
|
|
19
|
+
"standard": "^17.1.0"
|
|
21
20
|
},
|
|
22
21
|
"release": {
|
|
23
22
|
"plugins": [
|
|
@@ -47,6 +46,6 @@
|
|
|
47
46
|
]
|
|
48
47
|
},
|
|
49
48
|
"dependencies": {
|
|
50
|
-
"glob": "^
|
|
49
|
+
"glob": "^13.0.0"
|
|
51
50
|
}
|
|
52
51
|
}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node_modules
|
package/.eslintrc
DELETED
|
@@ -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 }}
|