@t8/docsgen 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -136,7 +136,7 @@ async function getConfig() {
136
136
  }
137
137
  let targetId;
138
138
  let args = process.argv.slice(2);
139
- if (!args[0].startsWith("--")) targetId = args.shift();
139
+ if (args.length !== 0 && !args[0].startsWith("--")) targetId = args.shift();
140
140
  config = {
141
141
  targetId,
142
142
  mainBranch: "main",
@@ -740,8 +740,10 @@ async function run() {
740
740
  return;
741
741
  }
742
742
  if (targetId) {
743
- let entryCtx = entries.find(({ id }) => id === targetId);
744
- if (entryCtx) runEntry(entryCtx);
743
+ let entryCtx = entries.find(
744
+ ({ id, dir }) => id === targetId || dir === targetId
745
+ );
746
+ if (entryCtx) runEntry({ ...rootCtx, ...entryCtx });
745
747
  else console.warn(`Specified config entry not found: '${targetId}'`);
746
748
  } else {
747
749
  await Promise.all(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/docsgen",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "main": "dist/bin.js",
6
6
  "bin": {
@@ -26,7 +26,7 @@ export async function getConfig(): Promise<BinConfig> {
26
26
  let targetId: string | undefined;
27
27
  let args = process.argv.slice(2);
28
28
 
29
- if (!args[0].startsWith("--")) targetId = args.shift();
29
+ if (args.length !== 0 && !args[0].startsWith("--")) targetId = args.shift();
30
30
 
31
31
  config = {
32
32
  targetId,
package/src/bin/run.ts CHANGED
@@ -13,9 +13,11 @@ async function run() {
13
13
  }
14
14
 
15
15
  if (targetId) {
16
- let entryCtx = entries.find(({ id }) => id === targetId);
16
+ let entryCtx = entries.find(
17
+ ({ id, dir }) => id === targetId || dir === targetId,
18
+ );
17
19
 
18
- if (entryCtx) runEntry(entryCtx);
20
+ if (entryCtx) runEntry({ ...rootCtx, ...entryCtx });
19
21
  else console.warn(`Specified config entry not found: '${targetId}'`);
20
22
  } else {
21
23
  await Promise.all(