[Pkg-javascript-devel] twemoji: Only node.js library?

Felix Natter fnatter at gmx.net
Thu Oct 1 21:11:58 BST 2020


Xavier <yadd at debian.org> writes:

hello Xavier,

many thanks for your reply, I just now noticed it (it slipped through my
mail check...). 

> Le 26/09/2020 à 15:12, Felix Natter a écrit :
>> Felix Natter <fnatter at gmx.net> writes:
>> 
>>> Pirate Praveen <praveen at onenetbeyond.org> writes:
>>>
>>>> On Sat, Sep 26, 2020 at 13:54, Felix Natter <fnatter at gmx.net> wrote:
>>>>> How do I build twemoji.js in the first place? Using dh --with nodejs?
>>>>> Will it run without node.js dependencies?
>>>>>
>>>>> As expected, this:
>>>>>
>>>>> override_dh_auto_build:
>>>>> 	uglifyjs.terser -o twemoji.min.js twemoji.js
>>>>>
>>>>> fails because twemoji.js has not been built. If it's supposed to be
>>>>> built by --with nodejs, can you recommend a similar package?
>>>
>>> h Pirate,
>>>
>>> thanks for the help.
>>>
>>>> pkg-js-tools (--with nodejs) tries to automate some build tools, it cannot
>>>> handle every node module. So you have to find the build command from
>>>> package.json#scripts#build and run this in an override like above or add in
>>>> debian/nodejs/build (which keeps rules file cleaner).
>>>>
>>>> https://github.com/twitter/twemoji/blob/master/package.json#L36
>>>
>>> Ok, great, now the build is triggered. Now I need to embed twemoji-parser:
>>>
>>> Error: Cannot find module 'twemoji-parser/dist/lib/regex'
>>>
>>> On #debian-js, I was told to use pkg-js-tools' add-node-component for
>>> this.
>>>
>>> #had to run this multiple times to get it right:
>>> $ add-node-component -i twemoji-parser
>>> No vcs repo found for 13.0.0 version
>>> [...]
>>>
>>> the watch file contains:
>>> # It is not recommended use npmregistry. Please investigate more.
>>> -> is this a problem?
>>>
>>> Now I need to change debian/changelog:
>>>
>>> felix at debianunstable:~/twemoji-stable/node-twemoji$ gbp buildpackage -us -uc
>>> gbp:error: Couldn't find upstream tree 'upstream/13.0.1^{tree}' to
>>> create orig tarball via pristine-tar
>>>
>>> https://wiki.debian.org/Javascript/GroupSourcesTutorial#pkg-js-tools_way. suggests
>>> something like:
>>>
>>> dch -v 3.1.4+~3.0.2+~3.1.3-1 'Import upstream version
>>> 3.1.4+~3.0.2+~3.1.3-1'
>>>
>>> So the node-twemoji version is 13.0.1, the twemoji-parser version seems
>>> to be 13.0.0, so I tried:
>>> dch -v 13.0.1+~13.0.0-1
>>>
>>> But it seems I have lost all my upstream/* tags:
>>> $ git tag
>>> debian/13.0.1-1
>
> Reimport package using
>   `gbp import-orig --pristine-tar ../xxx.orig.tar.gz`

Thanks, now I understand basically how components work.

In case it's useful for someone:

debian/watch was changed so that it knows how to create an orig tarball
for the component also. And gbp.conf was changed to set the
--component=twemoji-parser option, so that gbp import-orig will import the
component's orig tarball as well.

>>> $ gbp buildpackage -us -uc --git-ignore-new
>>> gbp:error: Couldn't find upstream tree 'upstream/13.0.1+_13.0.0^{tree}' to create orig tarball via pristine-tar

It turns out the upstream version remains the same (does not include
component version).

Best Regards,
-- 
Felix Natter
debian/rules!



More information about the Pkg-javascript-devel mailing list