node-scripts-docs
Advanced tools
Comparing version
@@ -11,4 +11,3 @@ "use strict"; | ||
it("renders a script store as expected", async () => { | ||
const scannerFragments = new FragmentScanner_1.FragmentScanner(path_1.default.join("test/fixtures/default", FragmentStore_1.DOCS_FRAGMENTS_DEFAULT_LOCATION)); | ||
const storeFragments = await scannerFragments.loadFragments(); | ||
const storeFragments = await FragmentScanner_1.FragmentScanner.loadFragments(path_1.default.join("test/fixtures/default", FragmentStore_1.DOCS_FRAGMENTS_DEFAULT_LOCATION)); | ||
const scannerScripts = new ScriptScanner_1.ScriptScanner("test/fixtures/default"); | ||
@@ -15,0 +14,0 @@ await scannerScripts.loadManifests(); |
import { FragmentStore } from "./FragmentStore"; | ||
export declare class FragmentScanner { | ||
private fragmentDirectory; | ||
fragments: string[]; | ||
constructor(fragmentDirectory: string); | ||
loadFragments(): Promise<FragmentStore>; | ||
static loadFragments(fragmentDirectory: string): Promise<FragmentStore>; | ||
} | ||
//# sourceMappingURL=FragmentScanner.d.ts.map |
@@ -8,10 +8,6 @@ "use strict"; | ||
class FragmentScanner { | ||
constructor(fragmentDirectory) { | ||
this.fragments = new Array(); | ||
this.fragmentDirectory = fragmentDirectory; | ||
} | ||
async loadFragments() { | ||
const fragmentStore = new FragmentStore_1.FragmentStore(this.fragmentDirectory); | ||
static async loadFragments(fragmentDirectory) { | ||
const fragmentStore = new FragmentStore_1.FragmentStore(fragmentDirectory); | ||
const fragments = await (0, globby_1.default)(FragmentStore_1.FragmentStore.scriptToFragmentFilename("*"), { | ||
cwd: this.fragmentDirectory, | ||
cwd: fragmentDirectory, | ||
}); | ||
@@ -18,0 +14,0 @@ for (const fragment of fragments) { |
@@ -8,6 +8,5 @@ "use strict"; | ||
it("loads existing fragments as expected", async () => { | ||
const scanner = new FragmentScanner_1.FragmentScanner(path_1.default.join("test/fixtures/default", FragmentStore_1.DOCS_FRAGMENTS_DEFAULT_LOCATION)); | ||
await scanner.loadFragments(); | ||
expect(scanner.fragments).toMatchSnapshot(); | ||
const fragmentStore = await FragmentScanner_1.FragmentScanner.loadFragments(path_1.default.join("test/fixtures/default", FragmentStore_1.DOCS_FRAGMENTS_DEFAULT_LOCATION)); | ||
expect(fragmentStore.fragments).toMatchSnapshot(); | ||
}); | ||
//# sourceMappingURL=FragmentScanner.test.js.map |
@@ -61,4 +61,3 @@ #!/usr/bin/env node | ||
console.info("Loading existing fragments..."); | ||
const fragmentScanner = new FragmentScanner_1.FragmentScanner(fragmentStorePath); | ||
fragmentStore = await fragmentScanner.loadFragments(); | ||
fragmentStore = await FragmentScanner_1.FragmentScanner.loadFragments(fragmentStorePath); | ||
console.info(`Docs contain ${fragmentStore.fragments.size} fragment(s).`); | ||
@@ -65,0 +64,0 @@ } |
@@ -10,4 +10,3 @@ "use strict"; | ||
it("augments a store with descriptions from fragments", async () => { | ||
const scannerFragments = new FragmentScanner_1.FragmentScanner(path_1.default.join("test/fixtures/default", FragmentStore_1.DOCS_FRAGMENTS_DEFAULT_LOCATION)); | ||
const storeFragments = await scannerFragments.loadFragments(); | ||
const storeFragments = await FragmentScanner_1.FragmentScanner.loadFragments(path_1.default.join("test/fixtures/default", FragmentStore_1.DOCS_FRAGMENTS_DEFAULT_LOCATION)); | ||
const scannerScripts = new ScriptScanner_1.ScriptScanner("test/fixtures/default"); | ||
@@ -14,0 +13,0 @@ await scannerScripts.loadManifests(); |
{ | ||
"name": "node-scripts-docs", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"license": "UNLICENSED", | ||
"author": "Oliver Salzburg <oliver.salzburg@gmail.com>", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/oliversalzburg/node-scripts-docs.git" | ||
}, | ||
"bin": { | ||
@@ -21,25 +27,25 @@ "nsd": "output/node-scripts-docs.js" | ||
"globby": "11.1.0", | ||
"marked": "4.0.12", | ||
"minimist": "1.2.5", | ||
"tslib": "2.3.1" | ||
"marked": "4.0.14", | ||
"minimist": "1.2.6", | ||
"tslib": "2.4.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "27.4.1", | ||
"@types/marked": "4.0.2", | ||
"@types/marked": "4.0.3", | ||
"@types/minimist": "1.2.2", | ||
"@types/node": "17.0.10", | ||
"@types/prettier": "2.4.4", | ||
"@types/prettier": "2.6.0", | ||
"@types/prettier-package-json": "2.1.1", | ||
"@yarnpkg/sdks": "2.6.0", | ||
"eslint": "8.11.0", | ||
"eslint": "8.14.0", | ||
"jest": "27.5.1", | ||
"lint-staged": "12.3.6", | ||
"prettier": "2.6.0", | ||
"lint-staged": "12.4.0", | ||
"prettier": "2.6.2", | ||
"prettier-package-json": "2.6.3", | ||
"prettier-plugin-organize-imports": "2.3.4", | ||
"prettier-plugin-sh": "0.8.1", | ||
"ts-jest": "27.1.3", | ||
"typescript": "4.6.2" | ||
"prettier-plugin-sh": "0.10.1", | ||
"ts-jest": "27.1.4", | ||
"typescript": "4.6.3" | ||
}, | ||
"packageManager": "yarn@3.2.0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Explicitly Unlicensed Item
License(Experimental) Something was found which is explicitly marked as unlicensed.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
98984
0.35%79
1.28%0
-100%1125
2.27%1
-50%6
-14.29%1
Infinity%1
Infinity%0
-100%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated
Updated