Skip to content

Commit 2b40014

Browse files
authored
Merge pull request #115 from ciatph/dev
v1.4.1
2 parents 01bc0b9 + 138dd62 commit 2b40014

File tree

8 files changed

+68
-30
lines changed

8 files changed

+68
-30
lines changed

.github/workflows/manual.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Manual Trigger Workflow with loglevel & tags
2+
#get log & tags information
3+
on:
4+
workflow_dispatch:
5+
branches:
6+
- wip/dispatch
7+
- dev
8+
inputs:
9+
logLevel:
10+
description: 'Log level'
11+
required: true
12+
default: 'information'
13+
type: choice
14+
options:
15+
- information
16+
- debug
17+
- warning
18+
- critical
19+
tags:
20+
description: 'Purpose of Run This Workflow?'
21+
required: true
22+
type: string
23+
24+
jobs:
25+
print-tag:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Print the purpose of run
29+
run: echo ${{ inputs.tags }} purpose

README.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ The following dependencies are used for this project. Feel free to use other dep
6565
- Checkout the excel file format on the `/app/data/day1.xlsx` sample file for more information
6666
5. (Optional) Download URL for a remote excel file.
6767
- See the `EXCEL_FILE_URL` variable on the [Installation](#installation) section.
68+
6. (Optional) Docker
69+
- Use Docker for localhost development
70+
- See the [Docker Dependencies](#docker-dependencies) section for more information.
6871

6972
</details>
7073

7174
<span id="faqs"></span>
7275
## FAQs
7376

7477
<details>
75-
<summary style="color: #808080; font-size: 24px;">
78+
<summary style="color: #808080; font-size: 22px;">
7679
<b>What is the purpose or goal of ph-municipalities?</b>
7780
</summary>
7881

@@ -89,7 +92,7 @@ Its early stages were written as procedural functions within a _private backend
8992
<br>
9093

9194
<details>
92-
<summary style="color: #808080; font-size: 24px;">
95+
<summary style="color: #808080; font-size: 22px;">
9396
<b>Can ph-municipalities parse and extract PAGASA 10-day weather forecast data?</b>
9497
</summary>
9598

@@ -104,7 +107,7 @@ ph-municipalities only have class methods for parsing, extracting, listing and q
104107
<br>
105108

106109
<details>
107-
<summary style="color: #808080; font-size: 24px;" id="similar-libraries">
110+
<summary style="color: #808080; font-size: 22px;" id="similar-libraries">
108111
<b>Are there alternative libraries to ph-municipalities for listing Philippine provinces and municipalities?</b>
109112
</summary>
110113

@@ -129,15 +132,15 @@ Note, however, that these items use old and new data sources. These may not be f
129132
<br>
130133

131134
<details>
132-
<summary style="color: #808080; font-size: 24px;">
135+
<summary style="color: #808080; font-size: 22px;">
133136
<b>Is it possible to make ph-municipalities parse and extract PAGASA 10-day weather forecast data?</b>
134137
</summary>
135138

136139
<br>
137140

138-
While ph-municipalites do not support parsing and extracting PAGASA 10-day weather forecast data, _you can extend the `ExcelFile` or `ExcelAdapter` classes with custom logic and codes to enable parsing and extracting PAGASA 10-day weather forecast data_.
141+
While ph-municipalites do not support parsing and extracting PAGASA 10-day weather forecast data, _you can extend the `ExcelFile` or `ExcelFactory` classes with custom logic and codes to enable parsing and extracting PAGASA 10-day weather forecast data_.
139142

140-
Since the `ExcelFile` or `ExcelAdapter` are [classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) (functions in disguise, not true OOP, but inheritance still works), you can extend them with class inheritance, overriding or creating new class methods to accommodate processing the PAGASA 10-day weather forecast data. Refer to the [ph-municipalities class documentation](https://ciatph.github.io/ph-municipalities) to know more about the available classes, member variables, and methods.
143+
Since the `ExcelFile` or `ExcelFactory` are JavaScript [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) (Functions in disguise, not true OOP, but inheritance still works), you can extend them with class inheritance, overriding or creating new class methods to accommodate processing the PAGASA 10-day weather forecast data. Refer to the [ph-municipalities class documentation](https://ciatph.github.io/ph-municipalities) to know more about the available classes, member variables, and methods.
141144

142145
An example of extending the classes to parse PAGASA 10-day weather forecast data may go along the lines of:
143146

@@ -174,8 +177,8 @@ weatherForecast = parser.getWeatherData()
174177
<br>
175178

176179
<details>
177-
<summary style="color: #808080; font-size: 24px;">
178-
<span style="color: #808080; font-size: 24px;">
180+
<summary style="color: #808080; font-size: 22px;">
181+
<span style="color: #808080; font-size: 22px;">
179182
<b>How does ph-municipalities determine which provinces belong to a region?</b>
180183
</span>
181184
</summary>
@@ -196,18 +199,18 @@ This file contains region/province names mapping encoded manually with reference
196199
<br>
197200

198201
<details>
199-
<summary style="color: #808080; font-size: 24px;">
200-
<span style="color: #808080; font-size: 24px;">
201-
<b>Are the provinces and municipality list generated by ph-municipalities updated?</b>
202+
<summary style="color: #808080; font-size: 22px;">
203+
<span style="color: #808080; font-size: 22px;">
204+
<b>Are the provinces and municipality lists generated by ph-municipalities updated?</b>
202205
</span>
203206
</summary>
204207

205208
<br>
206209

207-
NO. By default, ph-municipalities use an outdated PAGASA 10-day Excel file by default for its local data source, downloaded on August 8, 2022. However, it also provides several ways for using updated PAGASA 10-day Excel files as data sources by:
210+
NO. By default, ph-municipalities use an outdated PAGASA 10-day Excel file for its local data source, downloaded on August 8, 2022. However, it also provides several ways for using updated PAGASA 10-day Excel files as data sources:
208211

209212
- Prompting to download an updated PAGASA 10-day Excel file using the [Interactive CLI Scripts](#interactive-cli-scripts)
210-
- Providing [class methods](https://ciatph.github.io/ph-municipalities/ExcelFile.html#download) to programmatically download and use a remote PAGASA 10-day Excel file
213+
- Providing [class methods](https://ciatph.github.io/ph-municipalities/ExcelFile.html#download) for programmatically downloading and using a remote PAGASA 10-day Excel file
211214
- Allowing to override the default region - province list settings during class initialization (See [Class Usage - Using a Custom Configuration File](#using-a-custom-configuration-file))
212215

213216
> **NOTE:**<br>
@@ -452,7 +455,7 @@ npm run list:region
452455
453456
Builds the class documentation into the **/docs** directory.
454457
455-
> [!NOTE]
458+
> **NOTE:**<br>
456459
> This script requires manual installation of the `jsdoc@4.0.3`, `minami@1.2.3`, and `taffydb@2.7.3` packages as **devDependencies** inside the **/app** directory.
457460
> These libraries, only used for building the class documentation, were excluded from the final package.json to have fewer external dependencies.
458461
> ```bash
@@ -464,7 +467,7 @@ Builds the class documentation into the **/docs** directory.
464467
465468
Runs the Bash script that installs the JSDoc and theme dependencies for building the class documentation only within the **development Docker environment**.
466469
467-
> [!NOTE]
470+
> **NOTE:**<br>
468471
> This script requires running from a Bash terminal - it won't work from a Windows command line terminal. It is reserved for building the documentation with Docker.
469472
470473
This script is used for building the class documentation from a local Docker environment along with the `npm run docs:build` NPM script.
@@ -478,7 +481,7 @@ docker exec -u root -it ph-municipalities npm run docs:build
478481

479482
Runs the Bash script that builds the class documentation using JSDoc only within the **development Docker environment**.
480483

481-
> [!NOTE]
484+
> **NOTE:**<br>
482485
> This script requires running from a Bash terminal - it won't work from a Windows command line terminal. It is reserved for building the documentation with Docker.
483486
484487
This script is used for building the class documentation from a local Docker environment along with the `npm run docs:install` NPM script.

app/.npmignore

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ dist/
88
*.zip
99
*.tgz
1010
*.txt
11-
*.tgz
1211
*.png
1312
*.sh
13+
*.md
14+
*.tmp
1415

1516
.env.example
1617
.eslintrc.js
1718
.eslintrc_win.js
1819
.gitignore
1920
.npmignore
2021
.eslintignore
21-
README.md
22-
README.tmp
2322

2423
# Ignore all JSON files except:
2524
!package.json
@@ -34,7 +33,12 @@ src/examples/
3433
docs/
3534
diagrams/
3635

37-
# Docker
36+
# Exclude the __tests__ directory except for some files
37+
__tests__/**/*
38+
!__tests__/provinces/**/*.js
39+
!__tests__/classInitialization/checkClass.js
40+
41+
# Docker and other files
3842
Dockerfile
3943
.dockerignore
4044
jest.config.js

app/__tests__/municipalities/municipalitiesPerProvinceCount.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ describe('Municipalities per province count match', () => {
9090
const missingInConfig = allProvinces.filter(item => !allProvincesConfig.includes(item))
9191

9292
if (missingInParsed.length > 0) {
93-
let msg = `[WARNING]: ${missingInParsed.length} province(s) in the 10-Day Excel file are missing\n`
94-
msg += `in the (PAGASA seasonal) config: ${arrayToString(missingInParsed)}`
93+
let msg = `[WARNING]: ${missingInParsed.length} province(s) missing in the 10-Day Excel file\n`
94+
msg += `but present in the (PAGASA seasonal) config: ${arrayToString(missingInParsed)}`
9595
logger.log(msg, { color: ColorLog.COLORS.TEXT.YELLOW })
9696
}
9797

9898
if (missingInConfig.length > 0) {
99-
let msg = `[WARNING]: ${missingInConfig.length} province(s) in the (PAGASA seasonal) config are missing\n`
100-
msg += `in the 10-Day Excel file: ${arrayToString(missingInConfig)}`
99+
let msg = `[WARNING]: ${missingInConfig.length} province(s) in the (PAGASA seasonal) config is/are missing\n`
100+
msg += `but available in the 10-Day Excel file: ${arrayToString(missingInConfig)}`
101101
logger.log(msg, { color: ColorLog.COLORS.TEXT.YELLOW })
102102
}
103103
}

app/__tests__/provinces/updateInstances.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const updateInstances = ({
3232
if (fromConfig.length > 0) {
3333
uniqueProvinces = new Set(allProvinces.filter(item => !fromConfig.includes(item)))
3434

35-
let msg = `[WARNING]: ${fromConfig.length} province(s) in the (PAGASA seasonal) config are missing\n`
35+
let msg = `[WARNING]: ${fromConfig.length} province(s) from the (PAGASA seasonal) config are missing \n`
3636
msg += `in the 10-Day Excel file: ${arrayToString(fromConfig)}`
3737

3838
logger.log(msg)
@@ -41,8 +41,8 @@ const updateInstances = ({
4141
// Provinces present in the 10-Day Excel file but missing in the config (PAGASA seasonal) file
4242
if (fromExcel.length > 0) {
4343
uniqueExcelProvinces = new Set(allExcelProvinces.filter(item => !fromExcel.includes(item)))
44-
let msg = `[WARNING]: ${fromExcel.length} province(s) in the 10-Day Excel file are missing\n`
45-
msg += `in the (PAGASA seasonal) config: ${arrayToString(fromExcel)}`
44+
let msg = `[WARNING]: ${fromExcel.length} province(s) present in the 10-Day Excel file\n`
45+
msg += `but missing in the (PAGASA seasonal) config: ${arrayToString(fromExcel)}`
4646
logger.log(msg)
4747
}
4848

app/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const ExcelFile = require('./src/classes/excel')
22
const ExcelFactory = require('./src/classes/excelfactory')
33
const Schema = require('./src/classes/schema')
4+
const ColorLog = require('./src/classes/colorlog')
45

56
module.exports = {
7+
ColorLog,
68
ExcelFile,
79
ExcelFactory,
810
Schema

app/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ph-municipalities",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "List and write the `municipalities` of Philippines provinces or regions into JSON files",
55
"main": "index.js",
66
"engines": {

0 commit comments

Comments
 (0)