Generates TypeScript exposing the content of files as data URIs.
- NodeJS 10.19.0 or later.
- NPM 6.14.4 or later.
- NPX 6.14.4 or later.
- File.
All must be available on the PATH (e.g. node --version
, npm --version
, npx --version
and file --version
all print version strings when executed in a Bash terminal).
These are available from most Debian-based Linux distributions' package managers; for example, they can be installed when running Ubuntu 20.04 LTS using the following command:
sudo apt-get install nodejs npm --yes
Add an appropriate actions/setup-node action step before the make
action step:
name: Continuous Integration
on: [push, pull_request]
jobs:
main:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
# Insert this block:
###############################
- uses: actions/setup-node@v3
with:
node-version: 12
###############################
- run: make --file ./submodules/dreck/makefile
shell: bash
- if: github.event_name == 'release' && github.event.action == 'created'
uses: softprops/action-gh-release@v1
with:
files: dist/**
Run the following in a Bash shell at the root of your project:
git submodule add https://github.com/sunruse/dreck-data-uri-plugin plugins/data-uri
This plugin converts each file in the DRECK_DATA_URI_INPUT_PATHS
Make variable.
This plugin writes an equivalent TypeScript file for each input file. For example, if DRECK_DATA_URI_INPUT_PATHS
contained ./example/file-path.txt
, ./plugins/data-uri/generated/example/file-path.txt.ts
would be written to disk, which would contain the equivalent:
const dataUriExampleFilePathTxt: `data:text/plain;charset=utf-8,f2wGBEr154m8h7Bcokd1aQ==` = `data:text/plain;charset=utf-8,f2wGBEr154m8h7Bcokd1aQ==`;
Their paths are listed in the DRECK_DATA_URI_OUTPUT_TYPE_SCRIPT_PATHS
Make variable, space separated.