Skip to content

Commit 2277e62

Browse files
authored
Merge pull request #14 from ciatph/dev
v1.0.2
2 parents 87ba209 + 42b931d commit 2277e62

20 files changed

Lines changed: 4028 additions & 142 deletions

File tree

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
EXCEL_FILENAME=somefile.xlsx
1+
EXCEL_FILENAME=somefile.xlsx
2+
CSV_FILENAME=somefile.csv

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules/
66
*.zip
77
*.json
88
*.env
9+
*.~lock.*

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@ Sub item is in the same line as the unordered main item.
102102

103103
3. Create a `.env` file from the `.env.example` file. Replace `EXCEL_FILENAME` with a target excel file's filename relative to the `/src/01_recommendations` directory.
104104

105-
4. See the excel parser script's example usage on<br>
106-
`/src/01_recommendations/index.js`
105+
| Variable Name | Description |
106+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
107+
| EXCEL_FILENAME | Excel file name relative to the `/src/01_recommendations` scripts directory |
108+
| CSV_FILENAME | CSV file name relative to the `/src/02_crop_calendar` scripts |
109+
| FIREBASE_SERVICE_ACC | The project's private key file contents, condensed into one line and minus all whitespace characters.<br><br>The service account JSON file is generated from the Firebase project's **Project Settings** page, on **Project Settings** -> **Service accounts** -> **Generate new private key** |
110+
| FIREBASE_PRIVATE_KEY | The `private_key` entry from the service account JSON file.<br> <blockquote>**NOTE:** Take note to make sure that the value starts and ends with a double-quote on WINDOWS OS localhost. Some systems may or may not require the double-quotes (i.e., Ubuntu).</blockquote> |
107111

108112
## Available scripts
109113

@@ -115,11 +119,17 @@ Check source codes for lint errors.
115119

116120
Fix lint errors.
117121

118-
### `npm run parse`
122+
### `npm run process:recommendations`
119123

120-
Normalize an unconventional, complex excel file into an array of simple JS objects with columns containing messy (ordered and unordered) bullet lists converted into organized HTML list tags.
124+
Normalize an excel file into an array of simple JS objects with columns containing messy HTML tags bullet lists.
121125

122-
> **WARNING:** The script does not support `-` (dash) symbols.
126+
### `npm run process:calendar`
127+
128+
Normalize and upload the new cropping calendar data.
129+
130+
### `npm run process:details`
131+
132+
Normalize and upload the new municipalities and other details attached to the crop recommendations.
123133

124134
@ciatph<br>
125135
20221205

0 commit comments

Comments
 (0)