Skip to content

Archive editions

Archive editions options tell the publisher how to create source archives for clients, which are published to connect.

docs

  • Type:
    Record<string, string | function>;

Docs create files in the root of media-interactive editions.

keys

Each key represents a file to create in the root of media-interactive editions.

For example, a key of EMBED.txt would create the following file in the media-interactive edition folder:

  • Directorymedia-en-map
    • Directorymedia-interactive
      • EMBED.txt

values

Values represent the content of the file created.

string

A string represents the path to a local file that will be copied to the created file. Files will be rendered as mustache templates with the following context:

{
embedUrl: 'https://...',
embedSlug: 'media-en-map',
year: '2024',
}

For example:

publisher.config.ts
import { defineConfig } from '@reuters-graphics/graphics-kit-publisher';
export default defineConfig({
archiveEditions: {
docs: {
'EMBED.html': 'src/docs/embed.html',
},
},
});
src/docs/embed.html
<script
type="text/javascript"
src="https://graphics.thomsonreuters.com/cdn/pym.v1.min.js"
></script>
<script>
var pymParent = new pym.Parent('{{ embedSlug }}', '{{{ embedUrl }}}', {});
</script>
<div id="{{ embedSlug }}"></div>

… would render as:

EMBED.html
<script
type="text/javascript"
src="https://graphics.thomsonreuters.com/cdn/pym.v1.min.js"
></script>
<script>
var pymParent = new pym.Parent('media-en-map', 'https://...', {});
</script>
<div id="media-en-map"></div>

function

Alternatively, you can define the value as a function that returns the string contents of the file.

publisher.config.ts
import { defineConfig } from '@reuters-graphics/graphics-kit-publisher';
export default defineConfig({
archiveEditions: {
docs: {
'EMBED.html': ({ embedUrl, embedSlug }) =>
`<div id="${embedUrl}" data:embed="${embedUrl}"></div>`,
},
},
});

ignore

  • Type:
    string[]
  • Default:
    [];

An array of files to ignore — in addition to those ignored in your project’s .gitignore — when creating the ZIP archive of source files that is shared with clients on Reuters Connect.

Strings should be in gitignore pattern format.

publisher.config.ts
import { defineConfig } from '@reuters-graphics/graphics-kit-publisher';
export default defineConfig({
archiveEditions: {
ignore: ['project-files/'],
},
});

separateAssets

  • Type:
    string | false
  • Default:
    'project-files/'

A directory of assets that will be stored remotely on S3 and made available for clients to download separately. This is useful for precursor assets, such as Illustrator or Photoshop files, which are often too large to upload to the graphics server but needed by clients who wish to modify AI graphics.

When set, all files in the specified directory will be uploaded to S3 in a single ZIP archive and the link will be saved in the project’s package.json.