From d96a6def14701c8dbe69fc6ecadd6da6de55d626 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 24 Mar 2023 02:08:56 -0600 Subject: [PATCH 1/4] Add lirewine repos and npms Former-commit-id: 870a9877603f5b1d0e2839575e56dff84bcd31b0 --- app/data/npm-package-list.txt | 1 + app/data/repository-list.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/data/npm-package-list.txt b/app/data/npm-package-list.txt index 3adedb5a..34ec73f8 100644 --- a/app/data/npm-package-list.txt +++ b/app/data/npm-package-list.txt @@ -2,3 +2,4 @@ gem laconic-sdk debug laconic-registry-cli +gem diff --git a/app/data/repository-list.txt b/app/data/repository-list.txt index 073c664b..2922d8cb 100644 --- a/app/data/repository-list.txt +++ b/app/data/repository-list.txt @@ -19,3 +19,6 @@ vulcanize/assemblyscript cerc-io/eth-probe cerc-io/tx-spammer dboreham/foundry +lirewine/gem +lirewine/debug +lirewine/crypto From 364a71d694b21cf4c87a67bdb1cf8c5430bb472b Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 24 Mar 2023 02:30:04 -0600 Subject: [PATCH 2/4] Support the @lirewine npm scope Former-commit-id: 9e322203e9f07364a4ba28b28920aa6c9b945144 --- .../build-npm-package-local-dependencies.sh | 28 ++++++++++--------- .../cerc-builder-js/build-npm-package.sh | 2 +- .../cerc-laconic-registry-cli/Dockerfile | 3 +- app/data/npm-package-list.txt | 2 ++ 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh index 69e8e99e..7f372af7 100755 --- a/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh +++ b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh @@ -1,7 +1,7 @@ #!/bin/bash # Usage: build-npm-package-local-dependencies.sh # Runs build-npm-package.sh after first fixing up yarn.lock to use a local -# npm registry for all packages in a spcific scope (currently @cerc-io) +# npm registry for all packages in a spcific scope (currently @cerc-io and @lirewine) if [ -n "$CERC_SCRIPT_DEBUG" ]; then set -x fi @@ -17,18 +17,20 @@ fi set -e local_npm_registry_url=$1 package_publish_version=$2 -# TODO: make this a paramater and allow a list of scopes -npm_scope_for_local="@cerc-io" -# We need to configure the local registry -npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url} -npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN} -# Find the set of dependencies from the specified scope -mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]') -echo "Fixing up dependencies" -for package in "${dependencies_from_scope[@]}" -do - echo "Fixing up package ${package}" - yarn-local-registry-fixup.sh $package ${local_npm_registry_url} +# If we need to handle an additional scope, add it to the list below: +npm_scopes_to_handle=("@cerc-io" "@lirewine") +for npm_scope_for_local in ${npm_scopes_to_handle[@]}; do + # We need to configure the local registry + npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url} + npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN} + # Find the set of dependencies from the specified scope + mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]') + echo "Fixing up dependencies" + for package in "${dependencies_from_scope[@]}" + do + echo "Fixing up package ${package}" + yarn-local-registry-fixup.sh $package ${local_npm_registry_url} + done done echo "Running build" build-npm-package.sh ${local_npm_registry_url} ${package_publish_version} diff --git a/app/data/container-build/cerc-builder-js/build-npm-package.sh b/app/data/container-build/cerc-builder-js/build-npm-package.sh index e0d19481..c8c1e810 100755 --- a/app/data/container-build/cerc-builder-js/build-npm-package.sh +++ b/app/data/container-build/cerc-builder-js/build-npm-package.sh @@ -22,8 +22,8 @@ set -e # Get the name of this package from package.json since we weren't passed that package_name=$( cat package.json | jq -r .name ) local_npm_registry_url=$1 -npm config set @lirewine:registry ${local_npm_registry_url} npm config set @cerc-io:registry ${local_npm_registry_url} +npm config set @lirewine:registry ${local_npm_registry_url} npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN} # First check if the version of this package we're trying to build already exists in the registry package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball ) diff --git a/app/data/container-build/cerc-laconic-registry-cli/Dockerfile b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile index cef3b36f..e0b1ae1e 100644 --- a/app/data/container-build/cerc-laconic-registry-cli/Dockerfile +++ b/app/data/container-build/cerc-laconic-registry-cli/Dockerfile @@ -40,8 +40,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # RUN su node -c "npm install -g " # Configure the local npm registry -RUN npm config set @lirewine:registry ${CERC_NPM_URL} \ - && npm config set @cerc-io:registry ${CERC_NPM_URL} \ +RUN npm config set @cerc-io:registry ${CERC_NPM_URL} \ && npm config set @lirewine:registry ${CERC_NPM_URL} \ && npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN} diff --git a/app/data/npm-package-list.txt b/app/data/npm-package-list.txt index 34ec73f8..3def3d63 100644 --- a/app/data/npm-package-list.txt +++ b/app/data/npm-package-list.txt @@ -3,3 +3,5 @@ laconic-sdk debug laconic-registry-cli gem +debug +crypto From c4e3aa54f1253b06a8a06b295af7f0f860ba926a Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 24 Mar 2023 02:31:19 -0600 Subject: [PATCH 3/4] Remove trailing whitespace Former-commit-id: 2e7ef1e52eefbd4fc995cdc371be7930650a09c1 --- .../cerc-builder-js/build-npm-package-local-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh index 7f372af7..47869e16 100755 --- a/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh +++ b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh @@ -20,7 +20,7 @@ package_publish_version=$2 # If we need to handle an additional scope, add it to the list below: npm_scopes_to_handle=("@cerc-io" "@lirewine") for npm_scope_for_local in ${npm_scopes_to_handle[@]}; do - # We need to configure the local registry + # We need to configure the local registry npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url} npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN} # Find the set of dependencies from the specified scope From aa01feb98a1878cdf08c8f8a31a94981f7f0b997 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 24 Mar 2023 02:52:37 -0600 Subject: [PATCH 4/4] Fix up script and npm list Former-commit-id: e6b91acdeacc5eb27e03fb7d12f13ad23cd7e681 --- .../cerc-builder-js/build-npm-package-local-dependencies.sh | 5 +++-- app/data/npm-package-list.txt | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh index 47869e16..33b6c613 100755 --- a/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh +++ b/app/data/container-build/cerc-builder-js/build-npm-package-local-dependencies.sh @@ -19,13 +19,14 @@ local_npm_registry_url=$1 package_publish_version=$2 # If we need to handle an additional scope, add it to the list below: npm_scopes_to_handle=("@cerc-io" "@lirewine") -for npm_scope_for_local in ${npm_scopes_to_handle[@]}; do +for npm_scope_for_local in ${npm_scopes_to_handle[@]} +do # We need to configure the local registry npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url} npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN} # Find the set of dependencies from the specified scope mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]') - echo "Fixing up dependencies" + echo "Fixing up dependencies in scope ${npm_scope_for_local}" for package in "${dependencies_from_scope[@]}" do echo "Fixing up package ${package}" diff --git a/app/data/npm-package-list.txt b/app/data/npm-package-list.txt index 3def3d63..3b6656be 100644 --- a/app/data/npm-package-list.txt +++ b/app/data/npm-package-list.txt @@ -1,6 +1,4 @@ -gem laconic-sdk -debug laconic-registry-cli gem debug