From f524090308519ce426c02bd03ed1477c15bf2c1a Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:11:27 +0200 Subject: [PATCH] fix: expose autoloader --- README.md | 3 ++- package.json | 8 ++++++++ src/index.ts | 9 ++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9e5282bd..3bbf3774 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,9 @@ npm install -ED @specfy/stack-analyser ``` ```ts -import { analyser, FSProvider, flatten } from "@specfy/stack-analyser" +import { analyser, FSProvider, flatten, loadAllRules } from "@specfy/stack-analyser" +loadAllRules(); const result = await analyser({ provider: new FSProvider({ path: '/my/repository/path/', diff --git a/package.json b/package.json index d1dc2427..38d47574 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,14 @@ "bin": "./dist/cli.js", "typings": "./dist/index.d.ts", "type": "module", + "homepage": "https://github.com/specfy/stack-analyser#readme", + "repository": { + "type": "git", + "url": "https://github.com/specfy/stack-analyser.git" + }, + "bugs": { + "url": "https://github.com/specfy/stack-analyser/issues" + }, "scripts": { "prebuild": "ts-node --esm src/scripts/prebuild.ts", "build:watch": "tsc -w", diff --git a/src/index.ts b/src/index.ts index 04f4646f..eff2ab41 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,12 @@ /* eslint-disable import/extensions */ import { analyser } from './analyser/index.js'; import { listIndexed, listTech } from './common/techs.generated.js'; -import { rawList, dependencies as dependenciesList } from './loader.js'; +import { + rawList, + dependencies as dependenciesList, + loadAllRules, + loadOne, +} from './loader.js'; import { matchDependencies } from './matchDependencies.js'; import { flatten, @@ -55,6 +60,8 @@ export { export const rules = { register, list: registeredRules, + loadAllRules, + loadOne, }; export const dependencies = { detect: matchDependencies,