From 9718914988d08f6df61fa4922640fdb88f9761a6 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Tue, 13 Dec 2022 13:21:24 -0800 Subject: [PATCH 01/13] fix: replace relative links with absolute links --- addLinks.js | 2 ++ deleteBaseClasses.js | 2 ++ generate-devsite-base-classes.sh | 8 +++----- generate-devsite.sh | 22 ++++++++-------------- main.sh | 12 +++--------- package.json | 14 +++++++++++--- prettyPrint.js | 2 ++ removeInterface.js | 2 ++ removeProtos.js | 2 ++ 9 files changed, 35 insertions(+), 31 deletions(-) diff --git a/addLinks.js b/addLinks.js index 3cf8c94..ba0b5ec 100644 --- a/addLinks.js +++ b/addLinks.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const fs = require('fs'); const readline = require('readline'); diff --git a/deleteBaseClasses.js b/deleteBaseClasses.js index 7498e65..18b8363 100644 --- a/deleteBaseClasses.js +++ b/deleteBaseClasses.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const fs = require('fs'); const readline = require('readline'); diff --git a/generate-devsite-base-classes.sh b/generate-devsite-base-classes.sh index 3d4937a..4b9044b 100644 --- a/generate-devsite-base-classes.sh +++ b/generate-devsite-base-classes.sh @@ -21,17 +21,15 @@ mkdir -p ./etc -cp node_modules/@google-cloud/cloud-rad/api-extractor.json . +cp "$(npm root)/@google-cloud/cloud-rad/api-extractor.json" . npx @microsoft/api-extractor run --local npx @googleapis/api-documenter@^7 yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/prettyPrint.js" +pretty-print # remove interfaces from toc -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/removeInterface.js" +remove-interface # Clean up TOC # Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 diff --git a/generate-devsite.sh b/generate-devsite.sh index 94518fc..9cd8f14 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -20,32 +20,27 @@ mkdir -p ./etc - -cp node_modules/@google-cloud/cloud-rad/api-extractor.json . +cp "$(npm root)/@google-cloud/cloud-rad/api-extractor.json" . npx @microsoft/api-extractor run --local # copy the common.api.json file as it is used as a base class # If cloud-rad is running for common, the copied file will be overwritten by api-extractor -cp node_modules/@google-cloud/cloud-rad/api-extractor-configs/common.api.json temp -cp node_modules/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json temp +cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/common.api.json" temp +cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json" temp npx @googleapis/api-documenter@^7 yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/prettyPrint.js" +pretty-print # remove common and auth from toc -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/deleteBaseClasses.js" +delete-base-classes # remove interfaces from toc -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/removeInterface.js" +remove-interface # remove protos from toc -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/removeProtos.js" +remove-protos # Clean up TOC # Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 @@ -88,8 +83,7 @@ if [[ $numberOfFiles -ge 3 ]]; then fi # add href for external classes, see b/195674809 -dir="$(cd "$(dirname "$0")"; pwd)" -node "$dir/../@google-cloud/cloud-rad/addLinks.js" +add-links NAME=$(ls temp | sed s/.api.json*//) ## Copy everything to devsite diff --git a/main.sh b/main.sh index d52df72..e77870b 100755 --- a/main.sh +++ b/main.sh @@ -21,11 +21,6 @@ if [[ -z "$CREDENTIALS" ]]; then # and don't set NPM_CONFIG_PREFIX. export NPM_CONFIG_PREFIX=${HOME}/.npm-global export PATH="$PATH:${NPM_CONFIG_PREFIX}/bin" - cd $(dirname $0)/../.. -fi - -if [[ -n "$MONO_REPO_CWD" ]]; then - cd $MONO_REPO_CWD fi if [[ -n "$VERSION" ]]; then @@ -40,13 +35,12 @@ npm i json@9.0.6 -g name=$(cat package.json | json name | sed 's/^.*\///') # Generate the data for the devsite tarball -dir="$(cd "$(dirname "$0")"; pwd)" if [ "$name" == "common" ]; then - . "$dir/../@google-cloud/cloud-rad/generate-devsite-base-classes.sh" + . generate-devsite-base-classes elif [ "$name" == "google-auth-library" ]; then - . "$dir/../@google-cloud/cloud-rad/generate-devsite-base-classes.sh" + . generate-devsite-base-classes else - . "$dir/../@google-cloud/cloud-rad/generate-devsite.sh" + . generate-devsite fi if [[ -n "$NO_UPLOAD" ]]; then diff --git a/package.json b/package.json index f284043..fff278a 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,18 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.2.19", + "version": "0.4.12-experimental", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", "bin": { - "cloud-rad": "./main.sh" + "cloud-rad": "./main.sh", + "generate-devsite": "./generate-devsite.sh", + "generate-deviste-base-classes": "./generate-devsite-base-classes.sh", + "pretty-print": "./prettyPrint.js", + "delete-base-classes": "./deleteBaseClasses.js", + "remove-interface": "./removeInterface.js", + "remove-protos": "./removeProtos.js", + "add-links": "./addLinks.js" }, "scripts": { "test": "env NO_UPLOAD=1 mocha" @@ -14,7 +21,8 @@ "license": "Apache-2.0", "dependencies": { "@googleapis/api-documenter": "~7.13.0", - "@microsoft/api-extractor": "~7.19.0" + "@microsoft/api-extractor": "~7.19.0", + "glob": "^8.0.3" }, "engines": { "node": ">=12.0.0" diff --git a/prettyPrint.js b/prettyPrint.js index 8d2db89..00352fe 100644 --- a/prettyPrint.js +++ b/prettyPrint.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const fs = require('fs'); const readline = require('readline'); diff --git a/removeInterface.js b/removeInterface.js index e4544e7..c863419 100644 --- a/removeInterface.js +++ b/removeInterface.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const fs = require('fs'); const readline = require('readline'); diff --git a/removeProtos.js b/removeProtos.js index 4286d6d..28a0419 100644 --- a/removeProtos.js +++ b/removeProtos.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const fs = require('fs'); const readline = require('readline'); From fcc580fb6cbbe1f2f352e35186c64e8fcd589a26 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Tue, 13 Dec 2022 14:12:30 -0800 Subject: [PATCH 02/13] add changes --- generate-devsite.sh | 21 +++++++++++++++++++++ main.sh | 4 ++++ package.json | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/generate-devsite.sh b/generate-devsite.sh index 9cd8f14..27c3008 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -18,32 +18,45 @@ # When running locally, run `docfx --serve` in ./yaml/ after this script +echo "mkdir -p ./etc" mkdir -p ./etc +echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor.json ." cp "$(npm root)/@google-cloud/cloud-rad/api-extractor.json" . +echo "npx @microsoft/api-extractor run --local" npx @microsoft/api-extractor run --local +echo "mkdir temp" +mkdir temp # copy the common.api.json file as it is used as a base class # If cloud-rad is running for common, the copied file will be overwritten by api-extractor +echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/common.api.json temp" cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/common.api.json" temp +echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json temp" cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json" temp +echo "npx @googleapis/api-documenter@^7 yaml --input-folder=temp" npx @googleapis/api-documenter@^7 yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 +echo "pretty-print" pretty-print # remove common and auth from toc +echo "delete-base-classes" delete-base-classes # remove interfaces from toc +echo "remove-interface" remove-interface # remove protos from toc +echo "remove-protos" remove-protos # Clean up TOC # Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 +echo "sed commands" sed -i -e '1,3d' ./yaml/toc.yml # Shift everything to the left sed -i -e 's/^ //' ./yaml/toc.yml @@ -78,23 +91,31 @@ sed -i -e '7a\ # be two files in temp. Otherwise, delete common.api.json and auth. numberOfFiles=$(ls temp | wc -l) if [[ $numberOfFiles -ge 3 ]]; then + echo "rm temp/common.api.json" rm temp/common.api.json rm temp/google-auth-library.api.json fi # add href for external classes, see b/195674809 +echo "add-links" add-links NAME=$(ls temp | sed s/.api.json*//) ## Copy everything to devsite +echo "mkdir -p ./_devsite" mkdir -p ./_devsite +echo "mkdir -p ./_devsite/$NAME" mkdir -p ./_devsite/$NAME +echo "cp ./yaml/$NAME/* ./_devsite/$NAME || :" cp ./yaml/$NAME/* ./_devsite/$NAME || : +echo "cp ./yaml/toc.yml ./_devsite/toc.yml" cp ./yaml/toc.yml ./_devsite/toc.yml ## Rename the default overview page, +echo "mv ./yaml/$NAME.yml ./_devsite/overview.yml" mv ./yaml/$NAME.yml ./_devsite/overview.yml ## readme is not allowed as filename +echo "cp ./README.md ./_devsite/index.md" cp ./README.md ./_devsite/index.md diff --git a/main.sh b/main.sh index e77870b..cc01731 100755 --- a/main.sh +++ b/main.sh @@ -36,10 +36,13 @@ name=$(cat package.json | json name | sed 's/^.*\///') # Generate the data for the devsite tarball if [ "$name" == "common" ]; then + echo "calling generate devsite base classes" . generate-devsite-base-classes elif [ "$name" == "google-auth-library" ]; then + echo "calling generate devsite base classes" . generate-devsite-base-classes else + echo "calling generate devsite" . generate-devsite fi @@ -48,6 +51,7 @@ if [[ -n "$NO_UPLOAD" ]]; then exit 0 fi +echo "python commands" # create docs.metadata, based on package.json and .repo-metadata.json. pip install -U pip python3 -m pip install --user gcp-docuploader diff --git a/package.json b/package.json index fff278a..f955bc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.4.12-experimental", + "version": "0.4.13-experimental", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", From 3654d453e68c58c8dc4f20873bfc992e3b9e3cec Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Tue, 13 Dec 2022 14:15:52 -0800 Subject: [PATCH 03/13] celean up logs --- main.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.sh b/main.sh index cc01731..42a8582 100755 --- a/main.sh +++ b/main.sh @@ -36,13 +36,13 @@ name=$(cat package.json | json name | sed 's/^.*\///') # Generate the data for the devsite tarball if [ "$name" == "common" ]; then - echo "calling generate devsite base classes" + echo ". generate-devsite-base-classes" . generate-devsite-base-classes elif [ "$name" == "google-auth-library" ]; then - echo "calling generate devsite base classes" + echo ". generate-devsite-base-classes" . generate-devsite-base-classes else - echo "calling generate devsite" + echo ". generate-devsite" . generate-devsite fi @@ -51,7 +51,6 @@ if [[ -n "$NO_UPLOAD" ]]; then exit 0 fi -echo "python commands" # create docs.metadata, based on package.json and .repo-metadata.json. pip install -U pip python3 -m pip install --user gcp-docuploader From dbc2ded6ad35ac950f3ffd4f94019c4b473248c9 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Tue, 13 Dec 2022 14:22:33 -0800 Subject: [PATCH 04/13] remove mkdir tmp --- generate-devsite.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/generate-devsite.sh b/generate-devsite.sh index 27c3008..27abc59 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -26,8 +26,6 @@ cp "$(npm root)/@google-cloud/cloud-rad/api-extractor.json" . echo "npx @microsoft/api-extractor run --local" npx @microsoft/api-extractor run --local -echo "mkdir temp" -mkdir temp # copy the common.api.json file as it is used as a base class # If cloud-rad is running for common, the copied file will be overwritten by api-extractor echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/common.api.json temp" From ceb53f5375b6305cb038b09ec23d297850e74848 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Tue, 13 Dec 2022 15:30:16 -0800 Subject: [PATCH 05/13] run from node modules --- generate-devsite-base-classes.sh | 4 ++-- generate-devsite.sh | 20 ++++++++++---------- main.sh | 10 +++++----- package.json | 11 ++--------- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/generate-devsite-base-classes.sh b/generate-devsite-base-classes.sh index 4b9044b..dedd964 100644 --- a/generate-devsite-base-classes.sh +++ b/generate-devsite-base-classes.sh @@ -26,10 +26,10 @@ npx @microsoft/api-extractor run --local npx @googleapis/api-documenter@^7 yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 -pretty-print +node "$(npm root)/@google-cloud/cloud-rad/prettyPrint.js" # remove interfaces from toc -remove-interface +node "$(npm root)/@google-cloud/cloud-rad/removeInterface.js" # Clean up TOC # Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 diff --git a/generate-devsite.sh b/generate-devsite.sh index 27abc59..0fda793 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -37,20 +37,20 @@ echo "npx @googleapis/api-documenter@^7 yaml --input-folder=temp" npx @googleapis/api-documenter@^7 yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 -echo "pretty-print" -pretty-print +echo "node $(npm root)/@google-cloud/cloud-rad/prettyPrint.js" +node "$(npm root)/@google-cloud/cloud-rad/prettyPrint.js" # remove common and auth from toc -echo "delete-base-classes" -delete-base-classes +echo "node $(npm root)/@google-cloud/cloud-rad/deleteBaseClasses.js" +node "$(npm root)/@google-cloud/cloud-rad/deleteBaseClasses.js" # remove interfaces from toc -echo "remove-interface" -remove-interface +echo "node $(npm root)/@google-cloud/cloud-rad/removeInterface.js" +node "$(npm root)/@google-cloud/cloud-rad/removeInterface.js" # remove protos from toc -echo "remove-protos" -remove-protos +echo "node $(npm root)/@google-cloud/cloud-rad/removeProtos.js" +node "$(npm root)/@google-cloud/cloud-rad/removeProtos.js" # Clean up TOC # Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 @@ -95,8 +95,8 @@ if [[ $numberOfFiles -ge 3 ]]; then fi # add href for external classes, see b/195674809 -echo "add-links" -add-links +echo "node $(npm root)/@google-cloud/cloud-rad/removeProtos.js" +node "$(npm root)/@google-cloud/cloud-rad/addLinks.js" NAME=$(ls temp | sed s/.api.json*//) ## Copy everything to devsite diff --git a/main.sh b/main.sh index 42a8582..c4b7f36 100755 --- a/main.sh +++ b/main.sh @@ -36,14 +36,14 @@ name=$(cat package.json | json name | sed 's/^.*\///') # Generate the data for the devsite tarball if [ "$name" == "common" ]; then - echo ". generate-devsite-base-classes" - . generate-devsite-base-classes + echo ". $(npm root)/@google-cloud/cloud-rad/generate-devsite-base-classes.sh" + . "$(npm root)/@google-cloud/cloud-rad/generate-devsite-base-classes.sh" elif [ "$name" == "google-auth-library" ]; then - echo ". generate-devsite-base-classes" - . generate-devsite-base-classes + echo ". $(npm root)/@google-cloud/cloud-rad/generate-devsite-base-classes.sh" + . "$(npm root)/@google-cloud/cloud-rad/generate-devsite-base-classes.sh" else echo ". generate-devsite" - . generate-devsite + . "$(npm root)/@google-cloud/cloud-rad/generate-devsite.sh" fi if [[ -n "$NO_UPLOAD" ]]; then diff --git a/package.json b/package.json index f955bc8..d847e55 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,11 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.4.13-experimental", + "version": "0.4.15-experimental", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", "bin": { - "cloud-rad": "./main.sh", - "generate-devsite": "./generate-devsite.sh", - "generate-deviste-base-classes": "./generate-devsite-base-classes.sh", - "pretty-print": "./prettyPrint.js", - "delete-base-classes": "./deleteBaseClasses.js", - "remove-interface": "./removeInterface.js", - "remove-protos": "./removeProtos.js", - "add-links": "./addLinks.js" + "cloud-rad": "./main.sh" }, "scripts": { "test": "env NO_UPLOAD=1 mocha" From b460d0ca3d58435a947513bac35ea746bf3ab6bc Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 11:11:19 -0800 Subject: [PATCH 06/13] push up changes --- generate-devsite.sh | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generate-devsite.sh b/generate-devsite.sh index 0fda793..e5120d1 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -34,7 +34,7 @@ echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-l cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json" temp echo "npx @googleapis/api-documenter@^7 yaml --input-folder=temp" -npx @googleapis/api-documenter@^7 yaml --input-folder=temp +node $(npm root)/@google-cloud/cloud-rad/node_modules/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 echo "node $(npm root)/@google-cloud/cloud-rad/prettyPrint.js" diff --git a/package.json b/package.json index d847e55..afec632 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.4.15-experimental", + "version": "0.4.16-experimental", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", From 8b153b14067a1960ff778dc8b8dc82d7a9f5f14e Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 11:16:46 -0800 Subject: [PATCH 07/13] fix logging --- generate-devsite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-devsite.sh b/generate-devsite.sh index e5120d1..d3a2bd4 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -33,7 +33,7 @@ cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/common.api.json" t echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json temp" cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json" temp -echo "npx @googleapis/api-documenter@^7 yaml --input-folder=temp" +echo "node $(npm root)/@google-cloud/cloud-rad/node_modules/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp" node $(npm root)/@google-cloud/cloud-rad/node_modules/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 From 5570782eb66ac1df93a4b6efb380db5a2183cae5 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 13:49:10 -0800 Subject: [PATCH 08/13] last fixes --- generate-devsite.sh | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/generate-devsite.sh b/generate-devsite.sh index d3a2bd4..3899307 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -33,8 +33,9 @@ cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/common.api.json" t echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json temp" cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json" temp -echo "node $(npm root)/@google-cloud/cloud-rad/node_modules/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp" -node $(npm root)/@google-cloud/cloud-rad/node_modules/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp +echo "node $(npm root)/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp" +# npm i @googleapis/api-documenter +node "$(npm root)/@googleapis/api-documenter/bin/api-documenter" yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 echo "node $(npm root)/@google-cloud/cloud-rad/prettyPrint.js" diff --git a/package.json b/package.json index afec632..8303a56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.4.16-experimental", + "version": "0.4.19-experimental", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", From bb09e147d7e25e120b092ad4400bbb4006ee28e0 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 13:58:12 -0800 Subject: [PATCH 09/13] fix: clean up logging --- generate-devsite-base-classes.sh | 3 ++- generate-devsite.sh | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/generate-devsite-base-classes.sh b/generate-devsite-base-classes.sh index dedd964..af3a26e 100644 --- a/generate-devsite-base-classes.sh +++ b/generate-devsite-base-classes.sh @@ -23,7 +23,8 @@ mkdir -p ./etc cp "$(npm root)/@google-cloud/cloud-rad/api-extractor.json" . npx @microsoft/api-extractor run --local -npx @googleapis/api-documenter@^7 yaml --input-folder=temp +echo "node $(npm root)/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp" +node "$(npm root)/@googleapis/api-documenter/bin/api-documenter" yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 node "$(npm root)/@google-cloud/cloud-rad/prettyPrint.js" diff --git a/generate-devsite.sh b/generate-devsite.sh index 3899307..52bbcc2 100644 --- a/generate-devsite.sh +++ b/generate-devsite.sh @@ -34,7 +34,6 @@ echo "cp $(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-l cp "$(npm root)/@google-cloud/cloud-rad/api-extractor-configs/google-auth-library.api.json" temp echo "node $(npm root)/@googleapis/api-documenter/bin/api-documenter yaml --input-folder=temp" -# npm i @googleapis/api-documenter node "$(npm root)/@googleapis/api-documenter/bin/api-documenter" yaml --input-folder=temp # replace markdown code examples with html, see b/204924531 @@ -55,7 +54,6 @@ node "$(npm root)/@google-cloud/cloud-rad/removeProtos.js" # Clean up TOC # Delete SharePoint item, see https://github.com/microsoft/rushstack/issues/1229 -echo "sed commands" sed -i -e '1,3d' ./yaml/toc.yml # Shift everything to the left sed -i -e 's/^ //' ./yaml/toc.yml From 493c008480341c7dd25d944d7fcfce1e39b943ee Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 14:08:03 -0800 Subject: [PATCH 10/13] update test --- package.json | 2 +- test/generateYamlTest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8303a56..26172ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.4.19-experimental", + "version": "0.3.0", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", diff --git a/test/generateYamlTest.js b/test/generateYamlTest.js index fea1921..5ca136a 100644 --- a/test/generateYamlTest.js +++ b/test/generateYamlTest.js @@ -30,7 +30,7 @@ before(function () { // Copy over nodejs-deploy library from Github executeCmd("git clone --branch release-v1.0.0 https://github.com/googleapis/nodejs-deploy.git " + nodejsDeployDir) // Install local version of cloud-rad command and generate yaml. - executeCmd("cd " + nodejsDeployDir + "; npm i; npm i ../..; npx @google-cloud/cloud-rad") + executeCmd("cd " + nodejsDeployDir + "; npm i --no-save @google-cloud/cloud-rad; . ./node_modules/.bin/cloud-rad cloud-rad") }) describe('cloud-rad docfx generator', () => { From f9973ad7ae42c7b35b8fda758e7f5883fb0b9511 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 14:09:44 -0800 Subject: [PATCH 11/13] update test --- test/generateYamlTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/generateYamlTest.js b/test/generateYamlTest.js index 5ca136a..2a36648 100644 --- a/test/generateYamlTest.js +++ b/test/generateYamlTest.js @@ -30,7 +30,7 @@ before(function () { // Copy over nodejs-deploy library from Github executeCmd("git clone --branch release-v1.0.0 https://github.com/googleapis/nodejs-deploy.git " + nodejsDeployDir) // Install local version of cloud-rad command and generate yaml. - executeCmd("cd " + nodejsDeployDir + "; npm i --no-save @google-cloud/cloud-rad; . ./node_modules/.bin/cloud-rad cloud-rad") + executeCmd("cd " + nodejsDeployDir + "; npm i --no-save @google-cloud/cloud-rad;. ./node_modules/.bin/cloud-rad cloud-rad") }) describe('cloud-rad docfx generator', () => { From 510a96c1c92ffe7ba90d8930385afe0327cf07af Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 18:05:51 -0800 Subject: [PATCH 12/13] fix test --- package.json | 4 ++-- test/generateYamlTest.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 26172ae..0d265d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloud-rad", - "version": "0.3.0", + "version": "0.3.1", "description": "", "main": "index.js", "repository": "googleapis/cloud-rad", @@ -8,7 +8,7 @@ "cloud-rad": "./main.sh" }, "scripts": { - "test": "env NO_UPLOAD=1 mocha" + "test": "env NO_UPLOAD=1 mocha --timeout=5000" }, "author": "Google Inc", "license": "Apache-2.0", diff --git a/test/generateYamlTest.js b/test/generateYamlTest.js index 2a36648..5a9abb2 100644 --- a/test/generateYamlTest.js +++ b/test/generateYamlTest.js @@ -30,7 +30,11 @@ before(function () { // Copy over nodejs-deploy library from Github executeCmd("git clone --branch release-v1.0.0 https://github.com/googleapis/nodejs-deploy.git " + nodejsDeployDir) // Install local version of cloud-rad command and generate yaml. - executeCmd("cd " + nodejsDeployDir + "; npm i --no-save @google-cloud/cloud-rad;. ./node_modules/.bin/cloud-rad cloud-rad") + executeCmd("cd " + nodejsDeployDir + "; npm i; npm run compile; npm install --no-save @google-cloud/cloud-rad;. ./node_modules/.bin/cloud-rad") +}) + +after(function () { + executeCmd(`rm -rf ${nodejsDeployDir}`); }) describe('cloud-rad docfx generator', () => { From eadd3633a197d8c197728acf4b629b4b31a2b75b Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Wed, 14 Dec 2022 18:23:42 -0800 Subject: [PATCH 13/13] revert to npx --- test/generateYamlTest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/generateYamlTest.js b/test/generateYamlTest.js index 5a9abb2..e4ecab4 100644 --- a/test/generateYamlTest.js +++ b/test/generateYamlTest.js @@ -30,7 +30,7 @@ before(function () { // Copy over nodejs-deploy library from Github executeCmd("git clone --branch release-v1.0.0 https://github.com/googleapis/nodejs-deploy.git " + nodejsDeployDir) // Install local version of cloud-rad command and generate yaml. - executeCmd("cd " + nodejsDeployDir + "; npm i; npm run compile; npm install --no-save @google-cloud/cloud-rad;. ./node_modules/.bin/cloud-rad") + executeCmd("cd " + nodejsDeployDir + "; npm i; npm run compile; npm install --no-save @google-cloud/cloud-rad;npx @google-cloud/cloud-rad . cloud-rad") }) after(function () {