@diplodoc/cli 4.6.0-alpha-3 → 4.6.0-alpha-5

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/src/constants.ts CHANGED
@@ -24,7 +24,7 @@ includes.collect = require('@diplodoc/transform/lib/plugins/includes/collect');
24
24
  images.collect = require('@diplodoc/transform/lib/plugins/images/collect');
25
25
  changelog.collect = require('@diplodoc/transform/lib/plugins/changelog/collect');
26
26
 
27
- export const ASSETS_FOLDER = resolve(__dirname, '..', 'assets');
27
+ export const ASSETS_FOLDER = resolve(__dirname, '../assets');
28
28
  export const BUNDLE_FOLDER = '_bundle';
29
29
  export const TMP_INPUT_FOLDER = '.tmp_input';
30
30
  export const TMP_OUTPUT_FOLDER = '.tmp_output';
package/src/index.ts CHANGED
@@ -28,7 +28,7 @@ yargs
28
28
  .option('quiet', {
29
29
  alias: 'q',
30
30
  default: false,
31
- describe: "Run in quiet mode. Don't write logs to stdout",
31
+ describe: 'Run in quiet mode. Don\'t write logs to stdout',
32
32
  type: 'boolean',
33
33
  })
34
34
  .group(['config', 'strict', 'quiet', 'help', 'version'], 'Common options:')
@@ -57,7 +57,7 @@ async function applyIncluders(path: string, item: YfmToc, vars: YfmPreset) {
57
57
  }
58
58
 
59
59
  if (!includeValid(item.include)) {
60
- throw new IncludersError("include doesn't comply with includers standard", path);
60
+ throw new IncludersError('include doesn\'t comply with includers standard', path);
61
61
  }
62
62
 
63
63
  // normalize include mode (includers support link mode only)
@@ -1,3 +1,5 @@
1
+ // import type {DocInnerProps, DocPageData} from '@diplodoc/client/ssr';
2
+
1
3
  import {join} from 'path';
2
4
  import {platform} from 'process';
3
5
 
@@ -5,8 +7,8 @@ import {CUSTOM_STYLE, Platforms, ResourceType} from '../constants';
5
7
  import {Resources, SinglePageResult} from '../models';
6
8
  import {ArgvService, PluginService} from '../services';
7
9
  import {preprocessPageHtmlForSinglePage} from './singlePage';
8
- import {DocInnerProps, DocPageData, render} from '@diplodoc/client';
9
10
 
11
+ import {DocInnerProps, DocPageData, render} from '@diplodoc/client/ssr';
10
12
  import manifest from '@diplodoc/client/manifest';
11
13
 
12
14
  const dst = (bundlePath: string) => (target: string) => join(bundlePath, target);
@@ -49,9 +51,9 @@ export function generateStaticMarkup(
49
51
  }
50
52
  </style>
51
53
  ${manifest.css
52
- .map(dst(pathToBundle))
53
- .map((src: string) => `<link type="text/css" rel="stylesheet" href="${src}" />`)
54
- .join('\n')}
54
+ .map(dst(pathToBundle))
55
+ .map((src: string) => `<link type="text/css" rel="stylesheet" href="${src}" />`)
56
+ .join('\n')}
55
57
  ${PluginService.getHeadContent()}
56
58
  ${resources}
57
59
  </head>
@@ -62,12 +64,12 @@ export function generateStaticMarkup(
62
64
  window.__DATA__ = ${JSON.stringify(props)};
63
65
  </script>
64
66
  ${manifest.js
65
- .map(dst(pathToBundle))
66
- .map(
67
- (src: string) =>
68
- `<script type="application/javascript" src="${src}"></script>`,
69
- )
70
- .join('\n')}
67
+ .map(dst(pathToBundle))
68
+ .map(
69
+ (src: string) =>
70
+ `<script type="application/javascript" src="${src}"></script>`,
71
+ )
72
+ .join('\n')}
71
73
  </body>
72
74
  </html>
73
75
  `;
@@ -147,5 +149,5 @@ export function joinSinglePageResults(
147
149
  }
148
150
 
149
151
  export function replaceDoubleToSingleQuotes(str: string): string {
150
- return str.replace(/"/g, "'");
152
+ return str.replace(/"/g, '\'');
151
153
  }
@@ -32,7 +32,7 @@ const githubConnectorValidator: Record<string, ConnectorValidatorProps> = {
32
32
 
33
33
  const connectorValidator: Record<string, ConnectorValidatorProps> = {
34
34
  type: {
35
- warnMessage: "'type' must be provided for repo.",
35
+ warnMessage: '\'type\' must be provided for repo.',
36
36
  validateFn: notEmptyValue,
37
37
  },
38
38
  [SourceType.GITHUB]: {