@leverege/build-tools 2.58.5 → 2.59.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.58.5",
3
+ "version": "2.59.0-beta.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -27,7 +27,6 @@
27
27
  "encrypt-secrets": "src/encrypt-secrets.sh",
28
28
  "firebaseDeploy": "src/firebaseDeploy.mjs",
29
29
  "firebaseServe": "src/firebaseServe.mjs",
30
- "generate-docs": "src/generate-docs.mjs",
31
30
  "getfbcfg": "src/getfbcfg.mjs",
32
31
  "getjson": "src/getjson.mjs",
33
32
  "git-tar": "src/git-tar.sh",
@@ -60,9 +59,8 @@
60
59
  "license": "SEE LICENSE IN LICENSE.md",
61
60
  "dependencies": {
62
61
  "@google-cloud/artifact-registry": "^3.5.0",
63
- "@leverege/jsdoc-template": "^1.0.1",
64
62
  "ansi-colors": "^4.1.3",
65
- "chalk": "^5.4.1",
63
+ "chalk": "^5.3.0",
66
64
  "command-line-args": "^6.0.1",
67
65
  "command-line-usage": "^7.0.3",
68
66
  "deepmerge": "^4.3.1",
@@ -70,9 +68,8 @@
70
68
  "execa": "^9.5.2",
71
69
  "glob": "^11.0.0",
72
70
  "handlebars": "^4.7.8",
73
- "inquirer": "^12.3.0",
71
+ "inquirer": "^12.2.0",
74
72
  "js-yaml": "^4.1.0",
75
- "jsdoc": "^4.0.4",
76
73
  "ms": "^2.1.3",
77
74
  "npm-registry-fetch": "^18.0.2",
78
75
  "package-up": "^5.0.0",
@@ -85,6 +82,6 @@
85
82
  },
86
83
  "devDependencies": {
87
84
  "@leverege/eslint-config-leverege": "^5.0.1",
88
- "npm": "^11.0.0"
85
+ "npm": "^10.9.2"
89
86
  }
90
87
  }
package/src/Docker.mjs CHANGED
@@ -1,4 +1,6 @@
1
1
  import fs from 'node:fs'
2
+ import * as path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
2
4
 
3
5
  import chalk from 'chalk'
4
6
  import handlebars from 'handlebars'
@@ -13,6 +15,9 @@ import {
13
15
  warning
14
16
  } from './Utils.mjs'
15
17
 
18
+ const __filename = fileURLToPath( import.meta.url )
19
+ const __dirname = path.dirname( __filename )
20
+
16
21
  // TODO: change default to node 22 (jod) after 01/01/25
17
22
  const dockerfileNodeVersion = process.env.USE_NODEJS_22 ? 'jod-alpine' : 'iron-alpine'
18
23
 
@@ -20,73 +25,6 @@ const dockerfileNodeVersion = process.env.USE_NODEJS_22 ? 'jod-alpine' : 'iron-a
20
25
  // the build-tools repository, but it just became simpler to pull the contents
21
26
  // directly into these variables and forego the file loading.
22
27
  //
