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

[heft] Implementation of a copy task. #2186

Closed
wants to merge 2 commits into from

Conversation

iclanton
Copy link
Member

No description provided.

* Configures the "copy" task for Heft.
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/copy.schema.json",
Copy link
Collaborator

@octogonz octogonz Sep 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iclanton File copying seems like a "core operation" that belongs in heft.json rather than in a plugin-like config file. Another "core operation" would be executing simple shell scripts. Both of these actions could be triggered based on the same menu of Heft events.

Thus I'm thinking the config file design might be better like this:

config/heft.json

{
  "eventActions": {
    "beforePreCompile": [
      {
        "eventActionKind": "fileCopy",
        "sourceGlob": "src/**/*.md",
        "targetFolders": [ "dist" ],
        "hardlinkInsteadOfCopy": true
      }
    ],
    "afterPostBuild": [
      {
        "eventActionKind": "shell",
        "command": "rundown",
        "args": [
          "snapshot",
          "--script",
          "./lib/index.js"
        ]
      }
    ]
  }
}

/**
* Run these copy operations after the post-build build stage runs
*/
"afterPostBuild": [
Copy link
Collaborator

@octogonz octogonz Sep 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combining "before/after" and "pre/post" prefixes seems a little odd.

Instead of something like this:

beforePreLunch
afterPreLunch
beforeLunch
afterLunch
beforePostLunch
afterPostLunch

...maybe we could introduce some more intuitive names like:

beforeBreakfast
afterBreakfast
beforeLunch
afterLunch
beforeDinner
afterDinner

Or, the Windows API used a convention sort of like this:

breakfasting
breakfasted
lunching
lunched
dinnering
dinnered

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't tell how much of this comment is sarcasm...

@iclanton
Copy link
Member Author

Closing in favor of #2333

@iclanton iclanton closed this Nov 29, 2020
@iclanton iclanton deleted the ianc/heft-copy branch January 4, 2022 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants