Skip to content

Commit

Permalink
refactor: move to typescript (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigui authored and faustbrian committed Feb 21, 2019
1 parent 7c6938c commit aa3b69c
Show file tree
Hide file tree
Showing 12 changed files with 3,006 additions and 1,069 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/README.md export-ignore
/__tests__ export-ignore
/docs export-ignore
/README.md export-ignore
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Dependency directories
node_modules

# Build
dist
22 changes: 0 additions & 22 deletions jest.config.js

This file was deleted.

24 changes: 0 additions & 24 deletions jsdoc.json

This file was deleted.

7 changes: 0 additions & 7 deletions lib/defaults.js

This file was deleted.

17 changes: 0 additions & 17 deletions lib/index.js

This file was deleted.

57 changes: 37 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,46 @@
"Your Name <[email protected]>"
],
"license": "MIT",
"main": "lib/index.js",
"main": "dist/index.js",
"files": [
"dist"
],
"scripts": {
"build:docs": "../../node_modules/.bin/jsdoc -c jsdoc.json",
"test": "ARK_ENV=test jest --runInBand --detectOpenHandles",
"test:coverage": "ARK_ENV=test jest --coverage --runInBand --detectOpenHandles",
"test:debug": "ARK_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand --watch",
"test:watch": "ARK_ENV=test jest --runInBand --watch",
"test:watch:all": "ARK_ENV=test jest --runInBand --watchAll",
"lint": "eslint ./ --fix",
"depcheck": "depcheck ./"
"prepublishOnly": "yarn test && yarn build",
"pretest": "yarn lint && yarn build",
"compile": "../../node_modules/typescript/bin/tsc",
"build": "yarn clean && yarn compile",
"build:watch": "yarn clean && yarn compile -w",
"clean": "del dist",
"docs": "../../node_modules/typedoc/bin/typedoc src --out docs",
"lint": "../../node_modules/tslint/bin/tslint -c ./tslint.json 'src/**/*.ts' '__tests__/**/*.ts' --fix",
"test": "cross-env CORE_ENV=test jest --runInBand --forceExit",
"test:coverage": "cross-env CORE_ENV=test jest --coverage --coveragePathIgnorePatterns='/(defaults.ts|index.ts)$' --runInBand --forceExit",
"test:debug": "cross-env CORE_ENV=test node --inspect-brk ../../node_modules/.bin/jest --runInBand",
"test:watch": "cross-env CORE_ENV=test jest --runInBand --watch",
"test:watch:all": "cross-env CORE_ENV=test jest --runInBand --watchAll",
"updates": "../../node_modules/npm-check-updates/bin/npm-check-updates -a"
},
"dependencies": {
"@arkecosystem/core-interfaces": "^2.1.0"
},
"devDependencies": {
"depcheck": "^0.6.9",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"jest": "^23.1.0",
"jest-extended": "^0.7.2",
"jsdoc": "^3.5.5",
"@sindresorhus/tsconfig": "^0.1.1",
"@types/jest": "^23.3.10",
"@types/node": "^10.12.17",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"typescript": "^3.2.2",
"typedoc": "^0.13.0",
"ts-jest": "^23.10.5",
"jest": "^23.6.0",
"jest-extended": "^0.11.0",
"regenerator-runtime": "^0.11.1",
"standard": "^11.0.1"
"npm-check-updates": "^2.15.0",
"cross-env": "^5.2.0",
"del-cli": "^1.1.0"
},
"jest": {
"preset": "../../jest-preset.json"
}
}
1 change: 1 addition & 0 deletions src/defaults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const defaults = {};
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./plugin";
14 changes: 14 additions & 0 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Container } from "@arkecosystem/core-interfaces";
import { defaults } from "./defaults";

export const plugin: Container.PluginDescriptor = {
pkg: require("../package.json"),
defaults,
alias: "my-plugin",
async register(container: Container.IContainer, options) {
/* Start plugin here */
},
async deregister(container: Container.IContainer, options) {
/* Stop plugin here */
}
};
7 changes: 7 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src/**/**.ts"]
}
Loading

0 comments on commit aa3b69c

Please sign in to comment.