23
- const dockerfileTemplate = `
24
- # Version {{regvers}} @ {{date}}
25
- #
26
- # The FROM directive sets the Base Image for subsequent instructions
27
- FROM node:{{nodeimage}} as intermediate
28
- ENV NODE_ENV production
29
- ENV NPM_CONFIG_USERCONFIG /usr/src/app/.npmrc
30
-
31
- RUN mkdir -p /usr/src/app
32
- WORKDIR /usr/src/app
33
-
34
- # Install app dependencies
35
- COPY ./workspace/ /usr/src/app/
36
- ENV GRPC_VERBOSITY ERROR
37
-
38
- # --------------------------------------------------------------
39
- # copy the ssh keys into place, npm install, and remove them
40
- # --------------------------------------------------------------
41
-
42
- # Install packages to install private repos with ssh keys
43
- COPY ./.npmrc \${NPM_CONFIG_USERCONFIG}
44
- RUN apk --no-cache add openssh-client && \
45
- apk --update add --no-cache --virtual build-dep g++ gcc libgcc \\
46
- libstdc++ linux-headers make {{apkadds}} && \
47
- npm install -g npm@10
48
-
49
- {{preInstallPluginfile}}
50
-
51
- # Use SKIP_PREPARE to disable hook-and-release from running
52
- ENV SKIP_PREPARE=true
53
-
54
- # Do the clean install and remove the npm token and ssh keys from the image
55
- RUN npm ci --only=production --no-optional {{npmlogging}} && \
56
- rm -f \${NPM_CONFIG_USERCONFIG} /root/.ssh/*
57
-
58
- # --------------------------------------------------------------
59
- # Docker Final Stage
60
- # --------------------------------------------------------------
61
-
62
- FROM node:{{nodeimage}}
63
- ENV NPM_CONFIG_USERCONFIG /usr/src/app/.npmrc
64
-
65
- # Copy .npmrc for private registry access for access to any @leverege packages
66
- COPY ./.npmrc \${NPM_CONFIG_USERCONFIG}
67
-
68
- # Install tini for PID 1 and replace shell with bash so we can source files
69
- RUN apk update && \
70
- apk add --no-cache bash curl tini vim {{apkadds}} && \
71
- npm install -g npm@10 && \
72
- rm /bin/sh && ln -s /bin/bash /bin/sh && \
73
- mkdir -p /usr/src/app /tmp/levlog && \
74
- chown node:node /usr/src/app
75
-
76
- # Pull in the Dockerfile.plugin file here
77
- {{pluginfile}}
78
-
79
- # Eliminate the sensitive info from the final stage image
80
- RUN rm -f \${NPM_CONFIG_USERCONFIG}
81
-
82
- ENTRYPOINT [ "/sbin/tini", "--" ]
83
- WORKDIR /usr/src/app
84
-
85
- COPY --chown=node:node --from=intermediate /usr/src/app /usr/src/app
86
-
87
- USER {{runuser}}
88
- COPY ./bashrc /home/node/.bashrc
89
- CMD [ "/bin/bash", "-c", "source /home/node/.bashrc && node index.js" ]`
90
28
 
91
29
  const pluginTemplate = `
92
30
  # Dockerfile.plugin - optionally extend the service Docker image
@@ -103,73 +41,16 @@ const pluginTemplate = `
103
41
  # footprints small, so adding packages "just because" is not considered
104
42
  # a best practice.
