From 59155eb0c5ad520300ce20257d350f6a37843000 Mon Sep 17 00:00:00 2001 From: Jared Wray Date: Thu, 7 Mar 2024 12:04:59 -0800 Subject: [PATCH] adding in website support with docula --- .github/workflows/deploy-site.yml | 2 +- README.md | 2 +- package.json | 4 +--- site/docula.config.cjs | 6 +++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 5e6b385..331d662 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -19,7 +19,7 @@ jobs: # Test - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} diff --git a/README.md b/README.md index adde9e8..2e679c1 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ const ecto = new Ecto(); When looking at the API there are two main methods to make note of: [render](#render-from-string) (async) - Render from a string. -[renderFromFile](#render-from-file) (async) - Renders from a file path and will auto-select what engine to use based on the file extension. It will return a Promise of the rendered output. +[renderFromFile](#render-from-file) (async) - Renders from a file path and will auto-select what engine to use based on the file extension. It will return a `Promise` of the rendered output. Two key parameters to know are: defaultEngine:string - the [default engine](#default-engine) to use and set by default to ejs. diff --git a/package.json b/package.json index b9d68b2..765cba9 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "license": "MIT", "scripts": { "watch": "tsc -w -p .", - "clean": "rimraf ./dist yarn.lock package-lock.json ./coverage ./node_modules ./site/readme.md ./dist-site", + "clean": "rimraf ./dist yarn.lock package-lock.json pnpm-lock.yaml ./coverage ./node_modules ./site/readme.md ./dist-site", "test": "xo --fix && vitest run --coverage", "compile": "tsc -p .", "build": "rimraf ./dist && npm install && npm run test && npm run compile", @@ -67,9 +67,7 @@ "@types/pug": "^2.0.10", "@types/underscore": "^1.11.15", "@vitest/coverage-v8": "^1.3.1", - "docula": "0.4.0", "rimraf": "^5.0.5", - "ts-node": "^10.9.2", "typescript": "^5.3.3", "vitest": "^1.3.1", "webpack": "^5.90.3", diff --git a/site/docula.config.cjs b/site/docula.config.cjs index 288cc01..91d9af3 100644 --- a/site/docula.config.cjs +++ b/site/docula.config.cjs @@ -1,6 +1,6 @@ const path = require('node:path'); const process = require('node:process'); -const fsExtra = require('fs-extra'); +const fs = require('node:fs'); module.exports.options = { githubPath: 'jaredwray/ecto', @@ -12,8 +12,8 @@ module.exports.options = { module.exports.onPrepare = async config => { const readmePath = path.join(process.cwd(), './README.md'); const readmeSitePath = path.join(config.sitePath, 'README.md'); - const readme = await fsExtra.readFile(readmePath, 'utf8'); + const readme = await fs.promises.readFile(readmePath, 'utf8'); const updatedReadme = readme.replace('![Ecto](ecto_logo.png "Ecto")\n\n', ''); console.log('writing updated readme to', readmeSitePath); - await fsExtra.writeFile(readmeSitePath, updatedReadme); + await fs.promises.writeFile(readmeSitePath, updatedReadme); };