Commit Graph

21 Commits

Author SHA1 Message Date
Nazar Gargol
b8c1aeee35 Added empty string '' to null transform when parsing CSVs
no issue

- When items are parsed from CSV empty values were interpreted as empty strings - ''. Empty strings are always transformed into 'null' values in Ghost's model layer and are much more problematic to validate comparing to plain `null`. Specifically validation was imossible for 'format: date-time' with JSON schema validation through ajv when the value of date property was an empty string
- This behavior resemples one present in Ghost's model layer  - 95880dddeb
- When testing performance overhead for this change did not spot any statistically significant change in performance (tested set was 50K rows)
2020-08-17 17:57:49 +12:00
Nazar Gargol
5b909735fd Published new versions
- @tryghost/magic-link@0.4.10
 - @tryghost/members-api@0.23.1
 - @tryghost/members-csv@0.2.1
 - @tryghost/members-ssr@0.8.2
2020-07-08 20:23:05 +12:00
Nazar Gargol
d28d336660 Added package usage examples to README 2020-07-08 20:09:44 +12:00
Nazar Gargol
86ff376c99 Reworked unparse test to use less dependencies 2020-07-08 20:09:21 +12:00
Nazar Gargol
4c21bb9d65 Added basic test coverage for JSON to CSV serialization
no issue
2020-07-08 19:40:48 +12:00
Nazar Gargol
7f25548be5 Removed unneeded test suite
no issue

- This is a leftover from initial project scaffolding
2020-07-08 19:40:10 +12:00
Nazar Gargol
3a97d39d72 Substituted csv-parser with papaparse as CSV parsing package
refs 5c46786ebc

- This is continuation of work removing csv-parser as main CSV handling library with more suitable papaparse library
- Referenced commit introduced papaparse as a library to serialize JSON to CSV, this changeset takes it a step further and replaces CSV to JSON seriazliation logic
2020-07-08 19:39:37 +12:00
Nazar Gargol
6b24cb8a9d Published new versions
- @tryghost/members-csv@0.2.0
2020-07-02 14:58:12 +12:00
Nazar Gargol
fd982fef73 Added mapping support to CSV parser
no issue

- When processing CSV files `parse` function now allows for the client to specify "mapping" parameter in format of a hash as follows:
{ destination_property_name: 'source_column_name'}
e.g.:
{
  name: 'weird_name_column',
  email: 'email_column'
}
- It is done so to allow for the end user to provide exact mapping of the fields to be transformed into JSON.
2020-07-02 14:53:56 +12:00
Nazar Gargol
bf0e890751 Published new versions
- @tryghost/members-csv@0.1.2
2020-06-19 19:52:52 +12:00
Nazar Gargol
afa20f7472 Fixed module paths
refs 6d3b080b30
2020-06-19 19:52:21 +12:00
Nazar Gargol
6d3b080b30 Published new versions
- @tryghost/members-csv@0.1.1
2020-06-19 19:50:39 +12:00
Nazar Gargol
93ab8ae946 Moved modules into lib folder
no issue

- This fixes a problem where files are skiped form the @tryghost/members-csv package
- Also this follows the file structure convention with other packages
2020-06-19 19:49:39 +12:00
Nazar Gargol
53993358ae Published new versions
- @tryghost/members-csv@0.1.0
2020-06-19 19:35:55 +12:00
Nazar Gargol
5c47d725cb Fixed tests and added fixtures from Ghost repo 2020-06-19 19:33:43 +12:00
Nazar Gargol
320d1f7653 Exposed parsed/unparsed methods through package API 2020-06-19 19:33:43 +12:00
Nazar Gargol
0b54b187bd Added dependent CSV parsing packages 2020-06-19 19:33:43 +12:00
Nazar Gargol
5c46786ebc Colocated readCSV util with members input serializer
refs 8185b42d9e5fd9e9051f08ce3395a648ec02f3a4

- Allows to move files and keep the history in one go.
- 'csv-parser' will be upgraded to 'papaparse' lib in a new package
2020-06-19 19:33:43 +12:00
Nazar Gargol
08600f05c7 Extracted members csv input serialization logic into separate module
refs 772ec13ac49a1d80877bb7b0f90ad57899f868dd

- This is prep work for extraction into members repository.
2020-06-19 19:33:43 +12:00
Nazar Gargol
c5c20d5efb Extracted members csv serialization logic into separate module
no issue

- This is prep work for extraction into members repository.
2020-06-19 19:33:43 +12:00
Nazar Gargol
ca2ab5bbce Initialized members-csv package 2020-06-19 18:54:48 +12:00