Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16825 efrain 1
## Contributing
2
 
3
I'm very open to contributions, big and small! For general instructions on submitting a pull request on GitHub, see these guides: [Fork A Repo](https://help.github.com/articles/fork-a-repo), and [Creating a pull request from a fork](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
4
 
5
### Changes to the plugin
6
 
7
In order to build the project, you will first need to install [npm](https://www.npmjs.org), and then run `npm install` to install the project's dependencies. At this point, the included `demo.html` should be working, if you open it in your browser. Then you should make your changes in the `src` directory, and be sure to run the build script before committing your changes - see below for more information on this.
8
 
9
In most cases, you will only need to make changes to the JavaScript, in which case you can just run `npm run build:js` to build the JavaScript before committing.
10
 
11
If you want to make changes to the CSS or the flags sprite, you will need to globally install a package called evenizer with `npm install -g evenizer` and then run `npm run build` to build all of the assets (warning: this can take a while), before committing.
12
 
13
### Updating to a new version of libphonenumber
14
 
15
#### Step 1: Setup
16
Create a new dir (e.g. ~/workspace/libphonenumber-tools) where you will clone the libphonenumber project and a few other dependencies, and cd into it, and then:
17
 
18
```
19
git clone https://github.com/googlei18n/libphonenumber
20
git clone https://github.com/google/closure-library
21
git clone https://github.com/google/closure-compiler
22
git clone https://github.com/google/closure-linter
23
git clone https://github.com/google/python-gflags
24
```
25
 
26
Build Closure's compiler.jar in closure-compiler directory: `mvn -DskipTests` (requires maven to be installed - on MacOS, you can do this with `brew install maven`)
27
 
28
#### Step 2: Updating libphonenumber
29
 
30
Simply cd into the libphonenumber dir and checkout the required version tag e.g.
31
 
32
```
33
cd ~/workspace/libphonenumber-tools/libphonenumber
34
git checkout v8.9.14
35
```
36
 
37
Then to build the new version of utils.js:
38
 
39
1. Copy intl-tel-input/src/js/utils.js to libphonenumber/javascript/i18n/phonenumbers/demo.js
40
2. `ant -f libphonenumber/javascript/build.xml compile-demo` (requires ant to be installed - on MacOS, you can do this with `brew install ant`)
41
3. Copy libphonenumber/javascript/i18n/phonenumbers/demo-compiled.js to intl-tel-input/build/js/utils.js
42
 
43
Then, back in the intl-tel-input dir, first run the tests to make sure nothing has broken: `npm test`, then just commit the new utils.js, and create a pull request on Github.
44
 
45
 
46
### Updating the flag images
47
 
48
We get our flags from the region-flags project, which in turn pulls them in from Wikipedia. So cd into intl-tel-input/node_modules/region-flags and then do the following:
49
 
50
1. Install some depenencies. On MacOS use brew: `brew install wget dos2unix librsvg optipng`
51
2. Run the make-aliases command: `./make-aliases.sh` (Note: I got some "No such file or directory" warnings)
52
3. Run the download command: `./download-wp.sh` (Note: this kept freezing for me, so I had to keep doing ctrl+c and then re-running it)
53
 
54
Finally, the last time I did this (October 2018) there was a problem with the Cayman Islands flag (region-flags/png/KY.png) - it should be aprx 1200x600px, like the other flags, but was instead tiny (36x36px), so I replaced it with [the old one from the region-flags repo](https://github.com/behdad/region-flags/blob/gh-pages/png/KY.png).
55
 
56
At this point, you should be good to cd back to the project root directory, and re-build the images with `npm run build:img`, and then check everything looks ok, and create a pull request on Github.
57
 
58
If when building, you get an error in the "exec:evenizer" task, you may need to temporarily increase the ulimit by running this command: `ulimit -S -n 2048`