diff --git a/package-lock.json b/package-lock.json index 275f8109..e97058e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -83,9 +83,9 @@ } }, "@eslint/eslintrc": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", - "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.2.tgz", + "integrity": "sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -95,7 +95,7 @@ "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", - "lodash": "^4.17.20", + "lodash": "^4.17.19", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" }, @@ -228,6 +228,15 @@ "@types/range-parser": "*" } }, + "@types/fs-extra": { + "version": "9.0.6", + "resolved": "http://203.195.129.179:4875/@types%2ffs-extra/-/fs-extra-9.0.6.tgz", + "integrity": "sha1-SI5Wt3KZiZpgi4JpcZwdEzAnpqs=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/highlight.js": { "version": "9.12.4", "resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.12.4.tgz", @@ -281,9 +290,9 @@ "dev": true }, "@types/node": { - "version": "14.14.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz", - "integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==", + "version": "10.17.51", + "resolved": "http://203.195.129.179:4875/@types%2fnode/-/node-10.17.51.tgz", + "integrity": "sha1-Y5U4V1vvvPPThh+VxB3o5HEk1nQ=", "dev": true }, "@types/normalize-package-data": { @@ -653,6 +662,11 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "http://203.195.129.179:4875/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -775,9 +789,9 @@ "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==" }, "comment-parser": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.1.1.tgz", - "integrity": "sha512-vue7cRi1ZO5/72FJ+wZ5+siTSBlUv3ZksTk8bWD2IkaA6obitzMZP3yI65azTJLckwmi8lxfPP5Sd9oGuZ8e2g==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.0.1.tgz", + "integrity": "sha512-korDJ16mBVZexVd485jz4AeAcAFP1UzeecfVgfBCBojLFjMEHEHOY9vgk3e9o1zRSP0EscavonLki4JZDCKmrg==", "dev": true }, "compare-func": { @@ -1466,13 +1480,13 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", - "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.17.0.tgz", + "integrity": "sha512-zJk08MiBgwuGoxes5sSQhOtibZ75pz0J35XTRlZOk9xMffhpA9BTbQZxoXZzOl5zMbleShbGwtw+1kGferfFwQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.3.0", + "@eslint/eslintrc": "^0.2.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -1496,7 +1510,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", + "lodash": "^4.17.19", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -1540,12 +1554,12 @@ "dev": true }, "eslint-plugin-jsdoc": { - "version": "31.0.7", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-31.0.7.tgz", - "integrity": "sha512-aAfVrXxgS+x9nW97DYZ1hEdKvobSqfT6S9xIU+pZYZ9mQW03B4l6s79CcAz6Q/RqYJj/nq+IOQO5ZFA8v7e0Og==", + "version": "31.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-31.0.3.tgz", + "integrity": "sha512-O2HXyXyw2FYXWngFGeuCxhmClb4M1Y/w+bPcahO31P/Tw+vHZUU9wkPkSML2izznJ1dp3dnTG4on9bXDZDWfyQ==", "dev": true, "requires": { - "comment-parser": "1.1.1", + "comment-parser": "1.0.1", "debug": "^4.3.1", "jsdoctypeparser": "^9.0.0", "lodash": "^4.17.20", @@ -1897,6 +1911,17 @@ "null-check": "^1.0.0" } }, + "fs-extra": { + "version": "9.0.1", + "resolved": "http://203.195.129.179:4875/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2275,8 +2300,7 @@ "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, "handlebars": { "version": "4.7.6", @@ -2337,9 +2361,9 @@ "dev": true }, "husky": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.7.tgz", + "integrity": "sha512-0fQlcCDq/xypoyYSJvEuzbDPHFf8ZF9IXKJxlrnvxABTSzK1VPT2RKYQKrcgJ+YD39swgoB6sbzywUqFxUiqjw==", "dev": true, "requires": { "chalk": "^4.0.0", @@ -2611,6 +2635,22 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "jsonfile": { + "version": "6.1.0", + "resolved": "http://203.195.129.179:4875/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "http://203.195.129.179:4875/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + } + } + }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -4331,6 +4371,11 @@ "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" }, + "universalify": { + "version": "1.0.0", + "resolved": "http://203.195.129.179:4875/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/package.json b/package.json index dff13f71..656c4d8c 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "keywords": [], "engines": { - "node": ">15.0.0" + "node": ">10.0.0" }, "files": [ "bin", @@ -53,7 +53,7 @@ "@types/cosmiconfig": "^6.0.0", "@types/express": "^4.17.9", "@types/markdown-it": "^12.0.1", - "@types/node": "^14.14.20", + "@types/node": "^10.17.51", "@types/yargs": "^15.0.12", "@typescript-eslint/eslint-plugin": "^4.12.0", "@typescript-eslint/parser": "^4.12.0", @@ -67,7 +67,8 @@ "pretty-quick": "^3.1.0", "standard-version": "^9.1.0", "ts-node": "^9.1.1", - "typescript": "^4.1.3" + "typescript": "^4.1.3", + "@types/fs-extra": "^9.0.6" }, "dependencies": { "colorette": "^1.2.1", @@ -77,6 +78,7 @@ "express": "^4.17.1", "markdown-it": "^12.0.4", "ts-morph": "^9.1.0", - "yargs": "^16.2.0" + "yargs": "^16.2.0", + "fs-extra": "^9.0.1" } } diff --git a/src/builders/build-static.ts b/src/builders/build-static.ts index d5e4d819..4c459f0e 100644 --- a/src/builders/build-static.ts +++ b/src/builders/build-static.ts @@ -1,5 +1,5 @@ import * as fs from 'fs'; -import * as fsp from 'fs/promises'; +import * as fsp from 'fs-extra'; import * as path from 'path'; import { Tree } from '../model'; import { getConfig } from '../model/config'; diff --git a/src/themes/html/index.ts b/src/themes/html/index.ts index 56a3b76b..bd84b02f 100644 --- a/src/themes/html/index.ts +++ b/src/themes/html/index.ts @@ -1,6 +1,6 @@ import { Theme } from '../../model'; import MarkdownIt from 'markdown-it'; -import * as fsp from 'fs/promises'; +import * as fsp from 'fs-extra'; import * as fs from 'fs'; import * as path from 'path'; import { renderFile } from 'eta'; diff --git a/tsconfig.json b/tsconfig.json index 1d572d58..2aa7cd81 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ESNext", + "target": "ES2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ @@ -74,8 +74,9 @@ /* Advanced Options */ "skipLibCheck": true, /* Skip type checking of declaration files. */ - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ + "lib": ["ESNext"] }, "include": ["src"], "exclude": ["build"] diff --git a/views/partials/class.eta b/views/partials/class.eta index 8cafbf6e..88b0fece 100644 --- a/views/partials/class.eta +++ b/views/partials/class.eta @@ -41,7 +41,7 @@ const {declaration, md} = it; <% declaration.properties.forEach((property) => { %>
- <%= property.scope ?? ''%> + <%= property.scope || ''%> <%= property.isStatic ? 'static' : ''%> <%= property.isAbstract ? 'abstract' : ''%> <%= property.isReadonly ? 'readonly' : ''%> @@ -58,7 +58,7 @@ const {declaration, md} = it; <% declaration.methods.forEach((method) => { %>
- <%= method.scope ?? ''%> + <%= method.scope || ''%> <%= method.isStatic ? 'static' : ''%> <%= method.isAbstract ? 'abstract' : ''%> <%= method.isAsync ? 'async' : ''%> diff --git a/views/partials/function.eta b/views/partials/function.eta index 2e8c0538..911a44ec 100644 --- a/views/partials/function.eta +++ b/views/partials/function.eta @@ -50,7 +50,7 @@ const {declaration, md} = it : - <%= declaration.returnType ?? 'any' %> + <%= declaration.returnType || 'any' %>

diff --git a/views/partials/variable.eta b/views/partials/variable.eta index 3a707a05..01492232 100644 --- a/views/partials/variable.eta +++ b/views/partials/variable.eta @@ -11,7 +11,7 @@ : - <%= declaration.declarations[0]?.type ?? 'any' %> + <%= (declaration.declarations[0] && declaration.declarations[0].type) || 'any' %>