From 50de3779532e719c5d30e4b8943b50e3e50d1f2c Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Thu, 6 Aug 2020 15:20:54 +0200 Subject: [PATCH] Use scoped name for npm package --- doc/USING.rst | 4 ++-- native_client/javascript/Makefile | 4 ++-- taskcluster/examples-base.tyml | 2 +- taskcluster/node-package.sh | 2 +- taskcluster/package.sh | 2 +- taskcluster/tc-build-utils.sh | 8 ++++---- taskcluster/tc-node-utils.sh | 4 ++-- taskcluster/win-package.sh | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/USING.rst b/doc/USING.rst index c2813b9d..1701c31b 100644 --- a/doc/USING.rst +++ b/doc/USING.rst @@ -151,7 +151,7 @@ You can download the JS bindings using ``npm``\ : .. code-block:: bash - npm install mozilla_voice_stt + npm install @mozilla-voice/stt Please note that as of now, we support: - Node.JS versions 4 to 13. @@ -163,7 +163,7 @@ Alternatively, if you're using Linux and have a supported NVIDIA GPU, you can in .. code-block:: bash - npm install mozilla_voice_stt_cuda + npm install @mozilla-voice/stt-cuda See the `release notes `_ to find which GPUs are supported. Please ensure you have the required `CUDA dependency <#cuda-dependency>`_. diff --git a/native_client/javascript/Makefile b/native_client/javascript/Makefile index 5bd33efd..ba2da06a 100644 --- a/native_client/javascript/Makefile +++ b/native_client/javascript/Makefile @@ -2,7 +2,7 @@ NODE_BUILD_TOOL ?= node-pre-gyp NODE_ABI_TARGET ?= NODE_BUILD_VERBOSE ?= --verbose NPM_TOOL ?= npm -PROJECT_NAME ?= mozilla_voice_stt +PROJECT_NAME ?= @mozilla-voice/stt PROJECT_VERSION ?= $(shell cat ../../training/deepspeech_training/VERSION | tr -d '\n') NPM_ROOT ?= $(shell npm root) @@ -36,7 +36,7 @@ really-clean: clean clean-npm-pack package.json: package.json.in sed \ - -e 's/$$(PROJECT_NAME)/$(PROJECT_NAME)/' \ + -e 's`$$(PROJECT_NAME)`$(PROJECT_NAME)`' \ -e 's/$$(PROJECT_VERSION)/$(PROJECT_VERSION)/' \ package.json.in > package.json && cat package.json diff --git a/taskcluster/examples-base.tyml b/taskcluster/examples-base.tyml index 82f3760d..e540b419 100644 --- a/taskcluster/examples-base.tyml +++ b/taskcluster/examples-base.tyml @@ -26,7 +26,7 @@ then: DEEPSPEECH_AUDIO: "https://github.com/mozilla/DeepSpeech/releases/download/v0.4.1/audio-0.4.1.tar.gz" PIP_DEFAULT_TIMEOUT: "60" EXAMPLES_CLONE_URL: "https://github.com/mozilla/DeepSpeech-examples" - EXAMPLES_CHECKOUT_TARGET: "master" + EXAMPLES_CHECKOUT_TARGET: "nodejs-scoped-name" command: - "/bin/bash" diff --git a/taskcluster/node-package.sh b/taskcluster/node-package.sh index 1e03baba..d7c6c2b6 100644 --- a/taskcluster/node-package.sh +++ b/taskcluster/node-package.sh @@ -7,4 +7,4 @@ source $(dirname "$0")/tc-tests-utils.sh mkdir -p ${TASKCLUSTER_ARTIFACTS} || true # NodeJS package -cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/mozilla_voice_stt*.tgz ${TASKCLUSTER_ARTIFACTS}/ +cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/mozilla-voice-stt*.tgz ${TASKCLUSTER_ARTIFACTS}/ diff --git a/taskcluster/package.sh b/taskcluster/package.sh index ffe35c48..ca1ef9ea 100755 --- a/taskcluster/package.sh +++ b/taskcluster/package.sh @@ -14,7 +14,7 @@ package_libdeepspeech_as_zip "libmozilla_voice_stt.zip" if [ -d ${DS_ROOT_TASK}/DeepSpeech/ds/wheels ]; then cp ${DS_ROOT_TASK}/DeepSpeech/ds/wheels/* ${TASKCLUSTER_ARTIFACTS}/ - cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/mozilla_voice_stt*.tgz ${TASKCLUSTER_ARTIFACTS}/ + cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/mozilla-voice-stt*.tgz ${TASKCLUSTER_ARTIFACTS}/ fi; if [ -f ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/wrapper.tar.gz ]; then diff --git a/taskcluster/tc-build-utils.sh b/taskcluster/tc-build-utils.sh index d2c18006..60d94753 100755 --- a/taskcluster/tc-build-utils.sh +++ b/taskcluster/tc-build-utils.sh @@ -133,9 +133,9 @@ do_deepspeech_nodejs_build() done; if [ "${rename_to_gpu}" = "--cuda" ]; then - make -C native_client/javascript clean npm-pack PROJECT_NAME=mozilla_voice_stt_cuda + make -C native_client/javascript clean npm-pack PROJECT_NAME="@mozilla-voice/stt-cuda" else - make -C native_client/javascript clean npm-pack PROJECT_NAME=mozilla_voice_stt + make -C native_client/javascript clean npm-pack PROJECT_NAME="@mozilla-voice/stt" fi tar -czf native_client/javascript/wrapper.tar.gz \ @@ -165,9 +165,9 @@ do_deepspeech_npm_package() done; if [ "${package_option}" = "--cuda" ]; then - make -C native_client/javascript clean npm-pack PROJECT_NAME=mozilla_voice_stt_cuda + make -C native_client/javascript clean npm-pack PROJECT_NAME="@mozilla-voice/stt-cuda" elif [ "${package_option}" = "--tflite" ]; then - make -C native_client/javascript clean npm-pack PROJECT_NAME=mozilla_voice_stt_tflite + make -C native_client/javascript clean npm-pack PROJECT_NAME="@mozilla-voice/stt-tflite" else make -C native_client/javascript clean npm-pack fi diff --git a/taskcluster/tc-node-utils.sh b/taskcluster/tc-node-utils.sh index 5feb8333..cda5f262 100755 --- a/taskcluster/tc-node-utils.sh +++ b/taskcluster/tc-node-utils.sh @@ -7,8 +7,8 @@ get_dep_npm_pkg_url() { local all_deps="$(curl -s https://community-tc.services.mozilla.com/api/queue/v1/task/${TASK_ID} | python -c 'import json; import sys; print(" ".join(json.loads(sys.stdin.read())["dependencies"]));')" - # We try "mozilla_voice_stt_tflite" and "mozilla_voice_stt_cuda" first and if we don't find it we try "mozilla_voice_stt" - for pkg_basename in "mozilla_voice_stt_tflite" "mozilla_voice_stt_cuda" "mozilla_voice_stt"; do + # We try "mozilla-voice-stt-tflite" and "mozilla-voice-stt-cuda" first and if we don't find it we try "mozilla-voice-stt" + for pkg_basename in "mozilla-voice-stt-tflite" "mozilla-voice-stt-cuda" "mozilla-voice-stt"; do local deepspeech_pkg="${pkg_basename}-${DS_VERSION}.tgz" for dep in ${all_deps}; do local has_artifact=$(curl -s https://community-tc.services.mozilla.com/api/queue/v1/task/${dep}/artifacts | python -c 'import json; import sys; has_artifact = True in [ e["name"].find("'${deepspeech_pkg}'") > 0 for e in json.loads(sys.stdin.read())["artifacts"] ]; print(has_artifact)') diff --git a/taskcluster/win-package.sh b/taskcluster/win-package.sh index 875a0fb7..7f126150 100755 --- a/taskcluster/win-package.sh +++ b/taskcluster/win-package.sh @@ -22,5 +22,5 @@ fi; if [ -f ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/wrapper.tar.gz ]; then cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/wrapper.tar.gz ${TASKCLUSTER_ARTIFACTS}/ - cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/mozilla_voice_stt*.tgz ${TASKCLUSTER_ARTIFACTS}/ + cp ${DS_ROOT_TASK}/DeepSpeech/ds/native_client/javascript/mozilla-voice-stt*.tgz ${TASKCLUSTER_ARTIFACTS}/ fi;