From 327277d3dd29d0d7bce32dcd1efc774a9df598a0 Mon Sep 17 00:00:00 2001 From: Trey Cucco Date: Wed, 6 Sep 2023 15:42:23 -0600 Subject: [PATCH 1/3] Recognize .mdx files as doc files --- src/utils/fs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/fs.ts b/src/utils/fs.ts index f23df6b..1846e94 100644 --- a/src/utils/fs.ts +++ b/src/utils/fs.ts @@ -56,4 +56,4 @@ export const writeFileLines = async (filename: string, lines: string[]) => { export const isCodeFile = (filename: string) => /\.(js|jsx|ts|tsx)$/i.test(filename); -export const isDocFile = (filename: string) => /\.md$/i.test(filename); +export const isDocFile = (filename: string) => /\.mdx?$/i.test(filename); From 4de675ac54f2a71a99f89058f8301facf000f5f4 Mon Sep 17 00:00:00 2001 From: Trey Cucco Date: Wed, 6 Sep 2023 15:42:54 -0600 Subject: [PATCH 2/3] Build --- lib/cjs/actions/write.js | 2 +- lib/cjs/types/actions/write.d.ts | 2 +- lib/cjs/types/utils/fs.d.ts.map | 2 +- lib/cjs/types/utils/replace.d.ts | 2 +- lib/cjs/utils/fs.js | 2 +- lib/cjs/utils/replace.js | 2 +- lib/esm/actions/write.js | 2 +- lib/esm/types/actions/write.d.ts | 2 +- lib/esm/types/utils/fs.d.ts.map | 2 +- lib/esm/types/utils/replace.d.ts | 2 +- lib/esm/utils/fs.js | 2 +- lib/esm/utils/replace.js | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/cjs/actions/write.js b/lib/cjs/actions/write.js index 0337b4a..a83a79c 100644 --- a/lib/cjs/actions/write.js +++ b/lib/cjs/actions/write.js @@ -46,7 +46,7 @@ function writeAction({ srcPath, docsPath, generatedPath, codeUrl, options, }) { } exports.default = writeAction; /** - * Writes best practices out to md doc files. + * Writes best practices out to Markdown doc files. */ const writeBestPractices = (contentDir, bestPractices, codeUrl, options) => __awaiter(void 0, void 0, void 0, function* () { try { diff --git a/lib/cjs/types/actions/write.d.ts b/lib/cjs/types/actions/write.d.ts index 3d99864..57da023 100644 --- a/lib/cjs/types/actions/write.d.ts +++ b/lib/cjs/types/actions/write.d.ts @@ -14,7 +14,7 @@ type WriteArgs = { */ export default function writeAction({ srcPath, docsPath, generatedPath, codeUrl, options, }: WriteArgs): Promise; /** - * Writes best practices out to md doc files. + * Writes best practices out to Markdown doc files. */ export declare const writeBestPractices: (contentDir: string, bestPractices: BestPractice[], codeUrl: string, options: WriteOptions) => Promise; export declare const SPECIAL_META_KEYS: Set; diff --git a/lib/cjs/types/utils/fs.d.ts.map b/lib/cjs/types/utils/fs.d.ts.map index 5967d70..002b795 100644 --- a/lib/cjs/types/utils/fs.d.ts.map +++ b/lib/cjs/types/utils/fs.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/utils/fs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAG/D;;;GAGG;AACH,wBAAuB,IAAI,CACzB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAW,GACnB,cAAc,CAAC,MAAM,CAAC,CAWxB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,OAAQ,UAAU,QAAQ,MAAM;;;EACvB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,UAAU,aAAoB,MAAM,qBAOhD,CAAC;AAEF,eAAO,MAAM,aAAa,aAAoB,MAAM,sBAGnD,CAAC;AAEF,eAAO,MAAM,cAAc,aAAoB,MAAM,SAAS,MAAM,EAAE,kBAKrE,CAAC;AAEF,eAAO,MAAM,UAAU,aAAc,MAAM,YACL,CAAC;AAEvC,eAAO,MAAM,SAAS,aAAc,MAAM,YAA4B,CAAC"} \ No newline at end of file +{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/utils/fs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAG/D;;;GAGG;AACH,wBAAuB,IAAI,CACzB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAW,GACnB,cAAc,CAAC,MAAM,CAAC,CAWxB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,OAAQ,UAAU,QAAQ,MAAM;;;EACvB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,UAAU,aAAoB,MAAM,qBAOhD,CAAC;AAEF,eAAO,MAAM,aAAa,aAAoB,MAAM,sBAGnD,CAAC;AAEF,eAAO,MAAM,cAAc,aAAoB,MAAM,SAAS,MAAM,EAAE,kBAKrE,CAAC;AAEF,eAAO,MAAM,UAAU,aAAc,MAAM,YACL,CAAC;AAEvC,eAAO,MAAM,SAAS,aAAc,MAAM,YAA8B,CAAC"} \ No newline at end of file diff --git a/lib/cjs/types/utils/replace.d.ts b/lib/cjs/types/utils/replace.d.ts index a82995c..466d4dc 100644 --- a/lib/cjs/types/utils/replace.d.ts +++ b/lib/cjs/types/utils/replace.d.ts @@ -4,7 +4,7 @@ import BestPractice from '../BestPractice'; */ export declare const replaceAllBestPracticesInDocs: (docsRoot: string, bestPractices: BestPractice[], getBestPracticeLines: (bestPracitce: BestPractice) => string[]) => Promise>; /** - * Scan through a static documentation file and replace best practices ines + * Scan through a static documentation file and replace best practices lines */ export declare const insertBestPracticesIntoDoc: (filename: string, index: Map, getBestPracticeLines: (bestPracitce: BestPractice) => string[]) => Promise>; /** diff --git a/lib/cjs/utils/fs.js b/lib/cjs/utils/fs.js index 1afffef..f6dee7d 100644 --- a/lib/cjs/utils/fs.js +++ b/lib/cjs/utils/fs.js @@ -86,5 +86,5 @@ const writeFileLines = (filename, lines) => __awaiter(void 0, void 0, void 0, fu exports.writeFileLines = writeFileLines; const isCodeFile = (filename) => /\.(js|jsx|ts|tsx)$/i.test(filename); exports.isCodeFile = isCodeFile; -const isDocFile = (filename) => /\.md$/i.test(filename); +const isDocFile = (filename) => /\.mdx?$/i.test(filename); exports.isDocFile = isDocFile; diff --git a/lib/cjs/utils/replace.js b/lib/cjs/utils/replace.js index 07a7018..46ca962 100644 --- a/lib/cjs/utils/replace.js +++ b/lib/cjs/utils/replace.js @@ -56,7 +56,7 @@ const replaceAllBestPracticesInDocs = (docsRoot, bestPractices, getBestPracticeL }); exports.replaceAllBestPracticesInDocs = replaceAllBestPracticesInDocs; /** - * Scan through a static documentation file and replace best practices ines + * Scan through a static documentation file and replace best practices lines */ const insertBestPracticesIntoDoc = (filename, index, getBestPracticeLines) => __awaiter(void 0, void 0, void 0, function* () { const oldLines = yield (0, fs_1.readFileLines)(filename); diff --git a/lib/esm/actions/write.js b/lib/esm/actions/write.js index 508647c..3fa2d9e 100644 --- a/lib/esm/actions/write.js +++ b/lib/esm/actions/write.js @@ -35,7 +35,7 @@ async function writeAction({ srcPath, docsPath, generatedPath, codeUrl, options, } exports.default = writeAction; /** - * Writes best practices out to md doc files. + * Writes best practices out to Markdown doc files. */ const writeBestPractices = async (contentDir, bestPractices, codeUrl, options) => { try { diff --git a/lib/esm/types/actions/write.d.ts b/lib/esm/types/actions/write.d.ts index 3d99864..57da023 100644 --- a/lib/esm/types/actions/write.d.ts +++ b/lib/esm/types/actions/write.d.ts @@ -14,7 +14,7 @@ type WriteArgs = { */ export default function writeAction({ srcPath, docsPath, generatedPath, codeUrl, options, }: WriteArgs): Promise; /** - * Writes best practices out to md doc files. + * Writes best practices out to Markdown doc files. */ export declare const writeBestPractices: (contentDir: string, bestPractices: BestPractice[], codeUrl: string, options: WriteOptions) => Promise; export declare const SPECIAL_META_KEYS: Set; diff --git a/lib/esm/types/utils/fs.d.ts.map b/lib/esm/types/utils/fs.d.ts.map index 5967d70..002b795 100644 --- a/lib/esm/types/utils/fs.d.ts.map +++ b/lib/esm/types/utils/fs.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/utils/fs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAG/D;;;GAGG;AACH,wBAAuB,IAAI,CACzB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAW,GACnB,cAAc,CAAC,MAAM,CAAC,CAWxB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,OAAQ,UAAU,QAAQ,MAAM;;;EACvB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,UAAU,aAAoB,MAAM,qBAOhD,CAAC;AAEF,eAAO,MAAM,aAAa,aAAoB,MAAM,sBAGnD,CAAC;AAEF,eAAO,MAAM,cAAc,aAAoB,MAAM,SAAS,MAAM,EAAE,kBAKrE,CAAC;AAEF,eAAO,MAAM,UAAU,aAAc,MAAM,YACL,CAAC;AAEvC,eAAO,MAAM,SAAS,aAAc,MAAM,YAA4B,CAAC"} \ No newline at end of file +{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/utils/fs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,aAAa,CAAC;AAG/D;;;GAGG;AACH,wBAAuB,IAAI,CACzB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,MAAW,GACnB,cAAc,CAAC,MAAM,CAAC,CAWxB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,OAAQ,UAAU,QAAQ,MAAM;;;EACvB,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,UAAU,aAAoB,MAAM,qBAOhD,CAAC;AAEF,eAAO,MAAM,aAAa,aAAoB,MAAM,sBAGnD,CAAC;AAEF,eAAO,MAAM,cAAc,aAAoB,MAAM,SAAS,MAAM,EAAE,kBAKrE,CAAC;AAEF,eAAO,MAAM,UAAU,aAAc,MAAM,YACL,CAAC;AAEvC,eAAO,MAAM,SAAS,aAAc,MAAM,YAA8B,CAAC"} \ No newline at end of file diff --git a/lib/esm/types/utils/replace.d.ts b/lib/esm/types/utils/replace.d.ts index a82995c..466d4dc 100644 --- a/lib/esm/types/utils/replace.d.ts +++ b/lib/esm/types/utils/replace.d.ts @@ -4,7 +4,7 @@ import BestPractice from '../BestPractice'; */ export declare const replaceAllBestPracticesInDocs: (docsRoot: string, bestPractices: BestPractice[], getBestPracticeLines: (bestPracitce: BestPractice) => string[]) => Promise>; /** - * Scan through a static documentation file and replace best practices ines + * Scan through a static documentation file and replace best practices lines */ export declare const insertBestPracticesIntoDoc: (filename: string, index: Map, getBestPracticeLines: (bestPracitce: BestPractice) => string[]) => Promise>; /** diff --git a/lib/esm/utils/fs.js b/lib/esm/utils/fs.js index 865ef27..a919bb5 100644 --- a/lib/esm/utils/fs.js +++ b/lib/esm/utils/fs.js @@ -51,5 +51,5 @@ const writeFileLines = async (filename, lines) => { exports.writeFileLines = writeFileLines; const isCodeFile = (filename) => /\.(js|jsx|ts|tsx)$/i.test(filename); exports.isCodeFile = isCodeFile; -const isDocFile = (filename) => /\.md$/i.test(filename); +const isDocFile = (filename) => /\.mdx?$/i.test(filename); exports.isDocFile = isDocFile; diff --git a/lib/esm/utils/replace.js b/lib/esm/utils/replace.js index 6c51210..5a8f06d 100644 --- a/lib/esm/utils/replace.js +++ b/lib/esm/utils/replace.js @@ -27,7 +27,7 @@ const replaceAllBestPracticesInDocs = async (docsRoot, bestPractices, getBestPra }; exports.replaceAllBestPracticesInDocs = replaceAllBestPracticesInDocs; /** - * Scan through a static documentation file and replace best practices ines + * Scan through a static documentation file and replace best practices lines */ const insertBestPracticesIntoDoc = async (filename, index, getBestPracticeLines) => { const oldLines = await (0, fs_1.readFileLines)(filename); From b6fbd681fcbc0f6ece4a75bdd0f83568b4587889 Mon Sep 17 00:00:00 2001 From: Trey Cucco Date: Wed, 6 Sep 2023 15:43:02 -0600 Subject: [PATCH 3/3] 0.4.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50a1c52..41c24b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@closeio/best-practices-documentation", - "version": "0.4.0", + "version": "0.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@closeio/best-practices-documentation", - "version": "0.4.0", + "version": "0.4.1", "license": "ISC", "dependencies": { "crypto-js": "^4.1.1" diff --git a/package.json b/package.json index c3929b5..4516759 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@closeio/best-practices-documentation", - "version": "0.4.0", + "version": "0.4.1", "description": "Tooling to document best practices in your code base.", "author": "Trey Cucco", "main": "index.js",