Skip to content

Commit

Permalink
refactor(deps): updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 committed Jul 3, 2021
1 parent 2f50c63 commit 70a0650
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "h5p-cli-creator",
"version": "0.2.0",
"version": "0.2.1",
"description": "Mass creates h5p packages from content files",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand All @@ -9,21 +9,21 @@
"author": "Sebastian Rettig",
"license": "MIT",
"dependencies": {
"@types/yargs": "^13.0.3",
"axios": "^0.19.0",
"chalk": "^3.0.0",
"fs-extra": "^8.1.0",
"jszip": "^3.2.2",
"papaparse": "^5.1.0",
"ts-node": "^8.5.2",
"@types/yargs": "^17.0.1",
"axios": "^0.21.1",
"chalk": "^4.1.1",
"fs-extra": "^10.0.0",
"jszip": "^3.6.0",
"papaparse": "^5.3.1",
"ts-node": "^10.0.0",
"tslint": "^5.20.1",
"typescript": "^3.7.2",
"yargs": "^15.0.1"
"typescript": "^4.3.5",
"yargs": "^17.0.1"
},
"devDependencies": {
"@types/fs-extra": "^8.0.1",
"@types/jszip": "^3.1.6",
"@types/node": "^12.12.8",
"@types/papaparse": "^5.0.1"
"@types/fs-extra": "^9.0.11",
"@types/jszip": "^3.4.0",
"@types/node": "^16.0.0",
"@types/papaparse": "^5.2.5"
}
}
2 changes: 1 addition & 1 deletion src/content-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export abstract class ContentCreator<T extends H5pContent> {
* Add the content to the content object here.
* @param contentObject
*/
protected abstract async addContent(contentObject: T): Promise<void>;
protected abstract addContent(contentObject: T): Promise<void>;

/**
* Add settings you want to specify here.
Expand Down
22 changes: 13 additions & 9 deletions src/dialogcards-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ export class DialogCardsModule implements yargs.CommandModule {
y
.positional("input", { describe: "csv input file" })
.positional("output", {
describe: "h5p output file including .h5p extension"
describe: "h5p output file including .h5p extension",
})
.option("l", {
describe: "language for translations in h5p content",
default: "en",
type: "string"
type: "string",
})
.option("d", { describe: "CSV delimiter", default: ";", type: "string" })
.option("e", { describe: "encoding", default: "UTF-8", type: "string" })
.option("n", {
describe: "name/title of the content",
default: "Flashcards",
type: "string"
type: "string",
})
.option("m", {
describe: "mode of the content",
default: "repetition",
type: "string",
choices: ["repetition", "normal"]
choices: ["repetition", "normal"],
});

public handler = async argv => {
public handler = async (argv) => {
await this.runDialogcards(
argv.input,
argv.output,
Expand All @@ -54,7 +54,7 @@ export class DialogCardsModule implements yargs.CommandModule {
csvfile: string,
outputfile: string,
title: string,
encoding: string,
encoding: BufferEncoding,
delimiter: string,
language: string,
mode: "repetition" | "normal"
Expand All @@ -63,17 +63,21 @@ export class DialogCardsModule implements yargs.CommandModule {
csvfile = csvfile.trim();
outputfile = outputfile.trim();

let csv = fs.readFileSync(csvfile, encoding);
let csv = fs.readFileSync(csvfile, { encoding });
let csvParsed = papa.parse(csv, {
header: true,
delimiter,
skipEmptyLines: true
skipEmptyLines: true,
});
let h5pPackage = await H5pPackage.createFromHub(
"H5P.DialogCards",
language
);
let creator = new DialogCardsCreator(h5pPackage, csvParsed.data, mode);
let creator = new DialogCardsCreator(
h5pPackage,
csvParsed.data as any,
mode
);
await creator.create();
creator.setTitle(title);
creator.savePackage(outputfile);
Expand Down
16 changes: 8 additions & 8 deletions src/flashcards-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ export class FlashcardsModule implements yargs.CommandModule {
y
.positional("input", { describe: "csv input file" })
.positional("output", {
describe: "h5p output file including .h5p extension"
describe: "h5p output file including .h5p extension",
})
.option("l", {
describe: "language for translations in h5p content",
default: "en",
type: "string"
type: "string",
})
.option("d", { describe: "CSV delimiter", default: ";", type: "string" })
.option("e", { describe: "encoding", default: "UTF-8", type: "string" })
.option("t", {
describe: "title of the content",
default: "Flashcards",
type: "string"
type: "string",
})
.option("description", {
describe: "description of the content",
default: "Write in the answers to the questions.",
type: "string"
type: "string",
});

public handler = async argv => {
public handler = async (argv) => {
await this.runFlashcards(
argv.input,
argv.output,
Expand All @@ -53,7 +53,7 @@ export class FlashcardsModule implements yargs.CommandModule {
csvfile: string,
outputfile: string,
title: string,
encoding: string,
encoding: BufferEncoding,
delimiter: string,
language: string,
description: string
Expand All @@ -66,12 +66,12 @@ export class FlashcardsModule implements yargs.CommandModule {
let csvParsed = papa.parse(csv, {
header: true,
delimiter,
skipEmptyLines: true
skipEmptyLines: true,
});
let h5pPackage = await H5pPackage.createFromHub("H5P.Flashcards", language);
let flashcardsCreator = new FlashcardsCreator(
h5pPackage,
csvParsed.data,
csvParsed.data as any,
description,
title
);
Expand Down

0 comments on commit 70a0650

Please sign in to comment.