node-scripts-docs
Advanced tools
Comparing version
@@ -26,4 +26,5 @@ module.exports = { | ||
], | ||
"@typescript-eslint/no-unused-vars": ["off"], | ||
"@typescript-eslint/no-var-requires": ["off"], | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/no-var-requires": "off", | ||
}, | ||
@@ -30,0 +31,0 @@ }, |
@@ -16,3 +16,3 @@ "use strict"; | ||
for (const scriptMeta of this.metadata.scripts) { | ||
if (!scriptMeta.isGlobal && !includeLocalScripts) { | ||
if (!scriptMeta.isGlobal && !scriptMeta.isRootManifest && !includeLocalScripts) { | ||
continue; | ||
@@ -28,3 +28,3 @@ } | ||
for (const scriptMeta of this.metadata.scripts) { | ||
if (!scriptMeta.isGlobal && !includeLocalScripts) { | ||
if (!scriptMeta.isGlobal && !scriptMeta.isRootManifest && !includeLocalScripts) { | ||
continue; | ||
@@ -31,0 +31,0 @@ } |
@@ -16,2 +16,3 @@ "use strict"; | ||
isGlobal: true, | ||
isRootManifest: true, | ||
}; | ||
@@ -28,2 +29,3 @@ const fragment = FragmentRenderer_1.FragmentRenderer.makeDocumentation(meta, meta.description); | ||
isGlobal: true, | ||
isRootManifest: true, | ||
}; | ||
@@ -30,0 +32,0 @@ const fragment = FragmentRenderer_1.FragmentRenderer.makeDocumentation(meta, meta.description); |
@@ -26,2 +26,3 @@ "use strict"; | ||
isGlobal: false, | ||
isRootManifest: false, | ||
descriptiption: "something useful", | ||
@@ -37,2 +38,3 @@ }, | ||
isGlobal: false, | ||
isRootManifest: false, | ||
descriptiption: "something useful", | ||
@@ -48,2 +50,3 @@ }, | ||
isGlobal: false, | ||
isRootManifest: false, | ||
descriptiption: "something useful", | ||
@@ -59,2 +62,3 @@ }, | ||
isGlobal: false, | ||
isRootManifest: false, | ||
descriptiption: "something useful", | ||
@@ -76,2 +80,3 @@ }, | ||
isGlobal: false, | ||
isRootManifest: false, | ||
descriptiption: "something useful", | ||
@@ -87,2 +92,3 @@ }, | ||
isGlobal: false, | ||
isRootManifest: false, | ||
descriptiption: "something useful", | ||
@@ -89,0 +95,0 @@ }, |
@@ -34,2 +34,3 @@ "use strict"; | ||
for (const manifestPath of this.manifests) { | ||
const isRootManifest = manifestPath === "package.json"; | ||
const manifest = await ScriptScanner.loadManifest(path_1.default.resolve(this.rootDirectory, manifestPath)); | ||
@@ -40,3 +41,3 @@ const projectName = manifest.name; | ||
const isGlobal = name.includes(":"); | ||
scriptStore.add(manifestPath, projectName, name, script, isGlobal); | ||
scriptStore.add(manifestPath, projectName, name, script, isGlobal, isRootManifest); | ||
} | ||
@@ -43,0 +44,0 @@ } |
@@ -8,4 +8,5 @@ export declare const SCRIPTS_METADATA_DEFAULT_FILENAME = "package.json-scripts.json"; | ||
isGlobal: boolean; | ||
isRootManifest: boolean; | ||
description?: string | undefined; | ||
constructor(manifestPath: string, projectName: string, scriptName: string, scriptCode: string, isGlobal: boolean); | ||
constructor(manifestPath: string, projectName: string, scriptName: string, scriptCode: string, isGlobal: boolean, isRootManifest?: boolean); | ||
} | ||
@@ -19,3 +20,3 @@ export declare class ScriptStore { | ||
constructor(rootDirectory: string, filename?: string); | ||
add(manifestPath: string, projectName: string, scriptName: string, scriptCode: string, isGlobal: boolean): void; | ||
add(manifestPath: string, projectName: string, scriptName: string, scriptCode: string, isGlobal: boolean, isRootManifest?: boolean): void; | ||
save(filename?: string): Promise<void>; | ||
@@ -22,0 +23,0 @@ load(filename?: string): Promise<void>; |
@@ -10,3 +10,3 @@ "use strict"; | ||
class ScriptStoreEntry { | ||
constructor(manifestPath, projectName, scriptName, scriptCode, isGlobal) { | ||
constructor(manifestPath, projectName, scriptName, scriptCode, isGlobal, isRootManifest = false) { | ||
this.manifestPath = manifestPath; | ||
@@ -17,2 +17,3 @@ this.projectName = projectName; | ||
this.isGlobal = isGlobal; | ||
this.isRootManifest = isRootManifest; | ||
} | ||
@@ -34,4 +35,4 @@ } | ||
} | ||
add(manifestPath, projectName, scriptName, scriptCode, isGlobal) { | ||
this.scripts.push(new ScriptStoreEntry(manifestPath, projectName, scriptName, scriptCode, isGlobal)); | ||
add(manifestPath, projectName, scriptName, scriptCode, isGlobal, isRootManifest = false) { | ||
this.scripts.push(new ScriptStoreEntry(manifestPath, projectName, scriptName, scriptCode, isGlobal, isRootManifest)); | ||
// Assume consistent order is best preserved on insert. | ||
@@ -38,0 +39,0 @@ this.scripts.sort((a, b) => a.scriptName.localeCompare(b.scriptName) || a.projectName.localeCompare(b.projectName)); |
@@ -34,3 +34,3 @@ "use strict"; | ||
for (const scriptMeta of this.metadataFromScan.scripts) { | ||
if (!scriptMeta.isGlobal && !withLocals) { | ||
if (!scriptMeta.isGlobal && !scriptMeta.isRootManifest && !withLocals) { | ||
continue; | ||
@@ -37,0 +37,0 @@ } |
@@ -23,2 +23,3 @@ "use strict"; | ||
isGlobal: false, | ||
isRootManifest: true, | ||
manifestPath: "package.json", | ||
@@ -68,2 +69,3 @@ projectName: "default", | ||
isGlobal: false, | ||
isRootManifest: true, | ||
manifestPath: "package.json", | ||
@@ -98,2 +100,3 @@ projectName: "default", | ||
isGlobal: false, | ||
isRootManifest: true, | ||
manifestPath: "package.json", | ||
@@ -130,2 +133,3 @@ projectName: "default", | ||
isGlobal: false, | ||
isRootManifest: true, | ||
manifestPath: "package.json", | ||
@@ -160,2 +164,3 @@ projectName: "default", | ||
isGlobal: false, | ||
isRootManifest: true, | ||
manifestPath: "package.json", | ||
@@ -191,2 +196,3 @@ projectName: "default", | ||
isGlobal: false, | ||
isRootManifest: true, | ||
manifestPath: "package.json", | ||
@@ -193,0 +199,0 @@ projectName: "default", |
{ | ||
"name": "node-scripts-docs", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Generate documentation for your `package.json` scripts.", | ||
@@ -20,5 +20,5 @@ "license": "UNLICENSED", | ||
"build": "tsc", | ||
"docs:build": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material build --site-dir=public", | ||
"docs:build": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs ghcr.io/oliversalzburg/mkdocs-material-ex:main build --site-dir=public", | ||
"docs:scripts": "yarn nsd-debug --include-locals", | ||
"docs:serve": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material", | ||
"docs:serve": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs ghcr.io/oliversalzburg/mkdocs-material-ex:main", | ||
"npm:publish": "yarn build && npm publish", | ||
@@ -47,3 +47,3 @@ "npm:publish:patch": "yarn build && npm version patch && npm publish", | ||
"jest": "27.5.1", | ||
"lint-staged": "12.4.0", | ||
"lint-staged": "12.4.1", | ||
"prettier": "2.6.2", | ||
@@ -59,6 +59,8 @@ "prettier-package-json": "2.6.3", | ||
"mkdocs", | ||
"npm", | ||
"package.json", | ||
"scripts" | ||
"scripts", | ||
"yarn" | ||
], | ||
"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
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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
100932
1.52%1143
1.6%