Skip to content

Commit

Permalink
Merge pull request #95 from ciatph/dev
Browse files Browse the repository at this point in the history
v1.3.4
  • Loading branch information
ciatph authored Aug 28, 2024
2 parents 6dbc122 + dbe6dae commit 7f3ef73
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ jobs:

- name: Publish package
run: |
cp README.md app/
chmod u+x scripts/npm-publish.sh
./scripts/npm-publish.sh
cd app
npm publish
env:
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ It also asks users to key in the file download URL of a remote PAGASA 10-Day wea

> _**INFO:** When installing the package using `npm i ph-municipalities`, the default data source is inside `/data/day1.xlsx`. All source codes and files are also inside the **ph-municipalities** root directory._
### Architecture Diagram

![ph-municipalities-arch](/docs/diagrams/ph-municipalities-arch-90.png)

### Dataset Output

Extracted municipalities are written in JSON files following the format:

```
Expand Down Expand Up @@ -65,6 +71,7 @@ The following dependencies are used for this project. Feel free to use other dep
- [`npm run minify:all`](#npm-run-minifyall)
- [`npm run lint`](#npm-run-lint)
- [`npm run lint:fix`](#npm-run-lintfix)
- [`npm test`](#npm-test)
- [Class Usage](#class-usage)
- [Load and Parse a Local Excel File](#load-and-parse-a-local-excel-file)
- [Download and Parse a Remote Excel File](#download-and-parse-a-remote-excel-file)
Expand Down Expand Up @@ -220,6 +227,10 @@ Lint JavaScript source codes.
Fix JavaScript lint errors.
### `npm test`
Run tests defined in the `/app/__tests__` directory.
## Class Usage
Below are example usages of the `ExcelFile` class, run from the **/app/src/examples** directory. Check out the `/app/src/examples/sample_usage.js` file for more examples.
Expand Down
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ph-municipalities",
"version": "1.3.3",
"version": "1.3.4",
"description": "List and write the `municipalities` of Philippines provinces or regions into JSON files",
"main": "index.js",
"engines": {
Expand Down
Binary file added docs/diagrams/ph-municipalities-arch-90.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 133 additions & 0 deletions docs/diagrams/ph-municipalities-arch.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<mxfile host="Electron" modified="2024-08-28T02:39:18.762Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="v7skEjIrMClVe-O8wROi" version="22.0.3" type="device">
<diagram name="Page-1" id="PT_rIEPRiHDDqEcKwNWF">
<mxGraphModel dx="2518" dy="974" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="N0Y9xDM0efUduAB5_r4A-98" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-650" y="305" width="200" height="326" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-60" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="-200" y="128" width="140" height="195" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-73" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-1" target="N0Y9xDM0efUduAB5_r4A-63">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-126" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.75;entryY=0;entryDx=0;entryDy=0;dashed=1;endArrow=none;endFill=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-1" target="N0Y9xDM0efUduAB5_r4A-98">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-1" value="ExcelFile / ExcelFactory&lt;br&gt;(class)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="-545" y="195" width="150" height="60" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-4" value="PAGASA 10-day Excel file&lt;br&gt;(local cache)" style="whiteSpace=wrap;html=1;shape=mxgraph.basic.document" vertex="1" parent="1">
<mxGeometry x="-180" y="173" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-5" value="PAGASA 10-day Excel file&lt;br&gt;(remote)" style="whiteSpace=wrap;html=1;shape=mxgraph.basic.document" vertex="1" parent="1">
<mxGeometry x="-180" y="243" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-10" value="" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="-570" y="20" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-25" value="PAGASA seasonal settings&lt;br&gt;(region - province names)" style="html=1;verticalLabelPosition=middle;align=left;labelBackgroundColor=#ffffff;verticalAlign=middle;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.settings;labelPosition=right;spacingLeft=6;" vertex="1" parent="1">
<mxGeometry x="-560" y="30" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-62" value="load()" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-338" y="210.5" width="70" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-74" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;startArrow=classic;startFill=1;dashed=1;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-63" target="N0Y9xDM0efUduAB5_r4A-10">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-78" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-63" target="N0Y9xDM0efUduAB5_r4A-62">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-63" value="init()" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-505" y="118" width="70" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-76" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;dashed=1;startArrow=classic;startFill=1;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-62" target="N0Y9xDM0efUduAB5_r4A-60">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-77" value="Data Sources" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="-175" y="133" width="90" height="20" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-80" value="" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="-373" y="323" width="140" height="227" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-81" value="Stored Data" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="-349" y="329" width="90" height="20" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-83" value="Processed province / municipality&lt;br&gt;names" style="whiteSpace=wrap;html=1;shape=mxgraph.basic.document" vertex="1" parent="1">
<mxGeometry x="-352" y="370" width="100" height="60" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-84" value="Raw Excel data&lt;br&gt;(json)&lt;br&gt;" style="whiteSpace=wrap;html=1;shape=mxgraph.basic.document" vertex="1" parent="1">
<mxGeometry x="-352" y="440" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-85" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-62" target="N0Y9xDM0efUduAB5_r4A-80">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-87" value="listRegions()" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-630" y="348" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-88" value="listAllProvinces()" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-630" y="398" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-116" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-89" target="N0Y9xDM0efUduAB5_r4A-108">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-89" value="listMunicipalities()" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-630" y="448" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-90" value="writeMuniicipalities()" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-630" y="498" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-91" value="get()*" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="-630" y="548" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-92" value="PAGASA seasonal settings" style="whiteSpace=wrap;html=1;shape=mxgraph.basic.document" vertex="1" parent="1">
<mxGeometry x="-352" y="490" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-96" value="Class Methods" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="-610" y="312" width="110" height="30" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-99" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0;entryDx=0;entryDy=64.25;entryPerimeter=0;dashed=1;startArrow=classic;startFill=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-98" target="N0Y9xDM0efUduAB5_r4A-80">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-106" value="province list" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.direct_data;whiteSpace=wrap;spacingRight=20;" vertex="1" parent="1">
<mxGeometry x="-830" y="402.5" width="120" height="43" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-107" value="region list" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.direct_data;whiteSpace=wrap;spacingRight=20;" vertex="1" parent="1">
<mxGeometry x="-830" y="342" width="120" height="43" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-108" value="municipality list" style="strokeWidth=2;html=1;shape=mxgraph.flowchart.direct_data;whiteSpace=wrap;spacingRight=20;" vertex="1" parent="1">
<mxGeometry x="-830" y="467.5" width="120" height="43" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-109" value="municipality list&lt;br&gt;JSON" style="whiteSpace=wrap;html=1;shape=mxgraph.basic.document" vertex="1" parent="1">
<mxGeometry x="-815" y="532" width="90" height="60" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-111" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-87" target="N0Y9xDM0efUduAB5_r4A-107">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-112" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-88" target="N0Y9xDM0efUduAB5_r4A-106">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-118" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-90" target="N0Y9xDM0efUduAB5_r4A-109">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-119" value="(other class methods)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="-615" y="601" width="130" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-134" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.75;entryDx=0;entryDy=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-121" target="N0Y9xDM0efUduAB5_r4A-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-121" value="NPM script&lt;br&gt;list:province" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
<mxGeometry x="-730" y="214" width="130" height="52" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-133" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="N0Y9xDM0efUduAB5_r4A-130" target="N0Y9xDM0efUduAB5_r4A-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="N0Y9xDM0efUduAB5_r4A-130" value="NPM script&lt;br&gt;list:region" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="-730" y="128" width="130" height="52" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
4 changes: 4 additions & 0 deletions scripts/npm-publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

sed "s|/docs/diagrams/||g" README.md > app/README.md
cp docs/diagrams/ph-municipalities-arch-90.png app/

0 comments on commit 7f3ef73

Please sign in to comment.