@tryghost/mg-curated-members-csv 0.2.19 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
- const parse = require('./lib/parse-members-csv');
2
- const process = require('./lib/process');
1
+ import parse from './lib/parse-members-csv.js';
2
+ import process from './lib/process.js';
3
3
 
4
- module.exports = async (ctx) => {
4
+ export default async (ctx) => {
5
5
  const parsed = await parse(ctx);
6
6
  const normalized = await process(parsed, ctx);
7
7
 
@@ -1,10 +1,11 @@
1
- const parse = require('@tryghost/mg-fs-utils/lib/csv').parse;
1
+ import fsUtils from '@tryghost/mg-fs-utils';
2
+ const parseCSV = fsUtils.csv.parseCSV;
2
3
 
3
- module.exports = async (ctx) => {
4
+ export default async (ctx) => {
4
5
  const {options} = ctx;
5
6
 
6
7
  // grab the main file "signups"
7
- let parsed = await parse(options.pathToFile);
8
+ let parsed = await parseCSV(options.pathToFile);
8
9
 
9
10
  return parsed;
10
11
  };
package/lib/process.js CHANGED
@@ -1,4 +1,4 @@
1
- const {parse, parseISO} = require('date-fns');
1
+ import {parse, parseISO} from 'date-fns';
2
2
 
3
3
  const processOptions = (member, options) => {
4
4
  if (options.freeLabel) {
@@ -25,7 +25,7 @@ const processMember = (sMember, options) => {
25
25
  return processOptions(member, options);
26
26
  };
27
27
 
28
- module.exports = async (input, ctx) => {
28
+ export default async (input, ctx) => {
29
29
  const {options} = ctx;
30
30
  ctx.logs = [];
31
31
 
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@tryghost/mg-curated-members-csv",
3
- "version": "0.2.19",
3
+ "version": "0.3.0",
4
4
  "repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-curated-members-csv",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
+ "type": "module",
8
9
  "scripts": {
9
10
  "dev": "echo \"Implement me!\"",
10
- "test": "NODE_ENV=testing mocha './test/**/*.test.js'",
11
+ "test": "node --experimental-vm-modules $(yarn bin jest)",
11
12
  "lint": "eslint . --ext .js --cache",
12
13
  "posttest": "yarn lint"
13
14
  },
@@ -19,9 +20,9 @@
19
20
  "access": "public"
20
21
  },
21
22
  "devDependencies": {
22
- "mocha": "10.0.0",
23
- "should": "13.2.3",
24
- "sinon": "14.0.0"
23
+ "eslint": "8.25.0",
24
+ "jest": "29.1.2",
25
+ "jest-extended": "3.1.0"
25
26
  },
26
27
  "dependencies": {
27
28
  "bluebird": "3.7.2",
@@ -30,5 +31,5 @@
30
31
  "ghost-ignition": "4.6.3",
31
32
  "lodash": "4.17.21"
32
33
  },
33
- "gitHead": "370c7f9973e7518cfb6433e694c8fbbf022c32cf"
34
+ "gitHead": "35cb5c1ca6a826e1e596c4f2e209ab690fa06fa0"
34
35
  }