Giter Club home page Giter Club logo

bluprint's People

Contributors

dependabot[bot] avatar hobbes7878 avatar palewire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

doc22940 jarib

bluprint's Issues

New feature proposals

Thanks for this project, exactly what I've been looking for 👍

I would like to propose the following features. Would you accept PRs for any of these?

1. Read bluprint from a local directory

Perhaps I've missed something, but it seems any bluprint changes must be pushed to Github before you can test it? This is quite frustrating when developing new bluprints, especially since github.com seems to do a bit of caching that is hard to get around.

It would be nice to run bluprint start ../my-bluprint without having to commit every change.

Alternatively git archive to get a tarball or by adding support for git daemon to the hosted-git-info package.

2. Allow .blueprintrc.js

It would be useful to have the ability to execute JS inside this file. E.g. for my render actions I would like to have the current year in the context:

context: { year: new Date().getFullYear() } 

The only solution to this I've found is to switch from mustache to ejs and execute the JS line as part of the templates.

3. Allow templated execute actions

E.g.:

"cmds": [ ["git", ["remote", "add", "origin", "{{ org }}/{{ year }}-{{ slug }}" ]] ] 

4. Custom actions from the template repo

Not too sure about this one, but the ability to have custom actions in the bluprint repo itself would really make anything possible in terms of customization.

Merge JSON files option

Would be good to offer a way to say we should merge some JSON files, for example package.json, which would be most useful in parts.

[Q] can I use bluprints afterward ?

Hi,

Sometimes (most ?) you need template to start a project but later, you may need other files from another bluprint. Can I use a bluprint in my working dir if it is not empty ? if it already used another bluprint previously ?

In those cases, how does it handle conflict if a downloaded file already exists in the working dir ? Is there an option to skip it, overwrite, merge ? I don’t want my readme file be overwritten for instance.


Does "action": "remove" run before copying the files in the working dir or after ?

Cannot add bluprints for repositories that don't use `master` as the default branch

This bug can be replicated with the following code. After inspecting the error more closely, I believe it is caused by the bluprint repository having its default branch set to main. It appears that the version of hosted-git-info employed by package.json needs to be upgraded to support the preferred nomenclature, the parlance of our times. I will submit a pull request that attempts to resolve the bug shortly.

$ bluprint add https://github.com/datadesk/baker-example-page-template

bluprint v0.6.6

bluprint:  Added bluprint baker-example-page. Run bluprint start to start a new project.

$ mkdir main-branch-bug
$ cd main-branch-bug                                          
$ bluprint start baker-example-page

bluprint v0.6.6


bluprint: ERROR Connection error attempting to access bluprint repo.

bluprint start [bluprint]

Start a new project from a bluprint

Positionals:
  bluprint  The bluprint to use                                         [string]

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Error: HTTP error 404: Not Found
    at ClientRequest.<anonymous> (/home/palewire/.nodenv/versions/16.19.0/lib/node_modules/@reuters-graphics/bluprint/dist/index.js:963:13)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:513:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:534:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)

Consider adding some extra default context variables

Right now, we add bluprintPart as a default context variable: https://github.com/reuters-graphics/bluprint/blob/master/lib/actions/index.js#L52

Thinking a few extra defaults would be handy. Specifically, date variables come up a lot like the current year at runtime. Maybe also a variables that reflects the file system, like the parent directory where bluprint is running.

Can feel out what else is useful, but start by adding:

  • year - YYYY
  • month - MM
  • day - DD
  • dirname - parent directory name

Bluprint inheritance

Opening for discussion...

One of the main goals of bluprint is to make it easy to spin off small, reusable customizations. So if I have a set of components I like to use in our graphics rig, I can create a Jon's own-brand graphics rig bluprint. Great! But now updates are happening in the main bluprint I spun off from. How do keep my bluprint up-to-date?

Parts might be an answer. If the updates happened in a part of the parent bluprint, I can run it in my child and pick up that update. That might work for me as a once off, but it doesn't scale terribly well, and it assumes you know you need to update, which cuts against the idea of pushing changes to users that's so nice about bluprint.

Seems like a better system would be to register what bluprint a child inherits from, capturing the version of the parent as a dependency. Maybe we even want to always overwrite specific files in the child with ones from a parent.

Maybe the easier way to think about it is ... How would you write the bluprint config to specify that it inherits from another bluprint?

Any thoughts? @MatthewWeberTR @fcage @chriscanipe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.