What's a good way to sync native javascript code among projects?

In my web projects (Django framework) I usually have several internal javascript files that are common to them. These web projects are stored in separate mercury source code repositories. Here is the corresponding directory structure:

+ static
--+ css
--+ images
--+ js
-----+ thirdparty
-----+ mycompany
--------+ shared_lib1.js
--------+ shared_lib2.js
--------+ project_only_lib.js
-----+ tests

The html script link looks like this:

<script src="/static/js/mycompany/shared_lib1.js" type="text/javascript"></script>

Currently, when I make changes (for example, correct an error) in one of the shared libraries and check them, the updated code exists in only one repository. So now I manually copy the changes to other repositories and check them out.

That seems pretty dumb.

- , , javascript, -?

+3
1

- (, http://domain.com/shared_libs/), ( , ), libs .

45 :

http://domain.com/shared_libs/45/lib1.js
http://domain.com/shared_libs/45/lib2.js

( , Mercurial...) "0.8-beta3",

http://domain.com/shared_libs/0.8-beta3/lib1.js
http://domain.com/shared_libs/0.8-beta3/lib2.js

... .

() .

:

<script src="http://domain.com/shared_libs/45/lib1.js">

, , - , , .

, .

, (, /45/lib1.js /52/lib2.js), , .

, Mercurial Subversion "" , .

( , Mercurial , Subversion, - , .)

+3

Source: https://habr.com/ru/post/1750748/


All Articles