Skip to content

Commit

Permalink
Migrate to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmurphy committed Jun 13, 2021
1 parent b5351ca commit 6186189
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
interval: weekly
time: "13:00"
open-pull-requests-limit: 10
ignore:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

# build folder
lib
19 changes: 0 additions & 19 deletions jsconfig.json

This file was deleted.

140 changes: 114 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
"type": "module",
"version": "4.2.0",
"description": "Collect JS/JSON/YAML/YML/CSV/TSV/ArchieML files from a source folder and convert them into a single object.",
"exports": "./index.js",
"types": "types.d.ts",
"exports": "./lib/index.js",
"types": "./lib/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/rdmurphy/quaff.git"
},
"author": "Ryan Murphy <ryan@rdmurphy.org>",
"author": "Ryan Murphy",
"license": "MIT",
"files": [
"index.js",
"types.d.ts"
"lib"
],
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"build": "tsc",
"git-pre-commit": "precise-commits",
"test": "node test/test.js",
"test": "npm run build && node test/test.js",
"coverage": "c8 --reporter text --reporter lcovonly npm run test",
"release": "np --no-yarn"
},
Expand All @@ -35,18 +35,22 @@
],
"devDependencies": {
"@rdm/prettier-config": "^1.0.1",
"@tsconfig/node12": "^1.0.8",
"@types/d3-dsv": "^2.0.1",
"@types/js-yaml": "^4.0.1",
"@types/node": "^14.0.22",
"@vercel/git-hooks": "^1.0.0",
"c8": "^7.7.2",
"coveralls": "^3.1.0",
"np": "^7.5.0",
"precise-commits": "^1.0.2",
"prettier": "^2.0.5",
"typescript": "^4.3.2",
"uvu": "^0.5.0"
},
"dependencies": {
"archieml": "^0.4.2",
"d3-dsv": "^2.0.0",
"d3-dsv": "^3.0.1",
"dset": "^3.0.0",
"js-yaml": "^4.0.0",
"parse-json": "^5.0.0",
Expand Down
14 changes: 14 additions & 0 deletions source/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @param filePath the input file path
* @returns {Promise<unknown>}
*/
export declare function loadFile(filePath: string): Promise<unknown>;
/**
* We know this will return a string-keyed Object, but that's about it.
*/
export declare type LoadReturnValue = Record<string, unknown>;
/**
* @param dirPath the input directory
* @returns {Promise<LoadReturnValue>}
*/
export declare function load(dirPath: string): Promise<LoadReturnValue>;
Loading

0 comments on commit 6186189

Please sign in to comment.