onepub-dev / onepub-dev/dcli

Implement transformers for the dcli pack command

Open
#169 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Dart
Stars
265
Forks
30
PR merge metrics
No merged PRs in 30d

Description

The 'dcli pack' command allows you to pack resources into a dart exe.

Sometimes it is desirable to apply transformations to these files before they are packed.

This might be to include a version no. in one of the configuration files.

My thoughts are that:

the user creates a transforms directory under their tool directory:
<project root>/dcli/pack/transforms

The user can then place one or more scripts in the transforms directory.

When the pack command is called it runs each of the scripts in the transform directory.
The pack command will apply the transforms in order after sorting them alphanumerically.
The user can control the order the transforms are applied by naming them with a numeric prefix 01_xx.dart, 02_xx.dart.

Each transform will take the arguments <resource name> <input file> <output file>

The input and output file will change between each transform but the resource name will be constant allowing the transform to choose what transformation are to be applied.

If the transform doesn't want to apply any transformations to the input file then it can simply copy the input file to the output file.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dcli pack command and determine how resources are currently collected and packed. Define how a dcli/pack/transforms directory, alphanumerically ordered scripts, and the resource name, input file, and output file arguments fit into that flow. Done means transforms can run in order before packing and can either modify or copy each resource.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.