Use scoped name for npm package

This commit is contained in:
Reuben Morais 2020-08-06 15:20:54 +02:00
parent c31df0fd4c
commit 50de377953
8 changed files with 14 additions and 14 deletions

View File

@ -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 <https://github.com/mozilla/DeepSpeech/releases>`_ to find which GPUs are supported. Please ensure you have the required `CUDA dependency <#cuda-dependency>`_.

View File

@ -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

View File

@ -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"

View File

@ -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}/

View File

@ -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

View File

@ -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

View File

@ -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)')

View File

@ -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;