Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(copy): support advanced copy configuration with custom target paths #1711

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Dec 2, 2024

  1. feat(copy): support advanced copy configuration with custom target paths

    - Add CopyConfig enum to support both basic and advanced copy modes
    - Basic mode: maintains backward compatibility with string[] format
    - Advanced mode: supports {from: string, to: string} format for custom paths
    - Update copy plugin to handle both configuration formats
    - Ensure target directories are created automatically
    
    Example config:
    {
      'copy': [
        'public',                              // basic mode
        { 'from': 'assets', 'to': 'static' }  // advanced mode
      ]
    }
    BQXBQX authored and bqx committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    a3ddec7 View commit details
    Browse the repository at this point in the history
  2. fix(copy): prevent path traversal in copy plugin

    Add path canonicalization and validation to ensure target paths remain within the destination directory
    BQXBQX committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    464b49c View commit details
    Browse the repository at this point in the history
  3. chore: Update copy config type in Mako bundler

    - Updated the type of the `copy` property in the `BuildParams` interface to support both `string` and `{ from: string; to: string }`.
    - Ensured the `copy` configuration is properly validated to handle both types.
    BQXBQX committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    ffc0081 View commit details
    Browse the repository at this point in the history
  4. docs: Update copy config type in documentation

    - Updated the `copy` property type in the configuration documentation to reflect the change from `string[]` to `(string | { from: string; to: string })[]`.
    - Clarified that the `copy` configuration can now accept both strings and objects with `from` and `to` properties.
    BQXBQX committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    5d42e4f View commit details
    Browse the repository at this point in the history
  5. test(copy): add e2e tests for copy plugin from/to pattern

    - Update config.copy test fixtures to cover from/to pattern
    - Add assertions for copied files in new location
    - Adjust copy plugin path validation
    BQXBQX committed Dec 2, 2024
    Configuration menu
    Copy the full SHA
    f2c75e3 View commit details
    Browse the repository at this point in the history