Skip to content

Commit

Permalink
Merge pull request #3229 from mozilla/nodejs-scoped-name
Browse files Browse the repository at this point in the history
Use scoped name for npm package
  • Loading branch information
lissyx authored Aug 6, 2020
2 parents 0610a7a + 50de377 commit 402fc71
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions doc/USING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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>`_.

Expand Down
4 changes: 2 additions & 2 deletions native_client/javascript/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion taskcluster/examples-base.tyml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/node-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}/
2 changes: 1 addition & 1 deletion taskcluster/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions taskcluster/tc-build-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions taskcluster/tc-node-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)')
Expand Down
2 changes: 1 addition & 1 deletion taskcluster/win-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 402fc71

Please sign in to comment.