105
43
  `
106
-
107
- const bashrcTemplate = `#!/bin/bash
108
- #
109
- alias h=history
110
-
111
- alias ls='ls -CF --color=auto'
112
- alias ll='ls -lh'
113
- alias lla='ls -lha'
114
- alias glep='grep -l -s'
115
- alias m=less
116
- alias menv='env | sort | less'
117
-
118
- alias whatsmyip='wget -qO- ifconfig.co'
119
-
120
- alias err='wget -q -O- localhost:5111/logLevel/error'
121
- alias wrn='wget -q -O- localhost:5111/logLevel/warn'
122
- alias inf='wget -q -O- localhost:5111/logLevel/info'
123
- alias dbg='wget -q -O- localhost:5111/logLevel/debug'
124
- alias trc='wget -q -O- localhost:5111/logLevel/trace'
125
-
126
- socks()
127
- {
128
- netstat -ant | awk '{print }' | sort | uniq -c | sort -n
129
- }
130
-
131
- cmetrics()
132
- {
133
- wget -qO- localhost:5111/metrics
134
- }
135
-
136
- cmstat()
137
- {
138
- wget -qO- localhost:5111
139
- }
140
-
141
- cmclear()
142
- {
143
- # Future me - thinking this should call cmstat and pass in the endpoint as
144
- # a parameter? Well don't do it - without escaping the dollar 1 in cmstat
145
- # the port will end up being 51111, and escaping causes linting to complain
146
- # about unnecessary escaping.
147
- wget -qO- localhost:5111/status/clear
148
- }
149
-
150
- dunm() {
151
- du -sh /usr/src/app/node_modules/* | sort -sh
152
- }
153
- `
154
- const cloudBuildSteps = `
155
- steps:
156
- - name: 'gcr.io/cloud-builders/docker'
157
- args:
158
- - 'build'
159
- - '--network=cloudbuild'
160
- - '-t'
161
- - '{{imageName}}:{{imageVersion}}'
162
- - '.'
163
-
164
- images:
165
- - '{{imageName}}:{{imageVersion}}'
166
- `
44
+ const dockerfileTemplate = fs.readFileSync( path.join( __dirname, './dockerfileTemplate.hbs' ), 'utf8' )
45
+ const bashrcTemplate = fs.readFileSync( path.join( __dirname, './bashrcTemplate.hbs' ), 'utf8' )
46
+ const cloudBuildSteps = fs.readFileSync( path.join( __dirname, './cloudBuildSteps.hbs' ), 'utf8' )
167
47
 
168
48
  const defaultSettings = {
169
49
  apkadds : '',
170
50
  date : getDateTimestamp(),
171
51
  nodeimage : process.env.USE_NODEJS_22 ? 'jod-alpine' : 'iron-alpine',
172
- npmlogging : process.env.VERBOSE_NPM_LOGGING ? '--ddd' : '--silent',
52
+ imageBase : process.env.USE_NODEJS_22 ? 'node:jod-alpine' : 'node:iron-alpine',
53
+ npmlogging : process.env.VERBOSE_NPM_LOGGING ? '--ddd' : '--ddd',
173
54
  pluginfile : '# NO PLUGIN',
174
55
  preInstallPluginfile : '# NO PRE-INSTALL PLUGIN',
175
56
  regvers : 'package.version',
@@ -195,7 +76,7 @@ const generateDockerfile = ( options ) => {
195
76
  if ( !settings.nodeimage ) {
196
77
  settings.nodeimage = dockerfileNodeVersion
197
78
  }
198
-
79
+ settings.image = settings.imageBase || `node:${settings.nodeimage}`
199
80
  // Ensure the presence of the docker dir with plugin and bashrc - this code
200
81
  // could probably be tightened up a little.
201
82
  try {
package/src/Utils.mjs CHANGED
@@ -1,6 +1,4 @@
1
1
  import { existsSync, readdirSync, readFileSync } from 'node:fs'
2
- import path from 'node:path'
3
- import url from 'node:url'
4
2
 
5
3
  import chalk from 'chalk'
6
4
  import { $ } from 'execa'
@@ -9,10 +7,6 @@ import { glob } from 'glob'
9
7
  import { packageUp } from 'package-up'
10
8
  import YAML from 'js-yaml'
11
9
 
12
- // __dirname goes away with ESM so we take this approach instead and
13
- // this assumes this file lives in the src dir of the build-tools repo
14
- export const BUILD_TOOLS_ROOT = path.dirname( url.fileURLToPath( import.meta.url ) )
15
-
16
10
  let debugEnabled = process.env.BUILD_TOOLS_DEBUG === '1'
17
11
 
18
12
  export const enableDebug = () => { debugEnabled = true }
@@ -0,0 +1,46 @@
1
+ #!/bin/bash
2
+ #
3
+ alias h=history
4
+
5
+ alias ls='ls -CF --color=auto'
6
+ alias ll='ls -lh'
7
+ alias lla='ls -lha'
8
+ alias glep='grep -l -s'
9
+ alias m=less
10
+ alias menv='env | sort | less'
11
+
12
+ alias whatsmyip='wget -qO- ifconfig.co'
13
+
14
+ alias err='wget -q -O- localhost:5111/logLevel/error'
15
+ alias wrn='wget -q -O- localhost:5111/logLevel/warn'
16
+ alias inf='wget -q -O- localhost:5111/logLevel/info'
17
+ alias dbg='wget -q -O- localhost:5111/logLevel/debug'
18
+ alias trc='wget -q -O- localhost:5111/logLevel/trace'
19
+
20
+ socks()
21
+ {
22
+ netstat -ant | awk '{print }' | sort | uniq -c | sort -n
23
+ }
24
+
25
+ cmetrics()
26
+ {
27
+ wget -qO- localhost:5111/metrics
28
+ }
29
+
30
+ cmstat()
31
+ {
32
+ wget -qO- localhost:5111
33
+ }
34
+
35
+ cmclear()
36
+ {
37
+ # Future me - thinking this should call cmstat and pass in the endpoint as
38
+ # a parameter? Well don't do it - without escaping the dollar 1 in cmstat
39
+ # the port will end up being 51111, and escaping causes linting to complain
40
+ # about unnecessary escaping.
41
+ wget -qO- localhost:5111/status/clear
42
+ }
43
+
44
+ dunm() {
45
+ du -sh /usr/src/app/node_modules/* | sort -sh
46
+ }
package/src/circleate.sh CHANGED
@@ -128,7 +128,7 @@ jobs:
128
128
  at: ~/project
129
129
  - run:
130
130
  name: Generate docs
131
- command: npm run docs
131
+ command: npx jsdoc -r src -R README.md -d docs
132
132
  - store_artifacts:
133
133
  path: docs
134
134
  prefix: docs
@@ -0,0 +1,13 @@
1
+ steps:
2
+ - name: 'gcr.io/cloud-builders/docker'
3
+ args:
4
+ - 'build'
5
+ - '--network=cloudbuild'
6
+ - '-t'
7
+ - '{{imageName}}:{{imageVersion}}'
8
+ - '--cache-from'
9
+ - '{{imageName}}:{{imageVersion}}'
10
+ - '.'
11
+
12
+ images:
13
+ - '{{imageName}}:{{imageVersion}}'
@@ -96,6 +96,8 @@ if ( semver.lt( semver.coerce( repoDescr.buildToolsVersion ), minimumBuildToolsV
96
96
 
97
97
  const dockerInfo = await docker.generateDockerfile( {
98
98
  regvers : repoDescr.packageVersion,
99
+ imageBase : repoDescr.closestPackageJson.leverege?.imageBase,
100
+ buildEnv : repoDescr.closestPackageJson.leverege?.buildEnv || 'alpine',
99
101
  nodeimage : repoDescr.closestPackageJson.leverege?.nodeimg, // left as nodeimg in package.json for backwards compat
100
102
  } )
101
103
  debug( { dockerInfo }, '<==The Docker Info' )
@@ -216,7 +218,8 @@ log( `
216
218
  NPM Workspace: ${chalk.green.bold( isNpmWorkspace )}
217
219
 
218
220
  ${chalk.green.bold( 'Docker Information:' )}
219
- NodeImage: ${chalk.green.bold( dockerInfo.nodeimage )}
221
+ NodeImage: ${chalk.green.bold( dockerInfo.imageBase || `node:${dockerInfo.nodeimage}` )}
222
+ Docker Env: ${chalk.green.bold( dockerInfo.buildEnv || 'alpine' )}
220
223
  AddedPkgs: ${chalk.green.bold( dockerInfo.apkadds )}
221
224
  Run User: ${chalk.green.bold( dockerInfo.runuser )}
222
225
  Previous: ${chalk.yellow.bold( dockerInfo.previousBuild )}
@@ -0,0 +1,88 @@
1
+ # Version {{regvers}} @ {{date}}
2
+
3
+ # The FROM directive sets the Base Image for subsequent instructions
4
+ FROM {{image}} as intermediate
5
+
6
+ ARG BUILD_ENV="{{buildEnv}}"
7
+
8
+ ENV NODE_ENV production
9
+ ENV NPM_CONFIG_USERCONFIG /usr/src/app/.npmrc
10
+
11
+ RUN mkdir -p /usr/src/app
12
+ WORKDIR /usr/src/app
13
+
14
+ # Install app dependencies
15
+ COPY ./workspace/ /usr/src/app/
16
+ ENV GRPC_VERBOSITY ERROR
17
+
18
+ # --------------------------------------------------------------
19
+ # copy the ssh keys into place, npm install, and remove them
20
+ # --------------------------------------------------------------
21
+
22
+ # Install packages to install private repos with ssh keys
23
+ COPY ./.npmrc ${NPM_CONFIG_USERCONFIG}
24
+
25
+ RUN if [ "${BUILD_ENV}" = "debian" ]; then \
26
+ apt-get update && \
27
+ apt-get install -y openssh-client build-essential && \
28
+ npm install -g npm@10; \
29
+ else \
30
+ apk --no-cache add openssh-client && \
31
+ apk --update add --no-cache --virtual build-dep g++ gcc libgcc libstdc++ linux-headers make {{apkadds}} && \
32
+ npm install -g npm@10; \
33
+ fi
34
+
35
+ {{preInstallPluginfile}}
36
+
37
+ # Use SKIP_PREPARE to disable hook-and-release from running
38
+ ENV SKIP_PREPARE=true
39
+
40
+ {{preInstallPluginfile}}
41
+
42
+ # Do the clean install and remove the npm token and ssh keys from the image
43
+ RUN npm ci --only=production --no-optional {{npmlogging}} && \
44
+ rm -f ${NPM_CONFIG_USERCONFIG} /root/.ssh/*
45
+
46
+ # --------------------------------------------------------------
47
+ # Docker Final Stage
48
+ # --------------------------------------------------------------
49
+
50
+ FROM {{image}}
51
+
52
+ ARG BUILD_ENV="{{buildEnv}}"
53
+
54
+ ENV NPM_CONFIG_USERCONFIG /usr/src/app/.npmrc
55
+
56
+ # Copy .npmrc for private registry access for access to any @leverege packages
57
+ COPY ./.npmrc ${NPM_CONFIG_USERCONFIG}
58
+
59
+ # Install tini for PID 1 and replace shell with bash so we can source files
60
+ RUN if [ "$BUILD_ENV" = "debian" ]; then \
61
+ apt-get update && \
62
+ apt-get install -y tini bash curl vim {{apkadds}} && \
63
+ npm install -g npm@10 && \
64
+ rm /bin/sh && ln -s /bin/bash /bin/sh && \
65
+ mkdir -p /usr/src/app /tmp/levlog && chown node:node /usr/src/app; \
66
+ else \
67
+ apk update && \
68
+ apk add --no-cache bash curl tini vim {{apkadds}} && \
69
+ npm install -g npm@10 && \
70
+ rm /bin/sh && ln -s /bin/bash /bin/sh && \
71
+ mkdir -p /usr/src/app /tmp/levlog && chown node:node /usr/src/app; \
72
+ fi
73
+
74
+
75
+ # Pull in the Dockerfile.plugin file here
76
+ {{pluginfile}}
77
+
78
+ # Eliminate the sensitive info from the final stage image
79
+ RUN rm -f ${NPM_CONFIG_USERCONFIG}
80
+
81
+ ENTRYPOINT [ "tini", "--" ]
82
+ WORKDIR /usr/src/app
83
+
84
+ COPY --chown=node:node --from=intermediate /usr/src/app /usr/src/app
85
+
86
+ USER {{runuser}}
87
+ COPY ./bashrc /home/node/.bashrc
88
+ CMD [ "/bin/bash", "-c", "source /home/node/.bashrc && node index.js" ]
@@ -2,7 +2,7 @@
2
2
  #
3
3
  showInstalling "Elastic Search 8"
4
4
 
5
- [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.4.1"
5
+ [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.22"
6
6
 
7
7
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/elasticsearch"
8
8
 
@@ -4,7 +4,7 @@ showInstalling "The Prometheus Operator and Components"
4
4
  addHelmRepo prometheus-community https://prometheus-community.github.io/helm-charts
5
5
 
6
6
  showInstalling "The Prometheus Operator (kube-prometheus-stack)"
7
- [ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="67"
7
+ [ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="66"
8
8
 
9
9
  NS="--namespace prometheus"
10
10
 
@@ -4,7 +4,7 @@ showInstalling "Redis"
4
4
 
5
5
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/redis"
6
6
 
7
- [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.6.0"
7
+ [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.3.0"
8
8
 
9
9
  helm upgrade --install redis $OCI_CHART \
10
10
  --values redis/redis-local.yaml \
@@ -4,7 +4,7 @@ showInstalling "Velero Backup System"
4
4
 
5
5
  addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
6
6
 
7
- [ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="8"
7
+ [ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="7"
8
8
  #
9
9
  # Build the bucket, region and SA email variables and use --set to mod the
10
10
  # chart values as opposed to using an OVH:<label> approach. This eliminates
package/src/helmup.sh CHANGED
@@ -699,10 +699,10 @@ function installVeleroEnvironment() {
699
699
  gcloud config set project $GCP_PROJECT_ID
700
700
 
701
701
  ## The major chart version will determine the bucket suffix
702
- [ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="8"
702
+ [ -z "$VELERO_HELM_CHART" ] && VELERO_HELM_CHART="7"
703
703
 
704
704
  ## Create a bucket
705
- BUCKET="$GCP_PROJECT_ID-velero-$VELERO_CHART_VERSION"
705
+ BUCKET="$GCP_PROJECT_ID-velero-$VELERO_HELM_CHART"
706
706
  printf "\nCreating storage bucket `color g $BUCKET` in `color g $GCE_REGION`\n"
707
707
  gsutil mb -l $GCE_REGION gs://$BUCKET/ &> $DEVNULL
708
708
  warnOnError $? "Bucket failed to create or already exists - go check it\n"
@@ -1,42 +0,0 @@
1
- {
2
- "tags": {
3
- "allowUnknownTags": false
4
- },
5
- "source": {
6
- "includePattern": "\\.(js|mjs|jsx)$",
7
- "excludePattern": "(node_modules/|docs)"
8
- },
9
- "plugins": [],
10
- "templates": {
11
- "cleverLinks": true,
12
- "monospaceLinks": false,
13
- "preserveDescriptions": true,
14
- "default": {
15
- "useLongnameInNav": true,
16
- "outputSourceFiles": false
17
- }
18
- },
19
- "opts": {
20
- "template": "node_modules/@leverege/jsdoc-template",
21
- "encoding": "utf8",
22
- "lenient": false,
23
- "markdown": true
24
- },
25
- "docdash": {
26
- "static": true,
27
- "sort": false,
28
- "search": true,
29
- "collapse": true,
30
- "typedefs": true,
31
- "removeQuotes": "none",
32
- "scripts": [],
33
- "menu":{
34
- "Bitbucket": {
35
- "href":"https://bitbucket.org/leverege/IF_THIS_MAKES_SENSE",
36
- "target":"_blank",
37
- "class":"menu-item",
38
- "id":"repository"
39
- }
40
- }
41
- }
42
- }
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env node
2
- /*
3
- * Encapsulates the rather lengthy jsdoc / md docs npm script:
4
- *
5
- * npx jsdoc -c ./jsdoc.json -R README.md -d docs src && \
6
- * mkdir -p docs/md && \
7
- * npx --package=jsdoc-to-markdown jsdoc2md --files src/*.js --configure ./jsdoc.json > docs/md/API.md
8
- *
9
- */
10
- import fs from 'node:fs'
11
-
12
- import {
13
- BUILD_TOOLS_ROOT,
14
- debug,
15
- err,
16
- getRepositoryDescr,
17
- shellCmd,
18
- } from './Utils.mjs'
19
-
20
- const jsdocConfig = `${BUILD_TOOLS_ROOT}/generate-docs-conf.json`
21
-
22
- if ( !fs.existsSync( jsdocConfig ) ) { // eslint-disable-line security/detect-non-literal-fs-filename
23
- err( `cannot find the jsdoc config file: ${jsdocConfig}` )
24
- process.exit( 1 )
25
- }
26
-
27
- const repoDescr = await getRepositoryDescr()
28
-
29
- debug( { jsdocConfig, repoDescr }, '<==The Repo' )
30
-
31
- // blow away any existing docs before recreating the docs dir
32
- if ( fs.existsSync( 'docs' ) ) {
33
- fs.rmSync( 'docs', { recursive : true } )
34
- }
35
- fs.mkdirSync( 'docs/md', { recursive : true } )
36
-
37
- try {
38
- await shellCmd( `npx --yes jsdoc -c ${jsdocConfig} -R README.md -d docs src` )
39
- await shellCmd(
40
- `npx --yes --package=jsdoc-to-markdown jsdoc2md --files src/*.js --configure ${jsdocConfig}`,
41
- { stdout : { file : 'docs/md/API.md' } }
42
- )
43
- } catch ( error ) {
44
- err( error )
45
- }