Skip to content

Commit

Permalink
use PC links array
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Mar 27, 2024
1 parent 7308020 commit 347cdd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cmd/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {Arguments, Argv} from 'yargs';
import {join, resolve} from 'path';
import shell from 'shelljs';

import {LINK_KEYS} from '@diplodoc/client/ssr';
import {LINK_KEYS_PAGE_CONSTRUCTOR_CONFIG} from '@diplodoc/client/ssr';
import {isLocalUrl} from '@diplodoc/transform/lib/utils';
import OpenapiIncluder from '@diplodoc/openapi-extension/includer';

Expand Down Expand Up @@ -34,6 +34,7 @@ import {prepareMapFile} from '../../steps/processMapFile';
import {Resources} from '../../models';
import {checkPathExists, copyFiles, findAllValuesByKeys, logger} from '../../utils';
import {upload as publishFilesToS3} from '../publish/upload';
import {LINK_KEYS_PAGE_CONSTRUCTOR_CONFIG} from "@diplodoc/client/build/constants";

Check failure on line 37 in src/cmd/build/index.ts

View workflow job for this annotation

GitHub Actions / Verify Files

'LINK_KEYS_PAGE_CONSTRUCTOR_CONFIG' is already defined

Check failure on line 37 in src/cmd/build/index.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Replace `"@diplodoc/client/build/constants"` with `'@diplodoc/client/build/constants'`

export const build = {
command: ['build', '$0'],
Expand Down Expand Up @@ -277,7 +278,8 @@ async function handler(args: Arguments<any>) {
if (!Object.prototype.hasOwnProperty.call(content, 'blocks')) {
return;
}
const contentLinks = findAllValuesByKeys(content, LINK_KEYS);

const contentLinks = findAllValuesByKeys(content, LINK_KEYS_PAGE_CONSTRUCTOR_CONFIG);

Check failure on line 282 in src/cmd/build/index.ts

View workflow job for this annotation

GitHub Actions / Verify Files

Replace `content,·LINK_KEYS_PAGE_CONSTRUCTOR_CONFIG` with `⏎····························content,⏎····························LINK_KEYS_PAGE_CONSTRUCTOR_CONFIG,⏎························`
const localMediaLinks = contentLinks.filter(
(link) =>
new RegExp(/^\S.*\.(svg|png|gif|jpg|jpeg|bmp|webp|ico)$/gm).test(
Expand Down

0 comments on commit 347cdd2

Please sign in to comment.