@travetto/doc 8.0.0-alpha.2 → 8.0.0-alpha.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/doc",
3
- "version": "8.0.0-alpha.2",
3
+ "version": "8.0.0-alpha.4",
4
4
  "description": "Documentation support for the Travetto framework",
5
5
  "keywords": [
6
6
  "docs",
@@ -24,12 +24,12 @@
24
24
  "directory": "module/doc"
25
25
  },
26
26
  "dependencies": {
27
- "@travetto/runtime": "^8.0.0-alpha.2",
27
+ "@travetto/runtime": "^8.0.0-alpha.4",
28
28
  "@types/prismjs": "^1.26.6",
29
29
  "prismjs": "^1.30.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@travetto/cli": "^8.0.0-alpha.3"
32
+ "@travetto/cli": "^8.0.0-alpha.7"
33
33
  },
34
34
  "peerDependenciesMeta": {
35
35
  "@travetto/cli": {
@@ -124,7 +124,7 @@ ${PackageDocUtil.getInstallInstructions(node.props.pkg, true)}
124
124
  Ref: async ({ context, props }) =>
125
125
  `<a target="_blank" class="source-link" href="${context.link(props.href, props)}">${props.title}</a>`,
126
126
  Image: async ({ context, props }) => {
127
- if (!/^https?:/.test(props.href) && !(await fs.stat(props.href).catch(() => false))) {
127
+ if (!/^https?:/.test(props.href) && !(await fs.stat(props.href, { throwIfNoEntry: false }))) {
128
128
  throw new Error(`${props.href} is not a valid location`);
129
129
  }
130
130
  return `<img src="${context.link(props.href, props)}" alt="${props.title}">`;
@@ -101,7 +101,7 @@ ${context.cleanText(content.text)}
101
101
  },
102
102
 
103
103
  Image: async ({ props, context }) => {
104
- if (!/^https?:/.test(props.href) && !(await fs.stat(props.href).catch(() => false))) {
104
+ if (!/^https?:/.test(props.href) && !(await fs.stat(props.href, { throwIfNoEntry: false }))) {
105
105
  throw new Error(`${props.href} is not a valid location`);
106
106
  }
107
107
  return `![${props.title}](${context.link(props.href)})`;
@@ -12,7 +12,7 @@ import { PackageUtil } from '@travetto/manifest';
12
12
  @CliCommand()
13
13
  @Validator(async (cmd) => {
14
14
  const docFile = path.resolve(cmd.input);
15
- if (!(await fs.stat(docFile).catch(() => false))) {
15
+ if (!(await fs.stat(docFile, { throwIfNoEntry: false }))) {
16
16
  return { message: `input: ${cmd.input} does not exist`, path: 'input', source: 'flag', kind: 'invalid' };
17
17
  }
18
18
  })