From b52b3d5db9d62736b7b601d8cd08af0f4cd9f7c4 Mon Sep 17 00:00:00 2001 From: Brian Ignacio Date: Tue, 10 Oct 2023 12:23:06 +0200 Subject: [PATCH] fix doc generate --- examples/typescript/.parcelrc | 7 +++++++ examples/typescript/README.md | 2 +- examples/typescript/package.json | 8 ++++++-- package.json | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 examples/typescript/.parcelrc diff --git a/examples/typescript/.parcelrc b/examples/typescript/.parcelrc new file mode 100644 index 0000000..853a724 --- /dev/null +++ b/examples/typescript/.parcelrc @@ -0,0 +1,7 @@ +{ + "extends": "@parcel/config-default", + "resolvers": [ + "parcel-resolver-ignore", + "..." + ] + } \ No newline at end of file diff --git a/examples/typescript/README.md b/examples/typescript/README.md index 2dea2d9..4627d85 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -2,7 +2,7 @@ This example has example code in `src/index.ts` which is called in the `index.html`. We are using Parcel to bundle resulting files for simplicity here. -**NOTE:** This example is linked to the documentation generated from the source code. You could remove such dependency if necessary by remove `./docs/index.html` from `src/index.html` if you need so. NPM commands used below will generate documentation as well. +**NOTE:** This example is linked to the documentation generated from the source code. You could remove such dependency if necessary by remove `./docs/index.html` from `src/index.html` if you need so. NPM commands used below will generate documentation as well. ## Testing it locally diff --git a/examples/typescript/package.json b/examples/typescript/package.json index f59a220..1b17df5 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -4,16 +4,20 @@ "description": "This an example of using esptool-js with parcel and typescript", "source": "src/index.html", "scripts": { + "genDocs": "cd ../.. && npm run genDocs && mkdir -p examples/typescript/dist && cp -r docs examples/typescript/dist && cd examples/typescript", "dev": "npm run genDocs && parcel src/index.html", - "genDocs": "cd ../.. && npm run build && npm run genDocs", "build": "npm run clean && npm run genDocs && parcel build src/index.html --no-optimize --public-url ./", - "clean": "rimraf src/docs dist .parcel-cache", + "clean": "rimraf dist .parcel-cache", "test": "echo \"Error: no test specified\" && exit 1" }, + "parcelIgnore": [ + "./docs/.+" + ], "author": "", "license": "ISC", "devDependencies": { "parcel": "^2.8.3", + "parcel-resolver-ignore": "^2.1.5", "rimraf": "^4.1.2", "typescript": "^4.9.4" } diff --git a/package.json b/package.json index 3dc36a9..af09a63 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build": "npm run clean && tsc && rollup --config", "clean": "rimraf lib bundle.js .parcel-cache", "format": "prettier --write \"src/**/*.ts\"", - "genDocs": "rimraf examples/typescript/src/docs && typedoc --out examples/typescript/src/docs", + "genDocs": "rimraf docs && typedoc", "lint": "eslint . --ext .ts", "lintAndFix": "eslint . --ext .ts --fix", "prepare": "npm run build",