adapt-authoring-docs 1.4.3 → 1.4.5

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,32 +1,16 @@
1
1
  name: Release
2
+
2
3
  on:
3
4
  push:
4
5
  branches:
5
6
  - master
6
7
 
8
+ permissions:
9
+ contents: write
10
+ issues: write
11
+ pull-requests: write
12
+ id-token: write
13
+
7
14
  jobs:
8
15
  release:
9
- name: Release
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
16
- steps:
17
- - name: Checkout
18
- uses: actions/checkout@v3
19
- with:
20
- fetch-depth: 0
21
- - name: Setup Node.js
22
- uses: actions/setup-node@v3
23
- with:
24
- node-version: 'lts/*'
25
- - name: Update npm
26
- run: npm install -g npm@latest
27
- - name: Install dependencies
28
- run: npm install
29
- - name: Release
30
- env:
31
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
- run: npx semantic-release
16
+ uses: adaptlearning/semantic-release-config/.github/workflows/release.yml@master
@@ -98,7 +98,10 @@ export default async function docsify (appData, configs, outputdir, defaultPages
98
98
  homepage: defaultPages.manualIndex ? path.basename(defaultPages.manualIndex) : false
99
99
  })))
100
100
 
101
- await Promise.allSettled(Object.entries(titleMap).map(([filename, v]) => fs.copy(v.path, `${dir}/${filename}`)))
101
+ await Promise.allSettled([
102
+ ...Object.entries(titleMap).map(([filename, v]) => fs.copy(v.path, `${dir}/${filename}`)),
103
+ ...Object.values(defaultPages).filter(Boolean).map(f => fs.copy(f, `${dir}/${path.basename(f)}`))
104
+ ])
102
105
  /**
103
106
  * Generate custom sidebar
104
107
  */
package/lib/docsData.js CHANGED
@@ -147,15 +147,15 @@ export async function buildRouterTree (dependencies) {
147
147
 
148
148
  if (apiDep) {
149
149
  try {
150
- apiDefaultRoutes = await readJson(path.join(apiDep.rootDir, 'lib', 'default-routes.json'))
150
+ apiDefaultRoutes = await readJson(path.join(apiDep.rootDir, 'default-routes.json'))
151
151
  } catch { /* no defaults */ }
152
152
  }
153
153
  if (authDep) {
154
154
  try {
155
- authDefaultRoutes = await readJson(path.join(authDep.rootDir, 'lib', 'default-routes.json'))
155
+ authDefaultRoutes = await readJson(path.join(authDep.rootDir, 'default-routes.json'))
156
156
  } catch { /* no defaults */ }
157
157
  try {
158
- const coreAuthConfig = await readJson(path.join(authDep.rootDir, 'lib', 'routes.json'))
158
+ const coreAuthConfig = await readJson(path.join(authDep.rootDir, 'routes.json'))
159
159
  authRouter = {
160
160
  path: '/api/auth',
161
161
  routes: (coreAuthConfig.routes || []).map(r => staticRouteEntry(r)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-docs",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "Tools for auto-generating documentation for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/adapt-security/adapt-authoring-docs",
6
6
  "license": "GPL-3.0",
@@ -26,36 +26,10 @@
26
26
  "swagger-ui": "^5.17.14"
27
27
  },
28
28
  "devDependencies": {
29
- "@semantic-release/git": "^10.0.1",
30
- "conventional-changelog-eslint": "^6.0.0",
31
- "semantic-release": "^25.0.2",
29
+ "@adaptlearning/semantic-release-config": "^1.0.0",
32
30
  "standard": "^17.1.0"
33
31
  },
34
32
  "release": {
35
- "plugins": [
36
- [
37
- "@semantic-release/commit-analyzer",
38
- {
39
- "preset": "eslint"
40
- }
41
- ],
42
- [
43
- "@semantic-release/release-notes-generator",
44
- {
45
- "preset": "eslint"
46
- }
47
- ],
48
- "@semantic-release/npm",
49
- "@semantic-release/github",
50
- [
51
- "@semantic-release/git",
52
- {
53
- "assets": [
54
- "package.json"
55
- ],
56
- "message": "Chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
57
- }
58
- ]
59
- ]
33
+ "extends": "@adaptlearning/semantic-release-config"
60
34
  }
61
35
  }
@@ -25,7 +25,7 @@ async function createFixture () {
25
25
 
26
26
  // --- fake api module (library, not a loaded module) ---
27
27
  const apiDir = path.join(root, 'node_modules', 'adapt-authoring-api')
28
- await fs.mkdir(path.join(apiDir, 'lib'), { recursive: true })
28
+ await fs.mkdir(apiDir, { recursive: true })
29
29
  await fs.writeFile(path.join(apiDir, 'package.json'), JSON.stringify({
30
30
  name: 'adapt-authoring-api',
31
31
  version: '1.0.0'
@@ -34,7 +34,7 @@ async function createFixture () {
34
34
  module: false,
35
35
  documentation: { enable: true }
36
36
  }))
37
- await fs.writeFile(path.join(apiDir, 'lib', 'default-routes.json'), JSON.stringify({
37
+ await fs.writeFile(path.join(apiDir, 'default-routes.json'), JSON.stringify({
38
38
  routes: [
39
39
  {
40
40
  route: '/',
@@ -51,7 +51,7 @@ async function createFixture () {
51
51
 
52
52
  // --- fake auth module ---
53
53
  const authDir = path.join(root, 'node_modules', 'adapt-authoring-auth')
54
- await fs.mkdir(path.join(authDir, 'lib'), { recursive: true })
54
+ await fs.mkdir(authDir, { recursive: true })
55
55
  await fs.writeFile(path.join(authDir, 'package.json'), JSON.stringify({
56
56
  name: 'adapt-authoring-auth',
57
57
  version: '1.0.0'
@@ -59,7 +59,7 @@ async function createFixture () {
59
59
  await fs.writeFile(path.join(authDir, 'adapt-authoring.json'), JSON.stringify({
60
60
  documentation: { enable: true }
61
61
  }))
62
- await fs.writeFile(path.join(authDir, 'lib', 'routes.json'), JSON.stringify({
62
+ await fs.writeFile(path.join(authDir, 'routes.json'), JSON.stringify({
63
63
  routes: [
64
64
  {
65
65
  route: '/check',
@@ -68,7 +68,7 @@ async function createFixture () {
68
68
  }
69
69
  ]
70
70
  }))
71
- await fs.writeFile(path.join(authDir, 'lib', 'default-routes.json'), JSON.stringify({
71
+ await fs.writeFile(path.join(authDir, 'default-routes.json'), JSON.stringify({
72
72
  routes: [
73
73
  {
74
74
  route: '/',