@leverege/build-tools 2.58.4 → 2.58.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.58.4",
3
+ "version": "2.58.6",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -62,7 +62,7 @@
62
62
  "@google-cloud/artifact-registry": "^3.5.0",
63
63
  "@leverege/jsdoc-template": "^1.0.1",
64
64
  "ansi-colors": "^4.1.3",
65
- "chalk": "^5.4.0",
65
+ "chalk": "^5.4.1",
66
66
  "command-line-args": "^6.0.1",
67
67
  "command-line-usage": "^7.0.3",
68
68
  "deepmerge": "^4.3.1",
@@ -81,7 +81,7 @@
81
81
  "readline-sync": "^1.4.10",
82
82
  "semver": "^7.6.3",
83
83
  "simple-git": "^3.27.0",
84
- "zx": "^8.2.4"
84
+ "zx": "^8.3.0"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@leverege/eslint-config-leverege": "^5.0.1",
package/src/Utils.mjs CHANGED
@@ -477,7 +477,7 @@ export const analyzeRepository = async ( giveGuidance ) => {
477
477
  await shellCmd( 'npm run build' )
478
478
  }
479
479
 
480
- const buildToolsVersion = closestPackageJson.devDependencies['@leverege/build-tools']
480
+ const buildToolsVersion = closestPackageJson.devDependencies['@leverege/build-tools'] || closestPackageJson.dependencies['@leverege/build-tools']
481
481
  if ( !buildToolsVersion ) {
482
482
  errorExit( 'Error: missing devDependency for @leverege/build-tools in package.json' )
483
483
  }
package/src/circleate.sh CHANGED
@@ -128,7 +128,7 @@ jobs:
128
128
  at: ~/project
129
129
  - run:
130
130
  name: Generate docs
131
- command: npx jsdoc -r src -R README.md -d docs
131
+ command: npm run docs
132
132
  - store_artifacts:
133
133
  path: docs
134
134
  prefix: docs
@@ -347,7 +347,7 @@ jobs:
347
347
  at: ~/project
348
348
  - run:
349
349
  name: Generate docs
350
- command: npx jsdoc -r src -R README.md -d docs
350
+ command: npm run docs
351
351
  - store_artifacts:
352
352
  path: docs
353
353
  prefix: docs
@@ -10,15 +10,16 @@
10
10
  "templates": {
11
11
  "cleverLinks": true,
12
12
  "monospaceLinks": false,
13
+ "preserveDescriptions": true,
13
14
  "default": {
14
15
  "useLongnameInNav": true,
15
16
  "outputSourceFiles": false
16
17
  }
17
18
  },
18
19
  "opts": {
19
- "template": "node_modules/@leverege/jsdoc-template",
20
20
  "encoding": "utf8",
21
- "lenient": false
21
+ "lenient": false,
22
+ "markdown": true
22
23
  },
23
24
  "docdash": {
24
25
  "static": true,
@@ -30,10 +31,10 @@
30
31
  "scripts": [],
31
32
  "menu":{
32
33
  "Bitbucket": {
33
- "href":"https://bitbucket.org/leverege/IF_THIS_MAKES_SENSE",
34
- "target":"_blank",
35
- "class":"menu-item",
36
- "id":"repository"
34
+ "href":"https://bitbucket.org/leverege/IF_THIS_MAKES_SENSE",
35
+ "target":"_blank",
36
+ "class":"menu-item",
37
+ "id":"repository"
37
38
  }
38
39
  }
39
40
  }
@@ -7,23 +7,45 @@
7
7
  * npx --package=jsdoc-to-markdown jsdoc2md --files src/*.js --configure ./jsdoc.json > docs/md/API.md
8
8
  *
9
9
  */
10
+ import fs from 'node:fs'
11
+
10
12
  import {
11
- condir,
13
+ BUILD_TOOLS_ROOT,
12
14
  debug,
15
+ err,
13
16
  getRepositoryDescr,
14
- getSourceTop,
15
- log,
16
17
  shellCmd,
17
18
  } from './Utils.mjs'
18
19
 
20
+ const jsdocConfig = `${BUILD_TOOLS_ROOT}/generate-docs-conf.json`
21
+
22
+ // build the location of the template file from the build-tools root
23
+ // in order to avoid hardcoding in the jsdoc config file - this is
24
+ // important in order to support running generate-docs from a user's
25
+ // laptop or deployed to the doc-creator service on k8s
26
+ const jsdocTemplate = `${BUILD_TOOLS_ROOT}/../../jsdoc-template`
19
27
 
20
- const jsdocTemplate = `${getSourceTop()}/jsdoc-template`
21
- const jsdocConfig = `${jsdocTemplate}/jsdoc.json`
28
+ if ( !fs.existsSync( jsdocConfig ) ) { // eslint-disable-line security/detect-non-literal-fs-filename
29
+ err( `cannot find the jsdoc config file: ${jsdocConfig}` )
30
+ process.exit( 1 )
31
+ }
22
32
 
23
33
  const repoDescr = await getRepositoryDescr()
24
34
 
25
- condir( { jsdocTemplate, jsdocConfig, repoDescr }, '<==The Repo' )
35
+ debug( { jsdocConfig, repoDescr }, '<==The Repo' )
36
+
37
+ // blow away any existing docs before recreating the docs dir
38
+ if ( fs.existsSync( 'docs' ) ) {
39
+ fs.rmSync( 'docs', { recursive : true } )
40
+ }
41
+ fs.mkdirSync( 'docs/md', { recursive : true } )
26
42
 
27
- await shellCmd( `npx jsdoc -c ${jsdocConfig} -R README.md -d docs src` )
28
- await shellCmd( 'mkdir -p docs/md' )
29
- await shellCmd( `npx --package=jsdoc-to-markdown jsdoc2md --files src/*.js --configure ./jsdoc.json`, { stdout : { file : 'docs/md/API.md' } } )
43
+ try {
44
+ await shellCmd( `npx --yes jsdoc -c ${jsdocConfig} -t ${jsdocTemplate} -R README.md -d docs src` )
45
+ await shellCmd(
46
+ `npx --yes --package=jsdoc-to-markdown jsdoc2md --files src/*.js --configure ${jsdocConfig}`,
47
+ { stdout : { file : 'docs/md/API.md' } }
48
+ )
49
+ } catch ( error ) {
50
+ err( error )
51
+ }